/* ═══════════════════════════════════════════════════════════════════════
   GOALYTICS LANDING PAGE — styles.css
   Design tokens sourced from app/styles/abstract/_colors.scss
   Font: Inter (matches app/layout.tsx)
   ═══════════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────────────
   CSS CUSTOM PROPERTIES (Design Tokens)
────────────────────────────────────────────────────────────────────── */
:root {
    /* Primary brand blue — from app/styles/abstract/_colors.scss */
    --primary-50: #f2f7fd;
    --primary-100: #e4ecfa;
    --primary-200: #c3d8f4;
    --primary-300: #8eb9eb;
    --primary-400: #5194df;
    --primary-500: #2b77cc; /* interactive primary */
    --primary-600: #1c5dad; /* button background */
    --primary-700: #184a8c;
    --primary-800: #184074;
    --primary-900: #193761;
    --primary-950: #091323; /* primary text */

    /* Semantic */
    --success: #12b76a;
    --warning: #f79009;
    --danger: #f04438;
    --purple: #7a5af8;
    --white: #ffffff;

    /* Surface */
    --bg: #ffffff;
    --bg-soft: #f2f7fd;
    --border: #c3d8f4;
    --border-light: #e4ecfa;

    /* Typography — Inter, matching app/layout.tsx */
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    /* Display face for headlines — engineered, technical character, used only on headings */
    --font-display: "Space Grotesk", var(--font);
    /* Utility face for labels, kickers, and data readouts — reinforces the "engine telemetry" feel */
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Carbon — dark "engine room" surface, distinct from --primary-950 (kept as a text color) */
    --carbon: #0a0e14;
    --carbon-soft: #12151d;
    --purple-400: #9b8afb;
    --engine-line: rgba(122, 90, 248, 0.28);

    /* Spacing rhythm */
    --section-y: 7rem;
    --section-y-sm: 4rem;

    /* Radii */
    --r-sm: 0.5rem;
    --r-md: 0.75rem;
    --r-lg: 1.25rem;
    --r-xl: 1.5rem;
    --r-2xl: 2rem;
    --r-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(9, 19, 35, 0.06), 0 1px 2px rgba(9, 19, 35, 0.04);
    --shadow-md: 0 4px 16px rgba(142, 185, 235, 0.18);
    --shadow-lg: 0 8px 32px rgba(142, 185, 235, 0.22);
    --shadow-xl: 0 20px 60px rgba(142, 185, 235, 0.28);

    /* Transitions */
    --ease: all 0.3s ease-in-out;
    --ease-bounce: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ──────────────────────────────────────────────────────────────────────
   RESET & BASE
────────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font);
    color: var(--primary-950);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img,
svg {
    display: block;
    max-width: 100%;
}

/* Display face for every headline-weight heading, site-wide — Inter stays
   the body/UI face (it has to match the product), Space Grotesk carries the
   "engineered" personality on anything set at headline size. */
h1,
h2,
h3,
.section-title,
.ps-headline {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--ease);
}

ul {
    list-style: none;
}

button,
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* ──────────────────────────────────────────────────────────────────────
   LENIS SMOOTH SCROLL
   Lenis drives scrolling via JS while active; native `scroll-behavior:
   smooth` (set on html above) remains the fallback when Lenis is skipped
   (prefers-reduced-motion, or the script fails to load).
────────────────────────────────────────────────────────────────────── */
html.lenis,
html.lenis body {
    height: auto;
}
.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}
.lenis.lenis-stopped {
    overflow: hidden;
}
.lenis.lenis-smooth iframe {
    pointer-events: none;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }

    /* Force every scroll/entrance-animated element straight to its resting
       state — the JS animation functions skip their tweens under reduced
       motion, so this is the only thing that reveals them. */
    #hero-badge,
    #hero-headline,
    #hero-sub,
    #hero-actions .btn,
    #hero-stats .stat,
    #hero-stats .stat-divider,
    #hero-mockup,
    #hero-mockup .float-card,
    .feature-card,
    .ai-card,
    .success-modal {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ──────────────────────────────────────────────────────────────────────
   UTILITIES
────────────────────────────────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary-500);
    background: var(--primary-100);
    border-radius: var(--r-full);
    padding: 0.35rem 0.9rem;
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--primary-950);
    margin-bottom: 1.25rem;
}

.section-title em {
    font-style: normal;
    color: var(--primary-500);
    position: relative;
}

.section-sub {
    font-size: 1.0625rem;
    color: rgba(9, 19, 35, 0.65);
    max-width: 560px;
    margin-bottom: 3.5rem;
}

/* ──────────────────────────────────────────────────────────────────────
   SCROLL REVEAL — initial hidden state (JS adds .is-visible)
────────────────────────────────────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(36px);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
    transition:
        opacity 0.6s ease,
        transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Stagger delay helpers (applied via JS) */
.reveal[data-delay="1"] {
    transition-delay: 0.1s;
}
.reveal[data-delay="2"] {
    transition-delay: 0.2s;
}
.reveal[data-delay="3"] {
    transition-delay: 0.3s;
}
.reveal[data-delay="4"] {
    transition-delay: 0.4s;
}

