/* ==========================================================================
   Base — fonts, design tokens, reset, typography, and shared controls.
   Loaded first on every page, before layout.css and any page stylesheet.
   ========================================================================== */

/* Fonts ------------------------------------------------------------------- */
/* Nunito Sans is self-hosted so no page needs a font CDN in its policy. */

@font-face {
  font-family: "Nunito Sans";
  src: url("../../assets/fonts/nunito-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("../../assets/fonts/nunito-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("../../assets/fonts/nunito-sans-700.woff2") format("woff2");
  font-weight: 700 900;
  font-display: swap;
}

/* Design tokens ----------------------------------------------------------- */

:root {
  color-scheme: light;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  font-family: "Nunito Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  background: #ffffff;
  color: #000000;

  --red: #bf1e1e;
  --red-dark: #a11818;
  --pink: #ecbcbc;
  --blush: #f8eded;
  --ink: #000000;
  --paper: #ffffff;
  --line: #dcdcdc;

  /* Secondary text. 8.9:1 on white, and still 5.2:1 on the darkest pink at
     the top of .page-wash (WCAG 1.4.3). */
  --muted: #4a4a4a;

  /* Focus rings. Red on light surfaces, white on the black header and
     footer — both far above the 3:1 minimum (WCAG 1.4.11). */
  --focus-on-light: var(--red);
  --focus-on-dark: var(--paper);
}

/* Reset ------------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

h1,
h2,
h3,
p,
ul,
dl,
dd,
figure {
  margin: 0;
}

ul[role="list"] {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

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

button {
  cursor: pointer;
}

/* Scripts reveal and hide content with the hidden attribute; never let a
   display rule override it. */
[hidden] {
  display: none !important;
}

/* Typography -------------------------------------------------------------- */

h1,
h2,
h3 {
  line-height: 1.15;
}

/* Small uppercase label that sits above a heading. */
.eyebrow {
  margin-bottom: 12px;
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Text for screen readers only, e.g. "opens in a new tab". */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Buttons ----------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 160ms ease, transform 160ms ease;
}

.button:hover {
  background: #333333;
  transform: translateY(-1px);
}

.button-red {
  background: var(--red);
}

.button-red:hover {
  background: var(--red-dark);
}

/* Quiet button for secondary actions on light surfaces. */
.button-outline {
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
}

.button-outline:hover {
  background: var(--ink);
  color: var(--paper);
}

/* Focus rings ------------------------------------------------------------- */

:focus-visible {
  outline: 3px solid var(--focus-on-light);
  outline-offset: 3px;
}

/* Visible only once it receives focus: lets keyboard and screen-reader users
   jump past the header navigation (WCAG 2.4.1). */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 0 0 12px 0;
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Reduced motion ---------------------------------------------------------- */
/* Each stylesheet neutralises its own transitions, so that the override
   always comes after the rule it is cancelling. */

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

  .button {
    transition: none;
  }

  .button:hover {
    transform: none;
  }
}
