/* ==========================================================================
   base.css — tokens, reset, primitives
   McAuliffe Painting & Decorating — static template
   ========================================================================== */

:root {
  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "General Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: clamp(1.125rem, 1.6vw, 1.3rem);
  --text-xl: clamp(1.5rem, 3vw, 2.15rem);
  --text-2xl: clamp(2rem, 5vw, 3.1rem);
  --text-hero: clamp(2.55rem, 7.2vw, 5.1rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 5rem;
  --space-16: 7rem;

  --section-y: clamp(3.5rem, 8vw, 8rem);
  --gutter: clamp(1.15rem, 4vw, 3.25rem);
  --measure: 62ch;
  --radius: 3px;
  --radius-lg: 6px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Light theme — warm chalk / deep forest / pigment terracotta */
  --chalk: #f4efe6;
  --bg: #f4efe6;
  --surface: #fbf8f2;
  --surface-sink: #ebe4d6;
  --ink: #1b2620;
  --ink-soft: #4a564d;
  --ink-faint: #5c6760;
  --border: #d9d0be;
  --border-strong: #bfb49d;
  --accent: #a8461a;
  --accent-hover: #8c3813;
  --accent-ink: #fdf9f3;
  --accent-wash: #f0e4d6;
  --shadow-soft: 0 18px 40px -28px rgba(27, 38, 32, 0.45);
  --grain-opacity: 0.5;
}

html[data-theme="dark"] {
  --bg: #12170f;
  --surface: #1a2019;
  --surface-sink: #0d110c;
  --ink: #ece5d7;
  --ink-soft: #b3bcaf;
  --ink-faint: #8b9489;
  --border: #2c352c;
  --border-strong: #414c40;
  --accent: #e09a58;
  --accent-hover: #f0ac6b;
  --accent-ink: #171c14;
  --accent-wash: #23291f;
  --shadow-soft: 0 18px 44px -26px rgba(0, 0, 0, 0.7);
  --grain-opacity: 0.32;
  color-scheme: dark;
}

/* ---------- reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.62;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
img,
svg,
picture,
video {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.018em;
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 40;
  text-wrap: balance;
}
p {
  text-wrap: pretty;
}

/* ---------- primitives ---------- */
.shell {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.shell--wide {
  max-width: 1560px;
}

.eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 0.17em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-faint);
}
.eyebrow--accent {
  color: var(--accent);
}

.lede {
  font-size: var(--text-lg);
  color: var(--ink-soft);
  max-width: 46ch;
}

.rule {
  border: 0;
  border-top: 1px solid var(--border);
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 100px;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn:hover {
  transform: translateY(-1px);
}
.btn--solid {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn--solid:hover {
  background: var(--accent-hover);
}
.btn--outline {
  border-color: var(--border-strong);
  color: var(--ink);
}
.btn--outline:hover {
  border-color: var(--ink);
  background: var(--surface);
}
.btn--ink {
  background: var(--ink);
  color: var(--bg);
}
.btn--ink:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

/* focus + skip link */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  z-index: 200;
  background: var(--ink);
  color: var(--bg);
  padding: 0.7rem 1.2rem;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s var(--ease);
}
.skip-link:focus-visible {
  transform: translate(-50%, 0);
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* paper / plaster grain */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.14'/%3E%3C/svg%3E");
}
html[data-theme="dark"] .grain {
  mix-blend-mode: screen;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
