/* ---------------------------------------------------------------
   Annex — design system stylesheet
   Editorial / minimal / Toronto-warm. Light + dark. One accent.
   --------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&family=Newsreader:ital,wght@1,400;1,500&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* === V2 EXTENSION: atmospheric layers, TTY vocabulary, UI mockups === */

/* ---------- tokens ---------- */
:root {
  /* warm paper light */
  --bg:           oklch(0.985 0.005 80);
  --bg-soft:      oklch(0.965 0.006 78);
  --bg-sunken:    oklch(0.945 0.008 76);
  --ink:          oklch(0.20 0.012 60);
  --ink-soft:     oklch(0.36 0.010 60);
  --ink-mute:     oklch(0.52 0.008 60);
  --ink-faint:    oklch(0.70 0.006 60);
  --rule:         oklch(0.90 0.006 60);
  --rule-strong:  oklch(0.82 0.008 60);
  --accent:       oklch(0.55 0.16 40);   /* Toronto brick */
  --accent-ink:   oklch(0.42 0.18 38);
  --accent-soft:  oklch(0.94 0.04 50);

  --font-sans:    "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "Geist Mono", ui-monospace, "SFMono-Regular", monospace;
  --font-serif:   "Newsreader", ui-serif, Georgia, serif;

  --shell-max:    1280px;
  --col-max:      72ch;
  --gutter:       clamp(20px, 4vw, 48px);

  --ease:         cubic-bezier(.2, .7, .1, 1);
  --ease-out:     cubic-bezier(.22, 1, .36, 1);

  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    18px;

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg:           oklch(0.16 0.008 60);
  --bg-soft:      oklch(0.20 0.010 60);
  --bg-sunken:    oklch(0.12 0.008 60);
  --ink:          oklch(0.96 0.006 80);
  --ink-soft:     oklch(0.82 0.008 70);
  --ink-mute:     oklch(0.62 0.008 65);
  --ink-faint:    oklch(0.40 0.008 60);
  --rule:         oklch(0.28 0.010 60);
  --rule-strong:  oklch(0.38 0.012 60);
  --accent:       oklch(0.68 0.15 42);
  --accent-ink:   oklch(0.78 0.13 44);
  --accent-soft:  oklch(0.28 0.06 40);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "ss02", "cv11";
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  transition: background 600ms var(--ease), color 600ms var(--ease);
  text-wrap: pretty;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
::selection { background: var(--accent); color: var(--bg); }

/* ---------- typography ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 18px; height: 1px;
  background: var(--rule-strong);
  display: inline-block;
}

.display {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 0;
}
.display em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--accent-ink);
}
.h1 { font-size: clamp(34px, 4.6vw, 60px); font-weight: 500; line-height: 1.02; letter-spacing: -0.03em; margin: 0; }
.h2 { font-size: clamp(26px, 3vw, 40px); font-weight: 500; line-height: 1.08; letter-spacing: -0.025em; margin: 0; }
.h3 { font-size: clamp(20px, 1.8vw, 26px); font-weight: 500; line-height: 1.2; letter-spacing: -0.015em; margin: 0; }
.h4 { font-size: 18px; font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; margin: 0; }

.lede { font-size: clamp(18px, 1.5vw, 22px); line-height: 1.45; color: var(--ink-soft); letter-spacing: -0.01em; max-width: 56ch; }
.body { font-size: 16px; line-height: 1.6; color: var(--ink-soft); max-width: 65ch; }
.small { font-size: 13px; line-height: 1.5; color: var(--ink-mute); }
.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0; color: var(--ink-mute); }

.serif-i { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--accent-ink); }

/* ---------- shell ---------- */
.shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(72px, 9vw, 140px); }
.section-tight { padding-block: clamp(48px, 6vw, 88px); }
.hr-rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 16px var(--gutter);
  display: flex; align-items: center; gap: 32px;
}
.brand {
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.015em;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink);
}
.brand-dot { color: var(--accent); }
.brand-mark {
  width: 22px; height: 22px;
  display: inline-grid; place-items: center;
  color: var(--accent);
  flex-shrink: 0;
}
.brand-mark svg { width: 100%; height: 100%; }
.brand-word { display: inline-flex; align-items: baseline; gap: 0; }
.brand-word .pipe {
  display: inline-block;
  width: 1px;
  height: 0.85em;
  background: var(--rule-strong);
  margin: 0 8px;
  align-self: center;
}
.brand-coord {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--rule);
}
@media (max-width: 600px) {
  .brand-coord { display: none; }
}
.nav-links {
  display: flex; align-items: center; gap: 28px;
  margin-left: auto;
}
.nav-links a:not(.nav-cta) {
  font-size: 14px;
  color: var(--ink-soft);
  position: relative;
  padding-block: 4px;
  transition: color 400ms var(--ease);
}
.nav-links a:not(.nav-cta):hover { color: var(--ink); }
.nav-links a.is-current:not(.nav-cta) { color: var(--ink); }
.nav-links a.is-current:not(.nav-cta)::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--accent);
}
.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 500ms var(--ease), background 400ms var(--ease);
}
.nav-cta:hover { transform: translateY(-1px); }
.nav-cta .arr {
  width: 22px; height: 22px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: color-mix(in oklch, var(--bg) 18%, transparent);
  transition: transform 500ms var(--ease);
}
.nav-cta:hover .arr { transform: translate(2px, -1px); }

