/* Layout: a broadcast control-room notebook. Narrow reading column, a slim
   "slate" header strip, mono timecode-style metadata. One accent: chroma-key
   blue. Tally red is reserved for the single "live" signal on the build log. */
:root {
  --bg: #eef1f4;
  --surface: #f8fafb;
  --ink: #121820;
  --muted: #56606d;
  --rule: #cfd6de;
  --accent: #1d3fd0;
  --accent-ink: #ffffff;
  --tally: #d4352b;
  --good: #1f7a4d;
  --font-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.75rem;
  --step-3: 2.5rem;
  --step-4: clamp(2.4rem, 6vw, 3.9rem);
  --measure: 66ch;
  --wide: 72rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141a; --surface: #161d25; --ink: #e6ebf0; --muted: #9aa5b2;
    --rule: #2a3440; --accent: #7d97ff; --accent-ink: #0b1020; --tally: #ff6a5c; --good: #4fc28a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141a; --surface: #161d25; --ink: #e6ebf0; --muted: #9aa5b2;
  --rule: #2a3440; --accent: #7d97ff; --accent-ink: #0b1020; --tally: #ff6a5c; --good: #4fc28a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
}
a { color: var(--accent); text-underline-offset: 0.18em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
img { max-width: 100%; }

.wrap {
  max-width: var(--wide);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Slate strip header */
.slate {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.slate .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem;
  padding-block: 0.8rem;
}
.brand {
  font-family: var(--font-display); font-weight: 800; font-stretch: 112%;
  letter-spacing: 0.01em; color: var(--ink); text-decoration: none; font-size: 1.05rem;
}
.brand span { color: var(--accent); }
.nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin-left: auto; }
.nav a {
  font-family: var(--font-display); font-size: 0.92rem; font-weight: 600; color: var(--muted);
  text-decoration: none;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* Type */
h1, h2, h3 {
  font-family: var(--font-display); line-height: 1.12; text-wrap: balance; margin: 0;
}
h1 { font-size: var(--step-4); font-weight: 800; font-stretch: 88%; letter-spacing: -0.01em; }
h2 { font-size: var(--step-2); font-weight: 750; font-stretch: 92%; }
h3 { font-size: var(--step-1); font-weight: 700; }
.eyebrow {
  font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink); max-width: 58ch; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: 0.9em; }

/* Article */
.article { padding-block: 3rem 4rem; }
.article > * { max-width: var(--measure); }
.article header { display: grid; gap: 0.9rem; margin-bottom: 2.25rem; max-width: 52rem; }
.prose { display: grid; gap: 1.1rem; }
.prose h2 { margin-top: 1.6rem; }
.prose h3 { margin-top: 0.8rem; }
.prose p, .prose ul, .prose ol { margin: 0; }
.prose li + li { margin-top: 0.35rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.table-scroll { overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose th { font-family: var(--font-display); font-size: 0.9rem; }
.callout {
  border-left: 3px solid var(--accent); background: var(--surface);
  padding: 1rem 1.2rem;
}
.meta-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

/* Buttons and forms */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-weight: 700; font-size: 0.98rem;
  padding: 0.7rem 1.15rem; border-radius: 3px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); text-decoration: none; cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--accent); }
.field { display: grid; gap: 0.35rem; }
.field label { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; }
.field input, .field select {
  font: inherit; font-family: var(--font-mono); font-size: 1rem;
  padding: 0.6rem 0.7rem; border: 1px solid var(--rule); border-radius: 3px;
  background: var(--bg); color: var(--ink); width: 100%;
}
.hint { font-size: var(--step--1); color: var(--muted); }

.signup {
  display: grid; gap: 0.8rem; border: 1px solid var(--rule); background: var(--surface);
  padding: 1.4rem; margin-top: 2.5rem;
}
.signup form { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.signup input {
  flex: 1 1 14rem; min-width: 0; font: inherit; font-family: var(--font-mono); font-size: 1rem;
  padding: 0.65rem 0.75rem; border: 1px solid var(--rule); border-radius: 3px; background: var(--bg); color: var(--ink);
}
.signup .status { font-size: var(--step--1); color: var(--good); }

/* Footer */
.foot { border-top: 1px solid var(--rule); padding-block: 2rem 2.5rem; font-size: var(--step--1); color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between; }

/* Live indicator, used once on the build log */
.live {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--tally);
}
.live::before {
  content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--tally);
}

@media (prefers-reduced-motion: no-preference) {
  .live::before { animation: tally 2.4s ease-in-out infinite; }
  @keyframes tally { 50% { opacity: 0.35; } }
}
