:root {
    --bg-color: #0c0c0e;
    --text-main: #ffffff;
    --text-muted: #9c9c9c;
    --accent: #d235ff;
    --accent-hover: #b026ff;
    --card-bg: #141416;
    --card-border: #27272a;
    --font-family: 'Inter', sans-serif;
    --radius-md: 12px;
    --radius-lg: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    overflow: hidden;
    height: 100%;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-y: scroll;
    height: 100%;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Hide scrollbar (WebKit) */
body::-webkit-scrollbar {
    width: 0;
    display: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 48px;
    background-color: rgba(20, 20, 24, 0.4);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1400px;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    /* Increased gap */
    font-weight: 600;
    font-size: 1.25rem;
    /* Larger logo text */
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2E1A47;
    /* Deep purple bezel */
    border-radius: 12px;
    /* Smooth rounded corners for the housing */
    padding: 8px;
    /* Spacing between the bezel edge and the inner icon */
    box-shadow: 0 0 15px rgba(176, 38, 255, 0.15);
    flex-shrink: 0;
}

.logo-icon svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 40px;
    /* Slight increase for better breathing room */
}

.nav-links a {
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--text-main);
}

.btn-text {
    font-weight: 600;
    font-size: 1.05rem;
}

.btn-text:hover {
    color: var(--accent);
}

.accent-link {
    color: var(--accent);
}

.accent-link:hover {
    color: var(--accent-hover);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 102;
}

/* Hamburger → X morph */
.menu-bar {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.25s ease;
    transform-origin: center;
}

.mobile-menu-btn.active .bar-top {
    transform: translateY(6px) rotate(45deg);
}

.mobile-menu-btn.active .bar-mid {
    opacity: 0;
}

.mobile-menu-btn.active .bar-bot {
    transform: translateY(-6px) rotate(-45deg);
}

/* ─── Mobile Dropdown Panel ─── */
.mobile-menu {
    position: fixed;
    top: 102px;
    /* Calculated to sit exactly below the navbar bottom edge (~90px) + 12px gap */
    right: 2.5vw;
    /* mirrors the right edge of the 95%-wide mobile nav pill */
    width: 220px;
    background: rgba(20, 20, 24, 0.4);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    padding: 12px 0;
    z-index: 101;

    /* Hidden state */
    display: none;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top right;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.3s;
}

.mobile-menu.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    visibility: visible;
}

/* ─── Menu Items ─── */
.mobile-menu-item {
    display: block;
    padding: 14px 24px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 0;
    transition: background 0.2s ease,
        color 0.2s ease;

    /* Stagger entrance */
    opacity: 0;
    transform: translateY(-10px);
}

.mobile-menu-item:hover,
.mobile-menu-item:active {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

/* ─── Contact CTA (unique accent pill) ─── */
.mobile-menu-contact {
    display: block;
    margin: 8px 12px 4px;
    padding: 12px 24px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--accent);
    background: rgba(210, 53, 255, 0.10);
    border: 1px solid rgba(210, 53, 255, 0.18);
    border-radius: 10px;
    transition: background 0.2s ease,
        color 0.2s ease;

    /* Stagger entrance */
    opacity: 0;
    transform: translateY(-10px);
}

.mobile-menu-contact:hover,
.mobile-menu-contact:active {
    background: rgba(210, 53, 255, 0.18);
    color: #e06aff;
}

/* ─── Staggered reveal when panel is open ─── */
.mobile-menu.open .mobile-menu-item,
.mobile-menu.open .mobile-menu-contact {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.2s ease,
        color 0.2s ease;
}

.mobile-menu.open .mobile-menu-item:nth-child(1) {
    transition-delay: 0.06s;
}

.mobile-menu.open .mobile-menu-item:nth-child(2) {
    transition-delay: 0.12s;
}

.mobile-menu.open .mobile-menu-item:nth-child(3) {
    transition-delay: 0.18s;
}

.mobile-menu.open .mobile-menu-contact {
    transition-delay: 0.24s;
}

