@font-face {
  font-family: Bricolage;
  src: url("../fonts/bric-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
:root {
  --ink: #0a0908;
  --paper: #f2ece1;
  --ochre: #c4551f;
  --edge: rgba(242, 236, 225, 0.22);
  --pad: clamp(16px, 3.2vw, 38px);
  /* There is one cut of Bricolage in this repository and it is ExtraBold. It
     sets the display type, here and on the canvas; reading copy is the
     reader's own interface face, which is what reading copy should be. */
  --display: Bricolage, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* ------------------------------------------------------------- the picture */

#stage {
  position: fixed; inset: 0; z-index: 0;
  background: var(--ink);
}
#gl { display: block; width: 100%; height: 100%; }
#stage::before, #stage::after {
  content: ""; position: absolute; left: 0; right: 0;
  pointer-events: none; z-index: 1;
}
#stage::before {
  top: 0; height: 17vh;
  background: linear-gradient(to bottom, rgba(10, 9, 8, 0.58), rgba(10, 9, 8, 0));
}
#stage::after {
  bottom: 0; height: 13vh;
  background: linear-gradient(to top, rgba(10, 9, 8, 0.66), rgba(10, 9, 8, 0));
}
#dip {
  position: absolute; inset: 0; background: #000;
  opacity: 0; pointer-events: none;
}
body.nogl #stage { display: none; }

/* --------------------------------------------------------------- the scroll */

#scroll { position: relative; z-index: 1; }
.st { position: relative; width: 100%; }

/* what the canvas draws, for anyone not reading with their eyes */
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- the chrome */

#top {
  position: fixed; z-index: 3; top: 0; left: 0; right: 0;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; padding: var(--pad);
  pointer-events: none;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.75), 0 0 2px rgba(0, 0, 0, 0.9);
}
#top .mark {
  margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.015em;
  font-size: clamp(13px, 1.5vw, 17px);
}
#credits-open {
  pointer-events: auto;
  appearance: none; background: none; border: 0; cursor: pointer;
  color: inherit; font: inherit; font-size: clamp(12px, 1.3vw, 15px);
  padding: 0.2em 0; border-bottom: 1px solid currentColor;
}

#nav {
  position: fixed; z-index: 3; right: var(--pad); top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 9px;
}
#nav { filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.85)); }
#nav button {
  appearance: none; border: 0; padding: 0; cursor: pointer;
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(242, 236, 225, 0.28);
  transition: background 220ms, transform 220ms;
}
#nav button.on { background: var(--paper); transform: scale(1.5); }
#nav button:hover { background: var(--paper); }

@media (max-width: 620px) { #nav { display: none; } }

#caption {
  position: fixed; z-index: 3; left: var(--pad); bottom: calc(var(--pad) * 0.7);
  margin: 0; display: flex; flex-wrap: wrap; gap: 0 0.7em;
  font-size: clamp(10px, 1.05vw, 12.5px);
  letter-spacing: 0.06em; text-transform: lowercase;
  color: rgba(242, 236, 225, 0.5);
  opacity: 0; transition: opacity 700ms 300ms;
  max-width: min(60ch, 70vw);
}
#caption.on { opacity: 1; }
#caption .t { color: rgba(242, 236, 225, 0.82); }

#hint {
  position: fixed; z-index: 3; left: 50%; bottom: calc(var(--pad) * 0.7);
  transform: translateX(-50%); margin: 0;
  font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(242, 236, 225, 0.55);
  animation: breathe 3.4s ease-in-out infinite;
}
body[data-station]:not([data-station="0"]) #hint {
  opacity: 0; animation: none; transition: opacity 400ms;
}
@keyframes breathe { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.9; } }
@media (prefers-reduced-motion: reduce) { #hint { animation: none; } }

/* ------------------------------------------------------------ the invitation */

.invite {
  position: relative; z-index: 2;
  min-height: 160vh; display: flex; flex-direction: column; justify-content: flex-end;
  gap: 1.1rem; padding: calc(var(--pad) * 2) var(--pad) 16vh;
  max-width: 62ch; margin: 0 auto;
}
.invite .kicker {
  margin: 0; font-size: clamp(11px, 1.2vw, 13px);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ochre);
}
.invite h2 {
  margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.03em; line-height: 0.96;
  font-size: clamp(34px, 7vw, 86px);
}
.invite .lede {
  margin: 0; font-size: clamp(16px, 2.1vw, 23px); line-height: 1.35;
  color: rgba(242, 236, 225, 0.84); max-width: 34ch;
}
.invite .when { margin: 0.6rem 0 0; display: grid; gap: 0.55rem; }
.invite .when > div { display: flex; gap: 1rem; align-items: baseline;
  border-top: 1px solid var(--edge); padding-top: 0.55rem; }
