/* ============================================================
   CanyonRift — Design System
   ============================================================ */

:root {
    /* Brand */
    --accent: #2DD4BF;
    --accent-soft: rgba(45, 212, 191, 0.12);
    --accent-strong: #14B8A6;
    --purple: #8B7BF0;
    --purple-soft: rgba(139, 123, 240, 0.12);

    /* Dark (default) */
    --bg: #05070A;
    --bg-elev: #0B0F15;
    --surface: #0D1117;
    --surface-2: #11161D;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.12);
    --text: #F3F5F8;
    --text-dim: #9BA3AF;
    --text-faint: #6B7280;
    --code-bg: #161B22;

    /* Type */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Layout */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Motion */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --t-fast: 0.18s var(--ease);
    --t-med: 0.32s var(--ease);
}

.light-mode {
    --bg: #F4F6FA;
    --bg-elev: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #EEF1F6;
    --border: rgba(15, 23, 42, 0.10);
    --border-strong: rgba(15, 23, 42, 0.16);
    --text: #0B1220;
    --text-dim: #3E4C63;
    --text-faint: #5A6882;
    --code-bg: #E8EDF4;
    --accent: #0D9488;
    --accent-strong: #0F766E;
    --accent-soft: rgba(13, 148, 136, 0.12);
    --purple: #6D5EE0;
    --purple-soft: rgba(109, 94, 224, 0.12);
    --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-card-hover: 0 4px 16px rgba(15, 23, 42, 0.10), 0 12px 36px rgba(15, 23, 42, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "ss01", "cv11";
    transition: background-color 0.4s ease, color 0.4s ease;
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

a { color: inherit; }

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 28px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ============================================================
   Glow cursor (subtle ambient light)
   ============================================================ */
#glow-cursor {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-soft) 0%, transparent 60%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 0;
    opacity: 0.9;
    transition: opacity 0.4s ease;
}
.light-mode #glow-cursor { opacity: 0.5; }
@media (hover: none) { #glow-cursor { display: none; } }

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4 {
    font-family: var(--font-sans);
    letter-spacing: -0.02em;
    color: var(--text);
}

h1 {
    font-size: clamp(40px, 5.8vw, 68px);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.05;
    margin-bottom: 24px;
}
h1 span { color: var(--accent); }

h3 {
    font-size: clamp(28px, 3.6vw, 44px);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin-bottom: 20px;
}
h3 span { color: var(--accent); }

h4 {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
}

p {
    font-size: 16.5px;
    color: var(--text-dim);
    line-height: 1.65;
}

.lead {
    font-size: 19px;
    line-height: 1.6;
    max-width: 540px;
    color: var(--text-dim);
    margin-bottom: 36px;
}

.h-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--purple);
    margin-bottom: 20px;
    padding: 6px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 100px;
    background: var(--purple-soft);
}

.section-head {
    max-width: 760px;
    margin-bottom: 48px;
}
.section-sub {
    margin-top: 16px;
    font-size: 17px;
    max-width: 620px;
}

/* ============================================================
   Navigation
   ============================================================ */
nav {
    position: fixed;
    inset: 0 0 auto 0;
    height: 72px;
    background: rgba(5, 7, 10, 0.72);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid transparent;
    z-index: 100;
    transition: border-color var(--t-med), background var(--t-med);
}
.light-mode nav { background: rgba(244, 246, 250, 0.82); }
nav.scrolled { border-bottom-color: var(--border); }
.light-mode nav.scrolled { box-shadow: 0 1px 8px rgba(15, 23, 42, 0.06); }

.nav-container {
    max-width: 1180px;
    height: 100%;
    margin: 0 auto;
    padding: 0 28px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    justify-self: start;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    padding: 3px;
    background: #FFFFFF;
    border: 1.5px solid rgba(45, 212, 191, 0.35);
    box-shadow: 0 0 12px rgba(45, 212, 191, 0.25), 0 4px 16px rgba(45, 212, 191, 0.12);
    object-fit: contain;
    display: block;
    transition: all var(--t-med);
}
.brand-icon:hover {
    box-shadow: 0 0 18px rgba(45, 212, 191, 0.35), 0 6px 20px rgba(45, 212, 191, 0.18);
    transform: scale(1.05);
}
.light-mode .brand-icon {
    background: var(--surface);
    border-color: rgba(13, 148, 136, 0.3);
    box-shadow: 0 0 12px rgba(13, 148, 136, 0.15), var(--shadow-card);
}

