/* ── Fonts ──────────────────────────────────────────────────
   Self-hosted latin subsets (from Google Fonts), so no visitor data goes to
   Google. DM Sans is a variable font: one file covers every weight. */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/dm-sans-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Libre Caslon Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/libre-caslon-display-latin.woff2") format("woff2");
}

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --navy: #102b4e;
  --navy-deep: #07192e;
  --navy-ink: #061426;
  --gold: #c79b4b;
  --gold-bright: #d6ae67;
  --gold-pale: #e2c689;
  --gold-dark: #7d5f2c; /* 5.2:1+ on paper and cream, for small gold text */
  --ink: #211d1b;
  --muted: #6f6760;
  --muted-light: #6f6760; /* small print: was #968a80 (3.2:1), now 4.5:1+ */
  --cream: #f5f0e7;
  --sand: #eee7dc;
  --paper: #fbf8f2;
  --line: #d7cec0;
  --line-dark: #c7baaa;
  --field-border: #857a70; /* 3:1+ against white, for inputs and switches */
  --footer-text: #b5a9a0;
  --on-dark: #cbbdbc;
  --on-dark-muted: #aeb9c6;

  --serif: "Libre Caslon Display", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1.5rem, 8vw, 7.8rem);
  --topbar-h: 6rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
blockquote,
figure,
ol,
ul {
  margin: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

.on-dark :focus-visible,
.topbar :focus-visible,
.nav-drawer :focus-visible {
  outline-color: var(--gold-pale);
}

/* The skip link's target: focusable so keyboard users land in the content,
   without a ring around the whole page. */
main:focus {
  outline: none;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--gold-pale);
  color: var(--navy-deep);
}

/* ── Typography ─────────────────────────────────────────── */
h1,
h2,
blockquote,
.serif {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(2.5rem, 4.3vw, 4.125rem);
  line-height: 1.05;
  margin-top: 1.5rem;
}

h3 {
  font-family: var(--serif);
  font-weight: 400;
}

em {
  font-style: italic;
  font-weight: 400;
  color: var(--navy);
}

.on-dark em,
.on-dark h2 em {
  color: var(--gold-pale);
}

.lead {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2vw, 1.5625rem);
  line-height: 1.45;
  margin-bottom: 1.25rem;
}

.body-copy {
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.8;
}

.body-copy + .body-copy {
  margin-top: 1.125rem;
}

/* Small caps label with a rule in front: the site's signature eyebrow */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gold-dark);
}

.eyebrow::before,
.eyebrow--centred::after {
  content: "";
  width: 2.2rem;
  height: 1px;
  background: currentColor;
  flex: 0 0 auto;
}

.on-dark .eyebrow {
  color: var(--gold-pale);
}

.eyebrow--centred {
  justify-content: center;
}

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

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--paper);
  color: var(--navy);
  font-weight: 600;
  translate: 0 -200%;
  transition: translate 0.2s;
}

.skip-link:focus {
  translate: 0 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
