/* ============================================================
   base.css — typography defaults, links, body rhythm, focus,
   skip link. Element-level defaults only (no components).
   ============================================================ */

/* ---- Self-hosted fonts (latin subset, woff2, display:swap) ---- */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../../fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../../fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../../fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../../fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500; font-display: swap; src: url('../../fonts/space-grotesk-500.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 600; font-display: swap; src: url('../../fonts/space-grotesk-600.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 700; font-display: swap; src: url('../../fonts/space-grotesk-700.woff2') format('woff2'); }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  text-rendering: optimizeLegibility;
}

/* ---- Headings — display font, fluid clamp sizing ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--color-text);
  text-wrap: balance;
}

h1 { font-size: clamp(var(--fs-2xl), 1.6rem + 3.4vw, var(--fs-4xl)); font-weight: 700; }
h2 { font-size: clamp(var(--fs-xl), 1.4rem + 2.2vw, var(--fs-3xl)); }
h3 { font-size: clamp(var(--fs-lg), 1.1rem + 1.1vw, var(--fs-2xl)); }
h4 { font-size: clamp(var(--fs-md), 1rem + 0.5vw, var(--fs-xl)); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); letter-spacing: 0; }

p { line-height: 1.7; }

/* ---- Links — non-color cue required for inline links (WCAG) ---- */
a { color: var(--color-accent-deep); }
a:hover { color: var(--color-primary); }

/* Inline text links inside prose get an underline cue */
.prose a,
p > a:not([class]) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

strong, b { font-weight: 700; }

small { font-size: var(--fs-sm); }

/* ---- Lists in prose keep markers ---- */
.prose ul, .prose ol { padding-inline-start: var(--space-lg); }
.prose li + li { margin-block-start: var(--space-xs); }

/* ---- Selection ---- */
::selection {
  background-color: var(--color-primary-deep);
  color: var(--color-text-inverse);
}

/* ---- Focus visible — global, distinct, never removed without replacement ---- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---- Skip link — first focusable element ---- */
.skip-link {
  position: absolute;
  inset-block-start: var(--space-sm);
  inset-inline-start: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  z-index: 9999;
  transform: translateY(-200%);
  transition: transform var(--transition-base);
}
.skip-link:focus { transform: translateY(0); }

/* ---- Icon defaults (inline SVG sprite) ---- */
.icon {
  inline-size: 1.5em;
  block-size: 1.5em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  vertical-align: middle;
}

/* The hidden SVG sprite container */
.svg-sprite { display: none; }

/* Visually hidden but available to screen readers */
.visually-hidden {
  position: absolute;
  inline-size: 1px; block-size: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
