/* ── Theme variables ── */
:root {
    --c-bg: 11 17 32;
    --c-surface: 19 28 46;
    --c-border: 30 48 72;
    --c-muted: 100 116 139;
    --c-accent: 13 148 136;
    --c-fg: 203 213 225;
    --c-fg-strong: 241 245 249;
    --nav-bg: rgba(11, 17, 32, 0.92);
    --grain-opacity: 0.025;
    /* Semantic accents */
    --c-accent-hover: 20 184 166;
    --c-secondary: 217 119 6;
    --c-ai: 124 58 237;
    --c-success: 5 150 105;
    --c-danger: 225 29 72;
}
html.light {
    --c-bg: 248 250 252;
    --c-surface: 255 255 255;
    --c-border: 226 232 240;
    --c-muted: 100 116 139;
    --c-accent: 13 148 136;
    --c-fg: 30 41 59;
    --c-fg-strong: 15 23 42;
    --nav-bg: rgba(248, 250, 252, 0.92);
    --grain-opacity: 0.012;
    --c-accent-hover: 15 118 110;
    --c-secondary: 180 83 9;
    --c-ai: 109 40 217;
    --c-success: 4 120 87;
    --c-danger: 190 18 60;
}

/* ── Base ── */
html { scroll-behavior: smooth; }

