/* ============================================================================
   base.css — reset, document base, typography defaults, theming
   ============================================================================ */

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

* { margin: 0; }

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

body {
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }

button, input, textarea, select { font: inherit; color: inherit; }

ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

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

::selection { background: var(--c-brand); color: #fff; }

/* — Headings: serif display, optical tightening ————————————————————————— */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}
h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 600;
  line-height: var(--lh-snug);
}

p { text-wrap: pretty; }

/* — Mono small-caps label (the recurring "spec" label) ————————————————— */
.label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--c-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}
.label::before {
  content: "";
  width: 1.6em;
  height: 1px;
  background: var(--c-accent);
  flex: none;
}
.label--bare::before { display: none; }

/* — Section theming: ink (default) vs bone paper ——————————————————————— */
.section { padding-block: var(--section-y); position: relative; }

.theme-ink   { background: var(--c-bg);     color: var(--c-ink); }
.theme-deep  { background: var(--c-bg-2);   color: var(--c-ink); }
.theme-paper { background: var(--c-paper);  color: var(--c-paper-ink); }

.theme-paper .label        { color: var(--c-paper-muted); }
.theme-paper .label::before { background: var(--c-accent-deep); }
.theme-paper a:not(.btn)   { color: var(--c-paper-ink); }

/* Hairline divider used between bands */
.theme-ink   + .theme-ink   { border-top: var(--hair) solid var(--c-line); }
.theme-paper { border-block: var(--hair) solid var(--c-paper-line); }

/* Lead paragraph */
.lead {
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--c-muted);
  max-width: 54ch;
}
.theme-paper .lead { color: var(--c-paper-muted); }

.muted { color: var(--c-muted); }
.theme-paper .muted { color: var(--c-paper-muted); }

/* Visually hidden (a11y) */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--sp-sm);
  top: -100%;
  z-index: 200;
  background: var(--c-ink);
  color: var(--c-bg);
  padding: var(--sp-2xs) var(--sp-sm);
  border-radius: var(--r-sm);
  transition: top var(--dur-2) var(--ease-out);
}
.skip-link:focus { top: var(--sp-sm); }

/* — Reduced motion: reveal everything, kill animation ——————————————————— */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