.brand-name {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.18em;
    color: var(--text);
}

.nav-links-center {
    display: flex;
    align-items: center;
    gap: 36px;
    justify-self: center;
}

.nav-links-center a {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    transition: color var(--t-fast);
    position: relative;
}
.nav-links-center a:hover { color: var(--text); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: end;
}

.btn-enterprise {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    padding: 9px 18px;
    text-decoration: none;
    border-radius: 100px;
    transition: all var(--t-fast);
}
.btn-enterprise:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

/* Theme toggle */
#theme-toggle {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 100px;
    transition: all var(--t-fast);
}
#theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.light-mode .sun, .dark-mode .moon { display: none; }

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-dim);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    transition: all var(--t-fast);
    order: 3;
}
.mobile-menu-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.mobile-menu-toggle .close-icon { display: none; }
.mobile-menu-toggle.is-open .hamburger-icon { display: none; }
.mobile-menu-toggle.is-open .close-icon { display: block; }

/* Mobile nav drawer */
.mobile-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border-strong);
    padding: 16px 24px 24px;
    flex-direction: column;
    gap: 4px;
    z-index: 99;
    transform: translateY(-8px);
    opacity: 0;
    transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
    pointer-events: none;
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.3);
}
.light-mode .mobile-nav {
    box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.15);
}
.mobile-nav.is-open {
    display: flex;
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.mobile-nav a {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 15px;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    transition: all var(--t-fast);
}
.mobile-nav a:hover {
    color: var(--text);
    background: var(--surface-2);
}
.mobile-nav .mobile-cta {
    margin-top: 8px;
    justify-content: center;
    color: #04130F;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 22px;
    border-radius: 100px;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--t-fast);
    font-family: inherit;
    line-height: 1;
}

.btn-primary {
    background: var(--accent);
    color: #04130F;
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    transform: translateY(-1px);
    box-shadow: 0 10px 30px -10px rgba(45, 212, 191, 0.5);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text);
}
.btn-outline:hover {
    border-color: var(--text);
    background: var(--surface);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
    padding: 140px 0 88px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 10%, var(--accent-soft) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 0%, var(--purple-soft) 0%, transparent 45%);
    pointer-events: none;
    z-index: 0;
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 72px;
    align-items: center;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11.5px;
    margin-bottom: 28px;
    letter-spacing: 0.18em;
    font-weight: 500;
    padding: 8px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 100px;
    background: var(--surface-2);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 3px var(--accent-soft); }
    50% { box-shadow: 0 0 0 6px transparent; }
}

.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}
.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.meta-label {
    font-size: 11px;
    font-family: var(--font-mono);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-faint);
}
.meta-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.meta-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
}

/* ============================================================
   Terminal
   ============================================================ */
.terminal-window {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-strong);
    overflow: hidden;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 40px 80px -20px rgba(0, 0, 0, 0.55),
        0 0 0 1px var(--border) inset;
    font-family: var(--font-mono);
    transform: translateZ(0);
}
.light-mode .terminal-window {
    box-shadow:
        0 24px 60px -20px rgba(15, 23, 42, 0.15),
        0 0 0 1px var(--border) inset;
}

.terminal-header {
    background: var(--surface-2);
    padding: 13px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border);
}

