/* =========================================================
   NEXT PHASE MEDIA — main.css
   Tokens · reset · typography · layout primitives
   ========================================================= */

@font-face { font-family: "Manrope"; src: url("../assets/fonts/manrope-var.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../assets/fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../assets/fonts/instrument-serif-italic.woff2") format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../assets/fonts/instrument-serif.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }

:root {
  /* Palette */
  --ink: #171714;
  --ink-2: #201f1b;
  --ink-3: #2b2a25;
  --ivory: #f4f0e8;
  --ivory-2: #ebe5da;
  --stone: #d9d2c5;
  --bronze: #b8895d;
  --bronze-light: #cfa57c;
  --bronze-deep: #8a6440;
  --olive: #454c3c;
  --olive-2: #3a4033;
  --white: #ffffff;
  --muted: #5e5a52;
  --muted-light: #b9b2a6;
  --error: #9a3b2e;
  --error-light: #e6a596;
  --success: #3f5a37;

  /* Type */
  --f-display: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1.0625rem;
  --fs-md: clamp(1.125rem, 1.05rem + 0.3vw, 1.3rem);
  --fs-lg: clamp(1.35rem, 1.2rem + 0.7vw, 1.75rem);
  --fs-xl: clamp(1.75rem, 1.4rem + 1.6vw, 2.75rem);
  --fs-2xl: clamp(2.25rem, 1.6rem + 3vw, 4.25rem);
  --fs-3xl: clamp(2.6rem, 1.6rem + 4.6vw, 6.25rem);

  /* Space */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4rem; --s-9: 6rem; --s-10: 8rem;
  --section-y: clamp(4.5rem, 3rem + 7vw, 10rem);
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 3rem);
  --max: 1440px;
  --max-text: 68ch;

  /* Shape & motion */
  --radius: 4px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur: 0.6s;
  --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); }
body {
  min-height: 100vh;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
p, li, h1, h2, h3, h4 { overflow-wrap: break-word; }
::selection { background: var(--bronze); color: var(--ink); }

/* ---------- Focus ---------- */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--bronze); outline-offset: 3px; border-radius: 2px; }
.on-dark :focus-visible, .site-header :focus-visible, .menu :focus-visible { outline-color: var(--bronze-light); }

.skip-link {
  position: fixed; left: var(--s-4); top: var(--s-4); z-index: 200;
  padding: var(--s-3) var(--s-5); background: var(--bronze); color: var(--ink);
  font-weight: 600; border-radius: var(--radius-pill);
  transform: translateY(-200%); transition: transform 0.3s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.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;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, .display {
  font-family: var(--f-display);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.04;
  text-wrap: balance;
}
h1, .h1 { font-size: var(--fs-3xl); font-weight: 600; letter-spacing: -0.035em; line-height: 0.98; }
h2, .h2 { font-size: var(--fs-2xl); letter-spacing: -0.03em; }
h3, .h3 { font-size: var(--fs-lg); letter-spacing: -0.015em; line-height: 1.2; }
h4, .h4 { font-size: var(--fs-md); letter-spacing: -0.01em; line-height: 1.3; }
p { text-wrap: pretty; }
.lead { font-size: var(--fs-md); line-height: 1.6; max-width: 46ch; }
.serif { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
h1 .serif, h2 .serif, .display .serif { font-size: 1.08em; line-height: 0.9; }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-3);
  font-family: var(--f-body); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--bronze-deep);
}
.eyebrow::before { content: ""; width: 2.5rem; height: 1px; background: currentColor; }
.on-dark .eyebrow { color: var(--bronze-light); }
.eyebrow--plain::before { display: none; }

.num {
  font-family: var(--f-display); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: 0.12em; color: var(--bronze-deep); font-variant-numeric: tabular-nums;
}
.on-dark .num { color: var(--bronze-light); }

.prose { max-width: var(--max-text); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: var(--fs-xl); margin-top: 2em; }
.prose h3 { font-size: var(--fs-md); margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: 0.4em; }
.prose a { color: var(--bronze-deep); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 1040px; }
.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }
.section--ivory { background: var(--ivory); color: var(--ink); }
.section--ivory-2 { background: var(--ivory-2); color: var(--ink); }
.section--ink { background: var(--ink); color: var(--ivory); }
.section--olive { background: var(--olive); color: var(--ivory); }
.on-dark { color: var(--ivory); }
.on-dark .muted, .section--ink .muted, .section--olive .muted { color: var(--muted-light); }
.muted { color: var(--muted); }

.grid { display: grid; gap: var(--gutter); }
.stack > * + * { margin-top: var(--stack, var(--s-5)); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; }

.rule { height: 1px; background: var(--stone); border: 0; }
.on-dark .rule { background: rgba(244, 240, 232, 0.16); }

.section-head { display: grid; gap: var(--s-5); margin-bottom: clamp(2.5rem, 2rem + 3vw, 5rem); }
.section-head h2 { max-width: 18ch; }
.section-head p { max-width: 52ch; }
