/* ============================================================
   Yishii — Variation C (static rebuild)
   Mobile-first. Content present in HTML; JS only enhances.
   Tokens sourced from the Signsbeat/Yishii design system.
   ============================================================ */

/* --- Self-hosted Outfit (variable, 300–800) --- */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Brand tokens --- */
:root {
  --indigo-900: #140f3f;
  --indigo-700: #261977;
  --lilac-500:  #9191e8;
  --lilac-300:  #b9b9ef;
  --lav-100:    #e8e7fc;
  --lav-50:     #f3f3ff;
  --gold:       #f7d667;
  --mint:       #b6fcbe;
  --ink:        #1d1d1b;
  --white:      #ffffff;

  --bg:         var(--lav-50);
  --bg-inverse: var(--indigo-900);

  --fg:         var(--indigo-900);
  --fg-muted:   color-mix(in oklab, var(--indigo-900) 62%, transparent);
  --fg-subtle:  color-mix(in oklab, var(--indigo-900) 42%, transparent);
  --on-dark:    rgba(255,255,255,.72);
  --on-dark-mut:rgba(255,255,255,.62);
  --on-dark-sub:rgba(255,255,255,.45);
  --line-dark:  rgba(255,255,255,.14);
  --line-light: rgba(20,15,63,.09);

  --font-sans: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;

  --radius:    20px;
  --radius-sm: 14px;
  --radius-pill: 999px;

  --shadow-md: 0 10px 24px -6px rgba(20,15,63,.10), 0 4px 10px -2px rgba(20,15,63,.05);
  --shadow-sm: 0 2px 6px rgba(20,15,63,.06), 0 1px 2px rgba(20,15,63,.04);
  --shadow-lg: 0 24px 48px -12px rgba(38,25,119,.18), 0 8px 16px -4px rgba(38,15,63,.08);

  --ease:    cubic-bezier(.2,.8,.2,1);
  --ease-em: cubic-bezier(.16,1,.3,1);

  --maxw:    1200px;
  --maxw-narrow: 840px;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

/* --- Reset / base --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::selection { background: var(--gold); color: var(--indigo-900); }
input::placeholder { color: rgba(255,255,255,.4); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: var(--maxw-narrow); }

.caption {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Skip link (a11y) */
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--gold); color: var(--indigo-900); padding: 10px 16px; border-radius: 0 0 10px 0; font-weight: 600; }
.skip:focus { left: 0; }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(20,15,63,.72);
  border-bottom: 1px solid var(--line-dark);
  padding-top: var(--safe-t);
}
.nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 28px; height: 28px; }
.brand .wordmark { font-weight: 800; font-size: 21px; color: var(--white); letter-spacing: -.02em; }
.nav-links { display: none; align-items: center; gap: 24px; }
.nav-links a { color: var(--on-dark); font-size: 15px; font-weight: 500; transition: color .2s; }
.nav-links a:hover, .nav-links a:focus { color: var(--mint); }
.nav-cta {
  background: var(--gold); color: var(--indigo-900);
  font-weight: 600; font-size: 15px; padding: 10px 22px; border-radius: var(--radius-pill);
  transition: transform .18s var(--ease); border: 0; cursor: pointer;
}
.nav-cta:hover { transform: translateY(-2px); }
/* Mobile nav: compact — logo + partner button */
.nav-cta-mobile { background: var(--gold); color: var(--indigo-900); font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: var(--radius-pill); border: 0; cursor: pointer; }