/* ──────────────────────────────────────────────────────────────────────
   BUTTONS
────────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.375rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--r-md);
    transition: var(--ease-bounce);
    cursor: pointer;
    white-space: nowrap;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary-600);
    color: var(--white);
    box-shadow: 0 2px 10px rgba(28, 93, 173, 0.25);
}

.btn-primary:hover {
    background: var(--primary-500);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px rgba(28, 93, 173, 0.35);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-ghost {
    color: var(--primary-600);
    background: transparent;
    border-color: var(--border);
}

.btn-ghost:hover {
    border-color: var(--primary-400);
    background: var(--primary-50);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* ──────────────────────────────────────────────────────────────────────
   NAVIGATION
────────────────────────────────────────────────────────────────────── */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.125rem 0;
    transition: var(--ease);
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
    padding: 0.75rem 0;
    box-shadow: var(--shadow-sm);
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
}

.logo span {
    letter-spacing: -0.02em;
}

.logo-footer span {
    color: var(--white);
}

.logo-footer svg circle:first-child {
    fill: var(--primary-500);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(9, 19, 35, 0.7);
    padding: 0.4rem 0.75rem;
    border-radius: var(--r-sm);
}

.nav-links a:hover {
    color: var(--primary-600);
    background: var(--primary-50);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    background: none;
    border: none;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--primary-950);
    border-radius: 2px;
    transition: var(--ease);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ──────────────────────────────────────────────────────────────────────
   HERO
────────────────────────────────────────────────────────────────────── */
#hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: 8rem 0 5rem;
    overflow: hidden;
    background: var(--white);
}

/* Animated background blobs */
.hero-bg-blobs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: var(--r-full);
    filter: blur(80px);
    opacity: 0.5;
    animation: float 8s ease-in-out infinite;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #c3d8f4, transparent 70%);
    top: -150px;
    right: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #e4ecfa, transparent 70%);
    bottom: 0;
    left: -100px;
    animation-delay: 3s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #d9d6fe, transparent 70%);
    top: 40%;
    left: 40%;
    animation-delay: 6s;
    opacity: 0.25;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-30px) scale(1.05);
    }
}

/* Hero circuit — the page's signature motif: two flowing traces suggesting
   a live signal running underneath the hero, echoed later in #ai's engine-flow. */
.hero-circuit {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.circuit-path {
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 2 12;
    animation: circuit-flow 26s linear infinite;
}

.circuit-path-1 {
    stroke: var(--primary-300);
    opacity: 0.4;
}

.circuit-path-2 {
    stroke: var(--purple-400);
    opacity: 0.32;
    animation-duration: 32s;
    animation-direction: reverse;
}

@keyframes circuit-flow {
    to {
        stroke-dashoffset: -560;
    }
}

.circuit-node {
    fill: var(--purple-400);
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: node-pulse 3.2s ease-in-out infinite;
    animation-delay: var(--node-delay, 0s);
}

@keyframes node-pulse {
    0%,
    100% {
        opacity: 0;
        transform: scale(0.6);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.3);
    }
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Hero text */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary-600);
    background: var(--primary-100);
    border: 1px solid var(--primary-200);
    padding: 0.375rem 0.875rem;
    border-radius: var(--r-full);
    margin-bottom: 1.5rem;
    width: fit-content;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--r-full);
    background: var(--success);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.85);
    }
}

#hero-headline {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    color: var(--primary-950);
}

.hero-accent {
    color: var(--primary-500);
    display: inline-block;
}

.hero-sub {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: rgba(9, 19, 35, 0.65);
    max-width: 480px;
    margin-bottom: 2.25rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat {
    display: flex;
    flex-wrap: wrap;
}

.stat strong {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-950);
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-pct {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-500);
}

.stat-arrow {
    display: inline-flex;
    align-items: center;
    margin-right: 0.1em;
    vertical-align: middle;
    line-height: 1;
}

.stat-arrow--up {
    color: var(--success);
}

.stat-arrow--down {
    color: #f04438;
}

.stat-label {
    font-size: 0.75rem !important;
    color: rgba(9, 19, 35, 0.5) !important;
    font-weight: 500;
    margin-top: 0.25rem;
    display: block;
    width: 100%;
}

.stat-divider {
    width: 1px;
    height: 2.5rem;
    background: var(--border);
}

/* ──────────────────────────────────────────────────────────────────────
   HERO — entrance animation initial states (GSAP tweens TO the visible state)
────────────────────────────────────────────────────────────────────── */
#hero-badge,
#hero-headline,
#hero-sub,
#hero-actions .btn,
#hero-stats .stat,
#hero-stats .stat-divider,
#hero-mockup,
#hero-mockup .float-card {
    opacity: 0;
}

#hero-badge {
    transform: translateY(20px) scale(0.9);
}

#hero-headline {
    transform: translateY(40px);
}

#hero-sub {
    transform: translateY(30px);
}

#hero-actions .btn {
    transform: translateY(20px);
}

#hero-stats .stat,
#hero-stats .stat-divider {
    transform: translateY(15px);
}

