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

:root {
  /*
   * Color strategy: Restrained — OKLCH tinted neutrals, no accent.
   * Hue 250–260 (cool blue-indigo); chroma 0.007–0.012 is imperceptible as "blue"
   * but lifts the surface off the blank-paper feel of pure neutrals.
   * All text tokens verified WCAG AA (4.5:1) against their backgrounds.
   */
  color-scheme: light dark;  /* native scrollbars and form elements follow theme */

  --bg:        oklch(0.991 0.007 250);  /* near-white, barely cool — ~#fcfcff */
  --text:      oklch(0.140 0.012 260);  /* cool charcoal — ~#161620           */
  --muted:     oklch(0.477 0.010 260);  /* tagline, annotations — 5.2:1 ✓     */
  --subtle:    oklch(0.510 0.008 260);  /* section labels — 4.6:1 ✓           */
  --underline: oklch(0.820 0.008 250);  /* resting link underline              */

  /* Type scale — 1.333 ratio (perfect fourth) */
  --text-display: clamp(2rem, 5vw, 3.25rem);
  --text-body: 1rem;
  --text-secondary: 0.875rem;
  --text-label: 0.6875rem;

  /* Font stack — system default; SF Pro on macOS, Segoe UI on Windows */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        oklch(0.115 0.010 260);  /* rich near-black — ~#191921   */
    --text:      oklch(0.958 0.008 250);  /* near-white, cool — ~#eeeefc  */
    --muted:     oklch(0.647 0.010 260);  /* 6.1:1 on dark bg ✓           */
    --subtle:    oklch(0.718 0.008 260);  /* 7.7:1 on dark bg ✓           */
    --underline: oklch(0.300 0.008 260);  /* dark for resting underlines  */
  }

  body {
    /* Light text on dark reads lighter — bump leading to compensate */
    line-height: 1.72;
  }
}

/* Selection follows the theme palette */
::selection {
  background: oklch(0.140 0.012 260 / 0.12);
  color: var(--text);
}

@media (prefers-color-scheme: dark) {
  ::selection {
    background: oklch(0.958 0.008 250 / 0.18);
  }
}

/* Honour motion preferences — disable transitions for users who need it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-kerning: normal;
  font-optical-sizing: auto;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  /* Fluid vertical padding: tighter on mobile, more generous on wider screens */
  padding: clamp(3rem, 8vw, 5.5rem) 1.5rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  max-width: 480px;
  margin: 0 auto;
}

/* ─── Header ─────────────────────────────────────────── */

header {
  /* Hero zone — most generous separation; name needs room to breathe */
  margin-bottom: clamp(3.5rem, 9vw, 5.5rem);
}

h1 {
  font-size: var(--text-display);
  font-weight: 400;           /* regular at display size — heavy enough, not boxy */
  letter-spacing: -0.025em;  /* negative tracking tightens large type; looks deliberate */
  line-height: 1.05;
  text-wrap: balance;
  color: var(--text);
}

.tagline {
  font-size: var(--text-secondary);
  font-weight: 400;
  color: var(--muted);
  margin-top: 0.5rem;
  letter-spacing: 0.005em;
}

/* ─── Sections ───────────────────────────────────────── */

section {
  /* Fluid section gap — breathes on wider screens */
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

/* Work sits slightly further from About — signals the shift from intro to portfolio */
#work {
  margin-top: clamp(0.25rem, 1.5vw, 0.75rem);
}

h2 {
  font-size: var(--text-label);     /* 11px — intentional eyebrow, not heading */
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--subtle);
  margin-bottom: 0.875rem;
  text-wrap: balance;
}

/* ─── Body content ───────────────────────────────────── */

p {
  font-size: var(--text-body);
  color: var(--text);
  max-width: 58ch;
}

ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;  /* was 0.4rem; wider gap improves touch spacing between targets */
}

li {
  font-size: var(--text-body);
  color: var(--text);
  line-height: 1.5;  /* tighter than body — list entries are short, don't need full leading */
}

li span {
  font-weight: 500;
}

/* ─── Links ──────────────────────────────────────────── */

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.15s ease;
}

a:hover {
  text-decoration-color: var(--text);
}

a:active {
  opacity: 0.65;
}

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