/* Reset delays on close so items vanish together */
.mobile-menu:not(.open) .mobile-menu-item,
.mobile-menu:not(.open) .mobile-menu-contact {
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    /* Match desktop navbar pill height */
    padding: 0 36px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    white-space: nowrap;
    /* Prevent text wrap breaking pill shape */
}

.btn-primary {
    background-color: var(--accent);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(176, 38, 255, 0.3);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    /* Adjust ratio for image vs text block */
    gap: 64px;
    padding: 137px 64px 80px;
    /* Added dead padding to the very top to equalise visual pill spacing */
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(176, 38, 255, 0.08);
    color: #e21cff;
    /* Match the pink reference */
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 12px;
    margin-bottom: 40px;
    border: 1px solid rgba(176, 38, 255, 0.15);
}

.pill .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    /* Let the gradient natively draw the circle to avoid sub-pixel border-radius clipping halos */
    background: radial-gradient(circle closest-side, #22c55e 15%, rgba(34, 197, 94, 0) 100%);
    margin-right: 1px;
    animation: breathe 4s infinite linear;
}

@keyframes breathe {
    0% {
        /* Start at 15% core */
        opacity: 1;
        background: radial-gradient(circle closest-side, #22c55e 15%, rgba(34, 197, 94, 0) 100%);
    }

    1% {
        /* Snap to 20% core instantly */
        opacity: 1;
        background: radial-gradient(circle closest-side, #22c55e 20%, rgba(34, 197, 94, 0) 100%);
    }

    10% {
        /* Hold 20% core at full brightness for ~0.4s */
        opacity: 1;
        background: radial-gradient(circle closest-side, #22c55e 20%, rgba(34, 197, 94, 0) 100%);
    }

    95%,
    98.5% {
        /* Recede to 15% and fade opacity synchronously */
        opacity: 0;
        background: radial-gradient(circle closest-side, #22c55e 15%, rgba(34, 197, 94, 0) 100%);
    }

    100% {
        /* Snap back to full brightness at 15% core */
        opacity: 1;
        background: radial-gradient(circle closest-side, #22c55e 15%, rgba(34, 197, 94, 0) 100%);
    }
}

.hero h1 {
    font-size: 5.75rem;
    /* Increased to match exact reference scale */
    line-height: 1.02;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.04em;
    /* Tighter spacing */
}

.hero-title span {
    display: inline-block;
}

.grad-1 {
    color: #ffffff;
}

.grad-2,
.grad-3,
.grad-4 {
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.grad-2 {
    background-image: linear-gradient(90deg, #ffffff 0%, #ffffff 18%, #ecdcfc 35%, #9333ea 100%);
}

.grad-3 {
    background-image: linear-gradient(90deg, #faecff 0%, #a855f7 100%);
}

.grad-4 {
    background-image: linear-gradient(90deg, #f5d0fe 0%, #7c3aed 100%);
}

.hero p.hero-subtext {
    color: #9ca3af;
    font-size: 1.1rem;
    max-width: 90%;
    text-align: left;
    /* Desktop: left-align to match headline */
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 70px;
    /* Increased for desktop only */
    font-weight: 400;
    line-height: 1.65;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.hero-visual {
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Square aspect ratio to crop black bars */
    border-radius: 24px;
    /* Match the slightly sharper curve from reference */
    overflow: hidden;
    position: relative;
    z-index: 1;
    background: transparent;
    transform: scale(1.22);
    /* Scale up on desktop to push against negative space */
}

.hero-visual img,
.hero-visual video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    border-radius: 24px;
    /* Percentage-based stops: scale with container size on all viewports.
       Ratios derived from desktop (≈513px square): top 22%, bottom 15%, sides 4.5% */
    background:
        linear-gradient(to bottom, var(--bg-color) 0%, transparent 22%),
        linear-gradient(to top, var(--bg-color) 0%, transparent 15%),
        linear-gradient(to right, var(--bg-color) 0%, transparent 4.5%),
        linear-gradient(to left, var(--bg-color) 0%, transparent 4.5%);
}

/* Features Strip */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    padding: 40px 64px 80px;
    max-width: 1400px;
    margin: 0 auto;
}

.feature-card {
    background-color: transparent;
    /* Match reference darker/flat look */
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* slightly softer border */
    border-radius: 16px;
    /* slightly softer rounding */
    padding: 40px 32px;
    /* More vertical and horizontal padding for larger card */
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

.feature-icon {
    background-color: rgba(176, 38, 255, 0.1);
    color: var(--accent);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-text h3 {
    font-size: 1.15rem;
    /* Larger feature heading */
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-text p {
    color: #9ca3af;
    font-size: 0.95rem;
    /* Slightly larger feature text */
    line-height: 1.6;
}

/* Case Studies */
.case-studies {
    padding: 40px 64px 80px;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 64px;
}

.section-header h2 {
    font-size: 3rem;
    /* Larger case study heading */
    margin-bottom: 16px;
    font-weight: 700;
}

.section-header p {
    color: #9ca3af;
    font-size: 1.15rem;
    /* Larger subtext */
}

.study-card {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 40px;
    height: 450px;
    position: relative;
}

.study-card.reverse {
    grid-template-columns: 0.8fr 1.2fr;
}

.study-visual {
    width: 100%;
    height: 100%;
    min-height: 0;
    background-color: #1a1a1e;
    overflow: hidden;
}

.study-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.study-card:hover .study-visual img,
.study-card.touch-active .study-visual img {
    transform: scale(1.06);
    transition: transform 0.4s ease-out;
}

/* Smooth aesthetic reset when touch is released */
.study-visual img {
    transition: transform 0.7s ease-out;
}

.study-content {
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.study-tag {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.study-content h3 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.2;
}

.study-content p {
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 1rem;
}

.study-link {
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.study-link:hover {
    color: var(--accent);
}

.study-link .arrow {
    transition: transform 0.2s;
}

.study-link:hover .arrow {
    transform: translateX(4px);
}

/* CTA Banner */
.cta-banner {
    padding: 80px 64px;
    max-width: 1400px;
    margin: 0 auto 80px;
}

.cta-content {
    background: linear-gradient(180deg, #18181b 0%, #0d0d0f 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 80px 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.5;
}

.cta-content h2 {
    font-size: 3rem;
    margin-bottom: 16px;
    font-weight: 600;
}

.cta-content p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 40px;
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* Footer */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 64px 64px 24px;
    background-color: #08080a;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 64px;
    max-width: 1400px;
    margin: 0 auto 64px;
}

.footer-brand p {
    color: var(--text-muted);
    margin: 24px 0;
    max-width: 400px;
    font-size: 0.95rem;
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.social-links a:hover {
    color: white;
}

.footer-links h4 {
    margin-bottom: 24px;
    font-size: 1rem;
    font-weight: 600;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    color: #666;
    font-size: 0.85rem;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Card Interaction Borders */
.feature-card::after,
.study-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    /* Overlaps the existing 1px border */
    border-radius: inherit;
    border: solid var(--accent);
    /* Uses the purple accent */
    border-width: 0px 2px;
    /* Default to 0px top/bottom, 2px left/right for feature cards */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-in-out;
    z-index: 10;
}

.study-card::after {
    border-width: 1px 3px;
    /* Thick on left/right, thin on top/bottom */
}

/* Tap state for all devices, including JS drag persistence */
.feature-card:active::after,
.study-card:active::after,
.feature-card.touch-active::after,
.study-card.touch-active::after {
    opacity: 1;
}

/* Hover state only for non-touch devices (prevents sticky mobile hover) */
@media (hover: hover) and (pointer: fine) {

    .feature-card:hover::after,
    .study-card:hover::after {
        opacity: 1;
    }
}

/* Phase 1: Halt video downscaling, trigger rapid dynamic text scaling */
@media (max-width: 1400px) and (min-width: 1201px) {
    .hero {
        grid-template-columns: auto 1fr;
    }

    .hero-visual {
        width: 513px;
        /* Rigid width to intentionally halt scaling */
        max-width: 100%;
        margin: 0 auto;
    }

    .hero h1 {
        font-size: calc(12vw - 76px);
        /* Rapid text shrink */
    }

    .hero p.hero-subtext {
        font-size: calc(1vw + 3px);
    }
}

/* Phase 2: Synchronous proportional scaling down to mobile breakpoint */
@media (max-width: 1200px) and (min-width: 1025px) {
    .hero {
        grid-template-columns: auto 1fr;
    }

    .hero-visual {
        width: 100%;
        /* Flexible scaling */
        max-width: 513px;
        margin: 0 auto;
    }

    .hero h1 {
        font-size: calc(6.8vw - 13.6px);
        /* Synchronous proportional text shrink */
    }

    .hero p.hero-subtext {
        font-size: 1rem;
    }
}

@media (max-width: 1024px) {
    .navbar {
        padding: 12px 24px;
        width: 95%;
    }

    .nav-links,
    .nav-actions {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        /* Zero side padding — text child handles its own padding.
           This lets hero-visual fill the full grid width (= full viewport) */
        padding: 61px 0 40px;
        gap: 24px;
    }

    /* Give the text content its own side padding so only the video bleeds full-width */
    .hero-text {
        padding: 0 24px;
    }

    /* Move hero video ABOVE the text on mobile */
    .hero-visual {
        order: -1;
        margin-top: 0;
        height: auto;
        width: 92%;
        max-width: 480px;
        /* Constrain max size vertically on tablets */
        margin-left: auto;
        margin-right: auto;
        max-height: none;
        /* Restore radius so content is clipped cleanly at corners */
        border-radius: 18px;
        transform: none;
        /* Reset scale on mobile */
    }

    /* Match ::after radius to container exactly — prevents corner artifacts
       where the gradient mask curves inward but the raw content is still square */
    .hero-visual::after {
        border-radius: 18px;
    }

    .hero-content {
        order: 1;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero p.hero-subtext {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 40px;
        /* Preserve original spacing on mobile */
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    /* Tighten button padding on mobile to preserve pill shape */
    .btn {
        height: 52px;
        padding: 0 24px;
        font-size: 0.9rem;
    }

    .features {
        grid-template-columns: 1fr;
        padding: 24px 0;
        gap: 16px;
    }

    .feature-card {
        width: 89%;
        margin-left: auto;
        margin-right: auto;
        padding: 16px 24px;
    }

    .case-studies {
        padding: 40px 0 64px;
    }

    .section-header {
        padding: 0 24px;
    }

    .study-card,
    .study-card.reverse {
        display: flex;
        flex-direction: column;
        height: 520px;
        margin-bottom: 32px;
        width: 92%;
        margin-left: auto;
        margin-right: auto;
    }

    .study-visual {
        min-height: 0;
        flex: 1 1 auto;
        order: -1;
    }

    .study-content {
        flex: 0 0 auto;
        padding: 32px 24px;
        order: 1;
    }

    .study-content h3 {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }

    .study-content p {
        font-size: 0.95rem;
        margin-bottom: 24px;
    }

    footer {
        padding: 48px 24px 24px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .cta-banner {
        padding: 40px 0 64px;
        margin-bottom: 0;
    }

    .cta-content {
        width: 92%;
        margin-left: auto;
        margin-right: auto;
        padding: 48px 24px;
        border-radius: var(--radius-lg);
    }

    .cta-content h2 {
        font-size: 2rem;
    }

    .cta-content p {
        font-size: 1rem;
        max-width: 100%;
        margin-bottom: 32px;
    }

    .cta-actions {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .cta-actions .btn {
        width: 100%;
        max-width: 320px;
    }
}

/* Landscape mobile: reduce top padding and re-center hero subtext */
@media (orientation: landscape) and (max-width: 1024px) {
    .hero {
        /* Adjusted: total -40px from original 61px to optimize for landscape viewports */
        padding-top: 21px;
    }

    .hero p.hero-subtext {
        text-align: center;
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Reveal Animations */
.reveal-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-hidden.reveal-up {
    transform: translateY(-30px);
}

.reveal-hidden.visible {
    opacity: 1;
    transform: translateY(0);
}