:root {
  --paper: #f6efe4;
  --ink: #2a1418;
  --muted: #75625e;
  --rule: #e2d5c5;
  --accent: #7a1f3d;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1f1619;
    --ink: #f4eadd;
    --muted: #b5a3a5;
    --rule: #3d2c31;
    --accent: #e2b25f;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* Height of the sticky masthead, so anchors land below it. */
  scroll-padding-top: 4.75rem;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@supports (animation-timeline: scroll()) {
  body::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    z-index: 2;
    height: 3px;
    background: var(--accent);
    transform-origin: left;
    animation: scroll-progress linear both;
    animation-timeline: scroll(root);
  }
}
@keyframes scroll-progress { from { transform: scaleX(0); } }

body {
  overflow-x: clip;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 3rem);
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--accent); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

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

.label {
  margin: 0;
  font: 400 0.8125rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
  /* Extends the background to the viewport edges, over the full-width canvas. */
  box-shadow: 0 0 0 100vmax var(--paper);
  clip-path: inset(0 -100vmax);
}
.masthead__brand {
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.masthead__brand span { color: var(--accent); }
.masthead nav { display: flex; gap: 1.5rem; }
.masthead nav a {
  font: 400 0.8125rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Fills the first screen below the masthead. */
  min-height: calc(100svh - 4.75rem);
  padding: clamp(2rem, 10vw, 7rem) 0 clamp(2.5rem, 8vw, 5rem);
}
.hero h1 {
  position: relative;
  margin: 0;
  font-size: clamp(4.25rem, 27vw, 13rem);
  font-weight: 700;
  line-height: 0.86;
  letter-spacing: -0.055em;
}
.hero h1 span { display: block; }
.hero h1 span::first-letter { color: var(--accent); }
.hero__intro {
  position: relative;
  max-width: 34rem;
  margin: clamp(2rem, 6vw, 3.5rem) 0 0;
  font-size: clamp(1.25rem, 2.6vw, 1.5rem);
  line-height: 1.4;
  text-wrap: pretty;
}

/* script.js sets .fx on <html> only when it draws the headline on the
   canvas; with no JS or reduced motion the plain h1 stays visible. */
.hero canvas {
  display: none;
  position: absolute;
  top: 0;
  left: 50%;
  width: 100vw;
  height: 100%;
  transform: translateX(-50%);
  pointer-events: none;
}
.hero__fx {
  display: none;
  position: relative;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 2rem;
}
.fx .hero canvas { display: block; }
.fx .hero__fx { display: flex; }
.fx .hero h1,
.fx .hero h1 span::first-letter { color: transparent; }
.hero__fx button {
  padding: 0.6rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 0.8125rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.hero__fx button:hover { border-color: var(--accent); color: var(--accent); }
.hero__fx button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.hero__fx .label { font-variant-numeric: tabular-nums; }

section {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1rem 2rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule);
}
section > .label { padding-top: 0.3em; }
section p { margin: 0 0 1em; max-width: 36rem; text-wrap: pretty; }
section p:last-child { margin-bottom: 0; }

.facts, .path { margin: 0; padding: 0; list-style: none; }
.facts div, .path li {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0 1.5rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}
.facts div:first-child, .path li:first-child { padding-top: 0; }
.facts div:last-child, .path li:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt, .path time { font: 400 0.875rem/1.9 var(--mono); color: var(--muted); }
.facts dd { margin: 0; }
.path time { font-variant-numeric: tabular-nums; }
.path strong { font-weight: 700; }
.path small { display: block; font-size: 1rem; color: var(--muted); }

.contact a {
  display: inline-block;
  font-size: clamp(1.375rem, 4.6vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.contact p + p { margin-top: 0.25rem; }

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 2px solid var(--ink);
}

@media (max-width: 40rem) {
  section { grid-template-columns: 1fr; gap: 0.75rem; padding: 2rem 0; }
  .path li, .facts div { grid-template-columns: 1fr; }

  /* The headline cannot get wider on a phone, so it grows taller instead:
     the h1 takes the rest of the first screen (up to 1.6x its natural
     height of four 0.86em lines) and script.js stretches the letters to
     fill each line. */
  .fx .hero h1 {
    display: flex;
    flex-direction: column;
    height: clamp(3.44em, calc(100svh - 8.75rem), 5.5em);
  }
  .fx .hero h1 span { flex: 1; }
}