/* ── Logo wave ── */
.logo-wave {
    background: linear-gradient(90deg, rgb(var(--c-accent)) 0%, rgb(var(--c-fg)) 40%, rgb(var(--c-accent)) 80%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: logo-wave 14s ease-in-out infinite;
}
@keyframes logo-wave {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ── Grain texture ── */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ── Ticker (capabilities strip) ── */
.ticker-wrap {
    width: 100%;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
    mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}
.ticker {
    display: flex;
    align-items: center;
    width: max-content;
    animation: ticker-scroll 80s linear infinite;
}
.ticker:hover { animation-play-state: paused; }
.ticker-item {
    flex-shrink: 0;
    padding: 0 1.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgb(var(--c-fg) / 0.35);
    white-space: nowrap;
    transition: color 0.2s;
}
.ticker-item:hover { color: rgb(var(--c-fg) / 0.7); }
.ticker-sep {
    flex-shrink: 0;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgb(var(--c-fg) / 0.12);
}
@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── Staggered entrance ── */
.reveal {
    opacity: 0;
    transform: translateY(12px);
    animation: reveal 0.6s ease forwards;
}
.reveal-d1 { animation-delay: 0.1s; }
.reveal-d2 { animation-delay: 0.2s; }
.reveal-d3 { animation-delay: 0.35s; }
.reveal-d4 { animation-delay: 0.5s; }
.reveal-d5 { animation-delay: 0.65s; }
@keyframes reveal {
    to { opacity: 1; transform: translateY(0); }
}

/* ── Horizontal rule accent ── */
.rule-accent {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgb(var(--c-accent) / 0.25), transparent);
}

/* ── Feature card (bento) ── */
.feat-bento {
    background: rgb(var(--c-surface));
    border: 1px solid rgb(var(--c-border));
    border-radius: 8px;
    padding: 2rem 1.75rem;
    transition: border-color 0.15s ease;
}
.feat-bento:hover { border-color: rgb(var(--c-muted) / 0.3); }
.feat-bento-lg {
    grid-column: span 2;
}
@media(max-width: 768px) {
    .feat-bento-lg { grid-column: span 1; }
}

/* ── Step indicator ── */
.step-num {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgb(var(--c-accent));
    border: 1px solid rgb(var(--c-accent) / 0.2);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    display: inline-block;
    margin-bottom: 0.75rem;
}

/* ── Timeline (pain→solution) ── */
.tl-pain {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.3;
    color: rgb(var(--c-fg) / 0.15);
    letter-spacing: -0.01em;
}
@media(min-width: 768px) {
    .tl-pain { font-size: 1.75rem; }
}
.tl-answer {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: rgb(var(--c-fg));
}
.tl-detail {
    font-size: 0.85rem;
    color: rgb(var(--c-muted));
    line-height: 1.6;
    margin-top: 0.5rem;
}

/* ── Demo cards ── */
.demo-card {
    background: rgb(var(--c-surface));
    border: 1px solid rgb(var(--c-border));
    border-radius: 8px;
    padding: 1.5rem;
    transition: border-color 0.15s ease;
    text-decoration: none;
    display: block;
}
.demo-card:hover { border-color: rgb(var(--c-muted) / 0.3); }

/* ── Theme toggle ── */
.theme-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgb(var(--c-border));
    border-radius: 6px;
    background: transparent;
    color: rgb(var(--c-muted));
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    flex-shrink: 0;
}
.theme-toggle:hover {
    border-color: rgb(var(--c-muted) / 0.5);
    color: rgb(var(--c-fg));
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html.light .theme-toggle .icon-sun { display: block; }
html.light .theme-toggle .icon-moon { display: none; }

/* ── Light mode: CLiQ background ── */
html.light .cliq-bg { opacity: 0.06; filter: blur(1px); }

/* ── Light mode: timeline pain text needs more contrast ── */
html.light .tl-pain { color: rgb(var(--c-fg) / 0.25); }

/* ── Light mode: pricing section overrides ── */
html.light .pp {
    --surface: rgba(255, 255, 255, 0.9);
    --border: #d2d2dc;
    --muted: #46465a;
    --dim: #70708a;
    --text: #0f0f1e;
}
html.light .pp .formula,
html.light .pp .bracket-card,
html.light .pp .seat-chip,
html.light .pp .calc,
html.light .pp .typical-card,
html.light .pp .feat-card,
html.light .pp .ent-card,
html.light .pp .unlock-card,
html.light .pp .chart-box,
html.light .pp .mile {
    background: rgba(255, 255, 255, 0.9);
    border-color: #e4e4eb;
}
html.light .pp .calc-field input,
html.light .pp .calc-field select {
    background: #f8f8fa;
    border-color: #e4e4eb;
    color: #1a1a2e;
}
html.light .pp .calc-flow {
    background: #f8f8fa;
    border-top-color: #e4e4eb;
}
html.light .pp .calc-result {
    border-top-color: #e4e4eb;
}
html.light .pp .cr-stat {
    border-right-color: #e4e4eb;
}
html.light .pp details {
    background: #fff;
    border-color: #e4e4eb;
}
html.light .pp details[open] {
    border-color: rgb(var(--c-accent) / 0.3);
}
html.light .pp summary:hover {
    background: rgb(var(--c-accent) / 0.04);
}
html.light .pp .bracket-fade-r { background: linear-gradient(90deg, transparent, rgba(246,246,249,0.95)); }
html.light .pp .bracket-fade-l { background: linear-gradient(270deg, transparent, rgba(246,246,249,0.95)); }
html.light .pp .bracket-nav {
    background: #fff;
    border-color: #e4e4eb;
}
html.light .pp .pitch-box {
    background: rgba(245, 158, 11, 0.04);
    border-color: rgba(245, 158, 11, 0.15);
}
html.light .pp .ent-cta {
    background: rgba(239, 68, 68, 0.04);
    border-color: rgba(239, 68, 68, 0.15);
}

/* ── Light mode: surfaces get subtle shadow instead of dark bg ── */
html.light .feat-bento,
html.light .demo-card {
    background: #fff;
    border-color: #d2d2dc;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
html.light .feat-bento:hover,
html.light .demo-card:hover { border-color: #b0b0c0; }

/* ── Light mode: step indicator ── */
html.light .step-num {
    color: rgb(var(--c-accent));
    border-color: rgb(var(--c-accent) / 0.3);
}

/* ── Light mode: rule accent ── */
html.light .rule-accent {
    background: linear-gradient(90deg, transparent, rgb(var(--c-accent) / 0.15), transparent);
}

/* ── Light mode: CTA input ── */
html.light input[type="email"] {
    background: #fff;
    border-color: #d2d2dc;
}

/* ── Light mode: SVG chart ── */
html.light .pp svg text { fill: currentColor; }

/* ══════════════════════════════════════════════════════════════
   Light mode: comprehensive text contrast overrides
   On light backgrounds, Tailwind opacity modifiers (text-fg/30,
   text-fg/50 etc.) produce washed-out text. These overrides
   force readable contrast across the entire landing page.
   ══════════════════════════════════════════════════════════════ */

/* ── Ticker strip: much more visible ── */
html.light .ticker-item { color: rgba(15, 15, 30, 0.55); }
html.light .ticker-item:hover { color: rgba(15, 15, 30, 0.85); }
html.light .ticker-sep { background: rgba(15, 15, 30, 0.2); }

/* ── Timeline pain quotes: still faded but readable ── */
html.light .tl-pain { color: rgba(15, 15, 30, 0.35); }

/* ── Timeline detail text ── */
html.light .tl-detail { color: #3a3a50; }

/* ── All Tailwind text-fg/NN overrides via attribute selectors ──
   These catch every element using low-opacity fg text.
   We override the computed color directly. */

/* Hero "with confidence." fade text and similar very-low-opacity text */
html.light [class*="text-fg/25"],
html.light [class*="text-fg\\/25"] { color: rgba(15, 15, 30, 0.5) !important; }

html.light [class*="text-fg/30"],
html.light [class*="text-fg\\/30"] { color: rgba(15, 15, 30, 0.5) !important; }

html.light [class*="text-fg/50"],
html.light [class*="text-fg\\/50"] { color: rgba(15, 15, 30, 0.7) !important; }

html.light [class*="text-fg/60"],
html.light [class*="text-fg\\/60"] { color: rgba(15, 15, 30, 0.78) !important; }

html.light [class*="text-fg/70"],
html.light [class*="text-fg\\/70"] { color: rgba(15, 15, 30, 0.85) !important; }

html.light [class*="text-fg/80"],
html.light [class*="text-fg\\/80"] { color: rgba(15, 15, 30, 0.9) !important; }

html.light [class*="text-fg/90"],
html.light [class*="text-fg\\/90"] { color: rgba(15, 15, 30, 0.95) !important; }

html.light [class*="text-fg/95"],
html.light [class*="text-fg\\/95"] { color: rgba(15, 15, 30, 1) !important; }

/* ── Accent opacity overrides (category labels like "Core Engine") ── */
html.light [class*="text-accent/60"],
html.light [class*="text-accent\\/60"] { color: rgba(30, 80, 210, 0.85) !important; }

html.light [class*="text-accent/70"],
html.light [class*="text-accent\\/70"] { color: rgba(30, 80, 210, 0.9) !important; }

/* ── Amber accent for "Complex" demo card label ── */
html.light [class*="text-amber-500/60"],
html.light [class*="text-amber-500\\/60"] { color: rgba(180, 110, 0, 0.9) !important; }

/* ── Muted text (descriptions, subtitles): darken for light mode ── */
html.light .text-muted { color: #3a3a55 !important; }

/* ── Nav links ── */
html.light nav .text-muted { color: #3a3a55 !important; }
html.light nav a:hover { color: rgba(15, 15, 30, 0.9) !important; }

/* ── Footer ── */
html.light footer,
html.light [class*="contentinfo"] { color: #3a3a55; }

/* ── Pricing section light mode: boost dim/muted ── */
html.light .pp { --dim: #3a3a50; --muted: #3a3a55; }
html.light .bc-discount-label { color: #4a4a60; }
html.light .bc-base { color: #4a4a60; }
html.light .bc-range { color: #3a3a55; }
html.light .sc-price { color: #4a4a60; }
html.light .sc-feat { color: #3a3a55; }
html.light .formula-term-note { color: #4a4a60; }
html.light .formula-op { color: #4a4a60; }
html.light .tc-note { color: #4a4a60; }
html.light .cr-label { color: #3a3a55; }
html.light .cr-sub { color: #4a4a60; }
html.light .cfs-sub { color: #3a3a55; }
html.light .pp-sec-sub { color: #3a3a55; }
html.light .pp-hero p { color: #3a3a55; }
html.light .collapse-sub { color: #4a4a60; }
html.light .mile-p { color: #4a4a60; }
html.light .pitch-body { color: #3a3a55; }
html.light .pitch-disclaimer { color: #4a4a60; }

/* ── Emerald dot (Live in Canada) ── */
html.light [class*="bg-emerald-500/70"],
html.light [class*="bg-emerald-500\\/70"] { background-color: rgba(16, 185, 129, 0.9) !important; }