.terminal-controls {
    display: flex;
    gap: 7px;
}
.terminal-controls span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--border-strong);
}
.terminal-controls span:nth-child(1) { background: #FF5F56; }
.terminal-controls span:nth-child(2) { background: #FFBD2E; }
.terminal-controls span:nth-child(3) { background: #27C93F; }

.terminal-title {
    font-size: 11.5px;
    color: var(--text-faint);
    flex: 1;
    text-align: center;
}

.terminal-badge {
    font-size: 9.5px;
    letter-spacing: 0.15em;
    font-weight: 700;
    color: var(--accent);
    padding: 3px 8px;
    border: 1px solid var(--accent);
    border-radius: 100px;
    background: var(--accent-soft);
}

.terminal-body {
    padding: 22px 24px;
    font-size: 12.5px;
    line-height: 1.95;
    min-height: 340px;
    color: var(--text-dim);
}
.light-mode .terminal-body { color: #334155; }

.terminal-body .line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    animation: terminal-in 0.35s var(--ease) forwards;
}
.terminal-body .line:nth-child(1)  { animation-delay: 0.2s; }
.terminal-body .line:nth-child(2)  { animation-delay: 0.5s; }
.terminal-body .line:nth-child(3)  { animation-delay: 0.8s; }
.terminal-body .line:nth-child(4)  { animation-delay: 1.1s; }
.terminal-body .line:nth-child(5)  { animation-delay: 1.4s; }
.terminal-body .line:nth-child(6)  { animation-delay: 1.7s; }
.terminal-body .line:nth-child(7)  { animation-delay: 2.0s; }
.terminal-body .line:nth-child(8)  { animation-delay: 2.3s; }
.terminal-body .line:nth-child(9)  { animation-delay: 2.6s; }
.terminal-body .line:nth-child(10) { animation-delay: 2.9s; }
.terminal-body .line:nth-child(11) { animation-delay: 3.2s; }

@keyframes terminal-in {
    from { opacity: 0; transform: translateX(-4px); }
    to { opacity: 1; transform: translateX(0); }
}

.t-blue   { color: #58A6FF; }
.t-purple { color: #BC8CFF; }
.t-teal   { color: #2DD4BF; }
.t-amber  { color: #E3B341; }
.t-green  { color: #3FB950; }
.t-muted  { color: var(--text-faint); }
.t-cmd    { color: var(--text); font-weight: 500; }

.cursor-blink {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: var(--accent);
    vertical-align: middle;
    animation: blink 1.1s steps(2) infinite;
    color: transparent;
}
@keyframes blink {
    50% { opacity: 0; }
}

/* ============================================================
   Sections (base)
   ============================================================ */
section {
    padding: 88px 0;
    position: relative;
    border-top: 1px solid var(--border);
}

/* ============================================================
   Problem / Stats
   ============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    transition: all var(--t-med);
}
.light-mode .stat-tile {
    box-shadow: var(--shadow-card);
}
.stat-tile:hover {
    border-color: var(--border-strong);
    transform: translateY(-4px);
}
.light-mode .stat-tile:hover {
    box-shadow: var(--shadow-card-hover);
}

.stat-num {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--accent);
    margin-bottom: 12px;
    line-height: 1;
    font-feature-settings: "tnum";
}

.stat-label {
    font-size: 14.5px;
    color: var(--text-dim);
    line-height: 1.5;
}

/* ============================================================
   Pipeline
   ============================================================ */
/* ============================================================
   Pipeline Timeline (scroll-driven)
   ============================================================ */
.timeline {
    position: relative;
    margin-top: 40px;
    padding: 16px 0 32px;
}

.timeline-track {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background: linear-gradient(
        to bottom,
        transparent 0,
        var(--border) 48px,
        var(--border) calc(100% - 48px),
        transparent 100%
    );
    overflow: hidden;
    pointer-events: none;
}

.timeline-fill {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(
        to bottom,
        transparent 0,
        var(--accent) 48px,
        var(--accent) calc(100% - 24px),
        var(--purple) 100%
    );
    box-shadow: 0 0 18px var(--accent-soft);
    transition: height 0.08s linear;
    will-change: height;
}

.timeline-list {
    list-style: none;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 80px 1fr;
    align-items: center;
    min-height: 140px;
}

.timeline-item[data-side="left"] .timeline-card {
    grid-column: 1;
    text-align: right;
    transform: translateX(-24px);
}

.timeline-item[data-side="left"] .timeline-card .card-meta,
.timeline-item[data-side="left"] .card-source {
    justify-content: flex-end;
}

.timeline-item[data-side="right"] .timeline-card {
    grid-column: 3;
    text-align: left;
    transform: translateX(24px);
}

.timeline-node {
    grid-column: 2;
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.node-dot {
    position: relative;
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--text-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        transform var(--t-med),
        border-color var(--t-med),
        background-color var(--t-med),
        color var(--t-med),
        box-shadow var(--t-med);
}

.node-pulse {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
    pointer-events: none;
}

.timeline-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px 28px;
    transition:
        opacity 0.6s var(--ease),
        transform 0.6s var(--ease),
        border-color var(--t-med),
        box-shadow var(--t-med);
    opacity: 0;
}

.timeline-item[data-side="left"] .timeline-card {
    transform: translateX(-24px) translateY(20px);
}
.timeline-item[data-side="right"] .timeline-card {
    transform: translateX(24px) translateY(20px);
}

.timeline-item.is-active .timeline-card {
    opacity: 1;
    transform: translateX(0) translateY(0);
    border-color: var(--border-strong);
    box-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.6);
}

.timeline-item.is-active .node-dot {
    transform: scale(1.06);
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    box-shadow:
        0 0 0 4px var(--accent-soft),
        0 0 32px var(--accent-soft);
}

.timeline-item.is-active .node-pulse {
    animation: node-pulse 2.4s var(--ease) infinite;
}

.timeline-item.is-loop.is-active .node-dot {
    border-color: var(--purple);
    background: var(--purple-soft);
    color: var(--purple);
    box-shadow:
        0 0 0 4px var(--purple-soft),
        0 0 32px var(--purple-soft);
}

.timeline-item.is-loop .node-pulse {
    background: var(--purple);
}

@keyframes node-pulse {
    0% { opacity: 0.45; transform: scale(0.9); }
    70% { opacity: 0; transform: scale(2.4); }
    100% { opacity: 0; transform: scale(2.4); }
}

.card-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.card-num {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--accent);
    padding: 4px 10px;
    background: var(--accent-soft);
    border-radius: 100px;
}

.card-num.loop {
    color: var(--purple);
    background: var(--purple-soft);
}

.card-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-faint);
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: var(--surface-2);
    letter-spacing: 0.02em;
}

.timeline-card h4 {
    margin-bottom: 10px;
    font-size: 20px;
    letter-spacing: -0.01em;
}

.timeline-card p {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text-dim);
    margin-bottom: 14px;
}

.timeline-card p:last-of-type {
    margin-bottom: 0;
}

.timeline-card p code {
    font-family: var(--font-mono);
    font-size: 12.5px;
    background: var(--code-bg);
    color: var(--text);
    padding: 1px 6px;
    border-radius: 5px;
}

.timeline-card em {
    color: var(--text);
    font-style: normal;
    font-weight: 500;
}

.card-source {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.source-tag {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-faint);
    padding: 3px 8px;
    background: var(--code-bg);
    border-radius: 5px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .timeline-track { left: 28px; }
    .timeline-list { gap: 32px; }

    .timeline-item {
        grid-template-columns: 56px 1fr;
        align-items: start;
        min-height: 0;
    }

    .timeline-node {
        grid-column: 1;
        width: 56px;
        height: 56px;
        margin-top: 4px;
    }

    .node-dot {
        width: 36px;
        height: 36px;
    }

    .node-pulse {
        width: 36px;
        height: 36px;
    }

    .timeline-item[data-side="left"] .timeline-card,
    .timeline-item[data-side="right"] .timeline-card {
        grid-column: 2;
        text-align: left;
        transform: translateX(20px) translateY(0);
        padding: 22px 22px;
    }

    .timeline-item.is-active .timeline-card {
        transform: translateX(0) translateY(0);
    }

    .timeline-item[data-side="left"] .timeline-card .card-meta,
    .timeline-item[data-side="left"] .card-source {
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .timeline-card,
    .node-dot {
        transition: none;
    }
    .timeline-card { opacity: 1; transform: none !important; }
    .timeline-item.is-active .node-pulse { animation: none; }
}

/* ============================================================
   Features
   ============================================================ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.f-card {
    background: var(--surface);
    padding: 36px 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all var(--t-med);
    position: relative;
}
.light-mode .f-card {
    box-shadow: var(--shadow-card);
}
.f-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-4px);
}
.light-mode .f-card:hover {
    box-shadow: var(--shadow-card-hover);
}

.f-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 22px;
}

.f-card h4 {
    margin-bottom: 10px;
}

.f-card p {
    font-size: 15px;
    line-height: 1.6;
}

/* ============================================================
   Product Showcase
   ============================================================ */
.product-showcase {
    background: var(--bg);
}

.showcase-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 28px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}
.showcase-tabs::-webkit-scrollbar { display: none; }

.showcase-tab {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 13.5px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 100px;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--t-fast);
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}
.showcase-tab:hover {
    color: var(--text);
    border-color: var(--border-strong);
}
.showcase-tab.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #04130F;
}

.showcase-viewport {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border-strong);
    background: var(--surface);
}
.light-mode .showcase-viewport {
    box-shadow: var(--shadow-card-hover);
}

