/* Site-wide tokens. Direction: editorial, light (chosen 2026-10-02). */
:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #6b6b6b; /* 5.3:1 on bg */
  --color-accent: #c2410c; /* 5.2:1 on bg */
  --color-border: #d4d4d4;
  --font-body: 'Inter Tight Variable', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 2rem;
  --space-4: 4rem;
  --measure: 65ch;
  --page-width: 72rem;
}

/* Dark theme, set per door via BaseLayout's `theme` prop. */
:root[data-theme='dark'] {
  --color-bg: #0e0e0e;
  --color-text: #e8e6e1;
  --color-muted: #9a9893; /* 6.7:1 on bg */
  --color-accent: #ff6a2b; /* 6.8:1 on bg */
  --color-border: #2e2e2c;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: clip; /* full-bleed elements never cause sideways scroll */
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a {
  transition: color 150ms ease-out, text-decoration-color 150ms ease-out, text-underline-offset 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
a:hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
  text-underline-offset: 0.32em;
}

/* Trailing arrows nudge toward where the link goes. */
a > span[aria-hidden='true']:last-child {
  display: inline-block;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
a:hover > span[aria-hidden='true']:last-child,
a:focus-visible > span[aria-hidden='true']:last-child { transform: translateX(0.2em); }

/* Browser surfaces carry the palette too. */
::selection { background: var(--color-accent); color: #fff; } /* 5.2:1 */
html { caret-color: var(--color-accent); accent-color: var(--color-accent); }

/* Cross-document view transitions: shared titles and images morph between pages.
   Browsers without support simply navigate. */
@view-transition { navigation: auto; }
::view-transition-group(*) {
  animation-duration: 450ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
::view-transition-old(root) { animation-duration: 150ms; }
::view-transition-new(root) { animation-duration: 250ms; }

h1, h2, h3 { font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
h1 {
  font-size: clamp(2.5rem, 7vw, 6rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

/* Small uppercase label style shared by nav, section heads, and meta. */
.label {
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

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

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  a > span[aria-hidden='true']:last-child { transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
