/* ══════════════════════════════════════════════════════════════════════════
   How to Talk to a Computer — howtotalktoacomputer.com
   Direction 3a: Nocturne's structure and type, DOS blue as the spot color.

   Nocturne's dark ground carries anything you have to actually read; the
   DOS blue is the brand surface — nav, hero, buttons, verdict marks. A whole
   site in #0A1A8C is a headache at paragraph length.
   ══════════════════════════════════════════════════════════════════════ */

:root {
  /* — Nocturne ground: the reading surface — */
  --color-bg: #161826;
  --color-surface: #232532;
  --color-text: #e9e9ed;
  --color-divider: rgba(233, 233, 237, 0.16);

  --color-neutral-100: #f3f5fe;
  --color-neutral-200: #e4e7f5;
  --color-neutral-300: #cfd3e5;
  --color-neutral-400: #b2b6ca;
  --color-neutral-500: #9397ab;
  --color-neutral-600: #75798c; /* decorative only — 4.0:1 on the ground, under AA for text */
  --color-neutral-700: #595d6c;
  --color-neutral-800: #3f424d;
  --color-neutral-900: #292b31;

  /* — HTTTAC brand: the spot color and its pale grays — */
  --dos: #0a1a8c;        /* ground */
  --pale: #e6e8f5;       /* headline / cursor */
  --accent: #c8cef0;     /* accent line */
  --secondary: #a8b2e4;  /* secondary text on blue — 6.6:1 */
  --tertiary: #8f9ce0;   /* tertiary text on blue — 5.2:1 */
  --rule: #4a5ac4;       /* rules on blue */

  --font-heading: "Inter", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --space-1: 2.8px;
  --space-2: 5.6px;
  --space-3: 8.4px;
  --space-4: 11.2px;
  --space-6: 16.8px;
  --space-8: 22.4px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  /* Page gutter — the mockup's 1280px canvas used ~40px; it breathes on desktop
     and tightens on phones rather than snapping at a breakpoint. */
  --gutter: clamp(20px, 5vw, 40px);
  --measure: 34em; /* the mockup's reading measure, held everywhere */
}

*, *::before, *::after { box-sizing: border-box; }

/* Any class here that sets `display` would otherwise beat the UA sheet's
   [hidden] rule — the archive filter's rows are display:grid. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font: 400 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* Hierarchy is size and space — Inter never goes heavier than 500. */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0;
}

p { margin: 0 0 var(--space-3); }
img { display: block; max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }

a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--pale); }

/* Nocturne's focus ring, retuned to the brand — its default accent is a
   purple that has no business on this site. */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
::selection { background: rgba(200, 206, 240, 0.3); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: var(--gutter); top: -60px; z-index: 10;
  background: var(--pale); color: var(--dos);
  padding: 10px 16px; border-radius: var(--radius-md);
  font: 500 14px var(--font-body);
  transition: top 0.15s ease;
}
.skip-link:focus-visible { top: 12px; color: var(--dos); }

/* ─────────────────────────────────────────────────────────  layout  ── */

/* One measure for the whole site. The gutter sits outside the 1200px content
   column so the nav, the hero, the body and the footer all share a left edge. */
.wrap { max-width: calc(1200px + var(--gutter) * 2); margin: 0 auto; padding-inline: var(--gutter); }

.section { padding-block: clamp(44px, 7vw, 72px); }
.section-tight { padding-block: clamp(32px, 5vw, 50px); }

/* Nocturne's signature: freestanding rules fade to transparent at both ends
   over one 48px baseline unit. Box outlines stay solid. */
.fade {
  height: 1px; border: 0; margin: 0;
  background: linear-gradient(90deg,
    transparent, var(--color-neutral-800) 48px,
    var(--color-neutral-800) calc(100% - 48px), transparent);
}
.rule-solid { height: 1px; border: 0; background: var(--color-neutral-800); margin: 0; }

/* ────────────────────────────────────────────────────────────  nav  ── */

.nav {
  background: var(--dos);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-6);
  min-height: 64px;
  padding: 10px var(--gutter);
  flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  font: 500 16px var(--font-heading);
  color: var(--pale);
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--pale); }
.brand svg { display: block; flex: none; }

.navlinks {
  display: flex; gap: clamp(14px, 2.4vw, 26px); flex-wrap: wrap;
  font: 400 13.5px var(--font-body);
}
.navlinks a { color: var(--accent); }
.navlinks a:hover { color: var(--pale); }
.navlinks a[aria-current="page"] { color: var(--pale); }

