/* Base: reset, type, layout primitives, accessibility defaults */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--s-4));
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  margin: 0;
  color: var(--text-head);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-2xl); line-height: var(--lh-tight); letter-spacing: -0.028em; }
h2 { font-size: var(--fs-xl); line-height: 1.12; letter-spacing: -0.022em; }
h3 { font-size: var(--fs-md); }

p, ul, ol, dl, figure, blockquote { margin: 0; }
p { text-wrap: pretty; }

a {
  color: var(--cyan);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--dur) var(--ease-out);
}
a:hover { color: var(--cyan-hi); }

strong { color: var(--text-head); font-weight: 600; }
code, kbd, samp { font-family: var(--font-mono); font-size: 0.92em; }

::selection { background: rgba(46, 195, 212, 0.3); color: var(--text-head); }

/* Focus: one consistent, high-contrast ring everywhere (WCAG 2.4.7 / 2.4.13) */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: var(--s-3);
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  background: var(--gold);
  color: var(--void);
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease-out);
}
.skip-link:focus-visible { transform: none; outline-color: var(--text-head); }

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

/* Layout primitives */
.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); position: relative; }
.section--base { background: var(--base); }
.section--rule { border-top: 1px solid var(--line); }

.stack > * + * { margin-top: var(--s-4); }
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--s-4); }
.prose h2 { margin-top: var(--s-7); font-size: var(--fs-lg); }
.prose h3 { margin-top: var(--s-6); }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: var(--s-2); }
.prose li::marker { color: var(--gold); }

/* Eyebrow — terminal-style section label */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: currentColor;
}

.lede { font-size: var(--fs-md); color: var(--text); max-width: 58ch; }
.muted { color: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Windows High Contrast / forced colours: keep boundaries and focus visible */
@media (forced-colors: active) {
  .btn, .card, .field input, .field select, .field textarea { border: 1px solid CanvasText; }
  :focus-visible { outline: 2px solid Highlight; }
  .board-canvas, .hero__poster { display: none; }
}

@media print {
  .site-header, .board-canvas, .hero__poster, .contact-form, .site-footer nav { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: #000; }
}
