/* gaia.coldmc.com
   One face, Minecraft's own pixel type, set in capitals at multiples of its 8 px grid.
   The page is a fixed stage: the canvas fills it and each view is a layer of text over it. */

@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: 700;
  font-display: swap;
}

:root {
  --bg: #04070f;
  --ink: #e8eeff;
  --dim: #8191bd;
  --faint: rgba(200, 216, 255, 0.22);
  --violet: #b2a2ff;
  --violet-dim: rgba(178, 162, 255, 0.55);
  --ice: #bfe4ff;
  --ga: #2f64ff;
  --gb: #62c6ff;
  --gutter: 48px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
}

body {
  font: 400 16px/24px 'Minecraft', ui-monospace, monospace;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-rendering: optimizeSpeed;
}

a { color: inherit; }
button,
input { font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
p { margin: 0; }
h1, h2 { margin: 0; font-weight: 400; font-size: inherit; }

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

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

.skip {
  position: fixed;
  z-index: 50;
  left: var(--gutter);
  top: -80px;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}
.skip:focus { top: 16px; }

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

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

.loader {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 28px;
  background: #010207;
  color: var(--ice);
  transition: opacity 1.1s var(--ease) 0.35s, visibility 0s linear 1.5s;
}
/* sized and placed so its ring sits where the scene draws the glass one: the ring is 13 of the
   mark's 40 units across, centred 16 of 53 down */
.loader-mark {
  position: absolute;
  left: 50%;
  top: 44.5%;
  width: min(47vh, 80vw);
  height: auto;
  transform: translate(-50%, -30.2%);
  overflow: visible;
  filter: drop-shadow(0 0 10px rgba(127, 190, 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.12; }
.lm-ring { stroke-dasharray: 100; stroke-dashoffset: 100; }
.lm-ghost { fill: currentColor; opacity: 0.12; }
.lm-c { fill: #9fc4ff; }
.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-size: 8px;
  line-height: 16px;
  letter-spacing: 0.4em;
  color: var(--dim);
  transition: opacity 0.4s;
}
.loader.is-bloom { opacity: 0; visibility: hidden; }
.loader.is-bloom .loader-mark { transform: translate(-50%, -30.2%) scale(1.08); opacity: 0; filter: drop-shadow(0 0 24px rgba(127, 190, 255, 0.9)) blur(6px); }
.loader.is-bloom .loader-count { opacity: 0; }

/* ---------- chrome: brand, pill, meter, status ---------- */

.brand,
.top,
.view,
.finder { opacity: 0; transition: opacity 1s var(--ease); }
.is-ready .brand,
.is-ready .top { opacity: 1; }

.brand {
  position: fixed;
  z-index: 10;
  left: var(--gutter);
  top: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ice);
}
.brand img { display: block; filter: drop-shadow(0 0 6px rgba(127, 190, 255, 0.6)); }

.top {
  position: fixed;
  z-index: 10;
  right: var(--gutter);
  top: 40px;
  display: grid;
  justify-items: center;
}

/* a stone-grey slot from the game's own menus, stepped at the corners, lit from above */
.pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 44px;
  padding: 0 22px;
  border: 2px solid rgba(200, 216, 255, 0.3);
  border-radius: 2px;
  background: rgba(6, 10, 22, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.08), inset 0 -2px 0 rgba(0, 0, 0, 0.45);
  clip-path: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px));
}
.pill a {
  text-decoration: none;
  color: var(--ink);
  opacity: 0.86;
  transition: opacity 0.3s, text-shadow 0.3s;
}
.pill a:hover,
.pill a[aria-current] { opacity: 1; text-shadow: 0 0 10px rgba(191, 228, 255, 0.7); }
.pill-gem { width: 7px; height: 7px; fill: var(--dim); shape-rendering: crispEdges; transition: fill 0.5s, filter 0.5s; }
[data-view='features'] .pill-gem,
[data-view='detail'] .pill-gem,
[data-view='join'] .pill-gem { fill: var(--gb); filter: drop-shadow(0 0 4px var(--gb)); }

/* the sound toggle: pixel bars that move with the echo, and the word for what it does */
.sound {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 10px;
  padding: 4px 6px;
  font-size: 8px;
  line-height: 8px;
  color: var(--dim);
}
.sound:hover { color: var(--ink); }
.sound b { font-weight: 400; color: var(--ice); }
.ticks { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.ticks i {
  display: block;
  width: 3px;
  height: 14px;
  background: var(--ice);
  opacity: 0.6;
  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); } }