#hero-mockup {
    transform: translateX(60px) scale(0.92);
}

#hero-mockup .float-card {
    transform: scale(0.7);
}

/* ──────────────────────────────────────────────────────────────────────
   HERO MOCKUP
────────────────────────────────────────────────────────────────────── */
.hero-mockup {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.visual-glow {
    position: absolute;
    inset: -12% -12% -18% -8%;
    background:
        radial-gradient(ellipse 55% 45% at 22% 12%, rgba(43, 119, 204, 0.3), transparent 70%),
        radial-gradient(ellipse 45% 40% at 88% 90%, rgba(122, 90, 248, 0.22), transparent 70%);
    filter: blur(50px);
    pointer-events: none;
    z-index: 0;
}

.browser-frame {
    position: relative;
    z-index: 2;
    width: 100%;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    transform: perspective(1600px) rotateY(-6deg) rotateX(2deg);
    transition: var(--ease-spring);
}

.hero-mockup:hover .browser-frame,
.collab-visual:hover .browser-frame,
.step-panel.is-active .browser-frame,
.step-panel:hover .browser-frame {
    transform: perspective(1600px) rotateY(-2deg) rotateX(1deg) translateY(-6px);
    box-shadow: 0 30px 70px rgba(43, 119, 204, 0.3);
}

.browser-frame-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border-light);
}

.bf-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--r-full);
    flex-shrink: 0;
}

.bf-url {
    margin-left: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(9, 19, 35, 0.4);
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--r-full);
    padding: 0.2rem 0.75rem;
}

.browser-frame-body {
    line-height: 0;
}

.browser-frame-body img {
    width: 100%;
    height: auto;
}

/* Floating decorative cards */
.float-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--r-md);
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-950);
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    z-index: 3;
}

.float-card-1 {
    top: -20px;
    right: -10px;
    animation: float-card 5s ease-in-out infinite;
}

.float-card-2 {
    bottom: 60px;
    right: -30px;
    animation: float-card 6s ease-in-out infinite;
    animation-delay: 1.5s;
}

.float-icon {
    font-size: 1rem;
}

@keyframes float-card {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ──────────────────────────────────────────────────────────────────────
   OUR STORY
────────────────────────────────────────────────────────────────────── */
#story {
    padding: var(--section-y) 0;
    background: var(--white);
    overflow: hidden;
}

.story-inner {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.story-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.story-title {
    max-width: 460px;
}

.highlight-marker {
    background: #a7f3d0;
    padding: 0.05em 0.35em;
    border-radius: 0.3em;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.story-lead {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: rgba(9, 19, 35, 0.65);
    max-width: 460px;
    margin-bottom: 1.75rem;
}

.story-callout {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: var(--r-lg);
    padding: 1.25rem 1.5rem;
    max-width: 440px;
}

.story-callout p {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--primary-950);
}

.callout-strong {
    color: #059669;
    font-weight: 700;
}

.story-arrow {
    position: absolute;
    top: 25%;
    left: 25%;
    z-index: 2;
    pointer-events: none;
    transform: translate(-25%, -25%);
}

/* Chart card */
.story-chart-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.75rem;
}

.story-chart-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.story-chart-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-950);
}

.story-chart-body {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-shrink: 0;
    padding-bottom: 2.75rem;
}

.chart-legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(9, 19, 35, 0.65);
    white-space: nowrap;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--r-full);
    flex-shrink: 0;
}

.chart-bars-area {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1.5rem;
    flex: 1;
    min-width: 0;
}

.chart-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.chart-bar-stack {
    display: flex;
    flex-direction: column-reverse;
    width: 68px;
}

.bar-segment {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bar-segment:first-child {
    border-radius: 0 0 6px 6px;
}

.bar-segment:last-child {
    border-radius: 6px 6px 0 0;
}

.seg-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--white);
}

.bar-segment-thin {
    overflow: visible;
    position: relative;
}

.bar-segment-thin .seg-value {
    color: var(--white);
    font-size: 0.6875rem;
}

.chart-bar-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-950);
    white-space: nowrap;
}

.chart-connectors {
    position: relative;
    width: 46px;
    height: 287px;
    margin-bottom: 2.5rem;
    flex-shrink: 0;
}

.connector-line {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 2px dashed var(--primary-300);
}

.connector-label {
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    color: var(--primary-500);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0 4px;
}

.story-chart-footer {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.story-cost-box {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--primary-950);
    border: 1.5px solid var(--border);
    border-radius: var(--r-full);
    padding: 0.5rem 1rem;
}

.story-cost-box strong {
    color: var(--primary-600);
}

.story-caption {
    font-size: 0.75rem;
    color: rgba(9, 19, 35, 0.4);
}

/* ──────────────────────────────────────────────────────────────────────
   PROBLEM & SOLUTION — SCROLL STORY
   Mobile-first: static stacked panels (no scroll-jacking).
   Desktop (≥901px, motion allowed): JS adds .is-pinned-mode and pins
   .ps-pin via ScrollTrigger, cross-fading panels as the user scrolls.
────────────────────────────────────────────────────────────────────── */
.problem-solution {
    padding: var(--section-y) 0;
    background: var(--primary-50);
    position: relative;
    overflow: hidden;
    transition: background-color 0.6s ease;
}

