/* ============================================================
   Vexcraft — pixel frozen-world theme
   All colors live here. Edit these to re-tint the whole site.
   ============================================================ */
:root {
  /* Sky + scene */
  --sky-0: #070a24;
  --sky-1: #121c4e;
  --sky-2: #20427a;
  --horizon: #3a7ca3;
  --far: #4f6fae;
  --far-snow: #c9dbf4;
  --mid: #25397a;
  --mid-snow: #e4f1ff;
  --ground: #0e1a3f;
  --pine: #1d4a6e;
  --pine-snow: #e4f2fc;

  /* UI */
  --panel: #14234f;
  --panel-2: #1b2e62;
  --edge: #3f66b5;
  --text: #eef6ff;
  --muted: #a6b9de;
  --ice: #8fe3ff;
  --ice-hover: #b8eeff;
  --ice-dark: #2c6fb3;
  --mint: #62f0c8;
  --violet: #b48dff;
  --on-ice: #0a1433;
  --snow: #f4fbff;
  --snow-ground: #e3f1fb;
  --on-snow: #14224a;
  --on-snow-muted: #4a5d86;

  --mtn-h: 240px;
  --px: 4px; /* size of one "pixel" in borders and shadows */

  --font-pixel: "Pixelify Sans", "Silkscreen", ui-monospace, monospace;
  --font-brand: "Silkscreen", ui-monospace, monospace; /* clear capital C for VEXCRAFT */
  --font-label: "Silkscreen", ui-monospace, monospace;
  --font-body: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-code: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
code { font-family: var(--font-code); }
.icon { width: 1em; height: 1em; flex: none; fill: currentColor; }

/* ---------- Snow canvases (drawn by script.js) ---------- */
.snow { display: block; pointer-events: none; image-rendering: pixelated; }
.snow-page { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.nav, main, .footer { position: relative; z-index: 1; }

/* ---------- Pixel building blocks ---------- */
/* A panel with notched pixel corners: the 4 offset shadows draw the border
   and leave the corners empty, the last ones add a hard drop shadow. */
.px-panel {
  position: relative;
  margin: var(--px);
  background: var(--panel);
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--edge),
    0 var(--px) 0 0 var(--edge),
    calc(var(--px) * -1) 0 0 0 var(--edge),
    var(--px) 0 0 0 var(--edge),
    inset 0 var(--px) 0 0 rgb(143 227 255 / 0.12),
    calc(var(--px) * 2) calc(var(--px) * 3) 0 0 rgb(3 7 24 / 0.5);
}
/* Pixel snow resting on top of a panel */
.snowcap::before {
  content: "";
  position: absolute;
  left: calc(var(--px) * -1);
  right: calc(var(--px) * -1);
  top: -18px;
  height: 16px;
  background: /*@SNOWCAP*/ url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2296%22 height=%2216%22 shape-rendering=%22crispEdges%22%3E%3Crect x=%220%22 y=%220%22 width=%2212%22 height=%2216%22 fill=%22%23f4fbff%22/%3E%3Crect x=%2212%22 y=%220%22 width=%228%22 height=%2216%22 fill=%22%23f4fbff%22/%3E%3Crect x=%2220%22 y=%224%22 width=%228%22 height=%2212%22 fill=%22%23f4fbff%22/%3E%3Crect x=%2228%22 y=%224%22 width=%228%22 height=%2212%22 fill=%22%23f4fbff%22/%3E%3Crect x=%2236%22 y=%228%22 width=%2212%22 height=%228%22 fill=%22%23f4fbff%22/%3E%3Crect x=%2248%22 y=%228%22 width=%224%22 height=%228%22 fill=%22%23f4fbff%22/%3E%3Crect x=%2252%22 y=%228%22 width=%224%22 height=%228%22 fill=%22%23f4fbff%22/%3E%3Crect x=%2256%22 y=%228%22 width=%228%22 height=%228%22 fill=%22%23f4fbff%22/%3E%3Crect x=%2264%22 y=%224%22 width=%228%22 height=%2212%22 fill=%22%23f4fbff%22/%3E%3Crect x=%2272%22 y=%228%22 width=%224%22 height=%228%22 fill=%22%23f4fbff%22/%3E%3Crect x=%2276%22 y=%224%22 width=%228%22 height=%2212%22 fill=%22%23f4fbff%22/%3E%3Crect x=%2284%22 y=%220%22 width=%228%22 height=%2216%22 fill=%22%23f4fbff%22/%3E%3Crect x=%2292%22 y=%220%22 width=%224%22 height=%2216%22 fill=%22%23f4fbff%22/%3E%3Crect x=%220%22 y=%2212%22 width=%2296%22 height=%224%22 fill=%22%23cfe6f6%22/%3E%3C/svg%3E") /*@END*/ left bottom / 96px 16px repeat-x;
  image-rendering: pixelated;
  pointer-events: none;
}

/* ---------- Nav with hanging icicles ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: var(--sky-0);
  border-bottom: var(--px) solid #d9f4ff;
}
.nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 24px;
  background: /*@ICICLES*/ url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2296%22 height=%2224%22 shape-rendering=%22crispEdges%22%3E%3Crect x=%220%22 y=%220%22 width=%2296%22 height=%224%22 fill=%22%23d9f4ff%22/%3E%3Crect x=%220%22 y=%224%22 width=%228%22 height=%224%22 fill=%22%23bfe9ff%22/%3E%3Crect x=%220%22 y=%228%22 width=%228%22 height=%224%22 fill=%22%23bfe9ff%22/%3E%3Crect x=%220%22 y=%224%22 width=%222%22 height=%224%22 fill=%22%23ffffff%22 opacity=%220.7%22/%3E%3Crect x=%2212%22 y=%224%22 width=%228%22 height=%224%22 fill=%22%23bfe9ff%22/%3E%3Crect x=%2212%22 y=%228%22 width=%228%22 height=%224%22 fill=%22%23bfe9ff%22/%3E%3Crect x=%2212%22 y=%2212%22 width=%228%22 height=%224%22 fill=%22%23bfe9ff%22/%3E%3Crect x=%2214%22 y=%2216%22 width=%224%22 height=%224%22 fill=%22%23bfe9ff%22/%3E%3Crect x=%2214%22 y=%2220%22 width=%224%22 height=%224%22 fill=%22%23bfe9ff%22/%3E%3Crect x=%2212%22 y=%224%22 width=%222%22 height=%2216%22 fill=%22%23ffffff%22 opacity=%220.7%22/%3E%3Crect x=%2228%22 y=%224%22 width=%228%22 height=%224%22 fill=%22%23bfe9ff%22/%3E%3Crect x=%2228%22 y=%228%22 width=%228%22 height=%224%22 fill=%22%23bfe9ff%22/%3E%3Crect x=%2228%22 y=%2212%22 width=%228%22 height=%224%22 fill=%22%23bfe9ff%22/%3E%3Crect x=%2230%22 y=%2216%22 width=%224%22 height=%224%22 fill=%22%23bfe9ff%22/%3E%3Crect x=%2230%22 y=%2220%22 width=%224%22 height=%224%22 fill=%22%23bfe9ff%22/%3E%3Crect x=%2228%22 y=%224%22 width=%222%22 height=%2216%22 fill=%22%23ffffff%22 opacity=%220.7%22/%3E%3Crect x=%2252%22 y=%224%22 width=%228%22 height=%224%22 fill=%22%23bfe9ff%22/%3E%3Crect x=%2252%22 y=%228%22 width=%228%22 height=%224%22 fill=%22%23bfe9ff%22/%3E%3Crect x=%2254%22 y=%2212%22 width=%224%22 height=%224%22 fill=%22%23bfe9ff%22/%3E%3Crect x=%2252%22 y=%224%22 width=%222%22 height=%228%22 fill=%22%23ffffff%22 opacity=%220.7%22/%3E%3Crect x=%2276%22 y=%224%22 width=%228%22 height=%224%22 fill=%22%23bfe9ff%22/%3E%3Crect x=%2276%22 y=%228%22 width=%228%22 height=%224%22 fill=%22%23bfe9ff%22/%3E%3Crect x=%2276%22 y=%224%22 width=%222%22 height=%224%22 fill=%22%23ffffff%22 opacity=%220.7%22/%3E%3C/svg%3E") /*@END*/ 0 -4px / 96px 24px repeat-x;
  image-rendering: pixelated;
  pointer-events: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 1px;
}
.brand-flake { width: 27px; height: 27px; fill: var(--ice); }
.nav nav { display: flex; gap: 22px; }
.nav nav a {
  font-family: var(--font-label);
  font-size: 14px;
  text-decoration: none;
  color: var(--muted);
}
.nav nav a:hover { color: var(--ice); }