/* ---------- HERO ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--indigo-900); color: var(--white);
  padding: calc(96px + var(--safe-t)) 24px 72px;
  text-align: center;
}
.hero .spark { position: absolute; top: 16%; right: 10%; color: var(--gold); font-size: 30px; animation: spark 3.2s infinite var(--ease); pointer-events: none; }
.hero-inner { max-width: 1000px; margin: 0 auto; }
.hero .caption { color: var(--mint); display: block; margin-bottom: 18px; }
.hero h1 {
  font-size: clamp(40px, 9vw, 84px); line-height: 1.02; letter-spacing: -.03em; font-weight: 800;
  color: var(--white); text-wrap: balance;
}
.hero h1 .accent { color: var(--lilac-500); }
.hero .lede {
  font-size: clamp(17px, 2.4vw, 20px); color: var(--on-dark-mut);
  max-width: 560px; margin: 24px auto 0;
}
.hero-ctas { display: flex; gap: 14px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 16px; padding: 15px 30px; border-radius: var(--radius-pill);
  border: 0; cursor: pointer; transition: transform .18s var(--ease), background .2s, border-color .2s, color .2s;
  min-height: 48px;
}
.btn-primary { background: var(--gold); color: var(--indigo-900); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--white); border: 1.5px solid rgba(255,255,255,.25); }
.btn-ghost:hover { border-color: var(--mint); color: var(--mint); }
.btn:active { transform: translateY(0); }
.hero-hint { margin-top: 52px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--on-dark-sub); }

@keyframes spark { 0%,100%{transform:scale(1) rotate(0);opacity:1} 50%{transform:scale(1.25) rotate(12deg);opacity:.85} }

/* ---------- SECTION SHELL ---------- */
section { scroll-margin-top: 70px; }
.sec { padding: 84px 0; }
.sec-dark { background: var(--indigo-900); color: var(--white); }
.sec-light { background: var(--white); }
.sec-lav { background: var(--lav-50); }
.sec-eyebrow { color: var(--indigo-700); display: block; margin-bottom: 14px; }
.sec-dark .sec-eyebrow { color: var(--mint); }
.sec-title { font-size: clamp(28px, 5.5vw, 44px); font-weight: 700; line-height: 1.08; letter-spacing: -.02em; }
.sec-dark .sec-title { color: var(--white); }
.sec-lede { font-size: 17px; color: var(--fg-muted); max-width: 540px; margin-top: 16px; }
.sec-dark .sec-lede { color: var(--on-dark-mut); }