.showcase-frame {
    position: relative;
    overflow: hidden;
}

.showcase-slides {
    position: relative;
}

.showcase-slide {
    display: none;
    width: 100%;
    height: auto;
    object-fit: cover;
    animation: showcaseFadeIn 0.35s ease;
}
.showcase-slide.is-active {
    display: block;
}

@keyframes showcaseFadeIn {
    from { opacity: 0; transform: scale(0.985); }
    to { opacity: 1; transform: scale(1); }
}

.showcase-caption {
    margin-top: 20px;
    text-align: center;
}
.showcase-caption p {
    font-size: 15px;
    color: var(--text-dim);
    line-height: 1.6;
}
.showcase-caption strong {
    color: var(--text);
}

/* ============================================================
   Payers
   ============================================================ */
.payer-groups {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.payer-group {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
}
.light-mode .payer-group {
    box-shadow: var(--shadow-card);
}

.payer-group-title {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.payer-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payer-list li {
    font-size: 15px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}
.payer-list li::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

/* ============================================================
   Stack table
   ============================================================ */
.stack-table {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
}
.light-mode .stack-table {
    box-shadow: var(--shadow-card);
}

.stack-row {
    display: grid;
    grid-template-columns: 1fr 1.3fr 2fr;
    gap: 24px;
    padding: 18px 28px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    transition: background var(--t-fast);
}
.stack-row:last-child { border-bottom: none; }
.stack-row:not(.stack-head):hover { background: var(--surface-2); }

.stack-head {
    background: var(--surface-2);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-faint);
    font-weight: 600;
    padding-top: 14px;
    padding-bottom: 14px;
}

.stack-row > div {
    font-size: 14.5px;
    color: var(--text-dim);
}
.stack-row > div:first-child {
    color: var(--text);
    font-weight: 500;
}
.stack-row code {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--code-bg);
    color: var(--text);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    white-space: nowrap;
}

