/* ── Geist Mono (self-hostable via Fontsource; CDN for now) ───────────── */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(https://cdn.jsdelivr.net/fontsource/fonts/geist-mono:vf@latest/latin-wght-normal.woff2) format('woff2-variations');
}

/* ── Instrument Serif — the "annual report" display face ──────────────── */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(https://cdn.jsdelivr.net/fontsource/fonts/instrument-serif@latest/latin-400-normal.woff2) format('woff2');
}

/* ── Inter — the professional body face (everything outside the terminals) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(https://cdn.jsdelivr.net/fontsource/fonts/inter:vf@latest/latin-wght-normal.woff2) format('woff2-variations');
}

/* ── tokens ───────────────────────────────────────────────────────────── */
:root {
  --bg: #0A0A0A;
  --surface: #141210;
  --surface-2: #1b1814;
  --border: #2c261f;
  --border-bright: #44392b;
  --amber: #FFB000;
  --amber-dim: #c08a2e;
  --text: #F2F2F2;
  --text-dim: #8c857a;
  --user: #e0aa55;
  --error: #ff5252;
  --scanline: 0.028;
  --glow: 0 0 14px rgba(255,176,0,.28);
  --page-dim: #8c857a;   /* page-level dim text — NOT overridden inside the dark terminal scope */

  --font: 'Geist Mono', ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Courier New', monospace;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fs-caption: clamp(0.69rem, 0.62rem + 0.35vw, 0.8rem);
  --fs-body:    clamp(0.84rem, 0.78rem + 0.4vw, 0.97rem);
  --fs-label:   clamp(0.74rem, 0.68rem + 0.3vw, 0.83rem);
  --fs-lg:      clamp(1.05rem, 0.9rem + 0.7vw, 1.35rem);
  --fs-xl:      clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem);
  --fs-name:    clamp(2.4rem, 1.6rem + 4vw, 4rem);

  --maxw: 760px;
  --radius: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="light"] {
  --bg: #faf7f0;
  --surface: #fffdf8;
  --surface-2: #f4efe4;
  --border: #e5ddcc;
  --border-bright: #cfc3a9;
  --amber: #8a5200;
  --amber-dim: #875a14;
  --text: #1c1813;
  --text-dim: #6b6358;
  --user: #8a5200;
  --error: #c0322a;
  --scanline: 0;
  --glow: none;
  --page-dim: #6b6358;
}

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

/* Safari (desktop + iOS) layers native OS button chrome under custom
   border/padding unless appearance is reset — without this, buttons like
   the theme toggle render taller than their CSS box and visibly overrun
   thin fixed-height bars. Chromium already normalizes this, so it only
   shows up in Safari. */
button {
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
  line-height: normal;
}

body {
  font-family: var(--sans);
  font-size: var(--fs-body);
  font-variant-numeric: tabular-nums slashed-zero;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-top: 46px;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .3s var(--ease), color .3s var(--ease);
}

/* static CRT scanline overlay (dark only; never animated) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  background: repeating-linear-gradient(0deg,
    rgba(255,176,0,var(--scanline)) 0px,
    rgba(255,176,0,var(--scanline)) 1px,
    transparent 1px, transparent 3px);
}

.amber { color: var(--amber); }
.dim { color: var(--text-dim); }
strong { color: var(--text); font-weight: 700; }

a { color: var(--amber-dim); text-decoration: none; }
a:hover { color: var(--amber); }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--surface); color: var(--amber); padding: 8px 14px;
  border: 1px solid var(--amber);
}
.skip-link:focus { left: 8px; }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

main { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ── status bar ───────────────────────────────────────────────────────── */
.statusbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: 46px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-caption);
}
.sb-mono { font-family: var(--serif); color: var(--text); font-size: 1.05rem; letter-spacing: .02em; white-space: nowrap; }
.sb-status { display: inline-flex; align-items: center; gap: 8px; color: var(--text-dim); white-space: nowrap; min-width: 0; overflow: hidden; }
.sb-status-text { color: var(--text); letter-spacing: .03em; }
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: #3fb950;
  box-shadow: 0 0 8px #3fb95088; animation: pulse 2s var(--ease) infinite;
}
.dot.small { width: 6px; height: 6px; }
@keyframes pulse { 50% { opacity: .35; } }