/* ─────────────────────────────────────────────────────────  type  ── */

.h1 {
  font: 500 clamp(30px, 4.6vw, 46px) / 1.06 var(--font-heading);
  letter-spacing: -0.028em;
  color: var(--pale);
}
.h1-sm { font-size: clamp(27px, 3.9vw, 36px); }

.h2 {
  font: 500 clamp(20px, 2.5vw, 24px) / 1.25 var(--font-heading);
  letter-spacing: -0.015em;
  color: var(--color-text);
}
.h3 { font: 500 19px var(--font-heading); color: var(--color-text); }

.kicker {
  font: 500 11px var(--font-body);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--color-neutral-500);
}
.kicker-on-blue { color: var(--tertiary); letter-spacing: 0.14em; }

.lede {
  font: 400 clamp(15.5px, 1.6vw, 17px) / 1.6 var(--font-body);
  color: var(--secondary);
  max-width: var(--measure);
}
.body {
  font: 400 16.5px/1.75 var(--font-body);
  color: var(--color-neutral-300);
  max-width: var(--measure);
}
.prose { font: 400 16px/1.75 var(--font-body); color: var(--color-text); max-width: var(--measure); }
.prose-dim { font: 400 15px/1.7 var(--font-body); color: var(--color-neutral-500); max-width: var(--measure); }

.meta { font: 400 11.5px/1.5 var(--font-body); color: var(--color-neutral-500); }

/* Inside running text the accent is too close to the body color to carry a
   link on its own, so prose links are underlined. Nav, footer and buttons
   read as links from their position and stay clean. */
.prose a, .prose-dim a, .body a, .empty-body a, .pullquote a {
  text-decoration: underline;
  text-decoration-color: rgba(200, 206, 240, 0.45);
}
.prose a:hover, .prose-dim a:hover, .body a:hover, .empty-body a:hover, .pullquote a:hover {
  text-decoration-color: currentColor;
}

/* ──────────────────────────────────────────────────────  verdicts  ── */

/* CHECKED / PARTLY / OFF — the three marks, legible on both grounds. */
.verdict {
  font: 500 10px var(--font-body);
  letter-spacing: 0.12em;
  padding: 4px 9px;
  border-radius: 5px;
  display: inline-block;
  white-space: nowrap;
}
.verdict-sm { font-size: 9px; padding: 3px 7px; }
/* Backgrounds are declared on all three so the pills survive being rendered
   as <button> in the archive filter, where the UA supplies its own. */
.vok { color: var(--accent); background: transparent; border: 1px solid var(--rule); }
.voff { color: var(--dos); background: var(--pale); border: 1px solid var(--pale); }
.vpart { color: var(--secondary); background: transparent; border: 1px dashed var(--rule); }

/* ────────────────────────────────────────────────  cards & panels  ── */

.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  display: flex; flex-direction: column; gap: var(--space-4);
}
a.card { color: inherit; }
a.card:hover { background: #2a2d3c; color: inherit; }
a.card:hover .card-claim { color: var(--pale); }
.card-claim { font: 400 16px/1.4 var(--font-body); color: var(--color-text); }

.panel-blue { background: var(--dos); border-radius: var(--radius-md); }

.pullquote {
  background: var(--color-surface);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 18px;
  max-width: var(--measure);
  font: 400 14.5px/1.7 var(--font-body);
  color: var(--color-neutral-300);
}

/* Placeholder frame — stands in for artwork that doesn't exist yet. */
.pl {
  border: 1px dashed rgba(233, 233, 237, 0.28);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: var(--space-6);
  font: 400 11px/1.5 var(--font-body);
  color: rgba(233, 233, 237, 0.5);
}

/* Episode thumbnail. YouTube's hqdefault is 4:3 with 45px letterbox bars —
   cropping it to 16/9 with object-fit removes exactly those bars. */
.thumb {
  display: block; position: relative; overflow: hidden;
  border-radius: var(--radius-md); background: var(--color-surface);
}
/* height:auto is load-bearing — without it the img's height attribute wins
   over aspect-ratio and the letterbox bars come back. */
.thumb img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.thumb-cap {
  position: absolute; inset: auto 0 0 0; padding: 26px 16px 14px;
  /* Thumbnails are unpredictable — the scrim has to hold over a bright frame. */
  background: linear-gradient(transparent, rgba(10, 26, 140, 0.72) 45%, rgba(10, 26, 140, 0.97));
  font: 500 14px var(--font-body); color: var(--pale);
}

/* The empty state is a designed surface, not a missing one. */
.empty {
  border: 1px dashed var(--color-neutral-800);
  border-radius: var(--radius-md);
  padding: clamp(28px, 5vw, 44px);
  text-align: center;
}
.empty-title { font: 500 19px var(--font-heading); color: var(--color-text); margin-bottom: 10px; }
.empty-body { font: 400 14.5px/1.7 var(--font-body); color: var(--color-neutral-500); margin: 0 auto; max-width: 40em; }

/* ─────────────────────────────────────────────  buttons & inputs  ── */

.btn {
  height: 44px; padding: 0 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--pale);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 500 14px var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: rgba(200, 206, 240, 0.12); color: var(--pale); }