.problem-solution[data-active-phase="problem"] {
    background-color: #fef3f2;
}
.problem-solution[data-active-phase="solution"] {
    background-color: #ecfdf3;
}

.ps-container {
    position: relative;
}

.ps-progress {
    display: none;
}

.ps-grid {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.ps-stage {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.ps-visual {
    display: none;
}

.ps-panel {
    position: static;
    opacity: 1;
    transform: none;
}

.ps-kicker {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.3rem 0.8rem;
    border-radius: var(--r-full);
    margin-bottom: 1rem;
    background: var(--primary-100);
    color: var(--primary-600);
}

.ps-panel[data-phase="problem"] .ps-kicker {
    background: #fef3f2;
    color: var(--danger);
}
.ps-panel[data-phase="solution"] .ps-kicker {
    background: #ecfdf3;
    color: var(--success);
}

.ps-panel h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-950);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.ps-panel > p {
    color: rgba(9, 19, 35, 0.65);
    line-height: 1.7;
    margin-bottom: 1.25rem;
    max-width: 560px;
}

.ps-callout {
    display: inline-block;
    background: #fef3f2;
    border: 1px solid #fee4e2;
    color: var(--primary-950);
    border-radius: var(--r-lg);
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    max-width: 460px;
}
.ps-callout strong {
    color: var(--danger);
}

.ps-callout-positive {
    background: #ecfdf3;
    border-color: #a6f4c5;
}
.ps-callout-positive strong {
    color: var(--success);
}

.ps-headline {
    font-size: clamp(1.6rem, 3.6vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--primary-950);
    margin-bottom: 1.25rem;
}
.ps-headline em {
    font-style: normal;
    color: var(--primary-500);
}

.ps-body {
    color: rgba(9, 19, 35, 0.65);
    line-height: 1.7;
    max-width: 600px;
}

.ps-quote {
    border-left: 3px solid var(--primary-300);
    padding-left: 1rem;
    font-size: 1.0625rem;
    font-style: italic;
    color: rgba(9, 19, 35, 0.8);
    margin: 1rem 0;
    max-width: 480px;
}
.ps-quote cite {
    display: block;
    margin-top: 0.5rem;
    font-style: normal;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(9, 19, 35, 0.5);
}

.ps-outcome-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 2.5rem;
    margin: 1.5rem 0 2rem;
    max-width: 520px;
}
.ps-outcome-stat {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.15rem;
}
.ps-outcome-stat strong {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary-950);
    line-height: 1;
}
.ps-outcome-stat span {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-500);
}
.ps-outcome-stat label {
    width: 100%;
    font-size: 0.8125rem;
    color: rgba(9, 19, 35, 0.55);
    font-weight: 500;
    margin-top: 0.15rem;
}

/* ─── Pinned desktop mode ─────────────────────────────────────────── */
@media (min-width: 901px) {
    .is-pinned-mode .ps-pin {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .is-pinned-mode .ps-progress {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-bottom: 3.5rem;
        max-width: 640px;
    }

    .ps-progress-track {
        flex: 1;
        height: 4px;
        background: var(--border-light);
        border-radius: var(--r-full);
        overflow: hidden;
    }

    .ps-progress-fill {
        height: 100%;
        width: 0%;
        background: linear-gradient(90deg, var(--danger), var(--success));
        border-radius: var(--r-full);
    }

    .ps-progress-phase {
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: rgba(9, 19, 35, 0.35);
        transition: color 0.3s ease;
        white-space: nowrap;
    }
    .ps-progress-phase.is-active {
        color: var(--primary-950);
    }

    .is-pinned-mode .ps-grid {
        flex-direction: row;
        align-items: center;
        gap: 4.5rem;
    }

    .is-pinned-mode .ps-stage {
        position: relative;
        flex: 1 1 55%;
        min-height: 320px;
        gap: 0;
    }

    .is-pinned-mode .ps-panel {
        position: absolute;
        inset: 0;
        opacity: 0;
        pointer-events: none;
        transform: translateY(24px);
        transition:
            opacity 0.5s ease,
            transform 0.5s ease;
    }
    .is-pinned-mode .ps-panel.is-active {
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }

    .is-pinned-mode .ps-visual {
        display: flex;
        flex: 0 0 280px;
        align-items: center;
        justify-content: center;
        position: relative;
    }

    .ps-ring-wrap {
        position: relative;
        width: 240px;
        height: 240px;
        transition: opacity 0.4s ease;
    }
    .ps-ring-wrap.phase-hidden {
        opacity: 0;
    }

    .ps-ring {
        width: 100%;
        height: 100%;
        transform: rotate(-90deg);
    }
    .ps-ring-bg {
        fill: none;
        stroke: var(--border-light);
        stroke-width: 8;
    }
    .ps-ring-fg {
        fill: none;
        stroke: var(--primary-500);
        stroke-width: 8;
        stroke-linecap: round;
        transition: stroke 0.4s ease;
    }
    .ps-ring-wrap.phase-problem .ps-ring-fg {
        stroke: var(--danger);
    }
    .ps-ring-wrap.phase-solution .ps-ring-fg {
        stroke: var(--success);
    }

    .ps-ring-value {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
    }
    .ps-ring-value strong {
        font-size: 2.75rem;
        font-weight: 800;
        color: var(--primary-950);
    }
    .ps-ring-value span {
        font-size: 1.375rem;
        font-weight: 700;
        color: rgba(9, 19, 35, 0.4);
        margin-top: 0.5rem;
    }

    .ps-visual-icon {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transform: scale(0.7);
        transition:
            opacity 0.4s ease,
            transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        pointer-events: none;
    }
    .ps-visual-icon.is-active {
        opacity: 1;
        transform: scale(1);
    }
    .ps-visual-icon svg {
        display: none;
        position: absolute;
    }
    .ps-visual-icon[data-state="pivot"] svg[data-icon="pivot"],
    .ps-visual-icon[data-state="outcome"] svg[data-icon="outcome"] {
        display: block;
    }
}

/* ──────────────────────────────────────────────────────────────────────
   TEAM
────────────────────────────────────────────────────────────────────── */
#team {
    padding: var(--section-y) 0;
    background: var(--bg-soft);
}