/* ---------- LAYER STACK ---------- */
.stack-intro { max-width: 640px; margin-bottom: 40px; }
.stack-cards { display: grid; gap: 16px; }
.layer-card {
  background: rgba(255,255,255,.05); border: 1px solid var(--line-dark);
  border-radius: var(--radius); padding: 22px 24px;
}
.layer-card .layer-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--on-dark-sub); margin-bottom: 10px; }
.layer-card .layer-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-gold { background: rgba(247,214,103,.14); color: var(--gold); border-radius: var(--radius-pill); padding: 5px 13px; font-size: 13.5px; font-weight: 500; }
.tag-mono { font-family: var(--font-mono); font-size: 13.5px; color: rgba(255,255,255,.78); }
.layer-card.is-yishii {
  background: linear-gradient(160deg, #2a1d86, var(--indigo-700));
  border-color: rgba(182,252,190,.4); box-shadow: var(--shadow-lg);
}
.layer-card.is-yishii .layer-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.layer-card.is-yishii .layer-label { color: var(--mint); }
.layer-card.is-yishii img { width: 50px; height: 50px; flex: none; }
.layer-title { font-weight: 700; font-size: 19px; color: var(--white); }
.layer-sub { font-size: 14px; color: rgba(255,255,255,.66); margin-top: 6px; }
.stack-points { list-style: none; display: grid; gap: 18px; margin-top: 36px; }
.stack-points li { display: flex; gap: 14px; align-items: flex-start; }
.stack-points .num { font-family: var(--font-mono); font-size: 13px; color: var(--gold); flex: none; padding-top: 2px; }
.stack-points h3 { font-size: 17px; font-weight: 600; color: var(--white); }
.stack-points p { font-size: 15px; color: var(--on-dark-mut); margin-top: 4px; }

/* ---------- AI DEMO ---------- */
.demo-head { max-width: 460px; margin-bottom: 28px; }
.demo-head h2 { font-size: clamp(26px, 5vw, 38px); font-weight: 700; line-height: 1.12; letter-spacing: -.02em; color: var(--fg); }
.demo-head p { font-size: 16px; color: var(--fg-muted); margin-top: 14px; }
.chips { display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.chip-btn {
  display: flex; align-items: center; gap: 14px; text-align: left;
  border: 1px solid rgba(20,15,63,.12); background: var(--white); color: var(--fg);
  border-radius: var(--radius-sm); padding: 13px 18px; font-size: 15px; font-weight: 500;
  cursor: pointer; transition: background .22s, border-color .22s, color .22s; min-height: 48px;
}
.chip-btn .num { font-family: var(--font-mono); font-size: 11px; color: var(--indigo-700); }
.chip-btn:hover { border-color: var(--indigo-700); }
.chip-btn[aria-selected="true"] { background: var(--indigo-700); border-color: var(--indigo-700); color: var(--white); }
.chip-btn[aria-selected="true"] .num { color: rgba(255,255,255,.7); }

.demo-progress { margin-top: 24px; max-width: 420px; }
.demo-progress .track { height: 3px; background: var(--lav-100); border-radius: var(--radius-pill); overflow: hidden; }
.demo-progress .bar { height: 100%; background: var(--indigo-700); border-radius: var(--radius-pill); transition: width .3s; }
.demo-progress .meta { margin-top: 10px; font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-subtle); }

/* Device mockups */
.demo-panels { margin-top: 40px; display: grid; gap: 36px; }
.demo-panel { display: grid; gap: 24px; }
.demo-panel .panel-meta { display: none; } /* chips live above; panels are full content blocks */

.device-row { display: grid; gap: 24px; }
.phone {
  background: var(--indigo-900); border: 1px solid rgba(255,255,255,.08); border-radius: 34px;
  padding: 14px; box-shadow: var(--shadow-lg); color: var(--white);
}
.phone-screen { background: #0e0a30; border-radius: 24px; padding: 30px 14px 14px; min-height: 420px; display: flex; flex-direction: column; gap: 10px; }
.phone-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.1); }
.phone-head .av { width: 32px; height: 32px; border-radius: 50%; background: var(--mint); display: grid; place-items: center; font-weight: 700; color: var(--indigo-900); font-size: 15px; }
.phone-head .who { font-weight: 600; font-size: 14px; }
.phone-head .when { font-family: var(--font-mono); font-size: 10px; color: rgba(255,255,255,.45); }
.bubble-q { align-self: flex-end; max-width: 85%; background: var(--indigo-700); border-radius: 16px 4px 16px 16px; padding: 11px 14px; font-size: 13.5px; line-height: 1.5; }
.bubble-a { max-width: 90%; background: rgba(182,252,190,.1); border: 1px solid rgba(182,252,190,.2); border-radius: 4px 16px 16px 16px; padding: 12px 14px; color: #e9fcec; font-size: 13.5px; line-height: 1.55; }
.bubble-a.wide { border-radius: 16px; }
.phone-input { margin-top: auto; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius-pill); padding: 11px 16px; color: rgba(255,255,255,.4); font-size: 13.5px; }
.phone-input .arr { margin-left: auto; color: var(--mint); }

.android-card {
  background: var(--white); border: 1px solid var(--line-light); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-md);
}
.android-card .a-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-subtle); margin-bottom: 12px; }
.a-pill { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: var(--radius-pill); }
.a-score-row { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; }
.a-score { font-weight: 700; font-size: 58px; line-height: 1; letter-spacing: -.03em; color: var(--fg); font-variant-numeric: tabular-nums; }
.a-score-label { font-size: 13px; color: var(--fg-muted); }
.a-trend { font-family: var(--font-mono); font-size: 12px; color: var(--indigo-700); margin-top: 6px; }
.a-divider { border-top: 1px solid rgba(20,15,63,.1); margin: 16px 0 12px; }
.a-drivers-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-subtle); margin-bottom: 10px; }
.a-drivers { display: flex; flex-direction: column; gap: 9px; list-style: none; }
.a-drivers li { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; line-height: 1.45; }
.a-drivers li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lilac-500); margin-top: 6px; flex: none; }
.a-action { margin-top: 16px; background: var(--gold); border-radius: var(--radius-sm); padding: 13px 16px; color: var(--indigo-900); }
.a-action .a-action-label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .7; margin-bottom: 3px; }
.a-action .a-action-text { font-weight: 600; font-size: 14px; line-height: 1.4; }

