/* base.css — reset, typography, links, focus, skip-link, helpers, reduced motion. Uses tokens.css only. */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

body.is-locked { overflow: hidden; }

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

h1, h2, h3, h4 {
  margin: 0 0 var(--sp-4);
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: var(--lh-heading);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); font-weight: 700; }
h3 { font-size: var(--fs-h3); font-weight: 700; }

p, ul, ol, figure, address, blockquote { margin: 0 0 var(--sp-4); }
address { font-style: normal; }
strong, b { font-weight: 600; color: var(--color-text-strong); }
hr { border: 0; border-top: 1px solid var(--color-border); margin: var(--sp-6) 0; }

a {
  color: var(--color-accent-hover);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--color-text); }

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

/* visible focus for keyboard users */
:focus-visible {
  outline: 2px solid var(--color-white-ring);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }
main:focus { outline: none; }

::selection { background: var(--color-accent); color: var(--color-text-strong); }

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: 1000;
  padding: var(--sp-3) var(--sp-5);
  background: var(--color-accent);
  color: var(--color-text-strong);
  border-radius: var(--radius-pill);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--sp-3); }

.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;
}

[hidden] { display: none !important; }

/* reduced motion: disable animations and smooth scroll */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* root redirect page (src/index.njk) — replaces the former inline <style> (CSP without 'unsafe-inline') */
.redirect-page { display: grid; place-items: center; min-height: 100vh; min-height: 100svh; }

/* prose: text rendered from markdown — reading measure ~65ch (Design!B19:B31); spacing rules are in components.css */
.prose { max-width: 65ch; }