.theme-toggle {
  width: 32px; height: 32px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  transition: color 400ms var(--ease), border-color 400ms var(--ease), transform 400ms var(--ease);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--rule-strong); transform: rotate(8deg); }
.theme-toggle svg { width: 14px; height: 14px; }
html[data-theme="light"] .theme-icon-sun { display: none; }
html[data-theme="dark"]  .theme-icon-moon { display: none; }

/* mobile nav: collapse links, keep cta + toggle */
@media (max-width: 1100px) {
  .brand-coord { display: none; }
  .nav-links { gap: 20px; }
}
@media (max-width: 960px) {
  .nav-links { gap: 16px; }
  .nav-links a:not(.nav-cta) { font-size: 13px; }
}
@media (max-width: 760px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .nav-links a.nav-cta { display: inline-flex; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  background: var(--ink);
  color: var(--bg);
  transition: transform 500ms var(--ease), background 400ms var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn .arr {
  width: 24px; height: 24px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: color-mix(in oklch, var(--bg) 18%, transparent);
  transition: transform 500ms var(--ease);
}
.btn:hover .arr { transform: translate(2px, -1px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule-strong);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-ghost .arr { background: var(--bg-sunken); }

.btn-text {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px;
  color: var(--ink);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--rule-strong);
  transition: border-color 400ms var(--ease), color 400ms var(--ease);
}
.btn-text:hover { border-color: var(--accent); color: var(--accent-ink); }

/* arrows used inline */
.arr-glyph { display: inline-block; transition: transform 400ms var(--ease); }
a:hover .arr-glyph, button:hover .arr-glyph { transform: translate(2px, -2px); }

/* ---------- footer ---------- */
.foot {
  border-top: 1px solid var(--rule);
  margin-top: 80px;
  padding-block: 56px;
  background: var(--bg);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
}
.foot-col h5 {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 16px;
}
.foot-col a { display: block; padding: 6px 0; color: var(--ink-soft); font-size: 14px; }
.foot-col a:hover { color: var(--ink); }
.foot-lock {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
.foot-mark {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.foot-mark .brand-dot { color: var(--accent); }
@media (max-width: 760px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-lock { flex-wrap: wrap; }
}

/* ---------- generic page header ---------- */
.page-head {
  padding-top: clamp(64px, 8vw, 112px);
  padding-bottom: clamp(40px, 5vw, 64px);
  border-bottom: 1px solid var(--rule);
}
.page-head .eyebrow { margin-bottom: 24px; }
.page-head .lede { margin-top: 28px; }

/* (V1 .reveal removed — see .anim-up at end of file for V2 motion vocabulary) */

/* ---------- generic two-col layout ---------- */
.row {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.row-tight {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
@media (max-width: 820px) {
  .row, .row-tight { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- list ---------- */
.list-dash > * {
  border-top: 1px solid var(--rule);
  padding-block: 28px;
}
.list-dash > *:last-child { border-bottom: 1px solid var(--rule); }

.list-row {
  display: grid;
  grid-template-columns: 80px 1.2fr 1.5fr auto;
  gap: 32px;
  align-items: baseline;
}
.list-row .idx {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mute);
}
.list-row .arr {
  width: 32px; height: 32px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  display: inline-grid; place-items: center;
  color: var(--ink-soft);
  transition: transform 400ms var(--ease), color 400ms var(--ease), border-color 400ms var(--ease);
}
.list-row:hover .arr { color: var(--ink); border-color: var(--ink); transform: translate(3px, -3px); }
@media (max-width: 760px) {
  .list-row { grid-template-columns: 1fr; gap: 8px; }
  .list-row .arr { justify-self: start; margin-top: 8px; }
}

/* ---------- card (used sparingly) ---------- */
.card {
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 400ms var(--ease), transform 600ms var(--ease);
}
.card:hover { border-color: var(--rule-strong); transform: translateY(-2px); }

/* tag / chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--bg);
}

/* ---------- KPI line (not the stat-card cliche) ---------- */
.kpi-line {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.kpi-line > div {
  padding: 28px 24px;
  border-right: 1px solid var(--rule);
}
.kpi-line > div:last-child { border-right: 0; }
.kpi-line .v {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.kpi-line .k {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
@media (max-width: 760px) {
  .kpi-line { grid-template-columns: 1fr 1fr; }
  .kpi-line > div:nth-child(2) { border-right: 0; }
  .kpi-line > div:nth-child(1), .kpi-line > div:nth-child(2) { border-bottom: 1px solid var(--rule); }
}

/* ---------- table-like rows ---------- */
.spec {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding-block: 14px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
}
.spec:last-child { border-bottom: 1px solid var(--rule); }
.spec dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mute); padding-top: 2px; }
.spec dd { margin: 0; color: var(--ink); }

/* ---------- diagonal stripe placeholder ---------- */
.placeholder {
  position: relative;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(
      45deg,
      var(--bg-sunken) 0 12px,
      var(--bg-soft) 12px 24px
    );
  border: 1px solid var(--rule);
  display: grid; place-items: center;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow: hidden;
}

/* ---------- inline links in body copy ---------- */
.prose a {
  color: var(--ink);
  border-bottom: 1px solid var(--rule-strong);
  transition: border-color 400ms var(--ease), color 400ms var(--ease);
}
.prose a:hover { color: var(--accent-ink); border-color: var(--accent); }
.prose p { color: var(--ink-soft); }
.prose h2 { margin-top: 56px; margin-bottom: 16px; font-size: clamp(22px, 2.4vw, 30px); font-weight: 500; letter-spacing: -0.02em; color: var(--ink); }
.prose h3 { margin-top: 36px; margin-bottom: 12px; font-size: 18px; font-weight: 500; color: var(--ink); }
.prose ul { padding-left: 18px; }
.prose li { color: var(--ink-soft); margin-block: 6px; }
.prose blockquote {
  margin: 32px 0;
  padding: 0 0 0 24px;
  border-left: 1px solid var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.35;
  color: var(--ink);
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-sunken);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ---------- ticker / running line ---------- */
.ticker {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
  padding-block: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
}
.ticker-track {
  display: inline-flex;
  gap: 64px;
  white-space: nowrap;
  animation: tick 60s linear infinite;
  will-change: transform;
}
.ticker-track > span { display: inline-flex; align-items: center; gap: 12px; }
.ticker-track > span::before {
  content: "●";
  color: var(--accent);
  font-size: 8px;
}
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- soft figure ---------- */
figure { margin: 0; }
.figure-cap {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
}

/* ---------- form ---------- */
.field { display: block; margin-bottom: 22px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 8px;
}
.field input, .field textarea, .field select {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule-strong);
  padding: 10px 0 12px;
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 400ms var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 120px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 600px) { .field-grid { grid-template-columns: 1fr; } }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-group input { display: none; }
.chip-group label {
  font-family: var(--font-sans);
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 8px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  cursor: pointer;
  margin: 0;
  transition: all 300ms var(--ease);
}
.chip-group input:checked + label {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* ---------- diagrams ---------- */
.weeks {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  margin-top: 16px;
}
.weeks > div {
  height: 36px;
  background: var(--bg-sunken);
  border-radius: 4px;
  position: relative;
}
.weeks > div.on { background: var(--accent); }
.weeks > div.half { background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 60%, var(--bg-sunken) 60%); }
.weeks-cap {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  display: flex; justify-content: space-between;
}

/* =========================================================
   V2 PRIMITIVES — bracket labels, TTY vocab, atmosphere
   ========================================================= */

/* --- atmospheric vignette behind hero --- */
.atmos {
  position: absolute; inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.atmos::before {
  /* warm radial glow, very subtle */
  content: "";
  position: absolute;
  top: -10%; left: 50%;
  width: 800px; height: 800px;
  transform: translateX(-50%);
  background: radial-gradient(circle at center,
    color-mix(in oklch, var(--accent) 16%, transparent) 0%,
    transparent 60%);
  opacity: 0.45;
  filter: blur(40px);
}
.atmos::after {
  /* vignette darkening on corners */
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 50%, var(--bg) 100%);
  opacity: 0.6;
}
html[data-theme="dark"] .atmos::before { opacity: 0.65; }

/* paper grain via SVG noise — very low opacity, fixed */
.grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='3' seed='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
html[data-theme="dark"] .grain { opacity: 0.06; mix-blend-mode: screen; }

/* --- bracket label: TTY-style section header --- */
.bracket {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.10em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.bracket::before, .bracket::after {
  content: "";
  width: 14px; height: 1px;
  background: var(--accent);
  display: inline-block;
}
.bracket .hex { color: var(--accent); }
.bracket .sec { color: var(--ink-mute); }
.bracket .name { color: var(--ink); font-weight: 500; }

/* hex-id badge: small mono ID like [0x01] */
.hex-id {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--accent);
  padding: 2px 7px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: color-mix(in oklch, var(--accent) 8%, transparent);
}

/* mono divider rule with bracket marks */
.tty-rule {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin: 0;
}
.tty-rule::before, .tty-rule::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule);
}
.tty-rule .corners { color: var(--accent); }

/* --- UI mockup canvas — fake software screen --- */
.ui-mock {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  overflow: hidden;
  font-family: var(--font-sans);
  color: var(--ink);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.04),
    0 4px 8px rgba(0,0,0,0.03),
    0 16px 40px rgba(0,0,0,0.06),
    0 32px 80px rgba(0,0,0,0.05);
}
html[data-theme="dark"] .ui-mock {
  box-shadow:
    0 1px 2px rgba(0,0,0,0.4),
    0 8px 24px rgba(0,0,0,0.3),
    0 24px 64px rgba(0,0,0,0.4);
}

.ui-mock .ui-chrome {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-soft);
}
.ui-mock .ui-dots {
  display: flex; gap: 6px;
}
.ui-mock .ui-dots span {
  width: 9px; height: 9px;
  border-radius: 999px;
  background: var(--rule-strong);
}
.ui-mock .ui-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
.ui-mock .ui-tabs {
  display: flex; gap: 4px;
  margin-left: auto;
}
.ui-mock .ui-tab {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-mute);
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.ui-mock .ui-tab.on {
  border-color: var(--rule);
  color: var(--ink);
  background: var(--bg);
}

.ui-mock .ui-body {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 320px;
}
.ui-mock .ui-side {
  border-right: 1px solid var(--rule);
  padding: 14px 12px;
  background: var(--bg-soft);
  font-size: 12px;
}
.ui-mock .ui-side h6 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin: 14px 0 6px;
}
.ui-mock .ui-side h6:first-child { margin-top: 0; }
.ui-mock .ui-side ul { list-style: none; padding: 0; margin: 0; }
.ui-mock .ui-side li {
  padding: 5px 8px;
  border-radius: 4px;
  color: var(--ink-soft);
  font-size: 12px;
  display: flex; align-items: center; gap: 8px;
  cursor: default;
}
.ui-mock .ui-side li.on {
  background: color-mix(in oklch, var(--accent) 10%, transparent);
  color: var(--ink);
}
.ui-mock .ui-side li::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--rule-strong);
}
.ui-mock .ui-side li.on::before { background: var(--accent); }