/* Tab behavior: without JS all panels visible (stacked). With JS, only active. */
.js .demo-panel { display: none; }
.js .demo-panel.is-active { display: grid; }

/* ---------- FOUR DOORS ---------- */
.cases-tabs { display: flex; gap: 8px; margin-bottom: 32px; flex-wrap: wrap; }
.case-dot {
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; background: var(--lav-100); color: var(--indigo-700);
  transition: background .3s, color .3s;
}
.case-dot[aria-selected="true"] { background: var(--indigo-900); color: var(--gold); }
.case-dot:hover { background: var(--lav-100); color: var(--indigo-900); }
.case-dot[aria-selected="true"]:hover { background: var(--indigo-900); color: var(--gold); }

.case-panels { display: grid; gap: 40px; }
.case-panel .case-no { font-family: var(--font-mono); font-size: 12px; color: var(--indigo-700); margin-bottom: 12px; }
.case-panel h3 { font-size: clamp(24px, 5vw, 36px); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin-bottom: 14px; }
.case-panel .case-body { color: var(--fg-muted); font-size: 16px; margin-bottom: 18px; }
.case-panel .case-tail { color: var(--indigo-700); font-weight: 600; font-size: 15px; }
.case-visual { border-radius: var(--radius); box-shadow: var(--shadow-md); }

/* HR dashboard card */
.dash { background: var(--lav-50); border: 1px solid var(--line-light); border-radius: var(--radius); padding: 22px; }
.dash-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.dash-brand { display: flex; align-items: center; gap: 10px; }
.dash-swatch { width: 12px; height: 12px; border-radius: 4px; }
.dash-brand .name { font-weight: 600; font-size: 15.5px; }
.dash-brand .powered { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-subtle); }
.theme-row { display: flex; gap: 8px; }
.theme-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--white); cursor: pointer; padding: 0; box-shadow: 0 0 0 1px rgba(20,15,63,.1); }
.theme-dot[aria-pressed="true"] { outline: 2px solid currentColor; outline-offset: 2px; }
.team-list { display: flex; flex-direction: column; margin-top: 14px; }
.team-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid rgba(20,15,63,.07); }
.team-row .rank { font-family: var(--font-mono); font-size: 12px; color: var(--fg-subtle); width: 18px; }
.team-row .tinfo { width: 120px; }
.team-row .tname { font-weight: 600; font-size: 14px; }
.team-row .tmem { font-size: 12px; color: var(--fg-subtle); }
.team-row .tbar { flex: 1; height: 8px; background: var(--lav-100); border-radius: var(--radius-pill); overflow: hidden; }
.team-row .tbar > span { display: block; height: 100%; border-radius: var(--radius-pill); transition: background .3s; }
.team-row .tscore { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; width: 30px; text-align: right; }
.team-row .tdelta { font-family: var(--font-mono); font-size: 11.5px; width: 30px; }
.dash-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--fg-subtle); }
.dash-streak { background: var(--lav-100); color: var(--indigo-700); font-family: var(--font-mono); font-size: 11px; padding: 5px 10px; border-radius: var(--radius-pill); }

