@font-face {
  font-family: "Funnel Display";
  src: url("/assets/fonts/funnel-display.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}
@font-face {
  font-family: "Funnel Sans";
  src: url("/assets/fonts/funnel-sans.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("/assets/fonts/martian-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* river.js reads --ink-lch so both rivers land on exactly this colour. */
  --ink-lch: 0.13 0.010 252;
  --ink: oklch(var(--ink-lch));
  --text: oklch(0.935 0.010 235);
  --text-2: oklch(0.86 0.014 238);
  --text-3: oklch(0.72 0.018 240);
  --text-4: oklch(0.56 0.020 242);
  --accent: oklch(0.86 0.075 215);
  --hair: oklch(0.88 0.03 230 / 0.12);
  --hair-strong: oklch(0.88 0.03 230 / 0.32);

  --display: "Funnel Display", "Funnel Sans", system-ui, sans-serif;
  --sans: "Funnel Sans", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;

  --gutter: clamp(20px, 5vw, 72px);
  --measure: 1440px;
  --edge: max(var(--gutter), (100vw - var(--measure)) / 2);
  --space: clamp(120px, 19vh, 220px);
  --chapter: clamp(3.6rem, 8.6vw, 9rem);
  --support: clamp(1.9rem, 2.8vw, 2.7rem);
}

:root[data-palette="teal"] { --accent: oklch(0.86 0.065 198); }
:root[data-palette="cobalt"] { --accent: oklch(0.70 0.17 260); }
:root[data-palette="steel"] { --accent: oklch(0.83 0.035 240); }

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

html {
  background: var(--ink);
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--sans);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: oklch(0.86 0.075 215 / 0.28); }

a { color: inherit; text-underline-offset: 4px; text-decoration-color: oklch(0.86 0.075 215 / 0.5); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

code {
  font: 500 0.8em/1 var(--mono);
  font-stretch: 92%;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

h1, h2, h3 { font-family: var(--display); font-weight: 500; margin: 0; }
p { margin: 0; text-wrap: pretty; }
button { font: inherit; color: inherit; }

.chapter {
  font-size: var(--chapter);
  line-height: 0.88;
  letter-spacing: -0.05em;
  font-weight: 480;
}

.river {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.8s ease-out;
}

.river.on { opacity: 1; }

/* Navigation is the only glass on the page. It has no edge: the frost thins out
   downwards, so the bar never draws a line across the river. */

.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 36px;
  padding: 20px var(--edge) 28px;
}

.bar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s;
  background: oklch(0.13 0.010 252 / 0.55);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
}

.bar.solid::before { opacity: 1; }

.mark {
  font: 600 1rem/1 var(--display);
  letter-spacing: -0.02em;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.5s;
}

.bar.solid .mark { opacity: 1; }

.bar nav { display: flex; align-items: baseline; gap: 32px; margin-left: auto; }

.bar nav a {
  font-size: 0.9rem;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.2s;
}

.bar nav a:hover { color: var(--text); }

.bar nav .bar-join {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 6px;
}

.copy-label {
  flex: none;
  font: 500 0.86rem/1 var(--sans);
  color: var(--text-3);
  transition: color 0.25s;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Hero: the river comes in at the top and leaves through the left edge. The
   wordmark spans the measure and sits a layer nearer than the water. */

.hero {
  --name: calc((100vw - 2 * var(--edge)) / 7.3);
  position: relative;
  height: 100svh;
  min-height: 600px;
  isolation: isolate;
}

.hero-river {
  position: absolute;
  inset: 0 0 auto;
  height: calc(100lvh + 24vh);
  z-index: -1;
  will-change: transform;
}

.wordmark {
  position: absolute;
  left: var(--edge);
  right: var(--edge);
  top: 27%;
  font-size: var(--name);
  line-height: 0.86;
  letter-spacing: -0.055em;
  font-weight: 470;
  white-space: nowrap;
  margin-left: -0.055em;
  will-change: transform;
}

.wordmark span {
  font-weight: 300;
  font-size: 0.3em;
  letter-spacing: -0.02em;
  color: var(--text-3);
  margin-left: 0.1em;
}

/* One quiet line centred under the name, in small spaced capitals like a
   caption. The wordmark's line box is 0.86em and the p hangs about 0.2em below it. */
.hero-note {
  position: absolute;
  inset-inline: var(--edge);
  top: calc(27% + var(--name) * 1.45);
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 1.1em;
  font: 400 0.78rem/1.4 var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-3);
  will-change: transform;
}

.hero-note b { font-weight: 500; color: var(--text-2); }

/* A thin chevron at the foot, gone once scrolled. */
.down {
  position: absolute;
  left: 50%;
  bottom: clamp(24px, 5vh, 48px);
  padding: 12px;
  translate: -50% 0;
  color: var(--text-3);
  transition: color 0.25s, opacity 0.6s;
}

.down:hover { color: var(--text); }
.down.gone { opacity: 0; pointer-events: none; }

.down svg {
  display: block;
  width: 24px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  animation: sink 2.6s ease-in-out infinite;
}

@keyframes sink { 50% { translate: 0 6px; } }

/* The world: a letterbox slit in the dark opens to the whole screen while the
   section is pinned, then the camera pans along the picture. */

/* The jump from the chevron lands on the stage itself, not the bar's height
   above it, which html's scroll-padding would leave. */
.world { position: relative; z-index: 1; height: 300vh; scroll-margin-top: -80px; }

.world-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.world-word {
  position: absolute;
  inset: 50% 0 auto;
  margin-top: -0.42em;
  z-index: -1;
  text-align: center;
  font: 500 clamp(7rem, 30vw, 34rem)/0.84 var(--display);
  letter-spacing: -0.065em;
  color: oklch(0.24 0.035 250);
  will-change: transform;
}

.world-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(50% 0);
  will-change: clip-path;
  -webkit-mask-image: linear-gradient(transparent, #000 10%, #000 70%, transparent);
  mask-image: linear-gradient(transparent, #000 10%, #000 70%, transparent);
}

.world-frame picture, .world-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 40%;
}

.world-frame img { transform: scale(1.25); will-change: transform; }

/* The 3D spawn covers the picture once it has drawn; without WebGL2 the picture stays. */
.world-frame .spawn { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 0.8s; }
.world-frame.is-3d .spawn { opacity: 1; }
.world-frame.is-3d picture { visibility: hidden; }

/* Maces: three thick pixel maces turn with the scroll while the section is pinned.
   The scroll engine writes data-beat on .maces (0 to 3: Steve crafts, Alex crafts,
   Steve's mace is destroyed) and --mace (0 to 1 through the section). A held slot's
   mace is lit over a glow; a free one is a ghost. Opacity sits on the layers, not the
   mace, because opacity on a 3D group flattens it. */

.maces { position: relative; height: 280vh; }

.maces-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  width: min(100% - 2 * var(--edge), var(--measure));
  margin-inline: auto;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: clamp(22px, 4.5vh, 48px);
}

.forge { display: flex; gap: clamp(18px, 7vw, 130px); perspective: 1100px; }
.fm { position: relative; display: grid; justify-items: center; gap: 22px; }
.fm small { font: 400 0.74rem/1.35 var(--mono); font-stretch: 92%; color: var(--text-3); }
.fm .who { display: none; color: var(--text); }
:is(.maces[data-beat="1"], .maces[data-beat="2"]) .f1 .who,
:is(.maces[data-beat="2"], .maces[data-beat="3"]) .f2 .who { display: inline; }
:is(.maces[data-beat="1"], .maces[data-beat="2"]) .f1 .free,
:is(.maces[data-beat="2"], .maces[data-beat="3"]) .f2 .free { display: none; }

.fm-body {
  --s: clamp(86px, 15vw, 220px);
  position: relative;
  width: var(--s);
  aspect-ratio: 1;
  transform-style: preserve-3d;
  transform: rotateX(-10deg) rotateY(calc(var(--mace, 0) * 540deg + var(--turn)));
}
.f1 .fm-body { --turn: -20deg; }
.f2 .fm-body { --turn: 25deg; }
.f3 .fm-body { --turn: 70deg; }
.fm-body svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: auto;
  transform: translateZ(calc(var(--s) * var(--z)));
  opacity: 0.13;
  filter: grayscale(1);
  transition: opacity 0.6s, filter 0.6s;
}
.fm-body svg.inner { filter: grayscale(1) brightness(0.55); }
.fm-floor {
  width: 80%;
  height: 18px;
  margin-top: -8px;
  border-radius: 50%;
  background: radial-gradient(closest-side, oklch(0.86 0.075 215 / 0.55), transparent);
  opacity: 0;
  transition: opacity 0.6s;
}
:is(.maces[data-beat="1"], .maces[data-beat="2"]) .f1 :is(.fm-body svg, .fm-floor),
:is(.maces[data-beat="2"], .maces[data-beat="3"]) .f2 :is(.fm-body svg, .fm-floor) { opacity: 1; filter: none; }
:is(.maces[data-beat="1"], .maces[data-beat="2"]) .f1 .fm-body svg.inner,
:is(.maces[data-beat="2"], .maces[data-beat="3"]) .f2 .fm-body svg.inner { filter: brightness(0.55); }

