/* coldmc.com
   Cold fog, one glowing mark, mono captions in the corners.
   Every colour is a token here; the scene in js/main.js reads the same values. */

@font-face {
  font-family: "Goldman";
  src: url("../assets/fonts/goldman-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
/* the console face: Minecraft's own pixel type, the fan-made copy by IdreesInc, SIL OFL 1.1 */
@font-face {
  font-family: "Minecraft";
  src: url("../assets/fonts/Minecraft.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Minecraft";
  src: url("../assets/fonts/Minecraft-Bold.otf") format("opentype");
  font-weight: 500 700;
  font-display: swap;
}

:root {
  --frost-hi: #f1f3f8;
  --frost: #c7cdd9;
  --haze: #9aa2b4;
  --slate: #646d82;
  --ink: #2f3443;
  --blurple: #a399ff;
  --glow: #e6e2ff;

  --text: var(--frost-hi);
  --text-dim: #3c4252;
  --rule: rgba(241, 243, 248, 0.32);

  --gutter: clamp(16px, 2.2vw, 30px);
  --hud: 12px;
  --body: 16px;
  --ease: cubic-bezier(0.22, 0.61, 0.21, 1);
}

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

html {
  background: var(--haze);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #c3c9d6 0%, #9aa2b4 55%, #7e879b 100%) fixed;
  font: 400 var(--body)/1.45 "Minecraft", ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: none;
  font-smooth: never;
  overflow-x: hidden;
}

a { color: inherit; }
p { margin: 0; }

::selection { background: var(--blurple); color: #fff; }

:focus-visible {
  outline: 1px solid var(--glow);
  outline-offset: 4px;
  box-shadow: 0 0 14px rgba(163, 153, 255, 0.7);
}

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

.skip {
  position: fixed;
  left: var(--gutter);
  top: -60px;
  z-index: 50;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--frost-hi);
  font-size: var(--hud);
  text-decoration: none;
}
.skip:focus { top: var(--gutter); }

.is-deep {
  --text-dim: rgba(208, 214, 234, 0.62);
  --rule: rgba(208, 214, 234, 0.24);
}
.hud-dim,
.rail a,
.spec dt,
.realms .unfound b,
.realms .unfound span,
.foot { transition: color 0.6s var(--ease); }

/* ---------- the stage ---------- */

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.fallback-logo {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
}
.fallback-logo img {
  width: min(16vw, 120px);
  filter: drop-shadow(0 0 18px var(--blurple)) drop-shadow(0 0 40px var(--glow)) brightness(1.3);
}
.no-webgl .fallback-logo { opacity: 1; }
/* without the scene, the page makes the descent itself: light at the surface, deep blue below */
.no-webgl {
  --text-dim: rgba(208, 214, 234, 0.62);
  --rule: rgba(208, 214, 234, 0.24);
  background: linear-gradient(180deg, #c3c9d6 0, #9aa2b4 60vh, #3a4360 135vh, #1d2337 220vh, #141a2b 100%);
}
.no-webgl .act-hero ~ .act { color: var(--frost-hi); }

.whiteout {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 55%, #f4f6fb 0%, #dfe3ec 45%, rgba(200, 206, 218, 0.6) 100%);
  opacity: var(--whiteout, 0);
}

/* ---------- loader: the flat ColdMC mark builds itself, then gives way to the ice one ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--haze);
  color: #fff;
  transition: opacity 1.1s var(--ease) 0.35s, visibility 0s linear 1.5s;
}
/* its C sits where the scene's brick C spins, its ring round it */
.loader-mark {
  position: absolute;
  left: 50%;
  top: 47%;
  width: min(40vh, 70vw);
  height: auto;
  transform: translate(-50%, -30.2%);
  transform-origin: 50% 30.2%;
  overflow: visible;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8)) drop-shadow(0 0 22px rgba(163, 153, 255, 0.55));
  transition: transform 1.3s var(--ease), opacity 1s var(--ease) 0.2s, filter 1.2s var(--ease);
}
.lm-track,
.lm-ring { fill: none; stroke: currentColor; stroke-width: 0.8; }
.lm-track { opacity: 0.2; }
.lm-ring { stroke-dasharray: 100; stroke-dashoffset: 100; }
.lm-ghost { fill: currentColor; opacity: 0.18; }
.lm-c { fill: var(--glow); }
.lm-ice rect {
  fill: currentColor;
  transform: scaleY(0);
  transform-box: fill-box;
  transform-origin: top;
  transition: transform 0.5s var(--ease);
}
.lm-ice rect:nth-child(3n) { transition-delay: 0.08s; }
.lm-ice rect:nth-child(3n + 1) { transition-delay: 0.16s; }
.loader.is-full .lm-ice rect { transform: none; }
.loader-count {
  position: absolute;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  font: 400 12px/1 "Minecraft", ui-monospace, monospace;
  letter-spacing: 0.3em;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  transition: opacity 0.4s;
}
/* on Flake the C swells to the size of the brick C behind it, and goes */
.loader.is-bloom .loader-mark { transform: translate(-50%, -30.2%) scale(4.4); opacity: 0; filter: drop-shadow(0 0 24px #fff) blur(6px); }
.loader.is-bloom .loader-count { opacity: 0; }
.is-ready .loader { opacity: 0; visibility: hidden; }

/* ---------- corner HUD ---------- */

.hud {
  position: fixed;
  z-index: 10;
  font-size: var(--hud);
  line-height: 1.32;
  text-shadow: 0 0 10px rgba(80, 88, 110, 0.35);
}
.hud p + p { margin-top: 12px; }
.hud-dim {
  color: var(--text-dim);
  text-shadow: none;
}

.hud-tl { left: var(--gutter); top: var(--gutter); }
.hud-tr { right: var(--gutter); top: var(--gutter); text-align: right; }
.hud-bl { left: var(--gutter); bottom: var(--gutter); }
.hud-br { right: var(--gutter); bottom: var(--gutter); }

.wordmark {
  display: inline-block;
  margin-bottom: 14px;
  font: 700 clamp(28px, 2.9vw, 40px)/0.9 "Goldman", sans-serif;
  letter-spacing: 0.01em;
  color: #fff;
  text-decoration: none;
  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.85),
    0 0 18px rgba(230, 226, 255, 0.55),
    0 0 42px rgba(163, 153, 255, 0.35);
}

.hud-tr,
.hud-tl > p:not(.hud-dim),
.scroll-hint {
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.is-scrolled .hud-tr,
.is-scrolled .hud-tl > p:not(.hud-dim),
.is-scrolled .scroll-hint {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.scroll-hint { margin-bottom: 14px; }

/* the sound toggle, top right, as gaia.coldmc.com has it: pixel bars that move with the wind,
   and the word for what it does. The few words below it step down to make room */
.sound {
  position: fixed;
  z-index: 11;
  top: var(--gutter);
  right: var(--gutter);
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 4px 0 4px 6px;
  border: 0;
  background: none;
  color: var(--text-dim);
  font: 400 var(--hud)/1 "Minecraft", ui-monospace, monospace;
  cursor: pointer;
  transition: color 0.4s var(--ease);
}
.sound:hover { color: #fff; }
.sound b { font-weight: 400; color: #fff; text-shadow: 0 0 8px rgba(230, 226, 255, 0.8); }
.ticks { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.ticks i {
  display: block;
  width: 3px;
  height: 14px;
  background: #fff;
  opacity: 0.75;
  box-shadow: 0 0 6px rgba(230, 226, 255, 0.7);
  transform-origin: bottom;
  transform: scaleY(var(--h, 0.143));
}
.sound:not([aria-pressed="true"]) .ticks i { animation: idle 2.4s steps(4) infinite; animation-delay: calc(var(--n, 0) * -230ms); }
.ticks i:nth-child(2n) { --n: 3; }
.ticks i:nth-child(3n) { --n: 7; }
.ticks i:nth-child(5n) { --n: 11; }
@keyframes idle { 0%, 100% { transform: scaleY(0.143); } 50% { transform: scaleY(0.43); } }
.hud-tr { top: calc(var(--gutter) + 40px); }

/* section rail: where you are in the descent */
.rail {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: right;
  counter-reset: rail;
}
.rail li { counter-increment: rail; }
.rail a {
  display: inline-block;
  padding: 2px 0;
  color: var(--text-dim);
  text-decoration: none;
  text-shadow: none;
  transition: color 0.4s var(--ease);
}
.rail a::before {
  content: "0" counter(rail) "  ";
  white-space: pre;
  opacity: 0.6;
}
.rail a[aria-current="true"] {
  color: #fff;
  text-shadow: 0 0 10px rgba(230, 226, 255, 0.8);
}
.rail a:hover { color: #fff; }

/* ---------- acts ---------- */

main { position: relative; z-index: 5; }

.act {
  position: relative;
  min-height: 100vh;
  padding: 18vh var(--gutter);
}
.act-hero { min-height: 110vh; }
.act-descent { min-height: 140vh; }
.act-realms { min-height: 170vh; }
.act-update { min-height: 150vh; }
.act-gaia { min-height: 120vh; }
.act-join { min-height: 100vh; height: 100vh; display: grid; place-items: end center; padding-bottom: 15vh; }

.panel {
  position: sticky;
  top: 18vh;
  max-width: 360px;
}
.panel-left { margin-right: auto; }
.panel-right { margin-left: auto; margin-right: 112px; text-align: left; } /* clear of the section rail */
.panel-wide { max-width: 520px; }
/* the fog thins slowly, so light text on it gets a dark halo of its own; still a glow, only cold */
.is-deep .panel { text-shadow: 0 1px 2px rgba(18, 22, 40, 0.45), 0 0 20px rgba(18, 22, 40, 0.42); }

.act-realms { display: flex; justify-content: space-between; gap: 6vw; align-items: flex-start; }
.act-realms .panel-right { max-width: 520px; }

.panel h2 {
  margin: 14px 0 16px;
  font: 500 clamp(19px, 1.7vw, 24px)/1.22 "Minecraft", ui-monospace, monospace;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(18, 22, 40, 0.4), 0 0 14px rgba(230, 226, 255, 0.45);
  text-wrap: balance;
}
.lede {
  max-width: 44ch;
  color: rgba(241, 243, 248, 0.9);
  text-shadow: 0 0 10px rgba(70, 78, 100, 0.35);
}

.link {
  display: inline-block;
  margin-top: 22px;
  padding-bottom: 2px;
  font-size: var(--hud);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.3s var(--ease), text-shadow 0.3s var(--ease);
}
.link::before { content: "> "; color: var(--text-dim); }
.link:hover {
  border-color: #fff;
  text-shadow: 0 0 12px rgba(230, 226, 255, 0.9);
}

.realms {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  border-top: 1px solid var(--rule);
}
.realms li {
  display: grid;
  grid-template-columns: 15ch 1fr;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}
.realms b { font-weight: 500; color: #fff; }
.realms span { color: rgba(241, 243, 248, 0.86); }
.realms .unfound b,
.realms .unfound span { color: var(--text-dim); }
.realms .unfound b::after { content: " ???"; opacity: 0.6; }

.spec {
  margin: 26px 0 0;
  font-size: 13px;
  border-top: 1px solid var(--rule);
}
.spec div {
  display: grid;
  grid-template-columns: 17ch 1fr;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}
.spec dt { color: var(--text-dim); }
.spec dd { margin: 0; color: #fff; }

/* blurred data fragments that drift past during the descent. The descent is a white-out in the
   fog, so they are dark ice-ink rather than white, which vanished into it */
.drift {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
}
.drift span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font: 500 clamp(16px, 2vw, 26px)/1 "Minecraft", ui-monospace, monospace;
  letter-spacing: 0.04em;
  color: rgba(28, 36, 64, 0.62);
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.5);
  filter: blur(calc(var(--d) * 1.8px));
  transform: translate3d(0, calc(var(--drift, 0) * var(--d) * -60vh), 0);
  opacity: var(--drift-o, 0);
}

/* ---------- join ---------- */

.join {
  text-align: center;
  max-width: 560px;
  /* a flex column centres a child wider than itself on both sides; text-align only pushed the
     address out to the right */
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 20px 0 22px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
}
.ip-text {
  font: 700 clamp(40px, 7.4vw, 104px)/0.9 "Goldman", sans-serif;
  letter-spacing: 0.01em;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.9),
    0 0 28px rgba(230, 226, 255, 0.7),
    0 0 70px rgba(163, 153, 255, 0.55);
}
.ip-copy {
  font: 500 var(--hud)/1 "Minecraft", ui-monospace, monospace;
  padding: 7px 12px;
  border: 1px solid var(--rule);
  border-radius: 99px;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.ip:hover .ip-copy,
.ip:focus-visible .ip-copy { border-color: #fff; background: rgba(255, 255, 255, 0.08); }
.ip.is-copied .ip-copy { border-color: var(--glow); background: rgba(163, 153, 255, 0.25); }

.join-note {
  margin: 0 auto;
  max-width: 46ch;
  font-size: 13px;
  color: rgba(241, 243, 248, 0.9);
}
.join-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 26px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--hud);
}
.join-links a {
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.join-links a:hover { border-color: #fff; }

.foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 var(--gutter);
  font-size: 11.5px;
  text-align: center;
  color: var(--text-dim);
}

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  :root { --hud: 11.5px; --body: 13px; }
  .hud-tr { display: none; }
  .hud-br { display: none; }
  .sound-label { display: none; }
  .act { padding: 16vh var(--gutter); }
  .act-realms { display: block; }
  .panel-right { margin-right: 0; }
  .act-realms .panel-right { margin-top: 40px; }
  .panel { position: relative; top: 0; max-width: none; }
  .realms li,
  .spec div { grid-template-columns: 1fr; gap: 2px; }
  .foot { bottom: calc(var(--gutter) + 40px); }
  /* the corners are fixed and the text scrolls under them, so give them a shade to stand on */
  body::before,
  body::after {
    content: '';
    position: fixed;
    z-index: 9;
    left: 0;
    right: 0;
    height: 124px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s var(--ease);
  }
  body::before { top: 0; background: linear-gradient(rgba(22, 26, 42, 0.9) 40%, rgba(22, 26, 42, 0)); }
  body::after { bottom: 0; background: linear-gradient(rgba(22, 26, 42, 0), rgba(22, 26, 42, 0.9) 60%); }
  .is-scrolled::before,
  .is-scrolled::after { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { transition-duration: 0.01ms !important; animation: none !important; }
  .drift span { transform: none; filter: none; }
}
