/* ──────────────────────────────────────────────────────────────────────
   Styx Mill — Base styles

   Reset + typography + base elements. Structural; intentionally
   separable from brand tokens (see tokens.css) so this file carries
   across to the eventual NRL portfolio rebuild without modification.
   ────────────────────────────────────────────────────────────────────── */

/* ── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Reserve scrollbar gutter so layout doesn't shift between pages */
  scrollbar-gutter: stable;
}

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

img, picture, video, svg { max-width: 100%; display: block; height: auto; }

a {
  color: var(--colour-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--motion-fast) var(--ease);
}
a:hover { color: var(--colour-accent-hover); }
a:focus-visible {
  outline: 2px solid var(--colour-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

button { font: inherit; cursor: pointer; }

/* ── Typography ────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;                 /* Fraunces reads elegant + premium at 400 */
  font-optical-sizing: auto;
  line-height: var(--line-tight);
  color: var(--colour-brand);       /* deep teal headings — richer than near-black */
  letter-spacing: -0.005em;
  text-wrap: balance;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { line-height: var(--line-normal); text-wrap: pretty; }
p + p { margin-top: var(--space-4); }

.lead {
  font-size: var(--text-md);
  line-height: var(--line-snug);
  color: var(--colour-text);
}

small, .text-small { font-size: var(--text-sm); }
.text-muted   { color: var(--colour-text-muted); }
.text-soft    { color: var(--colour-text-soft); }

/* Lists — restrained */
ul, ol { padding-left: 1.25em; }
li + li { margin-top: var(--space-2); }

dl { display: grid; grid-template-columns: max-content 1fr; column-gap: var(--space-5); row-gap: var(--space-2); }
dt { color: var(--colour-text-soft); font-size: var(--text-sm); }
dd { font-weight: 500; }

/* ── Layout primitives ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--layout-max);
  margin-inline: auto;
  padding-inline: var(--layout-gutter);
}

.container--narrow { max-width: var(--layout-narrow); }

.section {
  padding-block: var(--space-9);
}
.section--tight { padding-block: var(--space-7); }
.section--tinted { background: var(--colour-surface-tint); }

/* ── Skip link (accessibility) ─────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--colour-text);
  color: var(--colour-surface);
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  border-radius: var(--radius);
  z-index: 1000;
}
.skip-link:focus { top: var(--space-4); color: var(--colour-surface); }

/* ── Visually hidden (screen-reader only) ─────────────────────────── */
.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 ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ── Print baseline ────────────────────────────────────────────────── */
@media print {
  body { background: white; color: black; }
  .site-header, .site-footer, .cta-band { display: none; }
  a { color: black; text-decoration: underline; }
}