/* ---------- Hero scene ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 11vw, 120px) 16px calc(var(--mtn-h) - 20px);
  text-align: center;
  background: linear-gradient(180deg, var(--sky-0) 0%, var(--sky-1) 38%, var(--sky-2) 72%, var(--horizon) 100%);
}
.sky, .hero > .snow, .mountains {
  position: absolute;
  left: 0;
  width: 100%;
  pointer-events: none;
}
.sky { top: 0; height: 100%; }
.hero > .snow { top: 0; height: 100%; }
.mountains { bottom: 0; height: var(--mtn-h); }
.sky .tw { animation: twinkle 3.2s steps(2) infinite; }
.aurora { animation: aurora 14s ease-in-out infinite alternate; }
@keyframes twinkle { 50% { opacity: 0.15; } }
@keyframes aurora {
  from { transform: translateX(-40px); opacity: 0.8; }
  to { transform: translateX(40px); opacity: 1; }
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  margin: var(--px);
  background: rgb(7 10 36 / 0.7);
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--edge), 0 var(--px) 0 0 var(--edge),
    calc(var(--px) * -1) 0 0 0 var(--edge), var(--px) 0 0 0 var(--edge);
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 13px;
}
.dot {
  width: 8px;
  height: 8px;
  background: var(--mint);
  box-shadow: 0 0 10px var(--mint);
  animation: blink 1.6s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0.3; } }

.hero h1 {
  margin: 22px 0 20px;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: clamp(40px, 11.5vw, 112px);
  line-height: 1;
  letter-spacing: 0;
  color: var(--snow);
  /* Stacked hard shadows = a chunky ice block */
  text-shadow:
    0 4px 0 #a9e9ff,
    0 8px 0 #5aa6dc,
    0 12px 0 #2c5f9e,
    0 16px 0 #1a3a72,
    0 26px 30px rgb(0 0 0 / 0.45);
}
.tagline {
  margin: 0 auto 40px;
  max-width: 520px;
  color: #cfdcf4;
  font-size: clamp(16px, 2.4vw, 19px);
}