.sb-toggle {
  background: transparent; border: 1px solid var(--border-bright); color: var(--text-dim);
  font: inherit; font-size: var(--fs-caption); padding: 4px 9px; border-radius: 6px; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
.sb-toggle:hover { color: var(--amber); border-color: var(--amber-dim); }
.ttoggle-light { display: none; }
html[data-theme="light"] .ttoggle-dark { display: none; }
html[data-theme="light"] .ttoggle-light { display: inline; }

.sb-actions { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sb-book {
  border: 1px solid var(--amber); color: var(--amber); border-radius: 6px;
  padding: 4px 10px; font-size: var(--fs-caption); letter-spacing: .02em; white-space: nowrap;
  flex-shrink: 0;
}
.sb-book:hover { background: var(--amber); color: #0A0A0A; }
html[data-theme="light"] .sb-book:hover { color: #faf6ee; }
.sb-book-short { display: none; }

.sb-short { display: none; }
@media (max-width: 560px) {
  .sb-status-text { display: none; }
  .sb-short { display: inline; color: var(--text); letter-spacing: .04em; }
  .sb-book-long { display: none; }
  .sb-book-short { display: inline; }
}

/* ── hero ─────────────────────────────────────────────────────────────── */
.hero-name {
  font-family: var(--serif);
  font-size: clamp(2.9rem, 2rem + 4.4vw, 4.6rem); font-weight: 400;
  letter-spacing: .005em; line-height: 1;
  color: var(--text); margin-bottom: .9rem;
  text-shadow: var(--glow);
}

/* ── the terminals: the AI console + work artifacts keep the dark machine
      look in BOTH themes — dark screens embedded in a professional page ── */
.console, #recon-demo, #find-break {
  --bg: #0A0A0A; --surface: #100d09; --surface-2: #171310;
  --border: #2c261f; --border-bright: #44392b;
  --amber: #FFB000; --amber-dim: #c9962f;
  --text: #F2F2F2; --text-dim: #8c857a; --user: #e0aa55;
  --error: #ff5252;
  --glow: 0 0 14px rgba(255,176,0,.28);
  font-family: var(--font);
}

/* ── console ──────────────────────────────────────────────────────────── */
.console {
  border: 1px solid var(--border-bright); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; margin-bottom: 3rem;
  box-shadow: 0 0 0 1px rgba(255,176,0,.03), 0 18px 44px rgba(0,0,0,.28);
}
html[data-theme="light"] .console { box-shadow: 0 10px 30px rgba(60,45,20,.10); }
.console-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: var(--fs-label);
}
.ch-title { color: var(--text); }
.ch-live { color: var(--text-dim); display: inline-flex; align-items: center; gap: 7px; }
.console-note {
  padding: 12px 16px; color: var(--text-dim); font-size: var(--fs-caption);
  border-bottom: 1px solid var(--border); line-height: 1.6;
}
.console-screen { padding: 14px 16px 16px; }
.log { min-height: 96px; max-height: 46vh; overflow-y: auto; font-size: var(--fs-body); cursor: text; }
.log-empty { color: var(--text-dim); }
.log-hint { color: var(--text-dim); font-size: var(--fs-caption); }
.log .line { margin-bottom: .7rem; white-space: pre-wrap; word-break: break-word; }
.log .line.user { color: var(--user); }
.log .line.bot { color: var(--text); }
.log .line .pfx { color: var(--amber); margin-right: .5rem; }
.log .line.user .pfx { color: var(--user); }
.log .line.err { color: var(--error); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.chip {
  background: var(--surface-2); border: 1px solid var(--border-bright); color: var(--text-dim);
  font: inherit; font-size: var(--fs-caption); padding: 7px 11px; border-radius: 7px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--amber); color: var(--amber); }

.console-input { display: flex; align-items: center; gap: 9px; margin-top: 12px;
  border-top: 1px solid var(--border); padding-top: 13px; }
.ci-caret { font-size: var(--fs-lg); }
#q {
  flex: 1; background: transparent; border: none; color: var(--text);
  font: inherit; font-size: var(--fs-body); padding: 4px 0;
}
#q::placeholder { color: var(--text-dim); }
#q:focus { outline: none; }
/* iOS Safari zooms the page when focusing inputs under 16px — hold the line on phones */
@media (max-width: 560px) { #q { font-size: 16px; } }
.ci-send {
  background: transparent; border: 1px solid var(--border-bright); color: var(--amber);
  width: 32px; height: 32px; border-radius: 7px; cursor: pointer; font-size: 1.05rem; line-height: 1;
}
.ci-send:hover { border-color: var(--amber); box-shadow: var(--glow); }

/* ── home stage: the AI face is the centerpiece (friendly Mr. House) ───── */
.home { max-width: 640px; margin: 0 auto; padding: 0 20px; }
.stage {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; min-height: calc(100vh - 46px); padding: 4vh 0 5vh;
}
.stage .hero-name { margin-bottom: .3rem; }
.hero-role {
  color: var(--amber-dim); font-size: var(--fs-label); margin: 0 0 .55rem;
  text-transform: uppercase; letter-spacing: .22em;
}
.hero-manifesto { font-size: var(--fs-caption); letter-spacing: .03em; margin: 0 0 1.4rem; }
.hero-manifesto a { color: var(--text-dim); }
.hero-manifesto a:hover { color: var(--amber); }
.stage .console { width: 100%; margin: 0; text-align: left; }

/* the face lives INSIDE the machine now — one dark chassis, both themes */
.console-avatar {
  display: flex; justify-content: center; width: 100%;
  padding: 18px 0 2px; position: relative;
  background: radial-gradient(58% 52% at 50% 46%, rgba(255,176,0,.07), transparent 74%);
}
.console-avatar canvas {
  width: clamp(196px, 48vw, 248px); height: auto; display: block;
  filter: drop-shadow(0 0 18px rgba(255,176,0,.14));
  transition: filter .3s var(--ease);
}
.console-avatar.talking canvas { filter: drop-shadow(0 0 26px rgba(255,176,0,.28)); }
/* short laptop screens: shrink the face a notch so the input stays near the fold */
@media (max-height: 860px) and (min-width: 561px) {
  .console-avatar canvas { width: clamp(170px, 34vw, 210px); }
  .stage { padding-top: 2vh; }
}

/* ── content blocks ───────────────────────────────────────────────────── */
.block { padding: 2.4rem 0; border-top: 1px solid var(--border); }
.block-kicker {
  color: var(--text-dim); font-size: var(--fs-caption);
  text-transform: uppercase; letter-spacing: .24em; margin-bottom: .5rem;
}
.block-kicker .amber { letter-spacing: 0; }
.block-h {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.3rem); font-weight: 400; color: var(--text);
  margin-bottom: 1.4rem; letter-spacing: .005em; line-height: 1.1;
}

.verified { color: #3fb950; }
html[data-theme="light"] .verified { color: #1a7f37; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 1.5rem; }
.cta {
  display: inline-block; border: 1px solid var(--border-bright); color: var(--text);
  padding: 10px 16px; border-radius: 7px; font-size: var(--fs-label);
}
.cta:hover { border-color: var(--amber); color: var(--amber); }
.cta.primary { background: var(--amber); border-color: var(--amber); color: #0A0A0A; font-weight: 700; }
.cta.primary:hover { background: #ffc23d; border-color: #ffc23d; color: #0A0A0A; box-shadow: var(--glow); }
html[data-theme="light"] .cta.primary { color: #faf6ee; }
html[data-theme="light"] .cta.primary:hover { background: #6e4100; border-color: #6e4100; }

/* ── footer ───────────────────────────────────────────────────────────── */
.footer { max-width: 600px; margin: 0 auto; padding: 1.5rem 20px 3rem;
  border-top: 1px solid var(--border); text-align: center; }
.foot-links { font-size: var(--fs-caption); display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 6px 10px; justify-content: center; margin-bottom: .6rem; }
.foot-credit { color: var(--text-dim); font-size: var(--fs-caption); }

/* ── gentle scroll-reveal for the professional sections ──────────────── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .65s var(--ease), transform .65s var(--ease); }
.reveal.on { opacity: 1; transform: none; }

/* ── reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, body { animation: none !important; transition: none !important; }
  .cursor { animation: none; }
  body::before { display: none; }
}

/* ── convert: primary CTA below the console ───────────────────────────── */
.convert { padding: 0 0 1.2rem; }
.cta-block {
  border: 1px solid var(--border-bright); border-radius: var(--radius);
  background: var(--surface); padding: 20px 18px; text-align: center;
  box-shadow: 0 0 0 1px rgba(255,176,0,.03);
}
.cta-lead { color: var(--text); font-size: var(--fs-label); max-width: 46ch; margin: 0 auto .9rem; line-height: 1.6; }
.cta-block .cta-row { justify-content: center; margin-bottom: .9rem; }
.cta-alt { color: var(--text-dim); font-size: var(--fs-caption); margin: 0; }
.cta-alt a { color: var(--amber-dim); }
.cta-alt a:hover { color: var(--amber); }

/* ── proof: question -> what I did -> outcome ─────────────────────────── */
.cases { display: grid; gap: 14px; margin-bottom: 1.4rem; }
.case {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 15px 17px;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.case:hover { border-color: var(--border-bright); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.22); }
html[data-theme="light"] .case:hover { box-shadow: 0 8px 22px rgba(60,45,20,.10); }
.case p { margin: 0 0 .5rem; line-height: 1.55; }
.case p:last-child { margin-bottom: 0; }
.case-q { color: var(--text); font-size: var(--fs-label); }
.case-did { color: var(--text-dim); font-size: var(--fs-label); }
.case-out { color: var(--amber); font-size: var(--fs-label); }
.case-tag {
  display: inline-block; min-width: 1.3em; color: var(--amber); font-weight: 700;
  margin-right: .4rem; letter-spacing: .04em;
}
.case-did .case-tag { color: var(--text-dim); }
.case-arrow { color: var(--amber); margin-right: .5rem; font-weight: 700; }

/* ── track record: timeline with typographic monogram tiles ───────────── */
.tl { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 20px; }
.tl::before {
  content: ""; position: absolute; left: 23px; top: 10px; bottom: 10px; width: 1px;
  background: linear-gradient(180deg, var(--border-bright), var(--border) 70%, transparent);
}
.tl-item { display: grid; grid-template-columns: 48px 1fr; gap: 15px; position: relative; }
.tl-chip {
  width: 48px; height: 48px; border-radius: 10px; position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 1.45rem; color: var(--amber);
  background: var(--surface-2); border: 1px solid var(--border-bright);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.tl-item:hover .tl-chip { border-color: var(--amber-dim); box-shadow: 0 0 14px rgba(255,176,0,.14); }
.tl-top { display: flex; align-items: baseline; gap: 8px 12px; flex-wrap: wrap; }
.tl-org { font-family: var(--serif); font-size: 1.22rem; color: var(--text); line-height: 1.15; }
.tl-dates { margin-left: auto; color: var(--text-dim); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.tl-role {
  color: var(--amber-dim); font-size: var(--fs-caption);
  text-transform: uppercase; letter-spacing: .14em; margin: 3px 0 5px;
}
.tl-note { color: var(--text-dim); font-size: var(--fs-label); line-height: 1.6; max-width: 54ch; }

.verify-row {
  font-size: var(--fs-caption); color: var(--text-dim);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; line-height: 1.5;
}
.verify-row .verified { font-weight: 700; margin-right: 2px; }
.verify-row a { color: var(--amber-dim); }
.verify-row a:hover { color: var(--amber); }
.vsep { color: var(--border-bright); }