.team-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.team-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    background: var(--bg-soft);
    border: 1px solid var(--border-light);
    border-radius: var(--r-xl);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-md);
}

.team-photo-wrap {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.team-photo-placeholder {
    width: 140px;
    height: 140px;
    border-radius: var(--r-full);
    background: var(--primary-100);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--primary-400);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    overflow: hidden;
}

.team-photo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.team-name {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--primary-950);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.team-creds {
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(9, 19, 35, 0.5);
}

.team-title {
    font-size: 0.9375rem;
    color: var(--primary-500);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.team-meta {
    font-size: 0.8125rem;
    color: rgba(9, 19, 35, 0.5);
    font-weight: 500;
    margin-bottom: 1rem;
}

.team-bio {
    font-size: 0.9375rem;
    color: rgba(9, 19, 35, 0.65);
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.team-quote {
    font-size: 0.9375rem;
    font-style: italic;
    color: rgba(9, 19, 35, 0.75);
    border-left: 3px solid var(--primary-300);
    padding-left: 1rem;
    line-height: 1.6;
    text-align: left;
}

/* ──────────────────────────────────────────────────────────────────────
   TESTIMONIALS
────────────────────────────────────────────────────────────────────── */
#testimonials {
    padding: var(--section-y) 0;
    background: var(--white);
}

.testimonial-slider {
    position: relative;
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 3rem;
}

.testimonial-quote-mark {
    position: absolute;
    top: -1.5rem;
    left: 3.5rem;
    color: var(--primary-100);
    z-index: 0;
}

.testimonial-track-wrap {
    overflow: hidden;
    border-radius: var(--r-xl);
}

.testimonial-track {
    display: flex;
    gap: 1.5rem;
    will-change: transform;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    cursor: grab;
}

.testimonial-track:active {
    cursor: grabbing;
}

.testimonial-slide {
    flex: 0 0 calc((100% - 3rem) / 3);
    min-width: 0;
    background: var(--bg-soft);
    border: 1px solid var(--border-light);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-md);
    padding: 2rem 1.75rem;
    position: relative;
    z-index: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.testimonial-stars {
    color: var(--warning);
    font-size: 1rem;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
}

.testimonial-quote {
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--primary-950);
    margin-bottom: 1.5rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: auto;
}

.testimonial-avatar {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.testimonial-author-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.testimonial-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--primary-950);
}

.testimonial-role {
    font-size: 0.8125rem;
    color: rgba(9, 19, 35, 0.55);
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: var(--r-full);
    background: var(--white);
    border: 1px solid var(--border-light);
    color: var(--primary-600);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: var(--ease-bounce);
    z-index: 2;
}

.slider-arrow:hover {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: var(--white);
    transform: translateY(-50%) scale(1.08);
}

.slider-arrow-prev {
    left: 0;
}

.slider-arrow-next {
    right: 0;
}

.slider-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--r-full);
    background: var(--primary-200);
    transition: var(--ease);
    padding: 0;
}

.slider-dot:hover {
    background: var(--primary-300);
}

.slider-dot.is-active {
    background: var(--primary-600);
    width: 22px;
}

@media (max-width: 640px) {
    .testimonial-slider {
        padding: 0;
    }

    .testimonial-slide {
        flex-basis: 100%;
        padding: 2.25rem 1.5rem;
    }

    .testimonial-quote-mark {
        left: 1.5rem;
        width: 44px;
        height: 34px;
    }

    /* Arrows give way to swipe + dots on small screens */
    .slider-arrow {
        display: none;
    }
}

/* ──────────────────────────────────────────────────────────────────────
   FEATURES
────────────────────────────────────────────────────────────────────── */
#features {
    padding: var(--section-y) 0;
    background: var(--carbon);
    position: relative;
    overflow: hidden;
}

