@font-face {
  font-family: "Cooljazz";
  src: url("fonts/cooljazz.woff2") format("woff2");
  font-display: swap;
}

:root {
  --ink: #111;
  --muted: #b8bccb;          /* muted text on the night sky */
  --muted-card: #4d4d4d;     /* muted text on white cards */
  --text: #fff;
  --shadow: var(--teal);     /* offset shadow on cards + buttons */
  --sky: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
  --paper: #f5f4f0;
  --card: #fff;
  --teal: #2cf5cf;
  --teal-shadow: #0b6f61;
  --skin: #f5b0a7;
  /* exact stops sampled from the designer's gradient bar */
  --rainbow: linear-gradient(90deg, #ff0000 0%, #ffff00 25%, #00ff00 40%, #00ffff 60%, #0000ff 70%, #ff00ff 100%);
  --display: "Cooljazz", "Comic Sans MS", cursive;
  --body: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* paper texture: fine grain (snek-style paper bg) */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sky) fixed, #090a0f;
  color: var(--text);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.5;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

/* the designer's gradient bar, used as section dividers */
.divider {
  width: calc(100% - 32px);
  max-width: 300px;
  margin: 0 auto 28px;
}

/* ---------- hero (one screen, snek layout) ---------- */

.hero {
  --elf-w: min(44vw, 640px, calc((min(100svh, 1000px) - 170px) * .773));
  position: relative;
  overflow: hidden;
  min-height: clamp(640px, 100svh, 1000px);
  display: grid;
  grid-template-columns: var(--elf-w) 1fr;
  grid-template-rows: auto 1fr auto auto 1.2fr;
  grid-template-areas:
    "nav  nav"
    "elf  ."
    "elf  head"
    "elf  cta"
    "elf  .";
}

.nav {
  grid-area: nav;
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px clamp(16px, 3vw, 40px);
}

.nav-right { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); margin-left: auto; }

.nav-link {
  font-family: var(--display);
  font-size: 24px;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: border-color .2s ease;
}

.nav-link:hover { border-bottom-color: var(--teal); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-size: 34px;
  color: var(--teal);
  text-shadow: 2px 2px 0 var(--teal-shadow);
}

.brand img { width: 48px; height: 48px; transition: transform .3s ease; }
.brand:hover img { transform: rotate(-20deg); }

/* social circles, top-left like snek */
.socials { display: flex; flex-wrap: wrap; gap: 14px; }
.socials:empty { display: none; }

.social {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--card);
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease, background .2s ease;
}

.social svg { width: 24px; height: 24px; fill: var(--ink); }
.social img { width: 64%; height: 64%; object-fit: contain; transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.social:hover img { transform: scale(1.12); }
.social:hover { transform: translate(-2px, -2px) rotate(-8deg); box-shadow: 6px 6px 0 #ff00ff; }

/* the elf: bleeds off the left and bottom edges */
.hero-elf {
  grid-area: elf;
  align-self: end;
  width: 100%;
  margin-bottom: 3vh;
}

.hero-head,
.hero-cta {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 clamp(16px, 4vw, 64px);
}

.hero-head { grid-area: head; }
.hero-cta { grid-area: cta; display: flex; flex-direction: column; align-items: center; }

.title,
.ticker,
.section-title {
  font-family: var(--display);
  font-weight: normal;
  color: var(--teal);
  text-shadow: 2px 3px 0 var(--teal-shadow);
  margin: 0;
  line-height: 1.05;
}

.title { font-size: clamp(52px, 6.6vw, 112px); }

.ticker { font-size: clamp(52px, 5.6vw, 92px); margin-top: 6px; }

.tagline {
  max-width: 460px;
  margin: 6px auto 30px;
  color: var(--muted);
  font-size: 19px;
}

.copy-link {
  margin-top: 26px;
  padding: 4px 8px;
  border: 0;
  background: none;
  font-family: var(--display);
  font-size: 22px;
  color: var(--muted);
  text-decoration: underline wavy var(--teal);
  text-underline-offset: 6px;
  cursor: pointer;
}

.copy-link:hover { color: var(--text); }

/* ---------- buttons ----------
   filled with the gradient bar; the circle logos are the icons:
   black at rest, rainbow on hover */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 26px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--rainbow);
  color: var(--ink);
  font-family: var(--display);
  font-size: 25px;
  line-height: 1.1;
  text-decoration: none;
  text-shadow: 0 0 3px #fff, 0 0 6px #fff, 0 0 10px #fff;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform .12s ease, box-shadow .2s ease;
}