.mace-count {
  font: 400 0.78rem/1.4 var(--sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
}
.mace-count::after { content: "0 of 3 slots taken"; }
.maces[data-beat="1"] .mace-count::after, .maces[data-beat="3"] .mace-count::after { content: "1 of 3 slots taken"; }
.maces[data-beat="2"] .mace-count::after { content: "2 of 3 slots taken"; }

.maces-copy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 30rem));
  gap: 16px clamp(32px, 5vw, 96px);
  text-align: left;
  color: var(--text-2);
}

/* Features: the heading stays put while the list runs past it, and the entry
   level with the middle of the screen is the one lit. */

.features {
  width: min(100% - 2 * var(--edge), var(--measure));
  margin: var(--space) auto 0;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 96px);
  align-items: start;
}

.features-head { position: sticky; top: 30vh; }
.features-head h2 { font-size: var(--support); line-height: 1.05; letter-spacing: -0.03em; }

.index { margin: 0; padding: 0; list-style: none; }

.index li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 24px;
  padding: clamp(26px, 4vh, 40px) 0;
  border-top: 1px solid var(--hair);
  color: var(--text-4);
  transition: color 0.5s;
}

.index li:last-child { border-bottom: 1px solid var(--hair); }

.index h3 {
  font-size: clamp(1.6rem, 2.2vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.index p { grid-column: 1; max-width: 36rem; }
.index code { grid-column: 2; grid-row: 1; align-self: center; font-size: 0.74rem; font-weight: 400; }
.index li.near { color: var(--text); }
.index li.near p { color: var(--text-2); }

/* Live stream: a day on a dial, closed all the way round, with a red dot where the
   visitor's time is now, pinging the way a live mark does on every streaming site. */

.live {
  width: min(100% - 2 * var(--edge), var(--measure));
  margin: var(--space) auto 0;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 120px);
  align-items: center;
}

/* Centred on the text as it is seen: the heading's line box has empty space above its
   capitals (about 0.12em), so the box's middle sits above the ink's. */
.dial { width: min(100%, 400px); overflow: visible; translate: 0 calc(var(--chapter) * 0.06); }
/* SVG text stands on its baseline, so each label drops by half its digits' height,
   measured on the rendered digits: 0.337 of the size in Funnel Display, 0.36 in
   Martian Mono. */
.dial-ring { fill: none; stroke: var(--text-2); stroke-width: 1.4; }
.dial-ticks line { stroke: var(--text-4); stroke-width: 1; }
.dial-ticks line.major { stroke: var(--text-2); stroke-width: 1.4; }
.dial-hour { fill: var(--text-4); font: 400 6.5px var(--mono); text-anchor: middle; }
.dial-mid { fill: var(--text); font: 500 40px var(--display); letter-spacing: -0.04em; text-anchor: middle; }
.dial-now { fill: oklch(0.64 0.21 27); }
.dial-now .ping { transform-box: fill-box; transform-origin: center; animation: ping 1.6s ease-out infinite; }

@keyframes ping { from { opacity: 0.6; scale: 1; } to { opacity: 0; scale: 3.4; } }

.live-copy { display: grid; gap: 22px; }
.live-copy p { color: var(--text-2); max-width: 30rem; }

.watch {
  justify-self: start;
  display: inline-flex;
  gap: 0.5em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hair-strong);
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.25s;
}