#features::before,
.features-bg {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 10% 20%, rgba(43, 119, 204, 0.15), transparent),
        radial-gradient(ellipse 50% 60% at 90% 80%, rgba(122, 90, 248, 0.1), transparent),
        radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: auto, auto, 26px 26px;
    pointer-events: none;
}

.features-label {
    background: rgba(43, 119, 204, 0.2);
    color: var(--primary-300);
    border: none;
}
.features-title {
    color: var(--white);
}
.features-sub {
    color: rgba(255, 255, 255, 0.6);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    position: relative;
}

.feature-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--r-lg);
    padding: 1.625rem;
    transition: var(--ease-spring);
    backdrop-filter: blur(8px);
    cursor: default;
}

.feature-card:hover {
    background: rgba(43, 119, 204, 0.12);
    border-color: rgba(43, 119, 204, 0.35);
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(43, 119, 204, 0.2);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--icon-bg, var(--primary-100));
    color: var(--icon-color, var(--primary-500));
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.125rem;
    transition: var(--ease-bounce);
}

.feature-card:hover .feature-icon {
    transform: scale(1.15) rotate(-3deg);
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.625rem;
    color: var(--white);
}

.feature-card p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.65;
}

/* Initial hidden state for animateFeatureCards() in script.js — GSAP tweens TO visible */
.feature-card {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
}

/* ──────────────────────────────────────────────────────────────────────
   HOW IT WORKS
────────────────────────────────────────────────────────────────────── */
#how-it-works {
    padding: var(--section-y) 0;
    background: var(--white);
    overflow: hidden;
}

.steps-sub {
    margin-bottom: 0;
}

/* ─── Pin wrapper ──────────────────────────────────────────────────────
   Mobile-first: a plain static block, .steps-track lays panels out in a
   vertical column below (no JS required). On desktop, with motion allowed,
   initHorizontalSteps() in script.js adds .is-horizontal-mode to the section
   and pins this wrapper, translating .steps-track horizontally as the user
   scrolls — the same enable-only-on-desktop pattern as the Problem &
   Solution section above. */
.steps-pin {
    position: relative;
    margin-top: 3rem;
}

.steps-progress {
    display: none;
}

.steps-track {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.step-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step-panel-media .browser-frame {
    width: 100%;
}

.step-tag {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-500);
    background: var(--primary-50);
    border: 1px solid var(--primary-100);
    padding: 0.3rem 0.75rem;
    border-radius: var(--r-full);
    margin-bottom: 1rem;
    width: fit-content;
}

.step-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-50);
    color: var(--primary-500);
    border: 1px solid var(--primary-100);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--ease-spring);
    margin-bottom: 0.75rem;
}

.step-panel:hover .step-icon,
.step-panel.is-active .step-icon {
    background: var(--primary-600);
    color: var(--white);
    border-color: var(--primary-600);
    transform: scale(1.1) rotate(-4deg);
}

.step-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-950);
    margin-bottom: 0.625rem;
}

.step-content p {
    font-size: 0.9375rem;
    color: rgba(9, 19, 35, 0.62);
    line-height: 1.7;
}

/* ─── Horizontal pinned mode (desktop, motion allowed) ────────────────── */
@media (min-width: 901px) {
    .is-horizontal-mode .steps-pin {
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        margin-top: 0;
        overflow: hidden;
    }

    .is-horizontal-mode .steps-progress {
        display: flex;
        align-items: center;
        gap: 1.25rem;
        max-width: 1200px;
        width: 100%;
        margin: 0 auto 3rem;
        padding: 0 1.5rem;
    }

    .steps-progress-count {
        font-family: var(--font-mono);
        font-size: 0.8125rem;
        font-weight: 700;
        color: var(--primary-950);
        letter-spacing: 0.02em;
        white-space: nowrap;
    }
    .steps-progress-count i {
        font-style: normal;
        color: rgba(9, 19, 35, 0.3);
        margin: 0 0.3rem;
    }

    .steps-progress-track {
        flex: 1;
        height: 3px;
        background: var(--border-light);
        border-radius: var(--r-full);
        overflow: hidden;
    }

    .steps-progress-fill {
        height: 100%;
        width: 0%;
        background: linear-gradient(90deg, var(--primary-500), var(--purple-400));
        border-radius: var(--r-full);
    }

    .is-horizontal-mode .steps-track {
        flex-direction: row;
        flex-wrap: nowrap;
        width: max-content;
        max-width: none;
        margin: 0;
        padding: 0 3vw;
        gap: 3vw;
        will-change: transform;
    }

    .is-horizontal-mode .step-panel {
        flex: 0 0 min(75vw, 1600px);
        flex-direction: row;
        align-items: center;
        gap: 3rem;
        opacity: 0.3;
        transform: scale(0.93);
        transition:
            opacity 0.4s ease,
            transform 0.4s ease;
    }

    .is-horizontal-mode .step-panel.is-active {
        opacity: 1;
        transform: scale(1);
    }

    .is-horizontal-mode .step-panel-media {
        flex: 1 1 60%;
        min-width: 0;
    }
    .is-horizontal-mode .step-content {
        flex: 1 1 40%;
        min-width: 0;
    }

    .is-horizontal-mode .step-panel-media .browser-frame-body {
        aspect-ratio: 16 / 9;
    }
    .is-horizontal-mode .step-panel-media .browser-frame-body img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: left;
    }
}