.btn:active { background: rgba(200, 206, 240, 0.2); }
.btn-strong { border-color: var(--pale); }
.btn-quiet { border-color: var(--color-neutral-800); color: var(--color-neutral-300); }
.btn-quiet:hover { background: rgba(233, 233, 237, 0.07); color: var(--color-text); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:hover { background: transparent; }

.inp {
  flex: 1; min-width: 0; height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-neutral-800);
  background: #12141f;
  padding: 0 14px;
  font: 400 14px var(--font-body);
  color: var(--color-text);
  caret-color: var(--accent);
}
.inp::placeholder { color: var(--color-neutral-500); }
.inp:hover { border-color: var(--color-neutral-600); }
.inp:focus-visible { border-color: var(--accent); outline-offset: 0; }
.inp:disabled { opacity: 0.6; cursor: not-allowed; }

/* On the blue ground the input inverts: a well cut into the blue. */
.on-blue .inp {
  border-color: var(--rule);
  background: rgba(0, 0, 0, 0.2);
  color: var(--pale);
}
.on-blue .inp::placeholder { color: var(--tertiary); }
.on-blue .btn { border-color: var(--pale); }
.on-blue .btn:hover { background: rgba(230, 232, 245, 0.14); }
.on-blue :focus-visible { outline-color: var(--pale); }

.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row .inp { flex: 1 1 200px; }
/* In a narrow rail the field and button stack rather than squeezing side by
   side. flex must be reset — in a column, `flex: 1 1 200px` sets the height. */
.form-stack { flex-direction: column; }
.form-stack .inp, .form-stack .btn { flex: none; width: 100%; height: 38px; }
.form-note { font: 400 12.5px/1.5 var(--font-body); color: var(--tertiary); margin: 10px 0 0; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ────────────────────────────────────────────────────────  hero  ── */

.hero { background: var(--dos); padding: clamp(40px, 6.5vw, 63px) var(--gutter) clamp(36px, 5.6vw, 56px); }
.hero-inner { max-width: 1200px; margin: 0 auto; }
.hero-copy { max-width: 720px; }
.hero .lede { margin: 22px 0 0; }
.hero-stat { font: 400 12.5px/1.6 var(--font-body); color: var(--tertiary); margin-top: 12px; }

/* ─────────────────────────────────────────────────────  archive  ── */

.cardgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }

.split {
  display: grid; grid-template-columns: 1.15fr 1fr;
  gap: clamp(24px, 4vw, 40px); align-items: center;
}
.split-rail, .split-rail-wide {
  display: grid; grid-template-columns: 1fr 300px;
  gap: clamp(24px, 4vw, 49px); align-items: start;
}
.split-rail-wide { grid-template-columns: 1fr 320px; }
.split-start { align-items: start; }

.rail { display: flex; flex-direction: column; gap: 20px; }

/* The archive table. Below 720px each row restacks as a verdict-led card —
   a four-column grid is unreadable on a phone. */
.checktable { display: flex; flex-direction: column; }
.checkrow {
  display: grid;
  grid-template-columns: 96px 1fr 190px 108px;
  gap: var(--space-8);
  align-items: baseline;
  padding: var(--space-6) 0;
}
.checkhead {
  font: 500 10.5px var(--font-body);
  letter-spacing: 0.12em;
  color: var(--color-neutral-500);
  padding: 0 0 var(--space-4);
  align-items: end;
}
.checkrow .claim { font: 400 15.5px/1.45 var(--font-body); color: var(--color-text); }
a.checkrow { color: inherit; }
a.checkrow:hover .claim { color: var(--pale); text-decoration: underline; }
.checkrow .verdict { justify-self: start; }