.ip-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 470px;
  margin: 0 auto;
  padding: 14px 14px 14px 22px;
  text-align: left;
}
.ip-text { display: flex; flex-direction: column; min-width: 0; }
.ip-label {
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--muted);
}
.ip-box code {
  font-size: clamp(17px, 4vw, 21px);
  font-weight: 600;
  color: var(--snow);
  overflow-wrap: anywhere;
}
.hero-actions { margin-top: 26px; }

/* ---------- Pixel buttons ---------- */
.btn {
  --fill: var(--ice);
  --lip: var(--ice-dark);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: var(--px);
  padding: 10px 18px;
  border: 0;
  background: var(--fill);
  color: var(--on-ice);
  font-family: var(--font-label);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--fill),
    0 var(--px) 0 0 var(--fill),
    calc(var(--px) * -1) 0 0 0 var(--fill),
    var(--px) 0 0 0 var(--fill),
    0 calc(var(--px) * 2) 0 0 var(--lip),
    inset 0 var(--px) 0 0 rgb(255 255 255 / 0.45);
  transition: transform 0.06s steps(1);
}
.btn:hover { --fill: var(--ice-hover); }
.btn:active {
  transform: translateY(var(--px));
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--fill),
    0 var(--px) 0 0 var(--fill),
    calc(var(--px) * -1) 0 0 0 var(--fill),
    var(--px) 0 0 0 var(--fill),
    inset 0 var(--px) 0 0 rgb(0 0 0 / 0.12);
}
.btn-ghost {
  --fill: rgb(7 10 36 / 0.55);
  --lip: rgb(3 7 24 / 0.6);
  color: var(--text);
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--edge),
    0 var(--px) 0 0 var(--edge),
    calc(var(--px) * -1) 0 0 0 var(--edge),
    var(--px) 0 0 0 var(--edge),
    0 calc(var(--px) * 2) 0 0 var(--lip);
}
.btn-ghost:hover { --fill: rgb(27 46 98 / 0.8); color: var(--ice); }
.btn-small {
  --fill: var(--panel-2);
  --lip: #0a1433;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--ice);
}
.btn-small:hover { --fill: #24407f; }
.btn:focus-visible { outline: 3px dashed var(--mint); outline-offset: 8px; }

/* ---------- Sections ---------- */
.section {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(56px, 9vw, 96px) 16px;
}
.kicker {
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--mint);
}
.section h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 6px 0 8px;
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: clamp(28px, 4.5vw, 40px);
  line-height: 1.1;
  text-shadow: 0 4px 0 #1a3a72;
}
.section h2 .icon { width: 0.75em; height: 0.75em; fill: var(--ice); }
.section-lead { margin: 0 0 44px; color: var(--muted); }

.join-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 44px 28px;
}
.card { display: flex; flex-direction: column; padding: 26px; }
.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tag {
  padding: 3px 10px;
  background: var(--ice);
  color: var(--on-ice);
  font-family: var(--font-label);
  font-size: 13px;
}
.tag-alt { background: var(--violet); }
.muted { color: var(--muted); font-size: 14px; }