/* API modules grid */
.modules-card { background: var(--indigo-900); border-radius: var(--radius); padding: 24px; color: var(--white); }
.modules-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.module { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius-sm); padding: 14px 16px; }
.module .m-code { font-family: var(--font-mono); font-size: 11.5px; color: var(--gold); margin-bottom: 5px; }
.module .m-desc { font-size: 13px; color: rgba(255,255,255,.72); line-height: 1.45; }
.modules-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; justify-content: space-between; flex-wrap: wrap; }
.modules-foot .mf-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.modules-foot .mf-brand img { width: 30px; height: 30px; }
.modules-foot .mf-int { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--on-dark-sub); }

/* LLM comparison card */
.llm-card { background: var(--lav-50); border: 1px solid var(--line-light); border-radius: var(--radius); padding: 22px; }
.llm-user { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.llm-user .u-av { width: 30px; height: 30px; border-radius: 50%; background: var(--lav-100); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--indigo-700); flex: none; }
.llm-user .u-bub { background: var(--lav-100); border-radius: 4px 16px 16px 16px; padding: 11px 15px; font-size: 14.5px; color: var(--fg); line-height: 1.5; }
.llm-toggle { display: flex; gap: 8px; margin-bottom: 14px; }
.llm-toggle button { font-weight: 600; font-size: 13px; padding: 9px 16px; border-radius: var(--radius-pill); border: 0; cursor: pointer; min-height: 40px; }
.llm-toggle button[aria-pressed="true"] { background: var(--indigo-900); color: var(--white); }
.llm-toggle button[aria-pressed="false"] { background: var(--white); color: var(--indigo-700); border: 1px solid var(--lav-100); }
.llm-answer { border-radius: 16px; padding: 16px 18px; background: var(--white); }
.llm-answer.is-generic { border: 1px dashed rgba(20,15,63,.2); }
.llm-answer.is-yishii { border: 1px solid var(--indigo-700); }
.llm-answer p { font-size: 14.5px; line-height: 1.6; }
.llm-answer.is-generic p { color: var(--fg-muted); }
.llm-answer .a-note { margin-top: 12px; font-family: var(--font-mono); font-size: 11px; color: var(--fg-subtle); }
.llm-answer.is-yishii .a-note { color: var(--indigo-700); }
.llm-cites { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; list-style: none; }
.llm-cites li { display: flex; gap: 9px; align-items: baseline; font-family: var(--font-mono); font-size: 11px; color: var(--fg-subtle); }
.llm-cites li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: none; transform: translateY(-1px); }

/* Care cases */
.care-cards { display: grid; gap: 14px; }
.care-card { background: var(--lav-50); border: 1px solid var(--line-light); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.care-card .care-tag { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; background: var(--mint); color: var(--indigo-900); padding: 4px 10px; border-radius: var(--radius-pill); }
.care-card h4 { font-size: 16.5px; font-weight: 600; margin: 12px 0 6px; }
.care-card p { font-size: 13.5px; color: var(--fg-muted); line-height: 1.55; }

/* Tab behavior for cases */
.js .case-panel { display: none; }
.js .case-panel.is-active { display: block; }

/* ---------- EVIDENCE ---------- */
.evidence-grid { display: grid; gap: 16px; }
.ev-card { border-radius: 24px; padding: 30px; }
.ev-card.dark { background: var(--indigo-900); color: var(--white); }
.ev-card.light { background: var(--white); border: 1px solid var(--line-light); box-shadow: var(--shadow-sm); }
.ev-card .caption { margin-bottom: 14px; }
.ev-card.dark .caption { color: var(--mint); }
.ev-card.light .caption { color: var(--indigo-700); }
.ev-card h3 { font-size: 22px; font-weight: 700; letter-spacing: -.015em; line-height: 1.15; margin-bottom: 12px; }
.ev-card.dark h3 { color: var(--white); }
.ev-card.light h3 { color: var(--fg); }
.ev-card p { font-size: 15.5px; line-height: 1.6; }
.ev-card.dark p { color: rgba(255,255,255,.68); }
.ev-card.light p { color: var(--fg-muted); }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin: 0 auto; }
.faq summary { list-style: none; cursor: pointer; font-weight: 600; font-size: 18px; padding: 20px 0; display: flex; justify-content: space-between; gap: 16px; align-items: center; border-top: 1px solid var(--line-light); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 24px; font-weight: 400; color: var(--indigo-700); transition: transform .2s; }
.faq details[open] summary::after { content: "−"; }
.faq .a { padding: 0 0 20px; color: var(--fg-muted); font-size: 16px; line-height: 1.6; }

