/* Shared by index.html (landing) and flash.html - NOT loaded alongside
   app.css (that file's body{overflow:hidden} is built for the fixed-height
   chat shell; these are ordinary scrolling pages). Token values are kept
   in sync with app.css by hand - there's no build step to share them
   through, and every other page in web/ already inlines its own copy of
   the signet mark SVG for the same reason. */
:root{
  --bg: #EEF0EF;
  --surface: #FFFFFF;
  --surface-2: #E3E6E4;
  --surface-3: #D7DBD8;
  --text: #171A1F;
  --text-muted: #5B6167;
  --text-faint: #868C90;
  --border: #D3D7D4;
  --border-strong: #B9BFBB;
  --accent: #8C6A3B;
  --accent-strong: #6E5029;
  --accent-ink: #FBF6EE;
  --accent-wash: rgba(140,106,59,0.10);
  --success: #3F7A5C;
  --success-wash: rgba(63,122,92,0.12);
  --warning: #A85423;
  --warning-wash: rgba(168,84,35,0.10);
  --danger: #A23D33;
  --danger-wash: rgba(162,61,51,0.10);
  --shadow: 0 1px 2px rgba(20,20,15,0.06), 0 8px 24px -12px rgba(20,20,15,0.18);

  --font-display: 'Cinzel', 'Iowan Old Style', serif;
  --font-sans: 'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg: #13151B; --surface: #1B1E26; --surface-2: #21252F; --surface-3: #2A2F3B;
    --text: #E9EAEA; --text-muted: #8A8F9C; --text-faint: #656B78;
    --border: #2C303B; --border-strong: #3A3F4C;
    --accent: #C79A5E; --accent-strong: #E0B67C; --accent-ink: #1B1408; --accent-wash: rgba(199,154,94,0.12);
    --success: #6FAE8B; --success-wash: rgba(111,174,139,0.14);
    --warning: #D08A4C; --warning-wash: rgba(208,138,76,0.14);
    --danger: #D06B5E; --danger-wash: rgba(208,107,94,0.14);
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 12px 28px -14px rgba(0,0,0,0.6);
  }
}
:root[data-theme="dark"]{
  --bg: #13151B; --surface: #1B1E26; --surface-2: #21252F; --surface-3: #2A2F3B;
  --text: #E9EAEA; --text-muted: #8A8F9C; --text-faint: #656B78;
  --border: #2C303B; --border-strong: #3A3F4C;
  --accent: #C79A5E; --accent-strong: #E0B67C; --accent-ink: #1B1408; --accent-wash: rgba(199,154,94,0.12);
  --success: #6FAE8B; --success-wash: rgba(111,174,139,0.14);
  --warning: #D08A4C; --warning-wash: rgba(208,138,76,0.14);
  --danger: #D06B5E; --danger-wash: rgba(208,107,94,0.14);
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 12px 28px -14px rgba(0,0,0,0.6);
}

*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family:var(--font-sans); font-size:15.5px; line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,p,ul,figure{ margin:0; }
ul{ list-style:none; padding:0; }
a{ color:inherit; }
button{ font:inherit; color:inherit; cursor:pointer; }
img,svg{ display:block; max-width:100%; }
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; border-radius:4px; }
.hidden{ display:none !important; }
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{ animation-duration:0.001ms !important; transition-duration:0.001ms !important; }
}

/* ---- Shared marks/primitives (mirrors app.css) ---- */
.seal{
  position:relative; flex:none; border-radius:50%;
  background:var(--surface-2); border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center;
}
.seal-glyph{ width:72%; height:72%; }
.seal-rim{ fill:none; stroke:var(--accent); stroke-width:1.4; opacity:.55; }
.seal-rim-inner{ fill:none; stroke:var(--accent); stroke-width:1; opacity:.35; }
.seal-core{ fill:var(--accent); }

.wordmark{
  font-family:var(--font-display); font-weight:700; font-size:19px; letter-spacing:0.12em;
  color:var(--text); display:flex; align-items:center; gap:10px;
}
/* fill/stroke are set as literal attributes inside the #signetMark symbol
   itself (currentColor), not via these descendant classes: a CSS selector
   like `.logo-mark .ring` can never match content cloned in by <use> - it
   crosses the same shadow-tree boundary normal Shadow DOM does, so only
   inherited properties (like `color`, which currentColor resolves to
   here) actually reach it. Confirmed live: without this, the mark
   rendered as two solid black circles instead of the two thin rings. */