.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
.btn:focus-visible { outline: 3px dashed var(--teal-shadow); outline-offset: 6px; }

.btn-ghost { background: var(--card); text-shadow: none; }

.btn-small { padding: 6px 16px; font-size: 19px; box-shadow: 3px 3px 0 var(--shadow); }
.btn-small:hover { box-shadow: 5px 5px 0 var(--shadow); }

/* the big snek-style button: chunky border, big offset shadow that changes color on hover */
.btn-big {
  padding: 18px 52px;
  border-width: 5px;
  font-size: clamp(32px, 3vw, 42px);
  box-shadow: 12px 12px 0 var(--shadow);
}

.btn-big:hover { transform: translate(-2px, -2px); box-shadow: 14px 14px 0 #ff00ff; }
.btn-big:active { transform: translate(4px, 4px); box-shadow: 6px 6px 0 #ff00ff; }

.btn:has(.btn-icon) { padding-left: 8px; }
.btn-big:has(.btn-icon) { padding-left: 12px; }

.btn-icon {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.3, 1.6, .5, 1);
}

.btn-big .btn-icon { width: 60px; height: 60px; border-width: 3px; }

.btn-icon::before,
.btn-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/circle-black-128.webp") center / cover;
  transition: opacity .2s ease;
}

.btn-icon::after { background-image: url("assets/circle-rainbow-128.webp"); opacity: 0; }

.btn:hover .btn-icon { transform: rotate(-18deg) scale(1.08); }
.btn:hover .btn-icon::after { opacity: 1; }

/* ---------- elf animation ---------- */

.elf-stage { position: relative; }

.elf {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.elf:focus-visible { outline: 3px dashed var(--teal-shadow); outline-offset: -12px; border-radius: 12px; }

/* the hat sways slowly, pivoting on the elf's head */
.elf-sway {
  position: relative;
  display: block;
  transform-origin: 18% 92%;
  animation: sway 5s ease-in-out infinite;
}

@keyframes sway {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-10px) rotate(2.5deg); }
}

.elf.boop .elf-sway { animation: boop .55s cubic-bezier(.3, 1.6, .5, 1); }

@keyframes boop {
  0%   { transform: scale(1, 1); }
  25%  { transform: scale(1.08, .9); }
  55%  { transform: scale(.95, 1.06) translateY(-16px); }
  100% { transform: scale(1, 1); }
}

/* eyelids sit exactly over the eyes in elf.webp (990x1280) */
.lid {
  position: absolute;
  background: var(--skin);
  border-bottom: 3px solid var(--ink);
  border-radius: 0 0 50% 50%;
  transform: scaleY(0);
  transform-origin: top;
  animation: blink 5s infinite;
}

.lid-l { left: 9.2%;  top: 87.8%; width: 2.6%; height: 3.2%; }
.lid-r { left: 17.1%; top: 88.4%; width: 2.6%; height: 3.3%; }

@keyframes blink {
  0%, 92%, 100% { transform: scaleY(0); }
  95%           { transform: scaleY(1); }
}

/* sparkles off the tip of the hat */
.sparkles { position: absolute; right: 0; top: 0; width: 1px; height: 1px; }

.sparkles i {
  position: absolute;
  width: 16px;
  height: 16px;
  background: currentColor;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: 0;
  animation: twinkle 3s ease-out infinite;
}