/* ---------- CONTACT ---------- */
.contact-inner { max-width: 660px; margin: 0 auto; text-align: center; }
.contact-inner .caption { color: var(--mint); display: block; margin-bottom: 14px; }
.contact-inner h2 { font-size: clamp(28px, 6vw, 44px); font-weight: 700; line-height: 1.08; letter-spacing: -.02em; color: var(--white); }
.contact-inner .sub { color: var(--on-dark-mut); margin: 16px auto 30px; max-width: 500px; }
.form-grid { display: grid; gap: 12px; text-align: left; }
.form-grid input, .form-grid select {
  padding: 15px 18px; border-radius: 12px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06); color: var(--white); font-size: 16px; font-family: inherit;
  width: 100%; min-height: 52px;
}
.form-grid select option { color: var(--fg); }
.form-grid input:focus, .form-grid select:focus { outline: 2px solid var(--mint); outline-offset: 1px; }
.form-grid .full { grid-column: 1 / -1; }
.form-submit {
  justify-self: center; background: var(--gold); color: var(--indigo-900);
  font-weight: 600; font-size: 16px; padding: 15px 34px; border-radius: var(--radius-pill); border: 0; cursor: pointer;
  transition: transform .18s var(--ease); min-height: 52px;
}
.form-submit:hover { transform: translateY(-2px); }
.form-success {
  background: rgba(182,252,190,.1); border: 1px solid rgba(182,252,190,.3); border-radius: 18px;
  padding: 28px; color: var(--mint); font-weight: 600; font-size: 17px;
}
.form-error { color: #ffb4b4; font-size: 14px; margin-top: 10px; min-height: 18px; }
.contact-alt { margin-top: 18px; font-size: 13.5px; color: var(--on-dark-sub); }
.contact-alt a { color: var(--mint); }

/* ---------- FOOTER ---------- */
.footer { background: #0e0a30; color: rgba(255,255,255,.6); padding: 48px 0 calc(36px + var(--safe-b)); }
.footer-grid { display: flex; justify-content: space-between; gap: 36px; flex-wrap: wrap; align-items: flex-start; }
.footer .f-brand { font-weight: 800; font-size: 20px; color: var(--white); letter-spacing: -.02em; }
.footer p { font-size: 14px; margin-top: 6px; }
.footer .f-signsbeat { margin-top: 12px; font-size: 13.5px; }
.footer .f-signsbeat a { color: var(--mint); font-weight: 600; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,.6); font-size: 14.5px; transition: color .2s; }
.footer-links a:hover { color: var(--mint); }
.footer-legal { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12.5px; color: rgba(255,255,255,.38); max-width: 780px; line-height: 1.6; }

/* ---------- DESKTOP ENHANCEMENTS ---------- */
@media (min-width: 720px) {
  .nav-links { display: flex; }
  .nav-cta-mobile { display: none; }
  .nav-cta { display: inline-flex; }
  .hero { padding-top: calc(120px + var(--safe-t)); }
  .device-row { grid-template-columns: 1fr 1fr; align-items: start; }
  .modules-grid { grid-template-columns: 1fr 1fr; }
  .evidence-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .demo-panel { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 980px) {
  .stack-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
  .case-panel { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: center; }
  .js .case-panel.is-active { display: grid; }
  .case-grid-intro { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
  .demo-layout { display: grid; grid-template-columns: minmax(0,.9fr) 1.1fr; gap: 48px; align-items: start; }
  .demo-panels { margin-top: 0; }
}

/* Pointer:fine only: hover lift on cards (touch gets nothing fragile) */
@media (hover: hover) and (pointer: fine) {
  .layer-card, .module, .care-card, .ev-card { transition: transform .2s var(--ease); }
  .module:hover, .care-card:hover { transform: translateY(-2px); }
}

/* Scroll reveal (JS toggles .in) — only when JS + motion allowed */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spark, .hero .spark { animation: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
.reveal { opacity: 1; } /* default visible; JS may set initial hidden state only when motion allowed */

/* ============================================================
   SCENE SYSTEM — scroll-pinned card swap/build.
   Desktop (>=860px, motion allowed, JS): the section pins and
   the right-hand deck swaps/builds as you scroll.
   Mobile / reduced-motion / no-JS: cards stack in normal flow
   (all content visible, fully crawlable).
   ============================================================ */
.scene { position: relative; scroll-margin-top: 0; }
.scene-stage { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.scene-head { max-width: 620px; }
.scene-head .sec-title { margin-top: 4px; }
.scene-head .sec-lede { margin-top: 14px; }
.scene-deck { display: grid; gap: 20px; margin-top: 30px; }
.case-card { display: grid; gap: 24px; }
.case-text .case-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* Steppers (clickable jump controls) */
.stepper { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.stepper button {
  font-family: var(--font-sans); cursor: pointer; border: 0; background: transparent;
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px;
  padding: 8px 14px; border-radius: var(--radius-pill); font-size: 13.5px; font-weight: 500;
  opacity: 1; transition: opacity .25s, background .25s, color .25s, border-color .25s;
}
.stepper button .num { font-family: var(--font-mono); font-size: 11px; opacity: .8; }
.sec-dark .stepper button { color: var(--on-dark); border: 1px solid var(--line-dark); }
.sec-light .stepper button, .sec-lav .stepper button { color: var(--fg-muted); border: 1px solid var(--line-light); }
.stepper button.is-current { border-color: var(--gold); color: var(--gold); }
/* chips (demo) */
.stepper.chips button {
  background: var(--white); border: 1px solid rgba(20,15,63,.12); color: var(--fg);
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; opacity: 1;
}
.stepper.chips button .num { color: var(--indigo-700); }
.stepper.chips button.is-current { background: var(--indigo-700); border-color: var(--indigo-700); color: #fff; }
.stepper.chips button.is-current .num { color: rgba(255,255,255,.7); }
/* dots (cases) */
.stepper.dots button {
  width: 44px; height: 44px; justify-content: center; padding: 0; opacity: 1;
  border-radius: 50%; background: var(--white); border: 1px solid var(--line-light);
  color: var(--indigo-700); font-family: var(--font-mono); font-size: 12px;
}
.stepper.dots button.is-current { background: var(--indigo-900); color: var(--gold); border-color: var(--indigo-900); }

/* ---- Pinned behaviour (ALL viewports; JS only) ----
   Pinning is scroll-linked layout, not auto-animation, so it runs even when
   the user prefers reduced motion — only the cross-fade transition is
   suppressed in that case. */
.js .scene { padding-top: 0; padding-bottom: 0; }
.js .scene[data-states="3"] { height: calc(100vh + 2 * 72vh); }
.js .scene[data-states="4"] { height: calc(100vh + 3 * 72vh); }
.js .scene-stage {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: calc(64px + var(--safe-t)); padding-bottom: var(--safe-b);
}
.js .scene-head { flex: none; }
.js .scene-deck { position: relative; flex: 1; min-height: 0; margin-top: 14px; }

/* swap mode: overlap + cross-fade */
.js .scene-deck:not(.build) .card {
  position: absolute; inset: 0; opacity: 0; transform: translateY(14px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
  pointer-events: none; display: flex; align-items: center; justify-content: center;
}
.js .scene-deck:not(.build) .card.is-active { opacity: 1; transform: none; pointer-events: auto; }
.js .scene-deck:not(.build) .demo-card > * { width: 100%; max-height: 100%; }
/* case cards: stack on mobile (scroll if tall so nothing clips); 2-col on desktop */
.js .scene-deck:not(.build) .case-card {
  display: flex; flex-direction: column; justify-content: safe center; gap: 14px;
  overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 2px 6px 2px 0;
}
/* build mode (layer stack): highlight the current layer; others dim */
.js .scene-deck.build { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.js .scene-deck.build .card { opacity: .14; transform: scale(.985); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.js .scene-deck.build .card.is-on { opacity: 1; transform: none; }

/* Desktop: two-column stage (head | deck) */
@media (min-width: 860px) {
  .js .scene-stage { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 56px; align-items: center; padding-top: 0; }
  .js .scene-deck:not(.build) { height: clamp(440px, 66vh, 600px); }
  .js .scene-deck:not(.build) .case-card { display: grid; grid-template-columns: .85fr 1.15fr; align-items: center; gap: 48px; overflow: visible; }
}

/* Mobile compact (pinned cards must fit a phone screen) */
@media (max-width: 859px) {
  .js .scene-head .sec-lede { display: none; }
  .js .scene-head .sec-title { font-size: clamp(22px, 6.2vw, 30px); }
  .js .stepper { margin-top: 12px; gap: 6px; }
  .js .stepper.chips button { padding: 7px 10px; font-size: 12px; min-height: 36px; }
  .js .demo-card .device-row { grid-template-columns: 1fr 1fr; gap: 10px; align-items: stretch; }
  .js .phone { border-radius: 24px; padding: 8px; }
  .js .phone-screen { min-height: 0; padding: 22px 9px 9px; gap: 6px; }
  .js .phone-screen .bubble-q, .js .phone-screen .bubble-a { font-size: 11px; padding: 8px 9px; line-height: 1.4; }
  .js .phone-screen .phone-head .who { font-size: 12px; }
  .js .phone-input { padding: 8px 12px; font-size: 11px; }
  .js .android-card { padding: 12px; }
  .js .android-card .a-label { font-size: 9px; margin-bottom: 8px; }
  .js .a-score { font-size: 36px; }
  .js .a-drivers li { font-size: 10.5px; }
  .js .a-action { padding: 9px 11px; }
  .js .a-action .a-action-text { font-size: 11.5px; }
  .js .case-card { gap: 10px; }
  .js .case-text .case-no { font-size: 11px; }
  .js .case-text h3 { font-size: clamp(17px, 5vw, 21px); }
  .js .case-text .case-body { font-size: 12.5px; }
  .js .case-text .case-tail { font-size: 12.5px; }
  .js .dash { padding: 12px; }
  .js .team-row { padding: 5px 2px; gap: 7px; }
  .js .team-row .tinfo { width: 86px; }
  .js .team-row .tname { font-size: 12px; }
  .js .team-row .tmem { font-size: 10px; }
  .js .team-row .tscore { font-size: 13px; width: 22px; }
  .js .modules-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .js .module { padding: 8px 9px; }
  .js .module .m-code { font-size: 10px; }
  .js .module .m-desc { font-size: 10.5px; }
  .js .modules-card { padding: 12px; }
  .js .modules-foot { margin-top: 10px; }
  .js .llm-card { padding: 12px; }
  .js .llm-user { margin-bottom: 10px; }
  .js .llm-user .u-bub { font-size: 12px; padding: 8px 11px; }
  .js .llm-answer { padding: 11px 12px; }
  .js .llm-answer p { font-size: 12px; }
  .js .care-card { padding: 12px; }
  .js .care-card h4 { font-size: 13.5px; }
  .js .care-card p { font-size: 11px; }
}

/* Reduce motion: keep the pinning, drop the fade (instant swaps) */
@media (prefers-reduced-motion: reduce) {
  .js .scene-deck .card { transition: none !important; }
}

/* Hide the textual demo-progress on small screens (steppers already show position) */
@media (max-width: 859px) { .demo-progress { display: none; } }