/* Gaia's status: one line, a beat that says it is awake, and which of its lines this is */
.status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 6px 10px;
  border-left: 2px solid var(--violet-dim);
  background: linear-gradient(90deg, rgba(20, 14, 48, 0.5), rgba(6, 10, 22, 0));
  font-size: 8px;
  line-height: 16px;
  color: var(--dim);
  text-align: left;
}
.status:hover { color: var(--ink); }
.status-text { min-width: 176px; }
.status-dot { width: 4px; height: 4px; background: #7dffb0; box-shadow: 0 0 6px #7dffb0; animation: beat 2s steps(2) infinite; }
@keyframes beat { 50% { opacity: 0.25; } }
.status-pips { display: flex; gap: 3px; }
.status-pips i { width: 4px; height: 4px; background: var(--faint); }
.status-pips i.is-on { background: var(--violet); }

/* made with: the one line on every view that says who built it */
.credit {
  position: fixed;
  z-index: 7;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  font-size: 8px;
  line-height: 16px;
  letter-spacing: 0.12em;
  color: var(--dim);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 1s var(--ease);
}
.is-ready .credit { opacity: 0.7; }
.credit a { text-decoration: none; color: var(--ice); }
.credit a:hover { text-shadow: 0 0 8px var(--ice); }

/* ---------- views ---------- */

.view {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.7s var(--ease), visibility 0s linear 0.7s;
}
.view > * { pointer-events: auto; }
.is-ready[data-view='home'] .view-home,
.is-ready[data-view='features'] .view-features,
.is-ready[data-view='detail'] .view-detail,
.is-ready[data-view='join'] .view-join {
  opacity: 1;
  visibility: visible;
  transition: opacity 1s var(--ease) 0.6s, visibility 0s;
}

/* home */
.scroll-hint {
  position: absolute;
  left: 50%;
  top: 20%;
  transform: translateX(-50%);
  color: var(--ice);
  opacity: 0.75;
  letter-spacing: 0.12em;
  pointer-events: none;
}
.scroll-hint::after {
  /* fills as you keep scrolling; full means the dive */
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 1px;
  background: var(--ice);
  transform: scaleX(var(--dive, 0));
  transform-origin: left;
  box-shadow: 0 0 6px var(--ice);
}
.home-caption {
  position: absolute;
  left: var(--gutter);
  bottom: 44px;
  max-width: 34ch;
  color: var(--dim);
}

/* features */
/* the name sits above the frame, like the name a game shows over the item you hold */
.feature-title {
  position: absolute;
  left: 50%;
  top: 14%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 18px;
  max-width: 86vw;
  color: rgba(242, 245, 255, 0.94);
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.55), 0 0 26px rgba(4, 8, 20, 0.7), 0 0 18px rgba(170, 200, 255, 0.35);
}
.feature-mark {
  width: 16px;
  height: 28px;
  background: currentColor;
  -webkit-mask: url('../assets/logo/coldmc-c.svg') center / contain no-repeat;
  mask: url('../assets/logo/coldmc-c.svg') center / contain no-repeat;
  filter: drop-shadow(0 0 8px rgba(191, 228, 255, 0.8));
}
.feature-name {
  font-size: clamp(28px, 4.2vw, 64px);
  line-height: 1;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
}
.stepper {
  position: absolute;
  right: var(--gutter);
  bottom: 44px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--dim);
}
.stepper button {
  width: 32px;
  height: 32px;
  border: 2px solid var(--faint);
  border-radius: 2px;
  color: var(--ink);
}
.stepper button:hover { border-color: var(--ice); }
/* the keys a player already has a hand on; js/main.js and js/ui.js listen for them */
.keys {
  position: absolute;
  right: var(--gutter);
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--dim);
}
.keys kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 18px;
  height: 18px;
  padding: 1px 4px 0;
  border: 1px solid var(--faint);
  border-bottom-width: 2px;
  border-radius: 3px;
  font: inherit;
  line-height: 1;
  color: var(--ink);
}
.keys span { margin: 0 10px 0 4px; }
.keys span:last-child { margin-right: 0; }
@media (hover: none) { .keys { display: none; } }

