/* ------------------------------------------------------------------ *
 * Tokens, reset, typography, shared primitives.
 * Dark by default — the subject matter earns it — with a light theme
 * for anyone whose system asks for one.
 * ------------------------------------------------------------------ */

:root {
  --ink:        #e9ecef;
  --ink-soft:   #a7b0ba;
  --ink-faint:  #6d7681;
  --bg:         #0b0d10;
  --bg-raised:  #12161a;
  --bg-sunken:  #08090b;
  --line:       #232830;
  --line-soft:  #1a1e24;

  --accent:      #e8c547;   /* signal lamp */
  --accent-ink:  #0b0d10;
  --danger:      #c8452f;   /* stop */
  --calm:        #5b9c8f;   /* clear */
  --warn:        #d98c3f;

  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 1px 0 rgba(255,255,255,.03), 0 18px 48px -24px rgba(0,0,0,.85);

  --measure: 68ch;
  --serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --step: clamp(1rem, 0.94rem + 0.3vw, 1.125rem);
}

@media (prefers-color-scheme: light) {
  :root {
    --ink:       #14181d;
    --ink-soft:  #4c545d;
    --ink-faint: #7b848e;
    --bg:        #f6f4ef;
    --bg-raised: #fffdf8;
    --bg-sunken: #ece8df;
    --line:      #ddd7ca;
    --line-soft: #e8e3d8;
    --accent:    #a8801a;
    --accent-ink:#fffdf8;
    --danger:    #a83521;
    --calm:      #3d7a6d;
    --warn:      #a8661f;
    --shadow:    0 1px 0 rgba(255,255,255,.6), 0 14px 40px -28px rgba(0,0,0,.5);
  }
}

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -0.015em; }
p { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
code { font-family: var(--mono); font-size: .88em; background: var(--bg-sunken);
       padding: .12em .4em; border-radius: 5px; }

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

/* Views move focus to their heading on navigation so screen readers announce the
   change. That is programmatic, not a keyboard journey, so it must not paint a ring. */
:where(h1, h2, h3, h4)[tabindex="-1"]:focus,
:where(h1, h2, h3, h4)[tabindex="-1"]:focus-visible {
  outline: none;
}

.sr-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; inset-inline-start: 1rem; inset-block-start: 1rem; z-index: 99;
  background: var(--accent); color: var(--accent-ink);
  padding: .6rem 1rem; border-radius: var(--radius-sm); font-family: var(--sans);
}

.app {
  max-width: 62rem;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 3.5rem) clamp(1.1rem, 4vw, 2rem) 4rem;
}

.view { animation: rise .34s cubic-bezier(.2,.7,.3,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* --- Typographic primitives --------------------------------------- */

.eyebrow {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .9rem;
}

.section-title {
  font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.85rem);
  margin-bottom: .35rem;
}

.section-blurb {
  font-family: var(--sans);
  font-size: .92rem;
  color: var(--ink-soft);
  max-width: var(--measure);
  margin-bottom: 0;
}

.prose { max-width: var(--measure); }
.prose p { color: var(--ink-soft); }

/* --- Buttons ------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1;
  padding: .95rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.btn:hover { border-color: var(--ink-faint); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover { filter: brightness(1.07); border-color: var(--accent); }

.btn--ghost { background: transparent; }
.btn--small { padding: .6rem 1rem; font-size: .85rem; }

/* --- Shared blocks -------------------------------------------------- */

.disclaimer {
  margin-top: 3rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
}
.disclaimer__title {
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--warn);
  margin-bottom: .8rem;
}
.disclaimer p { font-size: .92rem; color: var(--ink-soft); }

.fatal { padding: 4rem 0; max-width: var(--measure); }
.fatal h1 { font-size: 2rem; margin-bottom: 1rem; }
.fatal p { color: var(--ink-soft); }

.site-footer {
  max-width: 62rem;
  margin: 0 auto;
  padding: 2.5rem clamp(1.1rem, 4vw, 2rem) 3rem;
  border-top: 1px solid var(--line-soft);
  font-family: var(--sans);
  font-size: .8rem;
  color: var(--ink-faint);
}
.site-footer p { margin-bottom: .5rem; max-width: var(--measure); }
.site-footer__meta { display: flex; gap: .75rem; flex-wrap: wrap; }
