/* ═══════════════════════════════════════════════════════
   core.css: the small sheet every base loads, the overlay bases that do not extend public_base.html included.
   Skip link, reset, focus ring, the scale tokens and the below-the-fold helper. Nothing here is a brand decision.
   Every colour has a hard fallback; every token sits in :where(:root) (specificity 0), so a site's own :root wins.
   ═══════════════════════════════════════════════════════ */

:where(:root) {
  /* `--bg` is what the skip link and any ported component read; the template's page colour is --paper. */
  --bg: var(--paper, #fff);
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Type scale: 7 steps, nothing under 12 px. */
  --fs-display: clamp(2.25rem, 1.2rem + 4.4vw, 3.5rem);
  --fs-h2: clamp(1.625rem, 1.3rem + 1.4vw, 2.25rem);
  --fs-h3: 1.25rem;
  --fs-lead: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-label: 0.75rem;

  /* Spacing, the 4 px scale. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --section-y: clamp(4rem, 3rem + 4vw, 6rem);
  --gutter: clamp(1rem, 0.5rem + 2.2vw, 1.5rem);

  /* Radius: controls, cards, pills. */
  --radius-control: 6px;
  --radius-card: 8px;

  /* A control outline that reaches 3:1 on the page, drawn from the site's own border and ink. */
  --border-strong: color-mix(in srgb, var(--border, #c8c8c8) 45%, var(--ink, #111) 55%);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Never slant or embolden a face that has no italic or bold: the metrics stay the designer's. */
  font-synthesis: none;
}

/* Form controls take the page type, not the browser's. */
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }

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

h1, h2, h3 { text-wrap: balance; }

/* Focus: one 2 px ring in the accent, offset so it never touches the control's own border. */
:focus-visible {
  outline: 2px solid var(--accent, currentColor);
  outline-offset: 2px;
}

/* Skip link: off-screen until it takes focus, then the first thing on the page. */
.skip-link {
  position: fixed;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  z-index: 1000;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  background: var(--ink, #111);
  color: var(--bg, #fff);
  font: 600 0.875rem/1.2 var(--font-body, system-ui, sans-serif);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.18s ease-out;
}
.skip-link:focus { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .skip-link { transition: none; }
}

/* A section below the first screen: the browser skips its layout and paint until it nears the viewport.
   Never on the hero, nor on a section a script measures or an anchor jumps to on load. */
.cv-auto {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}
