/* ============================================================================
   base.css — UNIVERSAL STRUCTURAL SCAFFOLD. Reuse as-is every build.
   Holds: reset, blank design-token slots, layout primitives, reveal base,
   responsive nav, a11y, reduced-motion. NO design values live here.
   Put ALL look (colour, type, spacing scale, components) in design.css — fresh per build.
   ========================================================================== */

/* ---- Design tokens: FILL THESE in design.css :root, don't hardcode below ---- */
:root {
  --bg:        #ffffff;   /* TODO override */
  --ink:       #111111;   /* TODO override */
  --muted:     #666666;   /* TODO override */
  --accent:    #000000;   /* TODO override — ONE saturated accent */
  --line:      rgba(0,0,0,.12);
  --font-display: Georgia, serif;      /* TODO override */
  --font-body:    system-ui, sans-serif; /* TODO override */
  --container: 1200px;
  --gutter: clamp(1rem, 4vw, 3rem);
  --nav-bp: 820px; /* burger below this */
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* guard horizontal scroll; FIX root cause too */
}
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.1; text-wrap: balance; }
p { text-wrap: pretty; }
ul[class] { list-style: none; padding: 0; }

/* ---- Layout primitives ---- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section  { padding-block: clamp(3rem, 8vw, 7rem); }

/* ---- A11y ---- */
.skip-link {
  position: absolute; left: .5rem; top: -3rem; z-index: 1000;
  background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: .25rem;
  transition: top .2s;
}
.skip-link:focus { top: .5rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---- Header / nav (structural; skin in design.css) ---- */
.site-header { position: sticky; top: 0; z-index: 100; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
       max-width: var(--container); margin-inline: auto; padding: 1rem var(--gutter); }
.nav__menu { display: flex; gap: clamp(1rem, 2.5vw, 2.25rem); align-items: center; }
.nav__toggle { display: none; flex-direction: column; gap: 5px; padding: .5rem; }
.nav__toggle span { width: 24px; height: 2px; background: currentColor; transition: transform .3s, opacity .3s; }

@media (max-width: 820px) {
  .nav__toggle { display: flex; }
  .nav__menu {
    position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px);
    flex-direction: column; align-items: flex-start; gap: 1.25rem;
    padding: 5rem var(--gutter); background: var(--bg);
    transform: translateX(100%); transition: transform .35s ease; will-change: transform;
  }
  .nav__menu.is-open { transform: translateX(0); }
  body.nav-open { overflow: hidden; }
}

/* ---- Reveal base (paired with js/reveal.js) ---- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-plx] { will-change: transform; } /* parallax targets */

/* ---- Footer (structural) ---- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; gap: 1.25rem; }

/* ---- Reduced motion: kill all transitions/animations, reveal instantly ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