/* ============================================================
   Equity / Mission
   ============================================================ */
.equity-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 56px;
    align-items: center;
}

.equity-content p {
    font-size: 16.5px;
    margin-bottom: 20px;
    max-width: 560px;
}
.equity-content p:last-child { margin-bottom: 0; }
.equity-content strong {
    color: var(--text);
    font-weight: 600;
}

.equity-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    position: relative;
    overflow: hidden;
}
.light-mode .equity-card {
    box-shadow: var(--shadow-card);
}
.equity-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent);
}

.equity-card-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 18px;
}

.equity-card blockquote {
    font-size: 20px;
    line-height: 1.45;
    color: var(--text);
    font-weight: 500;
    letter-spacing: -0.01em;
    margin-bottom: 24px;
    font-style: italic;
}

.equity-card-meta {
    font-size: 13px;
    color: var(--text-faint);
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

/* ============================================================
   Team
   ============================================================ */
.team {
    position: relative;
    overflow: hidden;
}

.team::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 12% 0%, var(--accent-soft) 0%, transparent 48%),
        radial-gradient(ellipse at 88% 100%, var(--purple-soft) 0%, transparent 44%);
    pointer-events: none;
    opacity: 0.75;
}

.team .container {
    position: relative;
    z-index: 1;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}
