/* ==========================================================================
   base.css — reset, typography and layout helpers.
   ========================================================================== */

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

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

button { font: inherit; color: inherit; }

h1, h2, h3, h4 { margin: 0; line-height: 1.08; }
p { margin: 0; }

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

/* ---------- helpers ---------- */
.mono { font-family: var(--font-mono); }

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

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent-deep); color: var(--on-accent);
  padding: 12px 16px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 16px; color: var(--on-accent); }

/* ---------- type scale ---------- */
.h-section {
  font-size: clamp(36px, 4.4vw, 60px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.h-sub {
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.lead { font-size: 18px; line-height: 1.6; color: var(--fg-2); max-width: 620px; }
.muted { color: var(--fg-2); }
.label { font-family: var(--font-mono); font-size: 13px; color: var(--link); }

/* Smooth colour fade only while the theme is switching (added by theme.js) */
.theme-anim *,
.theme-anim *::before,
.theme-anim *::after {
  transition: background-color .45s ease, color .45s ease, border-color .45s ease, fill .45s ease, stroke .45s ease !important;
}