/* the finder: filters and Ask Gaia, shared by features and detail */
.finder {
  position: fixed;
  z-index: 6;
  left: var(--gutter);
  bottom: 56px;
  max-width: calc(100vw - 2 * var(--gutter));
  visibility: hidden;
  transition: opacity 0.7s var(--ease), visibility 0s linear 0.7s;
}
.is-ready[data-view='features'] .finder,
.is-ready[data-view='detail'] .finder {
  opacity: 1;
  visibility: visible;
  transition: opacity 1s var(--ease) 0.6s, visibility 0s;
}
.finder { text-shadow: 0 0 8px rgba(4, 7, 15, 0.9), 0 0 2px rgba(4, 7, 15, 0.9); }
.finder-h { margin-bottom: 12px; }
.filters { list-style: none; margin: 0 0 28px; padding: 0; }
.filters button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  color: var(--violet);
  transition: color 0.25s, text-shadow 0.25s;
}
.filters .box {
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  transition: background 0.25s;
}
.filters button:hover,
.filters button[aria-pressed='true'] { color: #fff; text-shadow: 0 0 10px var(--violet); }
.filters button[aria-pressed='true'] .box { background: currentColor; box-shadow: inset 0 0 0 2px #140e30; }
[data-view='detail'] .finder-h,
[data-view='detail'] .filters { display: none; }

/* Ask the wiki: the game's chat line, a dark bar with a prompt, and Enter sends it to wiki.coldmc.com */
.ask {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 320px;
  height: 40px;
  padding: 0 14px;
  border: 2px solid transparent;
  background: rgba(0, 0, 0, 0.52);
  color: var(--violet);
  transition: border-color 0.3s, box-shadow 0.3s, width 0.4s var(--ease);
}
.ask:focus-within { width: 380px; border-color: var(--violet-dim); box-shadow: 0 0 18px rgba(140, 110, 255, 0.25); }
.ask-prompt { color: var(--violet-dim); }
.ask input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  caret-color: var(--violet);
  outline: none;
}
.ask input::placeholder { color: var(--violet-dim); }
.ask input::-webkit-search-cancel-button { display: none; }

/* detail */
.scroll-close {
  position: absolute;
  left: 50%;
  top: 112px;
  transform: translateX(-50%);
  color: var(--dim);
  letter-spacing: 0.12em;
}
.sheet {
  position: absolute;
  left: var(--gutter);
  bottom: 136px;
  width: min(380px, calc(100vw - 2 * var(--gutter)));
  display: grid;
  gap: 12px;
  justify-items: start;
}
.sheet h2 { font-weight: 700; }
.sheet h2:focus { outline: none; }
.sheet-meta { color: var(--dim); }
.sheet-wiki[hidden] { display: none; }
.is-building .sheet-meta { color: #ffc46b; }
.sheet-text { text-transform: none; letter-spacing: 0.02em; }
.sheet-wiki,
.sheet-close { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.sheet-close { text-decoration: none; margin-top: 8px; }
.sheet-wiki:hover,
.sheet-close:hover { text-shadow: 0 0 10px rgba(191, 228, 255, 0.7); }

/* join */
.view-join { display: grid; }
.join-kicker {
  position: absolute;
  left: 50%;
  top: 25%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 24px;
  line-height: 32px;
  white-space: nowrap;
}
.join-kicker svg { width: 14px; height: 14px; fill: var(--ice); shape-rendering: crispEdges; }
/* the way through the realms, each one a slot in the game's own frame */
.route {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 24px);
  font-size: clamp(24px, 3.2vw, 48px);
  line-height: 1;
  white-space: nowrap;
  color: #eef2ff;
  text-shadow: 0 0 22px rgba(160, 190, 255, 0.35);
}
.route span {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 18px clamp(16px, 2vw, 32px) 20px;
  border: 2px solid rgba(200, 216, 255, 0.22);
  background: rgba(6, 10, 22, 0.55);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.06), inset 0 -2px 0 rgba(0, 0, 0, 0.45);
}
.route small { font-size: 8px; line-height: 8px; letter-spacing: 0.2em; color: var(--dim); text-shadow: none; }
.route span:nth-of-type(2) { color: #dcd6ff; border-color: var(--violet-dim); }
.route .arrow { width: 10px; height: 14px; flex: none; fill: var(--violet); shape-rendering: crispEdges; opacity: 0.8; }
.join-ip-wrap {
  position: absolute;
  left: 50%;
  top: 72%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}
.join-ip {
  font-size: 24px;
  line-height: 32px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 2px;
  transition: text-shadow 0.3s;
}
.join-ip:hover { text-shadow: 0 0 12px rgba(191, 228, 255, 0.8); }
.join-note,
.join-copied { color: var(--dim); min-height: 24px; }
.join-copied { color: var(--ice); }
.join-links {
  position: absolute;
  left: calc(var(--gutter) + 40px);
  bottom: 96px;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.join-links a { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.join-links a:hover { text-shadow: 0 0 10px rgba(191, 228, 255, 0.7); }
.join-badge {
  position: absolute;
  right: calc(var(--gutter) + 40px);
  bottom: 120px;
  display: grid;
  justify-items: center;
  gap: 12px;
  color: var(--dim);
}
.badge-c {
  position: relative;
  width: 104px;
  height: 104px;
  border: 1px solid var(--faint);
  border-radius: 8px;
  background: radial-gradient(closest-side, rgba(127, 190, 255, 0.18), transparent), rgba(6, 10, 22, 0.4);
}
.badge-c::before {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 30px;
  height: 52px;
  background: var(--ice);
  -webkit-mask: url('../assets/logo/coldmc-c.svg') center / contain no-repeat;
  mask: url('../assets/logo/coldmc-c.svg') center / contain no-repeat;
  filter: drop-shadow(0 0 8px rgba(127, 190, 255, 0.9));
}
.legal {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 2 * var(--gutter));
  font-size: 8px;
  line-height: 16px;
  color: var(--dim);
  text-align: center;
  opacity: 0.8;
}

/* ---------- the index: hidden while the scene runs, the whole site without it ---------- */

.index { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.index:focus-within {
  position: fixed;
  z-index: 30;
  inset: auto var(--gutter) var(--gutter) auto;
  width: min(360px, 80vw);
  height: auto;
  max-height: 60vh;
  overflow: auto;
  clip-path: none;
  padding: 16px 20px;
  background: rgba(4, 7, 15, 0.92);
  border: 1px solid var(--faint);
  border-radius: 8px;
}
.index ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.index a { text-decoration: none; display: grid; }
.index img { display: none; }
.index span { color: var(--dim); font-size: 8px; line-height: 16px; }
.index-h { margin-bottom: 12px; color: var(--dim); }

html:has(.no-webgl),
.no-webgl { height: auto; overflow: auto; }
.no-webgl #scene { display: none; }
.no-webgl .brand,
.no-webgl .top { opacity: 1; }
.no-webgl .top { position: absolute; }
.no-webgl .sound { display: none; }
.no-webgl .view,
.no-webgl .finder { display: none; }
.no-webgl .index {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  padding: 160px var(--gutter) 64px;
  background: radial-gradient(60% 50% at 0% 0%, rgba(47, 100, 255, 0.25), transparent), radial-gradient(50% 40% at 100% 100%, rgba(98, 198, 255, 0.18), transparent);
}
.no-webgl .index-h { font-size: 24px; line-height: 32px; color: var(--ink); margin-bottom: 32px; }
.no-webgl .index ol { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.no-webgl .index img { display: block; width: 100%; height: auto; border-radius: 8px; margin-bottom: 12px; border: 1px solid var(--faint); }
.no-webgl[data-view='detail'] .view-detail,
.no-webgl[data-view='join'] .view-join { display: grid; opacity: 1; visibility: visible; position: fixed; z-index: 20; background: rgba(4, 7, 15, 0.96); }
.noscript { position: fixed; inset: auto var(--gutter) var(--gutter); max-width: 50ch; }

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

@media (max-width: 760px) {
  :root { --gutter: 20px; }
  .brand { top: 26px; }
  .brand span { display: none; }
  .top { top: 20px; }
  .pill { height: 40px; padding: 0 16px; gap: 12px; }
  .sound-label { display: none; }
  .status { display: none; }
  .scroll-hint { top: 24%; }
  .home-caption { bottom: 28px; right: var(--gutter); }
  .feature-title { top: 20%; gap: 10px; }
  .feature-name { font-size: 32px; }
  .stepper { bottom: auto; top: 66%; left: 50%; right: auto; transform: translateX(-50%); padding: 4px 8px; border-radius: 999px; background: rgba(4, 7, 15, 0.72); }
  .finder-h { display: none; }
  .filters { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 16px; }
  .filters button span { display: none; }
  .finder { bottom: 32px; }
  .ask,
  .ask:focus-within { width: calc(100vw - 2 * var(--gutter)); }
  .scroll-close { top: 96px; }
  .sheet { bottom: 96px; }
  .join-kicker { top: 18%; font-size: 16px; }
  .route { flex-direction: column; gap: 8px; font-size: 24px; top: 42%; }
  .route span { padding: 10px 20px 12px; gap: 8px; }
  .route .arrow { transform: rotate(90deg); }
  .join-ip-wrap { top: 66%; width: calc(100vw - 2 * var(--gutter)); }
  .join-note { max-width: 28ch; }
  .join-links { left: var(--gutter); right: var(--gutter); bottom: 60px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; }
  .join-badge { display: none; }
  .legal { bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}