.light-mode .team-card {
    box-shadow: var(--shadow-card);
}
.light-mode .team-card:hover {
    box-shadow: var(--shadow-card-hover);
}

.team-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 100%;
    padding: 34px 32px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 24%), var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.light-mode .team-card {
    background: linear-gradient(180deg, rgba(13, 148, 136, 0.04), transparent 26%), var(--surface);
}

.team-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 32px;
    right: 32px;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), var(--purple));
    opacity: 0.55;
}

.team-portrait {
    position: relative;
    margin: -8px -6px 2px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
        var(--surface-2);
    box-shadow:
        0 18px 36px -24px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.light-mode .team-portrait {
    box-shadow:
        0 18px 36px -28px rgba(15, 23, 42, 0.2),
        0 0 0 1px rgba(15, 23, 42, 0.04) inset;
}

.team-portrait::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 44%;
    background: linear-gradient(180deg, transparent 0%, rgba(5, 7, 10, 0.2) 100%);
    pointer-events: none;
}

.light-mode .team-portrait::after {
    background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.08) 100%);
}

.team-portrait img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

.team-portrait-yash img {
    object-position: center 20%;
}

.team-portrait-andres img {
    object-position: center 18%;
}

.team-card-top {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.team-role {
    display: inline-flex;
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 100px;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.team-name-block h4 {
    font-size: 28px;
    margin-bottom: 8px;
}

.team-subtitle {
    font-size: 15px;
    color: var(--text);
    max-width: 42ch;
}

.team-summary {
    font-size: 15.5px;
    color: var(--text-dim);
}

.team-points {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.team-points li {
    position: relative;
    padding-left: 18px;
    font-size: 14.5px;
    color: var(--text-dim);
    line-height: 1.65;
}

.team-points li::before {
    content: "";
    position: absolute;
    top: 0.72em;
    left: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.team-points strong {
    color: var(--text);
    font-weight: 600;
}

.team-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.team-links a {
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    padding: 9px 14px;
    border-radius: 100px;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    transition: all var(--t-fast);
}

.team-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.team-proof {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.team-proof-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 30px;
}
.light-mode .team-proof-card {
    box-shadow: var(--shadow-card);
}

.proof-kicker {
    margin-bottom: 12px;
    color: var(--purple);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.team-proof-card p {
    font-size: 14.5px;
}

/* ============================================================
   CTA
   ============================================================ */
.final-cta { padding-bottom: 88px; }

.cta-box {
    background: var(--surface);
    padding: 56px 48px;
    border-radius: var(--radius-xl);
    text-align: center;
    border: 1px solid var(--border-strong);
    position: relative;
    overflow: hidden;
}
.light-mode .cta-box {
    box-shadow: var(--shadow-card-hover);
}
.cta-box::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 0%, var(--accent-soft) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 100%, var(--purple-soft) 0%, transparent 55%);
    pointer-events: none;
}
.cta-box > * { position: relative; z-index: 1; }

.cta-box h3 {
    max-width: 620px;
    margin: 0 auto 16px;
}

.cta-sub {
    margin: 0 auto 36px;
    max-width: 520px;
}

.contact-form {
    display: flex;
    gap: 10px;
    max-width: 520px;
    margin: 0 auto;
    background: var(--bg);
    padding: 8px;
    border-radius: 100px;
    border: 1px solid var(--border-strong);
    transition: border-color var(--t-fast);
}
.contact-form:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.contact-form input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 20px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    min-width: 0;
}
.contact-form input::placeholder { color: var(--text-faint); }

.contact-form .btn {
    padding: 12px 22px;
    flex-shrink: 0;
}

.form-status {
    margin-top: 16px;
    font-size: 13.5px;
    color: var(--accent);
    min-height: 18px;
    font-family: var(--font-mono);
    text-align: center;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.cta-divider {
    display: flex;
    align-items: center;
    margin: 32px auto;
    max-width: 420px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
}
.cta-divider::before,
.cta-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}
.cta-divider span {
    padding: 0 16px;
}

.calendly-cta p {
    color: var(--text-dim);
    margin-bottom: 16px;
    font-size: 15px;
}
.calendly-btn {
    display: inline-flex;
    margin: 0 auto;
    background: var(--surface-2);
}
.calendly-btn:hover {
    background: var(--surface-3);
    color: var(--text);
    border-color: var(--border-strong);
}

/* Shake animation for invalid input */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-4px); }
    30%, 70% { transform: translateX(4px); }
}
.contact-form input.shake {
    animation: shake 0.45s ease;
    border-color: #E3B341;
}

