/* ==========================================================================
   Base: design tokens, reset, typography, utilities
   ========================================================================== */

:root {
  /* Palette */
  --c-bg: #F5F1EA;
  --c-ink: #1F1E1C;
  --c-accent: #B4643C;
  --c-sage: #7C8571;
  --c-sand: #E6DCCB;
  --c-white: #FFFDF9;
  --c-muted: #5E5A53;          /* secondary text, AA on --c-bg */
  --c-line: rgba(31, 30, 28, 0.12);
  --c-accent-dark: #97512F;    /* hover / text-on-light accent, AA */
  --c-accent-strong: #AD5F37;  /* filled surfaces with small white text, AA */

  /* Typography */
  --f-display: "Fraunces", Georgia, "Times New Roman", serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Fluid type scale (360px -> 1440px) */
  --fs-0: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --fs-1: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --fs-2: clamp(1.125rem, 1.07rem + 0.25vw, 1.25rem);
  --fs-3: clamp(1.375rem, 1.25rem + 0.55vw, 1.75rem);
  --fs-4: clamp(1.75rem, 1.5rem + 1.1vw, 2.5rem);
  --fs-5: clamp(2.25rem, 1.8rem + 2vw, 3.5rem);
  --fs-6: clamp(2.75rem, 2rem + 3.6vw, 5.25rem);

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2.5rem;
  --sp-7: clamp(3rem, 2rem + 4vw, 5rem);
  --sp-8: clamp(4.5rem, 3rem + 6vw, 8rem);

  /* Shape & motion */
  --radius: 14px;
  --radius-lg: 24px;
  --shadow: 0 1px 2px rgba(31, 30, 28, 0.04), 0 12px 32px -12px rgba(31, 30, 28, 0.18);
  --shadow-lg: 0 2px 4px rgba(31, 30, 28, 0.05), 0 28px 60px -20px rgba(31, 30, 28, 0.28);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --container: 1240px;
  --header-h: 84px;
}

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

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

body {
  min-height: 100vh;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--f-body);
  font-size: var(--fs-1);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

img { height: auto; }

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

button { cursor: pointer; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

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

p, li, h1, h2, h3, h4 { overflow-wrap: break-word; }

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
  font-variation-settings: "SOFT" 50, "opsz" 96;
  text-wrap: balance;
}

h1 { font-size: var(--fs-6); }
h2 { font-size: var(--fs-5); }
h3 { font-size: var(--fs-3); line-height: 1.2; }
h4 { font-size: var(--fs-2); line-height: 1.3; }

h1 em, h2 em {
  font-style: italic;
  color: var(--c-accent);
}

p { text-wrap: pretty; }

.lead {
  font-size: var(--fs-2);
  color: var(--c-muted);
  max-width: 58ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--f-body);
  font-size: var(--fs-0);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-accent-dark);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

::selection { background: var(--c-accent); color: var(--c-white); }

/* --------------------------------------------------------------------------
   Focus
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.container {
  width: min(100% - 2 * clamp(1rem, 4vw, 2.5rem), var(--container));
  margin-inline: auto;
}

.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(--sp-4);
  top: -100px;
  z-index: 200;
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-ink);
  color: var(--c-white);
  border-radius: 8px;
  text-decoration: none;
}

.skip-link:focus { top: var(--sp-4); }

/* Reveal-on-scroll: hidden only when JS is running and motion is allowed */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition:
      opacity 0.9s var(--ease),
      transform 0.9s var(--ease);
    transition-delay: calc(var(--d, 0) * 90ms);
  }

  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}
