/* ============================================================
   base.css — Reset, typography, fonts, shared primitives
   Load order: tokens.css → base.css → home.css
   ============================================================ */

/* ---- Self-hosted fonts (latin subset) ----
   size-adjust 112% tunes Cormorant against the Georgia fallback so the swap is CLS-neutral. */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  size-adjust: 112%;
  src: url('../fonts/cormorant-garamond-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  size-adjust: 112%;
  src: url('../fonts/cormorant-garamond-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  size-adjust: 112%;
  src: url('../fonts/cormorant-garamond-600-italic.woff2') format('woff2');
}
/* Castoro Titling — section numerals only. No size-adjust (position:absolute can't shift layout)
   and no preload (below the fold). Digits U+0030-0039 are in the latin subset, not latin-ext. */
@font-face {
  font-family: 'Castoro Titling';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/castoro-titling-400.woff2') format('woff2');
}
/* Inter — body text only. No size-adjust: its metrics are close to the system-sans fallback,
   so the swap is CLS-neutral. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-400.woff2') format('woff2');
}
/* No Inter 600 @font-face: weight-600 micro-text renders in the platform bold, and
   .about__body strong is overridden to the display serif. */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden; /* off-canvas drawer is fixed → clip viewport x-overflow */
  overflow-x: clip;
  /* Explicit canvas colour: a propagated body background isn't part of the
     blending backdrop the accent's multiply layer blends against. */
  background-color: var(--bg);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Two faces: h1 (the hero name) keeps Cormorant; every other heading is monospace. */
h1 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  line-height: 0.95;
  letter-spacing: var(--track-display);
  margin: 0;
  text-wrap: pretty;
}
h2, h3, h4 {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: pretty;
}

p {
  margin: 0;
  max-width: 62ch;
  text-wrap: pretty;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Shared primitives ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Section spacing + anchor offset for sticky nav */
section[id] {
  scroll-margin-top: calc(var(--nav-h) + 8px);
}

/* Eyebrow / kicker label */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cobalt);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--cobalt);
  opacity: 0.6;
}

.accent {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 600;
}

/* Pill button (UI micro-text) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--r-pill);
  background: var(--cobalt);
  color: #fff;
  transition: transform var(--dur) var(--ease-soft),
              background-color var(--dur) var(--ease-soft),
              box-shadow var(--dur) var(--ease-soft);
  box-shadow: 0 6px 20px rgba(31, 78, 140, 0.25);
}
.btn:hover {
  background: var(--cobalt-deep);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(31, 78, 140, 0.32);
}
.btn:active {
  transform: translateY(0);
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  border: 1px solid var(--line-strong);
}
.btn--ghost:hover {
  background: var(--surface);
  border-color: var(--cobalt);
  color: var(--cobalt);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--cobalt);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--r-md) 0;
  z-index: 9999;
}
.skip-link:focus {
  left: 0;
}

/* Reduced motion: neutralize reveals */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