.sparkles i:nth-child(1) { color: #ff0000; animation-delay: 0s;   --dx: 40px;  --dy: -30px; }
.sparkles i:nth-child(2) { color: #ffd400; animation-delay: .6s;  --dx: 10px;  --dy: -50px; }
.sparkles i:nth-child(3) { color: #00e000; animation-delay: 1.2s; --dx: 50px;  --dy: 5px; }
.sparkles i:nth-child(4) { color: #00c8ff; animation-delay: 1.8s; --dx: -20px; --dy: -45px; }
.sparkles i:nth-child(5) { color: #ff00ff; animation-delay: 2.4s; --dx: 30px;  --dy: -10px; }

@keyframes twinkle {
  0%   { opacity: 0; transform: translate(0, 0) scale(.3) rotate(0); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1) rotate(180deg); }
}

/* burst stars spawned on click */
.burst {
  position: fixed;
  width: 16px;
  height: 16px;
  pointer-events: none;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: burst .9s ease-out forwards;
  z-index: 50;
}

@keyframes burst {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to   { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.4) rotate(220deg); }
}

.bubble {
  color: var(--ink);
  position: absolute;
  left: 30%;
  bottom: 22%;
  max-width: 220px;
  padding: 8px 14px;
  border: 3px solid var(--ink);
  border-radius: 18px 18px 18px 4px;
  background: var(--card);
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.15;
  text-align: left;
  opacity: 0;
  transform: translateY(8px) scale(.9);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 3;
}

.bubble.show { opacity: 1; transform: none; }

/* ---------- sections ---------- */

.section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 72px 16px 24px;
  text-align: center;
}

.section-title { font-size: clamp(44px, 6vw, 72px); margin-bottom: 16px; }

.section-sub { margin: 0 0 32px; color: var(--muted); }

.sub-title {
  font-family: var(--display);
  font-weight: normal;
  font-size: 36px;
  margin: 56px 0 20px;
}

.vision-quote {
  font-family: var(--display);
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.2;
  margin: 8px 0 18px;
}

.vision-body { max-width: 560px; margin: 0 auto; color: var(--muted); }

/* cards: white with the gradient bar along the top */
.card {
  position: relative;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  --muted: var(--muted-card);
  box-shadow: 6px 6px 0 var(--shadow);
}

.card::before {
  content: "";
  display: block;
  height: 12px;
  background: var(--rainbow);
  border-bottom: 3px solid var(--ink);
}

.facts {
  list-style: none;
  padding: 0;
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  max-width: 880px;
}

.facts li { padding-bottom: 14px; }

.fact-label {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

.fact-value { font-family: var(--display); font-size: 26px; }

/* supply split: two-segment bar + snek-style boxed legend */
.split-wrap { max-width: 880px; margin: 22px auto 0; padding-bottom: 22px; text-align: left; }

.split-title {
  font-family: var(--display);
  font-weight: normal;
  font-size: 28px;
  margin: 14px 22px 12px;
}

.split {
  display: flex;
  gap: 4px;
  height: 44px;
  margin: 0 22px;
  padding: 4px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
}

.split-seg { border-radius: 999px; }

.seg-curve { background: var(--rainbow); }
.seg-pool  { background: var(--ink); }

.legend {
  list-style: none;
  padding: 0;
  margin: 18px 22px 0;
  display: grid;
  gap: 10px;
  font-size: 17px;
}

.legend li { display: flex; align-items: center; gap: 12px; }

.legend b { font-family: var(--display); font-weight: normal; font-size: 24px; }

.swatch {
  flex: none;
  width: 28px;
  height: 28px;
  border: 4px solid var(--ink);
  border-radius: 8px;
}

.policy { max-width: 880px; margin: 22px auto 0; padding-bottom: 16px; }

.policy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  padding: 10px 16px 0;
}

.policy .fact-label { display: inline; margin: 0; }

.policy code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 14px;
  word-break: break-all;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  max-width: 880px;
  text-align: left;
}

.step-body { display: flex; gap: 12px; align-items: flex-start; padding: 14px; }

.steps b {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-family: var(--display);
  font-weight: normal;
  font-size: 22px;
}

.steps p { margin: 4px 0 0; font-size: 16px; }

/* ---------- memes ---------- */

.meme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.meme {
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 20px;
  background: var(--card);
  cursor: zoom-in;
  box-shadow: 6px 6px 0 var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}

.meme:hover { transform: rotate(-1.5deg) translate(-2px, -2px); box-shadow: 9px 9px 0 var(--shadow); }

.meme img,
.meme video { width: 100%; height: 100%; object-fit: cover; }

/* placeholder tile: gradient bar ring */
.meme-soon {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 6px solid transparent;
  border-radius: 20px;
  background: linear-gradient(var(--card), var(--card)) padding-box, var(--rainbow) border-box;
  font-family: var(--display);
  font-size: 26px;
  color: var(--muted-card);
}

/* ---------- lightbox ---------- */

.lightbox {
  color: var(--ink);
  max-width: min(92vw, 900px);
  padding: 16px;
  border: 4px solid var(--ink);
  border-radius: 24px;
  background: var(--card);
}

.lightbox::backdrop { background: rgba(0, 0, 0, .7); }

.lightbox-media img,
.lightbox-media video { max-height: 75vh; width: auto; margin: 0 auto; border-radius: 12px; }

.lightbox-actions { display: flex; justify-content: center; gap: 12px; margin-top: 14px; }

/* ---------- back to top: the rainbow circle ---------- */

.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 50%;
  overflow: hidden;
  background: url("assets/circle-rainbow-256.webp") center / cover;
  box-shadow: 4px 4px 0 var(--shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px) scale(.8);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, box-shadow .12s ease;
  z-index: 40;
}