/* ──────────────────────────────────────────────────────────────────────
   COLLABORATIVE SESSION
────────────────────────────────────────────────────────────────────── */
#collaborative {
    padding: var(--section-y) 0;
    background: linear-gradient(135deg, var(--bg-soft) 0%, #f4f3ff20 100%);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.collab-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4.5rem;
    align-items: center;
    margin-bottom: 4.5rem;
}

.collab-text h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    color: var(--primary-950);
}

.collab-text > p {
    color: rgba(9, 19, 35, 0.65);
    line-height: 1.75;
}

/* Collab visual (product screenshot) */
.collab-visual {
    position: relative;
}

.collab-float-1 {
    top: -18px;
    left: -18px;
    animation: float-card 5.5s ease-in-out infinite;
}

.collab-float-2 {
    bottom: -18px;
    right: -18px;
    animation: float-card 6.5s ease-in-out infinite;
    animation-delay: 2s;
}

/* Feature grid */
.collab-features {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.collab-feature {
    flex: 1 1 280px;
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: 1.375rem;
    transition: var(--ease-spring);
}

.collab-feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-200);
}

.cf-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--r-full);
    flex-shrink: 0;
    margin-top: 0.375rem;
}

.collab-feature h6 {
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 0 0 0.375rem;
}
.collab-feature p {
    font-size: 0.875rem;
    color: rgba(9, 19, 35, 0.6);
    line-height: 1.6;
}

/* ──────────────────────────────────────────────────────────────────────
   AI SECTION
────────────────────────────────────────────────────────────────────── */
#ai {
    padding: var(--section-y) 0;
    background: var(--carbon);
    position: relative;
    overflow: hidden;
}

.ai-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 10% 20%, rgba(43, 119, 204, 0.16), transparent),
        radial-gradient(ellipse 50% 60% at 90% 80%, rgba(122, 90, 248, 0.12), transparent),
        radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: auto, auto, 26px 26px;
    pointer-events: none;
}

.ai-label {
    background: rgba(43, 119, 204, 0.2);
    color: var(--primary-300);
    border: none;
}
.ai-title {
    color: var(--white);
}
.ai-sub {
    color: rgba(255, 255, 255, 0.6);
}

/* Engine flow — the section's signature: a literal pipeline diagram that
   frames the nine module cards below as stages of one continuous system. */
.engine-flow {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    /* max-width: 780px; */
    margin: 0 0 3.5rem;
}

.engine-flow-track {
    position: absolute;
    left: 6px;
    right: 6px;
    top: 6px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--engine-line) 15%, var(--engine-line) 85%, transparent);
}

.engine-flow-pulse {
    position: absolute;
    top: 1px;
    left: 0;
    width: 10px;
    height: 10px;
    border-radius: var(--r-full);
    background: var(--purple-400);
    box-shadow: 0 0 12px 3px rgba(155, 138, 251, 0.7);
    animation: engine-pulse-travel 5s ease-in-out infinite;
}

@keyframes engine-pulse-travel {
    0% {
        left: 0;
        opacity: 0;
    }
    8% {
        opacity: 1;
    }
    92% {
        opacity: 1;
    }
    100% {
        left: calc(100% - 10px);
        opacity: 0;
    }
}

.engine-flow-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    z-index: 1;
}

.efs-dot {
    width: 14px;
    height: 14px;
    border-radius: var(--r-full);
    background: var(--carbon);
    border: 2px solid var(--purple-400);
}

.efs-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
}

.ai-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.ai-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--r-lg);
    padding: 1.75rem;
    transition: var(--ease-spring);
    backdrop-filter: blur(8px);
    position: relative;
}

/* Small "component lead" mark — echoes the circuit-board language of the
   engine-flow diagram above, on every module card. */
.ai-card::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 1.75rem;
    width: 2px;
    height: 12px;
    background: var(--purple-400);
    opacity: 0.6;
}

.ai-card:hover {
    background: rgba(43, 119, 204, 0.12);
    border-color: rgba(43, 119, 204, 0.35);
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(43, 119, 204, 0.2);
}

/* Initial hidden state for animateAICards() in script.js — GSAP tweens TO visible */
.ai-card {
    opacity: 0;
    transform: translateY(40px);
}

.ai-card-num {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--purple-400);
    margin-bottom: 0.875rem;
}

.ai-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.625rem;
}

.ai-card p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.65;
    margin-bottom: 1rem;
}

.ai-card-tag {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-300);
    background: rgba(43, 119, 204, 0.15);
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: var(--r-full);
}

/* ──────────────────────────────────────────────────────────────────────
   CONTACT
────────────────────────────────────────────────────────────────────── */
#contact {
    padding: var(--section-y) 0;
    background: var(--white);
}

.contact-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: start;
}