.logo-mark{ width:22px; height:22px; flex:none; color:var(--accent); }

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  padding:11px 18px; border-radius:10px; border:1px solid var(--border-strong);
  background:var(--surface); color:var(--text); font-size:14px; font-weight:500;
  text-decoration:none; transition:border-color .12s ease, background .12s ease;
}
.btn:hover{ border-color:var(--accent); }
.btn-primary{ background:var(--accent); border-color:var(--accent); color:var(--accent-ink); font-weight:600; }
.btn-primary:hover{ background:var(--accent-strong); border-color:var(--accent-strong); }
.btn-quiet{ border-color:transparent; background:transparent; color:var(--text-muted); }
.btn-quiet:hover{ color:var(--text); background:var(--surface-2); border-color:transparent; }
.btn[disabled]{ opacity:.45; cursor:not-allowed; pointer-events:none; }
.card{ background:var(--surface); border:1px solid var(--border); border-radius:14px; }

.theme-toggle{
  display:flex; align-items:center; gap:8px; padding:7px 9px; border-radius:8px; border:1px solid var(--border);
  background:var(--surface); color:var(--text-muted); font-size:12px;
}
.theme-toggle .dot{ width:9px; height:9px; border-radius:50%; background:var(--accent); flex:none; }
.theme-toggle:hover{ color:var(--text); border-color:var(--border-strong); }
.spinner{ width:13px; height:13px; border-radius:50%; border:2px solid var(--border); border-top-color:var(--accent); animation:spin .8s linear infinite; flex:none; }
@keyframes spin{ to{ transform:rotate(360deg); } }

/* ---- Site chrome ---- */
.site-nav{
  display:flex; align-items:center; justify-content:space-between;
  max-width:1040px; margin:0 auto; padding:22px 24px;
}
.site-nav a.wordmark{ text-decoration:none; }
.site-nav-links{ display:flex; align-items:center; gap:10px; }

.site-footer{
  border-top:1px solid var(--border); margin-top:64px;
}
.site-footer-inner{
  max-width:1040px; margin:0 auto; padding:28px 24px 40px;
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:14px;
}
.site-footer .wordmark{ font-size:15px; }
.site-footer p{ color:var(--text-faint); font-size:12.5px; max-width:46ch; }
.site-footer-links{ display:flex; gap:18px; font-size:13px; }
.site-footer-links a{ color:var(--text-muted); text-decoration:none; }
.site-footer-links a:hover{ color:var(--accent); }

@media (max-width:640px){
  .site-nav{ padding:18px 18px; }
  .site-footer-inner{ padding:24px 18px 32px; }
}

/* ============ Landing hero ============ */
.hero{
  position:relative; text-align:center; padding:56px 24px 72px;
  background:
    radial-gradient(circle at 50% 0%, var(--accent-wash), transparent 60%),
    var(--bg);
  overflow:hidden;
}
.hero-mark{ width:112px; height:112px; margin:0 auto 22px; position:relative; }
.hero-mark .seal{ width:100%; height:100%; background:var(--surface); box-shadow:var(--shadow); }
.hero-mark .seal-glyph{ width:66%; height:66%; }
.hero-mark .ring{
  position:absolute; inset:-14px; border-radius:50%; border:1px solid var(--accent);
  opacity:0; transform:scale(0.7);
}
.hero-mark.pressed .seal{ animation:heroPress 1.1s cubic-bezier(.2,.8,.2,1); }
@keyframes heroPress{ 0%{ transform:scale(1); } 40%{ transform:scale(0.88) translateY(3px); } 100%{ transform:scale(1); } }
.hero-mark.pressed .ring{ animation:heroImpress 1.3s ease forwards .2s; }
@keyframes heroImpress{ 0%{ opacity:.9; transform:scale(0.7); } 100%{ opacity:0; transform:scale(1.7); } }

.hero h1{ font-family:var(--font-display); font-size:42px; letter-spacing:.16em; font-weight:700; }
.hero .lede{
  color:var(--text-muted); font-size:16.5px; max-width:50ch; margin:16px auto 0;
}
.hero .lede b{ color:var(--text); font-weight:600; }
.hero-ctas{ display:flex; align-items:center; justify-content:center; gap:10px; margin-top:30px; flex-wrap:wrap; }
.hero-ctas .btn{ min-width:150px; }
.hero-flash-link{
  display:inline-flex; align-items:center; gap:6px; margin-top:18px;
  font-size:13px; color:var(--text-faint); text-decoration:none;
}
.hero-flash-link:hover{ color:var(--accent); }
.hero-flash-link svg{ width:14px; height:14px; stroke:currentColor; fill:none; stroke-width:1.8; }

/* ============ How it works ============ */
.section{ max-width:1040px; margin:0 auto; padding:64px 24px; }
.section-head{ text-align:center; max-width:56ch; margin:0 auto 40px; }
.section-head .eyebrow{
  font-family:var(--font-mono); font-size:11px; letter-spacing:.16em; text-transform:uppercase; color:var(--accent);
}
.section-head h2{ font-family:var(--font-display); font-size:26px; font-weight:700; margin-top:10px; }
.section-head p{ color:var(--text-muted); font-size:14px; margin-top:10px; }