.steps {
  counter-reset: step;
  list-style: none;
  margin: 22px 0;
  padding: 0;
  flex: 1;
}
.steps li {
  counter-increment: step;
  position: relative;
  margin-bottom: 12px;
  padding-left: 40px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 2px var(--edge);
  color: var(--ice);
  font-family: var(--font-label);
  font-size: 13px;
}
.steps code {
  padding: 1px 6px;
  background: var(--panel-2);
  font-size: 0.9em;
}
.mini-ip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 14px;
  background: #0a1433;
  box-shadow: inset 0 0 0 2px var(--edge);
}
.mini-ip code { font-size: 15px; overflow-wrap: anywhere; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 28px;
  margin-top: 40px;
}
.feature {
  padding: 22px;
  transition: transform 0.2s steps(2);
}
.feature:hover { transform: translateY(calc(var(--px) * -1)); }
.feature .icon { width: 27px; height: 27px; margin-bottom: 12px; fill: var(--ice); }
.feature:nth-child(2n) .icon { fill: var(--mint); }
.feature:nth-child(3) .icon { fill: var(--violet); }
.feature h3 { margin: 0 0 6px; font-family: var(--font-pixel); font-weight: 500; font-size: 20px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- Snowy ground footer ---------- */
.footer {
  margin-top: 40px;
  padding: 36px 16px 44px;
  background: var(--snow-ground);
  color: var(--on-snow);
  text-align: center;
}
.footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -23px;
  height: 24px;
  background: /*@DRIFT*/ url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22128%22 height=%2224%22 shape-rendering=%22crispEdges%22%3E%3Crect x=%220%22 y=%228%22 width=%228%22 height=%2216%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%228%22 y=%2212%22 width=%228%22 height=%2212%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%2216%22 y=%228%22 width=%224%22 height=%2216%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%2220%22 y=%228%22 width=%228%22 height=%2216%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%2228%22 y=%228%22 width=%228%22 height=%2216%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%2236%22 y=%2212%22 width=%224%22 height=%2212%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%2240%22 y=%2212%22 width=%228%22 height=%2212%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%2248%22 y=%2212%22 width=%228%22 height=%2212%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%2256%22 y=%2216%22 width=%228%22 height=%228%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%2264%22 y=%2212%22 width=%224%22 height=%2212%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%2268%22 y=%228%22 width=%228%22 height=%2216%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%2276%22 y=%224%22 width=%228%22 height=%2220%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%2284%22 y=%228%22 width=%224%22 height=%2216%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%2288%22 y=%2212%22 width=%228%22 height=%2212%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%2296%22 y=%2216%22 width=%228%22 height=%228%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%22104%22 y=%2212%22 width=%224%22 height=%2212%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%22108%22 y=%228%22 width=%224%22 height=%2216%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%22112%22 y=%228%22 width=%228%22 height=%2216%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%22120%22 y=%2212%22 width=%224%22 height=%2212%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%22124%22 y=%228%22 width=%228%22 height=%2216%22 fill=%22%23e3f1fb%22/%3E%3Crect x=%220%22 y=%2220%22 width=%22128%22 height=%224%22 fill=%22%23e3f1fb%22/%3E%3C/svg%3E") /*@END*/ left bottom / 128px 24px repeat-x;
  image-rendering: pixelated;
}
.footer p { margin: 4px 0; }
.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 18px;
}
.footer-brand .icon { fill: var(--ice-dark); }
.footer-muted { color: var(--on-snow-muted); font-size: 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 24px);
  padding: 8px 16px;
  background: var(--ice);
  color: var(--on-ice);
  font-family: var(--font-label);
  font-size: 14px;
  box-shadow:
    0 -4px 0 0 var(--ice), 0 4px 0 0 var(--ice), -4px 0 0 0 var(--ice), 4px 0 0 0 var(--ice),
    0 8px 0 0 var(--ice-dark);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s steps(3), transform 0.15s steps(3);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 404 ---------- */
.lost {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  text-align: center;
  background: linear-gradient(180deg, var(--sky-0), var(--sky-1) 60%, var(--ground));
}
.lost h1 {
  margin: 12px 0;
  font-family: var(--font-pixel);
  font-size: clamp(72px, 20vw, 160px);
  line-height: 1;
  color: var(--snow);
  text-shadow: 0 6px 0 #5aa6dc, 0 12px 0 #2c5f9e, 0 18px 0 #1a3a72;
}
.lost .tagline { margin-bottom: 32px; }
.lost-flake { width: 54px; height: 54px; fill: var(--ice); }
.page-404 .snow-page { z-index: 2; }

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  :root { --mtn-h: 170px; }
  .nav nav { gap: 14px; }
  .nav nav a { font-size: 12px; }
  .brand { font-size: 19px; }
  .ip-box { flex-direction: column; align-items: stretch; text-align: center; padding: 18px; }
  .ip-text { align-items: center; }
  .card { padding: 20px 16px; }
  .mini-ip { padding-left: 10px; }
  .mini-ip code { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
