/* ─────────────────────────────────────────────────────
   FILE: base.css
   Purpose: Reset, document defaults, layout utilities,
            section primitives, accessibility helpers.
   ───────────────────────────────────────────────────── */

/* ── Reset (Eric Meyer-style, trimmed) ─────────────── */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, figure,
figcaption, footer, header, hgroup, menu, nav,
output, ruby, section, summary, time, mark, audio, video,
button, input, select, textarea {
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  vertical-align: baseline;
}

article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, main {
  display: block;
}

ol, ul { list-style: none; }
blockquote, q { quotes: none; }
blockquote::before, blockquote::after,
q::before, q::after { content: ''; content: none; }
table { border-collapse: collapse; border-spacing: 0; }

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

/* ── Document defaults ─────────────────────────────── */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 8px);
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }

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

/* ── Focus states (accessibility) ──────────────────── */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-md);
}

/* ── Layout primitives ─────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--section-pad-x);
  padding-right: var(--section-pad-x);
  width: 100%;
}

.section {
  padding: var(--section-pad-y) var(--section-pad-x);
}
.section + .section { border-top: 1px solid var(--color-border); }
.section__inner { max-width: var(--max-width); margin: 0 auto; }

/* ── Section label ("// What I do") ────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-8);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.section-label::before { content: '//'; opacity: 0.6; }
.section-label::after {
  content: '';
  flex: 0 0 32px;
  height: 1px;
  background: var(--color-accent);
  opacity: 0.35;
}

/* ── Headings utility ──────────────────────────────── */
.h-display {
  font-size: var(--text-hero);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  line-height: 0.96;
  color: var(--color-text);
}
.h-section {
  font-size: clamp(28px, 3.5vw, 36px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: var(--leading-tight);
  color: var(--color-text);
}

/* ── Visually hidden but accessible ────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Reduced motion respect ────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