.invite dt { margin: 0; width: 5.5em; flex: none;
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(242, 236, 225, 0.5); }
.invite dd { margin: 0; font-size: clamp(14px, 1.7vw, 18px); }
.invite .make {
  margin: 0.4rem 0 0; font-family: var(--display); font-size: clamp(14px, 1.7vw, 19px);
  color: var(--ochre); font-weight: 700; letter-spacing: -0.01em;
}
.invite .links { margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: 0.7rem; }
.invite .links a {
  color: var(--paper); text-decoration: none;
  border: 1px solid var(--edge); border-radius: 999px;
  padding: 0.6em 1.15em; font-size: clamp(13px, 1.5vw, 15px);
  transition: border-color 200ms, background 200ms;
}
.invite .links a:hover { border-color: var(--paper); background: rgba(242, 236, 225, 0.08); }
.invite .links a.key { background: var(--ochre); border-color: var(--ochre); }
.invite .links a.key:hover { background: #d9632a; border-color: #d9632a; }

/* ---------------------------------------------------------------- the credits */

#credits {
  border: 0; padding: 0; background: none; color: var(--paper);
  max-width: min(70ch, 92vw); max-height: 86vh;
}
#credits::backdrop { background: rgba(6, 6, 5, 0.86); backdrop-filter: blur(6px); }
#credits .sheet {
  background: #12100e; border: 1px solid var(--edge);
  padding: clamp(22px, 4vw, 44px); position: relative;
  max-height: 86vh; overflow: auto;
}
#credits h2 { margin: 0 0 0.8rem; font-family: var(--display); font-weight: 700; font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.02em; }
#credits p { margin: 0 0 1.1rem; font-size: 15px; line-height: 1.5;
  color: rgba(242, 236, 225, 0.78); }
#credits ul { margin: 0 0 1.2rem; padding: 0; list-style: none; display: grid; gap: 0.75rem; }
#credits li { border-top: 1px solid var(--edge); padding-top: 0.7rem;
  display: grid; gap: 0.15rem; font-size: 14px; }
#credits li a { color: var(--paper); font-weight: 700; text-decoration: none;
  border-bottom: 1px solid var(--edge); justify-self: start; }
#credits li a:hover { border-color: var(--paper); }
#credits li span { color: rgba(242, 236, 225, 0.6); line-height: 1.45; }
#credits .fine { font-size: 13px; color: rgba(242, 236, 225, 0.5); margin: 0; }
#credits-close {
  position: absolute; top: 10px; right: 14px;
  appearance: none; background: none; border: 0; cursor: pointer;
  color: rgba(242, 236, 225, 0.6); font-size: 30px; line-height: 1;
}
#credits-close:hover { color: var(--paper); }

/* ------------------------------------------------------------- without webgl */

.fallback, body.nogl .fallback { display: block; }
.fallback {
  position: relative; z-index: 2; max-width: 62ch;
  margin: 0 auto; padding: calc(var(--pad) * 2) var(--pad);
}
.fallback h1 { font-family: var(--display); font-size: clamp(32px, 7vw, 72px); letter-spacing: -0.03em; margin: 0 0 1rem; }
.fallback p { line-height: 1.5; color: rgba(242, 236, 225, 0.78); }
.fallback ol { line-height: 1.6; padding-left: 1.2em; }
.fallback li { margin-bottom: 0.5em; }

body:not(.ready) #nav, body:not(.ready) #caption { opacity: 0; }
