/* Design tokens and global defaults.
   Values come from design_spec.json — contrast ratios were verified
   against the WCAG relative-luminance formula, not eyeballed. */

/* ── Fonts ─────────────────────────────────────────────────────────
   Self-hosted variable woff2, latin subset only. Serving them from
   our own origin removes two preconnects and a render-blocking
   stylesheet from a third party, and lets the CSP stay at 'self'
   for both style-src and font-src.
   All three are SIL Open Font License 1.1 — see assets/fonts/LICENSE-*.txt */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;      /* variable wght axis */
  font-display: swap;
  src: url("../assets/fonts/fraunces-latin-var.woff2") format("woff2-variations");
}

@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/inter-tight-latin-var.woff2") format("woff2-variations");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-latin-var.woff2") format("woff2-variations");
}

:root {
  /* Colour */
  --bg: #0D0D0F;
  --surface: #16161A;
  --surface-high: #1F1F25;
  --border: #2A2A31;
  --text: #F2F0ED;
  --text-muted: #9A968F;
  --text-faint: #5F5E5A;
  --accent: #E8873A;          /* 7.36:1 on --bg — AAA */
  --accent-hover: #F5A05C;
  --accent-soft: rgba(232, 135, 58, 0.12);
  --accent-line: rgba(232, 135, 58, 0.4);

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --size-hero-name: clamp(3rem, 11vw, 9rem);
  --size-hero-role: clamp(0.75rem, 1.4vw, 0.9375rem);
  --size-section: clamp(2rem, 5vw, 3.75rem);
  --size-work-title: clamp(1.6rem, 3.5vw, 2.5rem);
  --size-body: clamp(1rem, 1.05vw, 1.125rem);
  --size-body-lg: clamp(1.125rem, 1.6vw, 1.375rem);
  --size-mono: 0.8125rem;

  /* Space */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;
  --space-7: 104px;
  --space-8: 160px;

  --radius: 2px;
  --radius-img: 4px;

  --gutter: clamp(24px, 5vw, 80px);
  --container: 1280px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 200ms;
  --dur-reveal: 600ms;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { margin: 0; font-family: var(--font-display); line-height: 1.1; font-weight: 700; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

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

/* Visible focus that survives a dark background. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius);
}

:target { scroll-margin-top: 96px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--accent);
  color: var(--bg);
  font-weight: 500;
}

.skip-link:focus {
  left: var(--space-3);
  top: var(--space-3);
}

@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;
    scroll-behavior: auto !important;
  }
}