.ui-mock .ui-main { padding: 16px; }
.ui-mock .ui-h {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.ui-mock .ui-h .t { font-size: 14px; font-weight: 500; }
.ui-mock .ui-h .m { font-family: var(--font-mono); font-size: 10px; color: var(--ink-mute); letter-spacing: 0.04em; }

.ui-mock .ui-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}
.ui-mock .ui-field {
  display: flex; flex-direction: column;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg);
  position: relative;
}
.ui-mock .ui-field .k {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.ui-mock .ui-field .v {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}
.ui-mock .ui-field .conf {
  position: absolute; top: 7px; right: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.ui-mock .ui-field.low { border-color: oklch(0.75 0.12 70); background: oklch(0.97 0.04 70); }
.ui-mock .ui-field.low .conf { color: oklch(0.55 0.15 60); }
html[data-theme="dark"] .ui-mock .ui-field.low {
  background: oklch(0.26 0.04 70);
  border-color: oklch(0.45 0.10 70);
}

@media (max-width: 720px) {
  .ui-mock .ui-body { grid-template-columns: 1fr; }
  .ui-mock .ui-side { border-right: 0; border-bottom: 1px solid var(--rule); }
  .ui-mock .ui-fields { grid-template-columns: 1fr; }
}

/* --- file-review state machine block --- */
.fr {
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  overflow: hidden;
  font-family: var(--font-mono);
}
.fr .fr-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-soft);
}
.fr .fr-head .t {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-mute);
}
.fr .fr-head .t b { color: var(--accent); font-weight: 500; }
.fr .fr-head .meta { font-size: 11px; color: var(--ink-mute); letter-spacing: 0.04em; }
.fr-list { list-style: none; margin: 0; padding: 0; }
.fr-row {
  display: grid;
  grid-template-columns: 22px 1fr 110px 80px;
  gap: 14px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-soft);
  transition: background 250ms var(--ease);
}
.fr-row:last-child { border-bottom: 0; }
.fr-row .ix { font-size: 10px; color: var(--ink-faint); }
.fr-row .nm { color: var(--ink); font-family: var(--font-mono); font-size: 12px; }
.fr-row .st {
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  text-align: right;
}
.fr-row .tm { font-size: 10px; color: var(--ink-mute); text-align: right; }

