/* base.css
   Reset, document defaults, typography, focus, layout containers, utilities.
   Loads after tokens.css. No raw colour values here. */

/* ---------------------------------------------------------------- fonts */
/* Latin subset, variable weight axis, self-hosted. Three files, no CDN. */

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/playfair-display-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Playfair Display";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/playfair-display-latin-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
}

/* ---------------------------------------------------------------- reset */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: light;
}

[data-theme="dark"] {
  color-scheme: dark;
}


body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
  margin: 0;
}

ul[class],
ol[class] {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

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

button {
  background: none;
  border: 0;
  cursor: pointer;
}

/* ------------------------------------------------------------- document */

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: var(--lh-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* A column that always fills the screen, so a short page still pushes the footer
     to the bottom and the floating button lands in the corner rather than mid-screen. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

/* The header is sticky, so anything scrolled to needs to clear it. */
[id] {
  scroll-margin-top: calc(var(--header-h) + var(--s-4));
}

/* Locked while the mobile navigation panel is open. */
body.is-locked {
  overflow: hidden;
}

/* ----------------------------------------------------------- typography */

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: var(--ls-heading);
  line-height: var(--lh-heading);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h3); font-weight: 700; }

p {
  max-width: var(--measure);
  text-wrap: pretty;
}

strong {
  font-weight: 700;
}

.display {
  font-family: var(--ff-display);
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  color: var(--ink);
  text-wrap: balance;
}

.lead {
  font-size: var(--fs-lead);
  font-weight: 500;
  color: var(--ink-soft);
  max-width: 46ch;
}

.small {
  font-size: var(--fs-small);
}

/* Uppercase label that sits above a heading. */
.eyebrow {
  display: block;
  font-family: var(--ff-body);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  color: var(--rose-deep);
  margin: 0 0 var(--s-4);
}

/* ---------------------------------------------------------------- links */

a {
  color: var(--ink);
  text-decoration-color: var(--rose);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-color: var(--ink-soft);
}

/* ---------------------------------------------------------------- focus */

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

:focus:not(:focus-visible) {
  outline: none;
}

.skip-link {
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
  z-index: 200;
  padding: var(--s-3) var(--s-4);
  background-color: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  text-decoration: none;
  transform: translateY(calc(-100% - var(--s-4)));
}

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

/* --------------------------------------------------------------- layout */

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

@media (min-width: 768px) {
  .container {
    padding-inline: var(--s-6);
  }
}

.section {
  padding-block: var(--section-y);
}

.prose {
  max-width: var(--measure);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin-block: var(--s-7);
}

/* ------------------------------------------------------------ utilities */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.center {
  text-align: center;
}

.center p,
.center .lead {
  margin-inline: auto;
}

[hidden] {
  display: none !important;
}

/* ------------------------------------------------------- reduced motion */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
