/* ============================================================================
   THE AGULHAS REPORT — SHARED BASE
   Reset + primitives shared by the marketing site and the reading app.
   Import order in any page:  fonts.css → tokens.css → base.css → (page css)
   ============================================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1; /* old-style figures = research-house feel */
}

img, svg, video, canvas { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

/* ---- Headings: the display serif voice -------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: 0.005em;
  color: var(--text);
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); line-height: var(--leading-snug); }
h4 { font-size: var(--step-1); line-height: var(--leading-snug); }
p { max-width: var(--measure); }

/* ---- Eyebrow / coordinate label (the signature nautical caption) ------ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--accent-ink);
}
.eyebrow--muted { color: var(--text-faint); }

/* A run of nautical metadata separated by spaced bars, like the cover. */
.coordinate-bar {
  display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-faint);
}
.coordinate-bar > * { position: relative; }
.coordinate-bar > * + *::before {
  content: ""; position: absolute; left: calc(var(--space-4) * -0.5);
  top: 50%; height: 0.9em; width: 1px; transform: translate(-50%, -50%);
  background: currentColor; opacity: 0.4;
}

/* ---- Layout primitives ------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--space-5); }
.container--narrow { max-width: var(--container-narrow); }
.stack > * + * { margin-top: var(--flow, var(--space-4)); }
.section { padding-block: clamp(var(--space-8), 10vw, var(--space-10)); }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  --_bg: var(--ink-800); --_fg: var(--cream-100); --_bd: var(--ink-800);
  display: inline-flex; align-items: center; gap: var(--space-3);
  font-family: var(--font-mono); font-size: var(--step--1); font-weight: 500;
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  padding: 0.95em 1.6em; border-radius: var(--radius);
  background: var(--_bg); color: var(--_fg); border: 1px solid var(--_bd);
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur) var(--ease-out),
              background var(--dur) var(--ease-out);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(0); }
.btn--accent { --_bg: var(--beam-500); --_fg: var(--ink-900); --_bd: var(--beam-500); }
.btn--accent:hover { --_bg: var(--beam-400); }
.btn--ghost { --_bg: transparent; --_fg: var(--text); --_bd: var(--surface-line); }
.btn--ghost:hover { --_bd: var(--accent); }
.btn .btn__icon { width: 1.1em; height: 1.1em; }

/* ---- Accessibility ----------------------------------------------------- */
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; border-radius: 2px; }
.visually-hidden {
  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: var(--space-4); top: -100px; z-index: var(--z-modal);
  background: var(--ink-800); color: var(--cream-100); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius); transition: top var(--dur) var(--ease-out);
}
.skip-link:focus { top: var(--space-4); }

/* A thin horizon rule — the two currents meeting. Use as a section divider. */
.horizon-rule { height: 2px; border: 0; background: var(--grad-horizon); opacity: 0.85; }