.fr-row[data-state="queued"]     .st { color: var(--ink-mute); }
.fr-row[data-state="processing"] .st { color: var(--accent); }
.fr-row[data-state="processing"] { background: color-mix(in oklch, var(--accent) 6%, transparent); }
.fr-row[data-state="done"]       .st { color: oklch(0.50 0.13 145); }
html[data-theme="dark"] .fr-row[data-state="done"] .st { color: oklch(0.72 0.13 145); }

.fr-row .st::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px;
  background: currentColor;
  margin-right: 6px;
  vertical-align: middle;
}
.fr-row[data-state="processing"] .st::before {
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* --- typewriter rotator --- */
/* The .tw container reserves space for the LONGEST word via a hidden ::before
   that pulls its text from data-longest. That way the typewriter word can
   shrink/grow without reflowing the surrounding text in the headline. */
.tw {
  display: inline-block;
  position: relative;
  vertical-align: baseline;
  white-space: nowrap;
}
.tw::before {
  content: attr(data-longest);
  display: block;
  height: 0;
  visibility: hidden;
  overflow: hidden;
  pointer-events: none;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.tw-word {
  color: var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.tw-cursor {
  display: inline-block;
  width: 2px;
  background: var(--accent);
  margin-left: 4px;
  animation: tw-blink 1s steps(1) infinite;
  align-self: center;
  height: 0.9em;
}
@keyframes tw-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* --- inline sparkline / chart utilities --- */
.spark { display: block; width: 100%; height: 56px; }
.spark path.line { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.spark path.area { fill: var(--accent); opacity: 0.10; stroke: none; }
.spark circle.pt { fill: var(--accent); }
.spark .grid { stroke: var(--rule); stroke-width: 1; }

.bars { display: grid; gap: 8px; }
.bars .row { display: grid; grid-template-columns: 110px 1fr 50px; gap: 12px; align-items: center; font-size: 12px; }
.bars .row .lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; color: var(--ink-mute); text-transform: uppercase; }
.bars .row .pct { font-family: var(--font-mono); font-size: 11px; color: var(--ink); text-align: right; }
.bars .row .track {
  height: 8px;
  background: var(--bg-sunken);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.bars .row .fill {
  position: absolute; inset: 0 auto 0 0;
  background: var(--accent);
  border-radius: 2px;
  transform-origin: left;
}

/* --- box-drawing diagram --- */
.diagram {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  padding: 24px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--bg);
  white-space: pre;
  overflow-x: auto;
  letter-spacing: 0;
}
.diagram b { color: var(--ink); font-weight: 500; }
.diagram .ac { color: var(--accent); }
.diagram .mute { color: var(--ink-mute); }

/* --- chevron ornament (large background motif) --- */
.chev-ornament {
  position: absolute;
  pointer-events: none;
  color: var(--accent);
  opacity: 0.06;
  z-index: 0;
}
html[data-theme="dark"] .chev-ornament { opacity: 0.10; }

/* --- improved hover for tile cards --- */
.tile {
  display: block;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--bg-soft);
  transition: border-color 400ms var(--ease), transform 600ms var(--ease);
}
.tile:hover { border-color: var(--rule-strong); transform: translateY(-2px); }
.tile .tile-hover {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, color-mix(in oklch, var(--accent) 18%, transparent), transparent 60%);
  opacity: 0; transition: opacity 500ms var(--ease);
  pointer-events: none;
}
.tile:hover .tile-hover { opacity: 1; }

/* --- live indicator pill --- */
.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 8px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--bg);
}
.live-pill::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: live-pulse 2s ease-out infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklch, var(--accent) 50%, transparent); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* --- terminal/log block --- */
.term {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--bg-sunken);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 16px 18px;
  color: var(--ink-soft);
  line-height: 1.6;
  overflow-x: auto;
}
.term .ln { display: block; }
.term .pf { color: var(--accent); margin-right: 8px; }
.term .ok { color: oklch(0.55 0.14 145); }
.term .warn { color: oklch(0.65 0.16 70); }
.term b { color: var(--ink); font-weight: 500; }

