@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif SAM";
  src: url("../fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif SAM";
  src: url("../fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --night: #07060d;
  --night-2: #0e0b19;
  --plum: #1c1030;
  --red: #ff2a3d;
  --red-deep: #c4142a;
  --violet: #c2307a;
  --blue: #4a56d8;
  --ink: #efece6;
  --ink-2: #b9b4c3;
  --ink-3: #9590a3;
  --line: rgba(239, 236, 230, 0.14);
  --line-red: rgba(255, 42, 61, 0.45);
  --ribbon: linear-gradient(90deg, var(--red) 0%, var(--violet) 55%, var(--blue) 100%);

  --f-display: "Instrument Serif SAM", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-sans: var(--font-sans);
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4.2vw, 64px);
  --measure: 34rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --t-xs: 0.72rem;
  --t-sm: 0.875rem;
  --t-md: 1.0625rem;
  --t-lg: clamp(1.2rem, 1.02rem + 0.75vw, 1.55rem);
  --t-xl: clamp(2.4rem, 1.4rem + 4vw, 5.2rem);
  --t-xxl: clamp(3.4rem, 1.6rem + 8vw, 10rem);

  color-scheme: dark;
}

html { background: var(--night); -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

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

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: var(--t-md);
  line-height: 1.65;
  font-weight: 400;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video { max-width: 100%; display: block; }
figure { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--red); color: #fff; }
:focus-visible:not(.site-header *, .case-nav *, .cta *, .site-footer *, .modal *) { outline: 2px solid var(--red); outline-offset: 4px; border-radius: 2px; }

.site-header, .case-nav, .cta, .modal { font-size: var(--fs-body); line-height: 1.55; letter-spacing: var(--tracking); }
.case-nav, .cta { color: var(--c-ink); background: var(--night); }
.site-footer { line-height: 1.55; letter-spacing: -0.01rem; }

.eyebrow {
  font-family: var(--f-sans);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.9em;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--ribbon);
  flex: none;
}
.display {
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}
.display em {
  font-style: italic;
  background: linear-gradient(95deg, #ff5a68 0%, #ff2a3d 30%, #d23a86 70%, #7d84ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.06em;
}
.lede { font-size: var(--t-lg); line-height: 1.45; color: var(--ink); text-wrap: pretty; margin: 0; }
.body-copy { color: var(--ink-2); max-width: var(--measure); text-wrap: pretty; }
p.body-copy { margin-top: 1em; }
.body-copy p { margin: 0; }
.body-copy p + p { margin-top: 1em; }
.body-copy strong { color: var(--ink); font-weight: 600; }

.chapters-nav {
  position: fixed;
  right: clamp(10px, 2vw, 28px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
}
.chapters { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chapters a {
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-2);
  text-shadow: 0 1px 10px rgba(7, 6, 13, 0.9);
  transition: color 0.4s var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.9em;
  padding: 4px 0;
}
.chapters a span { opacity: 0; transform: translateX(6px); transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out); }
.chapters a:hover span,
.chapters a:focus-visible span { opacity: 1; transform: none; }
.chapters a::after {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 3px;
  border: 1px solid currentColor;
  transition: height 0.4s var(--ease-out), background 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}
.chapters a[aria-current="true"] { color: var(--ink); }
.chapters a[aria-current="true"]::after { height: 18px; background: var(--red); border-color: var(--red); }

.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 101; pointer-events: none; }
.progress i { position: absolute; inset: 0; background: var(--ribbon); transform-origin: 0 50%; transform: scaleX(0); }

.grain {
  position: fixed;
  inset: -50%;
  z-index: 40;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(6) infinite;
}
@media (max-width: 860px) { .grain { inset: -15%; } }
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); }
  60% { transform: translate(-6%, -2%); }
  80% { transform: translate(5%, 4%); }
  100% { transform: translate(0, 0); }
}

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

.placeholder {
  display: grid;
  place-content: center;
  gap: 0.35rem;
  text-align: center;
  border: 1px dashed var(--line-red);
  background: repeating-linear-gradient(135deg, rgba(255, 42, 61, 0.06) 0 12px, transparent 12px 24px), var(--night-2);
  color: var(--ink-2);
  font-size: var(--t-sm);
}
.placeholder b { color: var(--red); font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; font-size: var(--t-xs); }

.facts { margin: 0; display: grid; gap: 1.1rem 2rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.facts div { border-top: 1px solid var(--line); padding-top: 0.8rem; }
.facts dt { font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); }
.facts dd { margin: 0.3rem 0 0; color: var(--ink); font-size: var(--t-sm); line-height: 1.5; }

@media (max-width: 640px) {
  .facts { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .grain { animation: none; }
}