.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top.show:hover { transform: translateY(-4px) rotate(-15deg); box-shadow: 6px 8px 0 var(--shadow); }

/* ---------- footer ---------- */

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 96px 16px 48px;
  text-align: center;
}

.rights {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--display);
  font-size: 24px;
}

.rights img { width: 30px; height: 30px; }

.disclaimer { max-width: 560px; margin: -12px auto 0; font-size: 14px; color: var(--muted); }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-family: var(--display);
  font-size: 22px;
  opacity: 0;
  transform: translate(-50%, 20px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 60;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .hero {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas: "nav" "head" "elf" "cta";
  }

  .hero-head { padding-top: 8px; }

  .hero-elf {
    width: min(100vw, 520px);
    margin: -10px 0 0;
    align-self: start;
    transform: none;
  }

  .hero-cta { padding-bottom: 56px; }

  .facts { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .nav-link { display: none; }
  .social { width: 44px; height: 44px; }
  .social svg { width: 20px; height: 20px; }
  .brand { font-size: 30px; }
  .brand img { width: 42px; height: 42px; }
  .meme-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .bubble { font-size: 19px; max-width: 160px; }
  .fact-value { font-size: 22px; }
  .to-top { width: 54px; height: 54px; }
  .split-title { font-size: 24px; margin-inline: 16px; }
  .split, .legend { margin-inline: 16px; }
}

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

/* ---------- night sky: parallax stars (3 layers drifting up) + rainbow glints ---------- */

.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

.stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  border-radius: 50%;
  background: transparent;
  animation: rise 60s linear infinite;
}

/* second copy 2000px below so the loop is seamless */
.stars::after {
  content: "";
  position: absolute;
  top: 2000px;
  width: inherit;
  height: inherit;
  border-radius: inherit;
  box-shadow: inherit;
}

.stars-2 { width: 2px; height: 2px; animation-duration: 110s; }
.stars-3 { width: 3px; height: 3px; animation-duration: 170s; }

@keyframes rise {
  from { transform: translateY(0); }
  to   { transform: translateY(-2000px); }
}

.glint {
  position: absolute;
  width: var(--s, 12px);
  height: var(--s, 12px);
  background: currentColor;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: 0;
  filter: drop-shadow(0 0 6px currentColor);
  animation: glint var(--d, 4s) ease-in-out infinite;
}

@keyframes glint {
  0%, 100% { opacity: 0; transform: scale(.2) rotate(0); }
  50%      { opacity: .9; transform: scale(1) rotate(90deg); }
}

/* ---------- elf peek: tucked off the left edge, slides out when the mouse comes near ---------- */

.hero-elf {
  transform: translateX(-7%) rotate(-2deg);
  transform-origin: 0% 100%;
  transition: transform .8s cubic-bezier(.34, 1.56, .64, 1);
}

.hero.peek .hero-elf { transform: none; }