/* Inline spinner for submit button */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(4, 19, 15, 0.25);
    border-top-color: #04130F;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Disabled state while submitting */
.contact-form .btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
    padding: 56px 0 40px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 2fr;
    gap: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.footer-brand { display: flex; flex-direction: column; gap: 18px; }
.brand-icon-lg {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    padding: 5px;
    background: #FFFFFF;
    border: 1px solid var(--border-strong);
    object-fit: contain;
}
.light-mode .brand-icon-lg { background: var(--surface-2); }
.brand-name-lg { font-weight: 700; font-size: 16px; letter-spacing: 0.18em; color: var(--text); }
.footer-tagline {
    font-size: 14.5px;
    max-width: 320px;
    margin: 0;
    color: var(--text-dim);
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    justify-self: end;
    width: 100%;
    max-width: 420px;
}

.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col-title {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 6px;
}
.footer-col a {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 14px;
    transition: color var(--t-fast);
}
.footer-col a:hover { color: var(--text); }

.footer-base {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.copy { font-size: 13px; color: var(--text-faint); }
.footer-note {
    font-size: 12.5px;
    color: var(--text-faint);
    max-width: 640px;
    text-align: right;
    line-height: 1.55;
}

.footer-note strong {
    color: var(--text-dim);
    font-weight: 600;
}

.footer-note code {
    font-family: var(--font-mono);
    font-size: 11.5px;
    background: var(--code-bg);
    color: var(--text-dim);
    padding: 1px 6px;
    border-radius: 4px;
}

/* ============================================================
   Reveal animations
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
    .hero { padding: 120px 0 72px; }
    .hero-grid { grid-template-columns: 1fr; gap: 48px; }
    .equity-grid { grid-template-columns: 1fr; gap: 40px; }
    .team-grid { grid-template-columns: 1fr; }
    .team-proof { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .payer-groups { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .footer-cols { justify-self: start; }
    .nav-container { grid-template-columns: auto 1fr auto; }
    .nav-links-center { display: none; }
    .mobile-menu-toggle { display: flex; }
}

@media (max-width: 640px) {
    section { padding: 56px 0; }
    .container { padding: 0 20px; }
    .nav-container { padding: 0 20px; }
    .stat-grid { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: 1fr; }
    .team-card { padding: 28px 24px; }
    .team-card::before { left: 24px; right: 24px; }
    .team-name-block h4 { font-size: 24px; }
    .team-proof-card { padding: 24px; }
    .cta-box { padding: 40px 24px; }
    .contact-form { flex-direction: column; border-radius: var(--radius-md); padding: 12px; }
    .contact-form .btn { justify-content: center; width: 100%; }
    .stack-row { grid-template-columns: 1fr; gap: 6px; padding: 16px 20px; }
    .stack-head { display: none; }
    .footer-base { flex-direction: column; align-items: flex-start; }
    .footer-note { text-align: left; }
    .hero-meta { gap: 16px; }
    .meta-divider { display: none; }
    .btn-enterprise { display: none; }
}
