:root {
  color-scheme: dark;
  --background: #111;
  --text: #f2f2f2;
  --muted: #b6b6b6;
  --rule: #505050;
  --gutter: clamp(1.5rem, 5.6vw, 7rem);
  --display: "Instrument Serif", Georgia, serif;
  --body: "Geist", system-ui, sans-serif;
  background: var(--background);
  color: var(--text);
  font: 400 1rem/1.55 var(--body);
}

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

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

body {
  margin: 0;
}

h1, h2, p {
  margin: 0;
}

a {
  color: inherit;
  text-underline-offset: .28em;
}

a:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 6px;
}

.wrap {
  width: min(100%, 106rem);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  padding-block: 1.9rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
}

.wordmark {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .055em;
  text-decoration: none;
  width: fit-content;
}

.wordmark span {
  color: #929292;
}

.site-header nav {
  display: flex;
  gap: clamp(1rem, 3vw, 3rem);
}

.site-header nav a, footer a {
  font-size: .875rem;
  text-decoration: none;
  color: var(--muted);
}

.site-header nav a:hover, footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

.contact-link {
  justify-self: end;
  padding: .55rem .95rem;
  border: 1px solid var(--rule);
  border-radius: 2rem;
  font-size: .875rem;
  text-decoration: none;
  white-space: nowrap;
}

.contact-link:hover {
  border-color: var(--text);
}

.story {
  display: grid;
  isolation: isolate;
}

.stage, .chapters {
  grid-area: 1 / 1;
  min-width: 0;
}

.stage {
  position: sticky;
  inset-block-start: 0;
  align-self: start;
  height: 100svh;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(ellipse at 70% 13%, #333, var(--background) 55%);
}

:root:not(.has-scene) .stage {
  position: relative;
}

.scene-poster, .stage canvas, .guide {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.scene-poster {
  object-fit: cover;
  object-position: 72% 50%;
}

.has-scene .scene-poster {
  visibility: hidden;
}

.stage canvas {
  visibility: hidden;
}

.has-scene .stage canvas {
  visibility: visible;
}

.guide {
  opacity: 0;
  overflow: visible;
  visibility: hidden;
}

.has-scene .guide {
  visibility: visible;
}

.guide path {
  stroke: #c1c1c1;
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}

.guide circle {
  fill: var(--text);
}

.chapters {
  position: relative;
}

.chapter > .wrap {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 6rem;
}

@media (min-height: 36rem) and (prefers-reduced-motion: no-preference) {
  .has-scene .chapter > .wrap {
    position: sticky;
    inset-block-start: 0;
  }

  .has-scene .chapter::after {
    content: '';
    display: block;
    block-size: 42svh;
  }
}

h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  line-height: .94;
  letter-spacing: -.025em;
}

h1 {
  font-size: clamp(5rem, 10.2vw, 11rem);
}

h2 {
  font-size: clamp(3.35rem, 5.7vw, 6.5rem);
}

.hero-copy p {
  max-width: 26ch;
  margin-block-start: 1.75rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.45vw, 1.32rem);
}

.explore {
  position: absolute;
  inset-block-end: 2.7rem;
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  font-size: .825rem;
  text-decoration: none;
  color: var(--muted);
}

.explore::before {
  content: '';
  width: 1px;
  height: 1.75rem;
  background: var(--muted);
}

.explore:hover {
  color: var(--text);
  text-decoration: underline;
}

.chapter-copy {
  width: min(100%, 32rem, 39vw);
}

.chapter-right .chapter-copy {
  margin-inline-start: auto;
}

.label {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 500;
  margin-block-end: 1.35rem;
}

.chapter-copy h2 + p {
  color: var(--muted);
  max-width: 38ch;
  margin-block-start: 1.6rem;
  font-size: clamp(1rem, 1.25vw, 1.2rem);
}

.has-scene .chapter-copy {
  opacity: var(--reveal, 1);
}

.has-scene .chapter-copy:focus-within {
  opacity: 1;
}

.contact {
  position: relative;
  background: #171717;
  padding-block: clamp(5rem, 12vw, 12rem);
  border-top: 1px solid #282828;
}

.contact h2 {
  font-size: clamp(4rem, 9vw, 10rem);
}

.contact p {
  color: var(--muted);
  max-width: 34ch;
  margin-block: 1.7rem;
}

.email {
  font-size: clamp(1rem, 1.45vw, 1.25rem);
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.6rem;
}

@media (max-width: 48rem) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: .75rem;
    padding-block: 1.1rem;
  }

  .site-header nav {
    display: none;
  }

  .stage {
    background: radial-gradient(ellipse at 50% 12%, #333, var(--background) 51%);
  }

  .chapter > .wrap {
    justify-content: end;
    padding-block: 49svh 9svh;
  }

  .hero > .wrap {
    padding-block-end: 14svh;
  }

  h1 {
    font-size: clamp(4rem, 15vw, 7rem);
  }

  .hero-copy p {
    margin-block-start: 1rem;
    max-width: 30ch;
  }

  .chapter-copy {
    width: min(100%, 31rem);
  }

  .chapter-right .chapter-copy {
    margin-inline-start: 0;
  }

  .chapter-copy h2 + p {
    margin-block-start: 1rem;
  }

  .label {
    margin-block-end: .8rem;
  }

  .explore {
    inset-block-end: 3.5svh;
  }

  .explore::before {
    height: 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage {
    position: relative;
  }

  .chapter:not(.hero) > .wrap {
    min-height: 0;
    padding-block: clamp(4rem, 10vw, 8rem);
    border-top: 1px solid var(--rule);
  }

  .chapter-right .chapter-copy {
    margin-inline-start: 0;
  }

  .guide {
    display: none;
  }

  .has-scene .chapter-copy {
    opacity: 1;
  }
}
