/* Base: fonts, design tokens, reset, typography and utilities. */

@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/lora-latin-variable.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-variable.woff2") format("woff2");
}

:root {
  /* Colors */
  --color-bg: #f7f5ef;
  --color-surface: #fff;
  --color-text: #202821;
  --color-muted: #586259;
  --color-accent: #285c46;
  --color-accent-hover: #1d4635;
  --color-accent-light: #e6eee7;
  --color-border: #d8ded5;
  --color-warm: #e7cfad;
  --color-warm-light: #f3ebdf;
  --color-error: #a2342a;
  --color-focus: #285c46;

  /* Fonts */
  --font-serif: "Lora", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* Font sizes */
  --fs-hero: clamp(2.25rem, 1.6rem + 2.8vw, 4rem);
  --fs-h1: clamp(2rem, 1.6rem + 1.6vw, 3rem);
  --fs-h2: clamp(1.625rem, 1.4rem + 0.9vw, 2.125rem);
  --fs-h3: clamp(1.375rem, 1.3rem + 0.3vw, 1.5rem);
  --fs-lead: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
  --fs-article: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);
  --fs-body: 1rem;
  --fs-small: 0.9375rem;
  --fs-meta: 0.875rem;
  --fs-eyebrow: 0.75rem;

  /* Line heights */
  --lh-tight: 1.12;
  --lh-heading: 1.25;
  --lh-body: 1.6;
  --lh-article: 1.7;

  /* Spacing scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4rem;
  --space-7: 5rem;
  --section-space: clamp(2.5rem, 1.6rem + 3.6vw, 5rem);

  /* Layout */
  --container-width: 77.5rem;
  --gutter: clamp(1.25rem, 0.8rem + 1.8vw, 2rem);
  --measure: 45rem;

  /* Shape and motion */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --shadow-soft: 0 1px 2px rgb(32 40 33 / 0.04), 0 8px 24px rgb(32 40 33 / 0.06);
  --transition: 0.2s ease;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: var(--lh-heading);
  text-wrap: balance;
}

p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

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

img {
  height: auto;
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent-hover);
}

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

address {
  font-style: normal;
}

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

[id] {
  scroll-margin-top: var(--space-4);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important; /* Respect the user's reduced-motion preference everywhere. */
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Utilities */

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

.skip-link {
  position: absolute;
  top: var(--space-1);
  left: var(--space-1);
  z-index: 100;
  padding: var(--space-1) var(--space-2);
  font-weight: 600;
  color: var(--color-surface);
  background-color: var(--color-accent);
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
}

.skip-link:focus {
  color: var(--color-surface);
  transform: none;
}

.eyebrow {
  margin-bottom: var(--space-2);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* Long-form text: article bodies, information and legal pages. */

.prose {
  font-size: var(--fs-article);
  line-height: var(--lh-article);
}

.prose p + p,
.prose p + ul,
.prose ul + p {
  margin-top: 1.1em;
}

.prose h2 {
  margin-bottom: var(--space-2);
  font-size: var(--fs-h2);
}

.prose h3 {
  margin: var(--space-4) 0 var(--space-1);
  font-size: var(--fs-h3);
}

.prose ul {
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: 0.4em;
}

.prose a {
  text-decoration-line: underline;
}