.filterbar {
  display: flex; gap: 12px; flex-wrap: wrap;
  align-items: center; justify-content: space-between;
}
.filterbar form { display: flex; flex: 1 1 260px; max-width: 420px; }
.counts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.count-btn { cursor: pointer; font-family: var(--font-body); }
.count-btn[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }
.filter-empty { padding: var(--space-8) 0; }

/* ───────────────────────────────────────────────────────  entry  ── */

.crumb { font: 400 12.5px/1.5 var(--font-body); color: var(--color-neutral-500); }
.crumb a { color: var(--color-neutral-400); }
.crumb a:hover { color: var(--color-text); }

.claim-h1 {
  font: 500 clamp(26px, 3.6vw, 34px) / 1.24 var(--font-heading);
  letter-spacing: -0.02em;
  color: var(--pale);
  margin: 16px 0 0;
  max-width: 20em;
}

.steps { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6) 28px; max-width: 38em; }
.step { display: flex; gap: 12px; }
.step-n { font: 500 15px var(--font-heading); color: var(--color-neutral-600); flex: none; }
.step-t { font: 400 14.5px/1.5 var(--font-body); color: var(--color-neutral-300); }
.step-on .step-n { color: var(--pale); }
.step-on .step-t { color: var(--color-text); }

/* ──────────────────────────────────────────────────  newsletter  ── */

/* 5c — "The prompt that caught it": the bad version, the fixed version, and
   the thing the fix actually caught. */
.prompt-bad, .prompt-good {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font: 400 13.5px/1.55 var(--font-body);
}
.prompt-bad { background: rgba(0, 0, 0, 0.2); color: var(--tertiary); text-decoration: line-through; }
.prompt-good { background: rgba(230, 232, 245, 0.1); color: var(--pale); }
.prompt-good em { color: var(--pale); font-style: italic; }

.nl-card { padding: clamp(24px, 3.4vw, 36px) clamp(22px, 3vw, 34px); }
.nl-title {
  font: 500 clamp(22px, 2.9vw, 28px) / 1.2 var(--font-heading);
  letter-spacing: -0.02em; color: var(--pale);
}
.nl-sub { font: 400 15px/1.65 var(--font-body); color: var(--secondary); margin: 16px 0 22px; max-width: 30em; }
.nl-rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

.strip { display: flex; flex-direction: column; gap: 8px; }
.strip-item { display: flex; gap: 11px; align-items: baseline; }
.strip-item span:last-child { font: 400 13px/1.5 var(--font-body); color: var(--accent); }

/* ──────────────────────────────────────────────────────  footer  ── */

.footer { background: var(--dos); padding: clamp(32px, 4vw, 44px) var(--gutter); margin-top: auto; }
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: var(--space-8) clamp(24px, 5vw, 60px);
  justify-content: space-between; align-items: flex-start;
}
.footer a { color: var(--secondary); }
.footer a:hover { color: var(--pale); }
.footer-tag { font: 400 12.5px/1.6 var(--font-body); color: var(--secondary); max-width: 24em; }
.footer-col { display: flex; flex-direction: column; gap: 9px; font: 400 13px var(--font-body); }
.footer-h { font: 500 10px var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--tertiary); }
.footer-legal { font: 400 11.5px var(--font-body); color: var(--tertiary); }

.page { display: flex; flex-direction: column; min-height: 100vh; }
.page > main { flex: 1; }

/* ─────────────────────────────────────────────────  responsive  ── */

@media (max-width: 900px) {
  .cardgrid { grid-template-columns: 1fr; }
  .split, .split-rail, .split-rail-wide { grid-template-columns: 1fr; align-items: start; }
  /* On one column the rail follows the article rather than floating beside it. */
  .rail { flex-direction: column; }
}

@media (max-width: 720px) {
  .checkhead { display: none; }
  .checkrow {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: var(--space-8) 0;
  }
  .checkrow .claim { font-size: 16px; }
  .checkrow .meta-source::before { content: "Checked against "; color: var(--color-neutral-600); }
  .steps { grid-template-columns: 1fr; }
  .nav { min-height: 0; padding-block: 14px; }
  .navlinks { width: 100%; gap: 16px; }
  .footer-inner { flex-direction: column; gap: var(--space-8); }
}

@media (max-width: 480px) {
  .btn { width: 100%; }
  .btn-row { flex-direction: column; align-items: stretch; }
  .form-row .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