.watch::after { content: "\2197"; color: var(--text-3); transition: translate 0.25s; }
.watch:hover { border-color: var(--text); }
.watch:hover::after { translate: 2px -2px; }

/* Referrals: what a referral is worth, set huge (yours in the accent), beside how to
   get one, on a lighter ground that rises out of the ink and sinks back, so the
   section stands apart from the live stream above it. */

.refer {
  margin-top: var(--space);
  padding-block: calc(var(--space) * 1.3);
  background: linear-gradient(transparent, oklch(0.195 0.014 250) 30%, oklch(0.195 0.014 250) 70%, transparent);
}

.refer-in {
  width: min(100% - 2 * var(--edge), var(--measure));
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 40px clamp(32px, 5vw, 96px);
  align-items: end;
}

.coins { display: flex; gap: clamp(36px, 6vw, 112px); }
.coin b { display: block; font: 470 clamp(6rem, 16vw, 15rem)/0.8 var(--display); letter-spacing: -0.06em; }
.coin:first-child b { color: var(--accent); }
.coin span { display: block; margin-top: 18px; font-size: 0.9rem; color: var(--text-3); }

.refer-text { display: grid; gap: 20px; }
.refer-text h2 { font-size: var(--support); line-height: 1.05; letter-spacing: -0.03em; }
.refer-text p { color: var(--text-2); max-width: 30rem; }

.refer-text .refer-addr {
  font: 470 clamp(1.4rem, 2.4vw, 2.3rem)/1 var(--display);
  letter-spacing: -0.035em;
  white-space: nowrap;
  color: var(--text);
}