html[data-theme="dark"] .term .ok { color: oklch(0.72 0.13 145); }

/* --- mini stat-card variant: not the SaaS hero-metric template --- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.stat-strip > div {
  padding: 20px 24px;
  border-left: 1px solid var(--rule);
}
.stat-strip > div:first-child { border-left: 0; }
.stat-strip .lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 6px;
}
.stat-strip .v {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
@media (max-width: 700px) {
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-strip > div:nth-child(3) { border-left: 0; }
  .stat-strip > div:nth-child(3), .stat-strip > div:nth-child(4) { border-top: 1px solid var(--rule); }
}

/* --- subtle hover zoom on framed art / mockups --- */
.frame {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--rule);
}
.frame > * {
  transition: transform 1200ms var(--ease-out);
}
.frame:hover > * {
  transform: scale(1.02);
}

/* re-enable scroll motion (CSS + JS hybrid) — visible by default, JS opts below-fold elements into the entry animation */
.anim-up { opacity: 1; transform: none; }

.js-on .anim-up.below {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
}
.js-on .anim-up.below.in {
  opacity: 1; transform: translateY(0);
}
.js-on .anim-up.below[data-delay="1"].in { transition-delay: 80ms; }
.js-on .anim-up.below[data-delay="2"].in { transition-delay: 160ms; }
.js-on .anim-up.below[data-delay="3"].in { transition-delay: 240ms; }
.js-on .anim-up.below[data-delay="4"].in { transition-delay: 320ms; }
@media (prefers-reduced-motion: reduce) {
  .js-on .anim-up.below { opacity: 1; transform: none; transition: none; }
}