.contact-text h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    color: var(--primary-950);
}

.contact-text > p {
    color: rgba(9, 19, 35, 0.65);
    line-height: 1.75;
    margin-bottom: 2rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: rgba(9, 19, 35, 0.65);
}

.contact-info-item em {
    font-size: 0.75rem;
    color: var(--warning);
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: var(--bg-soft);
    border: 1px solid var(--border-light);
    border-radius: var(--r-xl);
    padding: 2.25rem;
    box-shadow: var(--shadow-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-950);
}

.req {
    color: var(--danger);
    margin-left: 0.1rem;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    background: var(--white);
    color: var(--primary-950);
    font-size: 0.9375rem;
    transition: var(--ease);
    resize: vertical;
    outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(9, 19, 35, 0.35);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(43, 119, 204, 0.12);
}

.form-group input.is-error,
.form-group textarea.is-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.1);
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    font-weight: 500;
    min-height: 1em;
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: var(--white);
    border-radius: var(--r-full);
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ──────────────────────────────────────────────────────────────────────
   CONTACT SUCCESS MODAL
────────────────────────────────────────────────────────────────────── */
.success-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(9, 19, 35, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.success-modal-overlay[hidden] {
    display: none;
}

.success-modal-overlay.is-visible {
    opacity: 1;
}

.success-modal {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--white);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    /* Initial hidden state for the open animation in script.js — GSAP tweens TO visible */
    opacity: 0;
    transform: scale(0.92) translateY(10px);
}

.success-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-full);
    color: rgba(9, 19, 35, 0.4);
    transition: var(--ease);
}
.success-modal-close:hover {
    background: var(--bg-soft);
    color: var(--primary-950);
}

.success-modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.25rem;
    border-radius: var(--r-full);
    background: #ecfdf3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-modal h3 {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--primary-950);
    margin-bottom: 0.625rem;
}

.success-modal p {
    font-size: 0.9375rem;
    color: rgba(9, 19, 35, 0.65);
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

.success-modal-ok {
    width: 100%;
    justify-content: center;
}

/* ──────────────────────────────────────────────────────────────────────
   FOOTER
────────────────────────────────────────────────────────────────────── */
#footer {
    background: var(--carbon);
    padding: 4.5rem 0 2rem;
    color: rgba(255, 255, 255, 0.65);
}

.footer-top {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3.5rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand p {
    font-size: 0.875rem;
    line-height: 1.7;
    margin: 1rem 0 1.5rem;
    color: rgba(255, 255, 255, 0.5);
}

.footer-socials {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    transition: var(--ease-bounce);
}

.social-link:hover {
    color: var(--white);
    border-color: var(--primary-400);
    background: rgba(43, 119, 204, 0.2);
    transform: translateY(-3px);
}

.footer-links-group h4 {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--white);
    margin-bottom: 1.25rem;
}

.footer-links-group ul {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.footer-links-group a {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
    transition: var(--ease);
}

.footer-links-group a:hover {
    color: var(--white);
    padding-left: 4px;
}
.footer-links-group em {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.footer-credit {
    font-style: italic;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8125rem;
}

/* ──────────────────────────────────────────────────────────────────────
   RESPONSIVE
────────────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    :root {
        --section-y: 5rem;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .testimonial-slider {
        padding: 0 3.25rem;
    }

    .testimonial-slide {
        flex-basis: calc((100% - 1.5rem) / 2);
    }

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

    .browser-frame {
        max-width: 560px;
        transform: none;
    }

    .story-inner {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .story-text {
        align-items: stretch;
    }

    .story-title,
    .story-lead,
    .story-callout {
        max-width: none;
    }

    .story-arrow {
        display: none;
    }

    .collab-inner {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .contact-inner {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .footer-top {
        grid-template-columns: 1fr 1fr;
    }

    .team-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
    .ai-grid {
        grid-template-columns: 1fr 1fr;
    }

    .engine-flow {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
        max-width: none;
    }
    .engine-flow-track,
    .engine-flow-pulse {
        display: none;
    }
    .engine-flow-stage {
        flex-direction: row;
        gap: 0.75rem;
    }
}

@media (max-width: 640px) {
    .nav-links {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1.5rem;
        z-index: 999;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        font-size: 1.25rem;
        font-weight: 600;
    }

    .nav-cta {
        display: none;
    }

    .hamburger {
        display: flex;
        z-index: 1001;
        position: relative;
    }

    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-stats {
        gap: 1rem;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .float-card {
        display: none;
    }

    .ai-grid {
        grid-template-columns: 1fr;
    }

    .story-chart-body {
        flex-wrap: wrap;
        justify-content: center;
    }

    .chart-legend {
        flex-direction: row;
        flex-wrap: wrap;
        padding-bottom: 0;
        gap: 0.5rem 1rem;
    }

    .chart-bars-area {
        width: 100%;
    }

    .chart-connectors {
        width: 32px;
    }
}

@media (max-width: 400px) {
    .hero-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .stat-divider {
        display: none;
    }
    .ps-outcome-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem 1.5rem;
    }
    .contact-form {
        padding: 1.5rem;
    }
}
