/* ClaimTheStory — one stylesheet, shared by the Astro pages and the Hugo
   sections. Both render into the same origin, so a second design system would
   show up as a visible seam the moment a reader clicks from a page into a post.
   Token values are the source of truth recorded in brand/BRAND.md.

   Typography note: the wordmark and headings are set in a system serif stack as
   a stand-in. A licensed face must be self-hosted before launch, or letter
   spacing renders differently on every machine. */

:root {
  --paper: #F4F6F5;
  --panel: #FFFFFF;
  --ink: #14202B;
  --ink-soft: #47586A;
  --ink-faint: #93A3B1;
  --rule: #D8DFE2;
  --red: #B33A2B;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --measure: 66ch;
  --gutter: clamp(20px, 5vw, 32px);
}

/* The default "system" theme setting stamps nothing on the root element, so
   prefers-color-scheme is the only signal there. The :not() guard keeps an
   explicit light choice winning over a dark OS. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101A22;
    --panel: #17242E;
    --ink: #E6ECEF;
    --ink-soft: #9DAEBC;
    --ink-faint: #5F7383;
    --rule: #26353F;
    --red: #E0705C;
  }
}

:root[data-theme="dark"] {
  --paper: #101A22;
  --panel: #17242E;
  --ink: #E6ECEF;
  --ink-soft: #9DAEBC;
  --ink-faint: #5F7383;
  --rule: #26353F;
  --red: #E0705C;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.prose { max-width: var(--measure); }

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

h1, h2, h3 {
  font-weight: 400;
  letter-spacing: -.01em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.15; }
h2 { font-size: clamp(23px, 3vw, 28px); line-height: 1.25; margin-top: 2em; }
h3 { font-size: 20px; line-height: 1.35; margin-top: 1.6em; }

p { margin: 1em 0; }
a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 2px;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.lede { color: var(--ink-soft); font-size: 1.06em; }

blockquote {
  margin: 1.6em 0;
  padding-left: 20px;
  border-left: 2px solid var(--red);
  color: var(--ink-soft);
}

code, pre { font-family: var(--mono); font-size: .88em; }
pre {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 16px 18px;
  overflow-x: auto;
}

table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
th { font-family: var(--sans); font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); }

img { max-width: 100%; height: auto; }

/* Wide content scrolls inside its own box so the page body never does. */
.scroll-x { overflow-x: auto; }

/* ── the mark + wordmark ──────────────────────────────────── */

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand svg { display: block; flex: none; }
.brand .wordmark {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: -.015em;
  line-height: 1;
  white-space: nowrap;
}
.brand .wordmark .verb { color: var(--red); }
.brand .wordmark .object { color: var(--ink); }

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

.site-nav {
  border-bottom: 1px solid var(--rule);
  padding-block: 18px;
}
.site-nav .row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-nav nav { display: flex; gap: 22px; font-family: var(--sans); font-size: 14.5px; }
.site-nav nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav nav a:hover, .site-nav nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 72px;
  padding-block: 32px 56px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-faint);
}
.site-footer .row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ── post + article lists ─────────────────────────────────── */

.section-head { padding-block: 56px 8px; }
.section-head h1 { margin-bottom: 12px; }

.entry-list { list-style: none; margin: 32px 0 0; padding: 0; }
.entry-list li { padding-block: 22px; border-bottom: 1px solid var(--rule); }
.entry-list h2 { font-size: 22px; margin: 0 0 6px; }
.entry-list h2 a { color: var(--ink); text-decoration: none; }
.entry-list h2 a:hover { color: var(--red); }
.entry-list .meta {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.entry-list .summary { color: var(--ink-soft); margin: 6px 0 0; max-width: var(--measure); }

.post-head { padding-block: 56px 0; }
.post-head .meta {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 14px;
  font-variant-numeric: tabular-nums;
}
.post-body { padding-top: 8px; }

.empty {
  border: 1px dashed var(--rule);
  border-radius: 3px;
  padding: 34px 30px;
  margin-top: 32px;
  color: var(--ink-soft);
  max-width: var(--measure);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