.refer-addr span { color: var(--accent); }

/* Ways to play: Java with or without a paid account, Bedrock and Eaglercraft, four
   short columns under hairlines, all at one address. */

.play { width: min(100% - 2 * var(--edge), var(--measure)); margin: var(--space) auto 0; }

.ways {
  margin: clamp(48px, 8vh, 88px) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px clamp(24px, 3vw, 48px);
}

.ways li { display: grid; gap: 10px; align-content: start; padding-top: 20px; border-top: 1px solid var(--hair-strong); }
.ways h3 { font-size: clamp(1.3rem, 1.7vw, 1.6rem); line-height: 1.2; letter-spacing: -0.02em; }
.ways p { color: var(--text-2); }
.ways-note { margin-top: 32px; color: var(--text-3); }
.ways-note b { color: var(--text); font-weight: 500; }

/* Finale: the river returns from the left under the name and runs off the bottom
   of the page. No band of water waits above the name: it follows the last chapter. */

.finale {
  position: relative;
  margin-top: calc(var(--space) * 0.6);
  overflow: clip;
  isolation: isolate;
}

.finale-river {
  position: absolute;
  inset: 0 0 -20vh;
  z-index: -1;
  will-change: transform;
}

/* The river moves while the section's top edge does not, so the fade in from
   the ink is pinned to the section, not drawn by the river. */
.finale::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 55%;
  z-index: -1;
  background: linear-gradient(var(--ink), oklch(0.13 0.010 252 / 0.5) 40%, transparent);
  pointer-events: none;
}

.closing {
  width: min(100% - 2 * var(--edge), var(--measure));
  margin: clamp(40px, 9vh, 96px) auto 0;
  font: 500 calc((100vw - 2 * var(--edge)) / 6.45)/1 var(--display);
  letter-spacing: -0.06em;
  text-indent: -0.05em;
  white-space: nowrap;
}

/* The address under the end of the name, in its face at a fifth of its size, as a
   wordmark carries its web address: set this close, the two read as one. */

.lockup {
  width: min(100% - 2 * var(--edge), var(--measure));
  margin: calc((100vw - 2 * var(--edge)) / 6.45 * -0.06) auto 0;
  display: flex;
  justify-content: flex-end;
  text-shadow: 0 0 16px oklch(0.13 0.010 252 / 0.9);
}

.lockup-ip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.9em;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.lockup-host {
  font: 500 calc((100vw - 2 * var(--edge)) / 6.45 * 0.2)/1 var(--display);
  letter-spacing: -0.04em;
  color: var(--text-2);
  transition: color 0.2s;
}

.lockup-ip:hover .lockup-host { color: var(--text); }
.lockup-ip:hover .copy-label { color: var(--accent); }

.foot {
  position: relative;
  padding: 26px var(--edge) 34px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 32px;
  font-size: 0.82rem;
  color: var(--text-3);
  background: linear-gradient(transparent, oklch(0.13 0.010 252 / 0.85) 40%);
}

/* Narrow screens */

@media (max-width: 900px) {
  .features { grid-template-columns: 1fr; }
  .ways { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features-head { position: static; }
  .refer-in, .live { grid-template-columns: 1fr; }
  .dial { translate: none; width: min(100%, 260px); }
}

@media (max-width: 720px) {
  .bar nav a:not(.bar-join) { display: none; }
  .mark { opacity: 1; }
  .hero { --name: calc((100vw - 2 * var(--edge)) / 6.55); }
  .wordmark { top: 22%; white-space: normal; }
  .wordmark span { display: block; margin: 0.3em 0 0 0.04em; font-size: 0.42em; }
  .hero-note { top: calc(22% + var(--name) * 1.35 + 28px); justify-content: flex-start; gap: 0.8em; letter-spacing: 0.12em; white-space: nowrap; }
  .world { height: 240vh; }
  .maces-copy { grid-template-columns: 1fr; font-size: 0.98rem; }
  .fm-body { --s: 24vw; }
  .forge { gap: 18px; }
  .coin b { font-size: clamp(5rem, 26vw, 8rem); }
  .refer-text .refer-addr { font-size: 1.3rem; }
  .lockup { margin-top: 6px; }
  .lockup-host { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .world, .maces { height: auto; }
  .world-stage { position: relative; height: 70svh; }
  .world-frame { clip-path: none; }
  .world-frame img { transform: none; }
  .world-word { display: none; }
  .down svg, .dial-now .ping { animation: none; }
  .dial-now .ping { display: none; }
  .maces-stage { position: relative; height: auto; padding-block: var(--space); }
  .maces * { transition: none !important; }
  .index li { color: var(--text); }
  .index li p { color: var(--text-2); }
}