.steps{ display:grid; grid-template-columns:repeat(3, 1fr); gap:20px; counter-reset:step; }
.step{ padding:26px 22px; position:relative; }
.step-num{
  font-family:var(--font-mono); font-size:12px; color:var(--accent); letter-spacing:.06em;
}
.step h3{ font-size:16px; font-weight:600; margin-top:12px; }
.step p{ color:var(--text-muted); font-size:13.5px; margin-top:8px; }
.step-connector{
  position:absolute; top:38px; left:100%; width:20px; height:1px; background:var(--border-strong);
}
.step:last-child .step-connector{ display:none; }

.feature-grid{ display:grid; grid-template-columns:repeat(3, 1fr); gap:16px; }
.feature{ padding:22px; }
.feature svg{ width:20px; height:20px; stroke:var(--accent); fill:none; stroke-width:1.7; }
.feature h3{ font-size:14.5px; font-weight:600; margin-top:14px; }
.feature p{ color:var(--text-muted); font-size:13px; margin-top:6px; }

@media (max-width:800px){
  .hero h1{ font-size:32px; }
  .steps, .feature-grid{ grid-template-columns:1fr; }
  .step-connector{ display:none; }
  .section{ padding:48px 20px; }
}

/* ============ Flash page ============ */
.flash-head{ max-width:640px; margin:0 auto; padding:48px 24px 8px; text-align:center; }
.flash-head h1{ font-family:var(--font-display); font-size:28px; font-weight:700; }
.flash-head p{ color:var(--text-muted); font-size:14.5px; margin-top:12px; }
.flash-note{
  display:flex; gap:10px; text-align:left; padding:12px 14px; border-radius:10px;
  background:var(--surface-2); border:1px solid var(--border); font-size:12.5px; color:var(--text-muted);
  margin-top:20px;
}
.flash-note svg{ width:15px; height:15px; stroke:var(--text-faint); fill:none; stroke-width:1.8; flex:none; margin-top:1px; }

.flash-panel{ max-width:560px; margin:28px auto 80px; padding:0 24px; }
.flash-card{ padding:28px; }
.flash-step{ display:none; flex-direction:column; gap:14px; text-align:center; }
.flash-step.active{ display:flex; }
.flash-status{ display:flex; align-items:center; justify-content:center; gap:9px; font-family:var(--font-mono); font-size:13px; color:var(--text-muted); }

.chip-result{ display:flex; align-items:center; gap:14px; padding:14px 16px; border-radius:10px; background:var(--surface-2); border:1px solid var(--border); text-align:left; }
.chip-result svg{ width:26px; height:26px; stroke:var(--accent); fill:none; stroke-width:1.5; flex:none; }
.chip-result .name{ font-weight:600; font-size:15px; }
.chip-result .detail{ font-size:12px; color:var(--text-muted); margin-top:2px; }

.flash-files{ display:flex; flex-direction:column; gap:10px; text-align:left; }
.flash-file-row{ display:flex; align-items:center; gap:10px; }
.flash-file-row .label{ font-family:var(--font-mono); font-size:11.5px; color:var(--text-muted); width:112px; flex:none; }
.flash-track{ flex:1; height:6px; border-radius:99px; background:var(--surface-3); overflow:hidden; }
.flash-fill{ height:100%; background:var(--accent); width:0%; transition:width .15s ease; }
.flash-file-row .pct{ font-family:var(--font-mono); font-size:11px; color:var(--text-faint); width:34px; text-align:right; flex:none; }

.flash-advanced{ text-align:left; font-size:12.5px; }
.flash-advanced summary{ cursor:pointer; color:var(--text-muted); }
.flash-advanced summary:hover{ color:var(--text); }
.flash-advanced .warn{ display:flex; gap:8px; align-items:flex-start; margin-top:10px; padding:10px 12px; border-radius:8px; background:var(--warning-wash); border:1px solid var(--warning); color:var(--warning); }
.flash-advanced .warn svg{ width:14px; height:14px; stroke:var(--warning); fill:none; stroke-width:1.8; flex:none; margin-top:1px; }
.flash-advanced label{ display:flex; align-items:center; gap:8px; margin-top:10px; color:var(--text-muted); }

.flash-error{ display:flex; flex-direction:column; gap:10px; padding:14px; border-radius:10px; background:var(--danger-wash); border:1px solid var(--danger); color:var(--danger); font-size:13px; text-align:left; }

/* The one deliberately non-adaptive surface on the site: a real serial
   console reads as itself only in dark-on-mono, in either site theme -
   the same reason a hardware UART monitor doesn't reskin for daytime. */
.terminal{
  background:#0B0D10; color:#C9D1D9; border-radius:10px; padding:14px 16px;
  font-family:var(--font-mono); font-size:12px; line-height:1.6;
  height:220px; overflow-y:auto; text-align:left; white-space:pre-wrap; word-break:break-all;
}
.terminal .line-e{ color:#E5837A; }
.terminal .line-w{ color:#E0B67C; }
.terminal .line-i{ color:#7FBF9B; }
