/* ═══════════════════════════════════════════════
   CUBE — Y2K sticker / cartoon, hand-drawn feel
   ═══════════════════════════════════════════════ */

@font-face {
  font-family: "Titan One";
  src: url("assets/fonts/titanone-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Baloo 2";
  src: url("assets/fonts/baloo2-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --paper: #fff7ee;
  --ink: #191a22;

  --red: #f8504b;
  --pink: #ff85b8;
  --gold: #ffaf3c;
  --yellow: #ffcf4a;
  --green: #8fc65a;
  --sky: #5ec9f1;
  --peri: #7a86dd;
  --purple: #9d6be0;

  --pale-pink: #ffe3ef;
  --pale-cyan: #d9f2fc;
  --pale-gold: #fff0d2;
  --pale-green: #e8f6d9;
  --pale-peri: #e9ecff;

  --display: "Titan One", "Baloo 2", system-ui, sans-serif;
  --body: "Baloo 2", system-ui, sans-serif;

  --shadow: 0.30rem 0.30rem 0 var(--ink);
  --shadow-big: 0.5rem 0.5rem 0 var(--ink);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --nav-h: 92px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-weight: 500;
  color: var(--ink);
  background-color: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--pink); color: var(--ink); }

img { max-width: 100%; }
a { color: inherit; }

svg.ic { width: 1.1em; height: 1.1em; flex: none; display: inline-block; vertical-align: -0.14em; }

/* ── background: one clean minimalist gradient ── */
.bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    linear-gradient(168deg, #fff8ef 0%, #ffeff6 24%, #edf6ff 54%, #f2eeff 76%, #fff6ea 100%);
}
.bg::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(25, 26, 34, 0.06) 1.1px, transparent 1.6px);
  background-size: 26px 26px;
}
.blob {
  position: absolute;
  width: 34vmax; height: 34vmax;
  border-radius: 50%;
  filter: blur(58px);
  opacity: 0.4;
  animation: blobFloat 30s ease-in-out infinite alternate;
  will-change: transform;
}
.blob-pink   { background: #ffd6e8; top: -10vmax; left: -8vmax; }
.blob-cyan   { background: #cfeffc; top: 24vmax; right: -12vmax; animation-delay: -10s; }
.blob-purple { background: #e6d6fb; bottom: -14vmax; left: 16vmax; animation-delay: -20s; }

@keyframes blobFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(3vmax, -2.5vmax) scale(1.1); }
}

main { position: relative; z-index: 1; padding-top: var(--nav-h); }

/* ── floating bubble nav ─────────────────────── */
.nav {
  position: fixed; top: 14px; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: center;
  pointer-events: none;
  padding: 0 12px;
}
.nav-inner {
  pointer-events: auto;
  display: flex; align-items: center; gap: clamp(0.8rem, 2.5vw, 1.6rem);
  max-width: min(1020px, 100%);
  padding: 0.42rem 0.5rem 0.42rem 1rem;
  background: rgba(255, 251, 244, 0.88);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0.28rem 0.32rem 0 rgba(25, 26, 34, 0.9);
}
.nav-brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.nav-logo { width: 38px; height: 38px; transition: transform 0.4s var(--bounce); }
.nav-brand:hover .nav-logo { transform: rotate(-14deg) scale(1.12); }
.nav-name { font-family: var(--display); font-size: 1.3rem; letter-spacing: 0.03em; }
.nav-links { display: flex; gap: clamp(0.7rem, 2vw, 1.3rem); }
.nav-links a {
  text-decoration: none; font-weight: 700; font-size: 0.98rem;
  padding: 0.2em 0.05em; position: relative; white-space: nowrap;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 4px; border-radius: 4px; background: var(--pink);
  transition: right 0.25s var(--bounce);
}
.nav-links a:hover::after { right: 0; }
.nav-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }

/* ── sticker buttons ─────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-family: var(--body); font-weight: 800; font-size: 1.08rem;
  color: var(--ink); text-decoration: none;
  padding: 0.7em 1.35em;
  background: #fff;
  border: 3px solid var(--ink); border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.16s var(--bounce), box-shadow 0.16s var(--bounce), background 0.2s;
  user-select: none;
  white-space: nowrap;
}
.btn:hover { transform: translate(-2px, -3px); box-shadow: 0.45rem 0.5rem 0 var(--ink); }
.btn:active { transform: translate(2px, 3px); box-shadow: 0.08rem 0.08rem 0 var(--ink); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: var(--shadow); }
.btn-pink  { background: var(--pink); }
.btn-green { background: var(--green); }
.btn-gold  { background: var(--gold); }
.btn-sky   { background: var(--sky); }
.btn-ink   { background: var(--ink); color: #fff; }
.btn-small { font-size: 0.92rem; padding: 0.5em 1.05em; }
.btn-big {
  font-size: 1.24rem;
  padding: 0.85em 1.9em;
  box-shadow: 0.38rem 0.38rem 0 var(--ink);
}
.btn-big:hover { box-shadow: 0.55rem 0.6rem 0 var(--ink); }
.btn-locked { opacity: 0.6; cursor: not-allowed; }
.btn-locked:hover, .btn-locked:active { transform: none; box-shadow: var(--shadow); }

.chip-btn {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  background: #fff; border: 3px solid var(--ink); border-radius: 50%;
  box-shadow: 0.18rem 0.18rem 0 var(--ink);
  cursor: pointer;
  color: var(--ink); text-decoration: none;
  transition: transform 0.16s var(--bounce), box-shadow 0.16s var(--bounce);
}
.chip-btn svg { width: 20px; height: 20px; }
.chip-btn:hover { transform: translate(-1px, -2px) rotate(-6deg); box-shadow: 0.28rem 0.32rem 0 var(--ink); }
.chip-btn:active { transform: translate(1px, 2px); box-shadow: 0.05rem 0.05rem 0 var(--ink); }
.hidden { display: none !important; }

/* ═══════════════ HERO ═══════════════ */
.hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.4rem) clamp(1rem, 4vw, 2.4rem) 3rem;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: clamp(1.6rem, 3.5vw, 3rem);
  align-items: center;
  min-height: calc(100svh - var(--nav-h));
}

.eyebrow { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.eyebrow-chip {
  background: var(--pale-cyan); border: 3px solid var(--ink); border-radius: 999px;
  padding: 0.3em 0.9em; font-weight: 800; font-size: 0.9rem;
  box-shadow: 0.18rem 0.18rem 0 var(--ink);
}
.eyebrow-token {
  background: var(--ink); color: var(--yellow); border-radius: 999px;
  padding: 0.34em 0.85em; font-weight: 800; font-size: 0.9rem;
  border: 3px solid var(--ink);
  animation: tokenPulse 2.6s ease-in-out infinite;
}
@keyframes tokenPulse { 0%, 100% { transform: rotate(-2deg) scale(1); } 50% { transform: rotate(2deg) scale(1.06); } }

.title {
  display: flex; gap: 0.12em; margin: 0 0 1.6rem; line-height: 1;
  font-family: var(--display); font-weight: 400;
}
.tile {
  display: inline-grid; place-items: center;
  font-size: clamp(3.4rem, 8vw, 6.2rem);
  color: #fff;
  padding: 0.04em 0.14em;
  border: 4px solid var(--ink);
  border-radius: 0.16em;
  box-shadow: 0.09em 0.09em 0 var(--ink);
  cursor: pointer;
  transition: transform 0.25s var(--bounce);
  text-shadow: 0.03em 0.03em 0 rgba(25, 26, 34, 0.25);
}
.tile-red    { background: var(--red);    transform: rotate(-3deg); }
.tile-gold   { background: var(--gold);   transform: rotate(2deg) translateY(0.06em); }
.tile-sky    { background: var(--sky);    transform: rotate(-1.5deg); }
.tile-purple { background: var(--purple); transform: rotate(3deg) translateY(0.05em); }
.tile:hover { transform: translateY(-0.09em) rotate(0deg) scale(1.04); }
.tile.boing { animation: boing 0.55s var(--bounce); }
@keyframes boing {
  0% { transform: scale(1, 1); }
  30% { transform: scale(1.25, 0.72); }
  55% { transform: scale(0.82, 1.24) translateY(-0.14em); }
  75% { transform: scale(1.08, 0.94); }
  100% { transform: scale(1, 1); }
}

.tagline {
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.5vw, 2.05rem);
  line-height: 1.24;
  margin: 0 0 1.1rem;
}
.tagline em {
  font-style: normal;
  background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 94%, transparent 94%);
}

.sub { font-size: 1.07rem; line-height: 1.62; max-width: 47ch; margin: 0 0 1.5rem; }
.sub b, .sub strong { font-weight: 800; }

.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.hero-actions-toys { margin-top: 0.9rem; }
.hero-actions-toys .btn { font-size: 0.98rem; padding: 0.58em 1.15em; }

.hint {
  margin-top: 1.2rem; font-size: 0.96rem; font-weight: 700; opacity: 0.7;
  animation: hintWiggle 3.2s ease-in-out infinite;
  transform-origin: left center;
}
@keyframes hintWiggle { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-1.6deg); } }

/* ── cube stage ──────────────────────────────── */
.hero-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1rem; }

.stage-frame {
  position: relative;
  width: min(100%, 580px);
  aspect-ratio: 1;
}
#cube-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  touch-action: pan-y;
  cursor: grab;
  z-index: 1;
}
#cube-canvas.grabbing { cursor: grabbing; }

/* the ring hugs the cube: one clean dashed orbit, centered */
.stage-halo {
  position: absolute; inset: 11%;
  border-radius: 50%;
  background: radial-gradient(closest-side, #ffffff 30%, rgba(217, 242, 252, 0.8) 58%, rgba(217, 242, 252, 0) 74%);
  z-index: 0;
  pointer-events: none;
}
.stage-ring {
  position: absolute; inset: 5.5%;
  border: 3px dashed rgba(25, 26, 34, 0.25);
  border-radius: 50%;
  animation: spinSlow 80s linear infinite;
  z-index: 0;
  pointer-events: none;
}
.stage-ring::after {
  content: "";
  position: absolute; inset: 5.5%;
  border: 2px solid rgba(25, 26, 34, 0.08);
  border-radius: 50%;
}
@keyframes spinSlow { to { transform: rotate(360deg); } }

.doodle {
  position: absolute; z-index: 2; pointer-events: none;
  font-size: 1.9rem; line-height: 1;
  animation: twinkle 2.8s ease-in-out infinite;
}
.doodle-1 { top: 5%; left: 6%; color: var(--gold); font-size: 2.3rem; }
.doodle-2 { top: 10%; right: 8%; color: var(--purple); animation-delay: -0.9s; }
.doodle-3 { bottom: 24%; left: 9%; color: var(--red); font-size: 1.4rem; animation-delay: -1.7s; }
.doodle-4 { bottom: 16%; right: 7%; color: var(--sky); font-size: 1.8rem; animation-delay: -2.2s; }
@keyframes twinkle {
  0%, 100% { transform: scale(0.75) rotate(0deg); opacity: 0.5; }
  50% { transform: scale(1.15) rotate(18deg); opacity: 1; }
}

.mode-btn { position: absolute; top: 3%; right: 3%; z-index: 3; display: none; }
@media (pointer: coarse) { .mode-btn { display: grid; } }

/* ── HUD: one consistent family of pills ─────── */
.hud {
  position: relative; z-index: 2;
  width: min(100%, 580px);
  display: flex; flex-direction: column; gap: 0.7rem;
}
.hud-chips { display: flex; justify-content: center; gap: 0.45rem; flex-wrap: wrap; }
.hud-chip {
  display: flex; align-items: center; gap: 0.38rem;
  background: #fff; border: 3px solid var(--ink); border-radius: 999px;
  padding: 0.26rem 0.6rem 0.26rem 0.4rem;
  font-weight: 800; font-size: 0.94rem;
  box-shadow: 0.16rem 0.16rem 0 var(--ink);
}
.hud-swatch {
  width: 17px; height: 17px; border-radius: 5px;
  border: 2.5px solid var(--ink);
  display: inline-block;
}
.hud-chip small { font-weight: 700; opacity: 0.55; font-size: 0.8em; }
.hud-chip.pop { animation: chipPop 0.45s var(--bounce); }
@keyframes chipPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.22) rotate(-3deg); }
  100% { transform: scale(1); }
}

.hud-row { display: flex; align-items: stretch; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }
.pill {
  display: flex; align-items: center; gap: 0.55rem;
  background: #fff; border: 3px solid var(--ink); border-radius: 999px;
  padding: 0.32rem 0.9rem;
  box-shadow: 0.18rem 0.18rem 0 var(--ink);
}
.pill-label {
  font-weight: 800; font-size: 0.72rem; letter-spacing: 0.07em;
  text-transform: uppercase; opacity: 0.6; white-space: nowrap;
}
.pill-value { font-family: var(--display); font-size: 1rem; white-space: nowrap; }
.pill-value b { font-size: 0.72em; }
.pill-pot { background: var(--gold); }
.pill-order { flex: 1 1 200px; min-width: 200px; }
.order-bar {
  flex: 1; height: 14px;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px;
  overflow: hidden;
}
.order-fill {
  height: 100%; width: 12%;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green), var(--sky), var(--purple));
  border-radius: 999px;
  transition: width 0.5s var(--bounce);
}
.pill.pop { animation: chipPop 0.45s var(--bounce); }
.pot-float {
  position: absolute; right: 0.6rem; top: -0.5rem;
  font-weight: 800; font-size: 0.92rem; color: var(--ink);
  background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 999px;
  padding: 0.05em 0.5em;
  pointer-events: none;
  animation: potFloat 1s ease-out forwards;
}
.pill-pot { position: relative; }
@keyframes potFloat {
  from { transform: translateY(0) rotate(3deg); opacity: 1; }
  to { transform: translateY(-2.1rem) rotate(-6deg); opacity: 0; }
}
.hud-note {
  text-align: center; font-size: 0.85rem; font-weight: 600; opacity: 0.6; margin: 0;
}

/* ═══════════════ MARQUEE ═══════════════ */
.marquee {
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  background: var(--yellow);
  overflow: hidden;
  position: relative; z-index: 1;
}
.marquee-track {
  display: inline-flex; align-items: center; gap: 2.2rem;
  white-space: nowrap;
  padding: 0.58rem 0;
  font-family: var(--display); font-size: 1rem; letter-spacing: 0.04em;
  animation: marquee 30s linear infinite;
  will-change: transform;
}
.marquee-track i { font-style: normal; color: var(--purple); font-size: 1.15rem; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ═══════════════ SECTIONS ═══════════════ */
.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(3.4rem, 7vw, 5.4rem) clamp(1rem, 4vw, 2.4rem) clamp(2.2rem, 4vw, 3.2rem);
  scroll-margin-top: var(--nav-h);
}
.section-head { text-align: center; margin-bottom: 2.8rem; }
.section-head h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  margin: 0;
  display: inline-block;
  transform: rotate(-1.2deg);
  text-shadow: 0.13rem 0.13rem 0 var(--pink);
}
#law .section-head h2 { text-shadow: 0.13rem 0.13rem 0 var(--sky); }
.section-sub { margin: 0.7rem 0 0; font-weight: 700; font-size: 1.08rem; opacity: 0.7; }

/* rule cards */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.8rem 1.6rem;
  margin-top: 1rem;
}
.card {
  position: relative;
  background: #fff;
  border: 3.5px solid var(--ink);
  border-radius: 26px;
  padding: 1.7rem 1.7rem 1.5rem;
  box-shadow: var(--shadow-big);
  transition: transform 0.3s var(--bounce), box-shadow 0.3s var(--bounce);
}
.card-tilt-l { transform: rotate(-0.8deg); }
.card-tilt-r { transform: rotate(0.8deg); }
.card:hover { transform: rotate(0deg) translate(-3px, -6px); box-shadow: 0.75rem 0.8rem 0 var(--ink); }
.card h3 { font-family: var(--display); font-weight: 400; font-size: 1.4rem; margin: 0.7rem 0 0.5rem; }
.card p { margin: 0; font-size: 1.01rem; line-height: 1.6; }
.card p b { font-weight: 800; }
.card-art {
  width: 96px; height: 96px; display: block;
  transition: transform 0.3s var(--bounce);
}
.card:hover .card-art { transform: rotate(-5deg) scale(1.08); }
.card-num {
  position: absolute; top: -16px; right: 22px;
  font-family: var(--display); font-size: 0.95rem;
  color: #fff;
  padding: 0.22em 0.7em;
  border: 3px solid var(--ink); border-radius: 999px;
  box-shadow: 0.14rem 0.14rem 0 var(--ink);
  transform: rotate(4deg);
}
.num-red { background: var(--red); }
.num-gold { background: var(--gold); }
.num-sky { background: var(--sky); }
.num-purple { background: var(--purple); }

/* honesty box */
.honest {
  position: relative;
  max-width: 800px;
  margin: 3.2rem auto 0;
  background: var(--pale-cyan);
  border: 3px solid var(--ink); border-radius: 24px;
  padding: 1.6rem 1.8rem 1.4rem;
  box-shadow: var(--shadow);
  transform: rotate(0.5deg);
}
.honest p { margin: 0; font-size: 1.02rem; line-height: 1.62; }
.honest-tape {
  position: absolute; top: -1rem; left: 1.4rem;
  background: var(--red); color: #fff;
  font-family: var(--display); font-size: 0.9rem; letter-spacing: 0.05em;
  padding: 0.24em 0.8em;
  border: 3px solid var(--ink); border-radius: 8px;
  transform: rotate(-3deg);
  box-shadow: 0.14rem 0.14rem 0 var(--ink);
}

/* ═══════════════ THE LAW ═══════════════ */
.quote-card {
  margin: 0 auto;
  max-width: 860px;
  background: #fff;
  border: 3.5px solid var(--ink); border-radius: 30px;
  padding: clamp(1.7rem, 4vw, 2.7rem);
  box-shadow: var(--shadow-big);
  transform: rotate(-0.5deg);
}
.quote-card blockquote {
  margin: 0;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.45rem, 3.2vw, 2.25rem);
  line-height: 1.24;
}
.quote-card mark {
  background: linear-gradient(transparent 55%, var(--pink) 55%, var(--pink) 95%, transparent 95%);
  color: inherit;
}
.quote-card figcaption { margin-top: 1.2rem; font-size: 1.05rem; line-height: 1.62; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
  margin-top: 2.6rem;
}
.stat {
  text-align: center;
  border: 3px solid var(--ink); border-radius: 20px;
  padding: 1.2rem 0.8rem 1.05rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--bounce);
}
.stat:hover { transform: rotate(0deg) scale(1.05); }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.3rem; margin-bottom: 0.25rem; }
.stat span { font-size: 0.92rem; font-weight: 700; opacity: 0.75; }
.stat-a { background: var(--pale-pink); transform: rotate(-1.6deg); }
.stat-b { background: var(--pale-gold); transform: rotate(1.2deg); }
.stat-c { background: var(--pale-green); transform: rotate(-1deg); }
.stat-d { background: var(--pale-peri); transform: rotate(1.6deg); }

.cta-row { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-top: 2.8rem; }

/* ═══════════════ FOOTER ═══════════════ */
.footer {
  border-top: 3px solid var(--ink);
  text-align: center;
  padding: 2.8rem 1rem 3.2rem;
  background: rgba(255, 255, 255, 0.45);
  margin-top: 2rem;
}
.footer-logo { width: 88px; animation: footFloat 4.5s ease-in-out infinite; }
@keyframes footFloat { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-9px) rotate(2deg); } }
.footer-line { font-family: var(--display); font-size: 1.2rem; margin: 0.7rem 0 0.35rem; }
.footer-small { font-size: 0.86rem; font-weight: 600; opacity: 0.55; margin: 0; }

/* ═══════════════ TOASTS + FX ═══════════════ */
.toasts {
  position: fixed; top: calc(var(--nav-h) + 8px); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.55rem;
  z-index: 70; pointer-events: none;
  width: max-content; max-width: 92vw;
}
.toast {
  background: #fff;
  border: 3px solid var(--ink); border-radius: 999px;
  padding: 0.55em 1.2em;
  font-weight: 800; font-size: 1rem;
  box-shadow: var(--shadow);
  animation: toastIn 0.5s var(--bounce);
  text-align: center;
}
.toast-gold { background: var(--yellow); }
.toast-pink { background: var(--pink); }
.toast-green { background: var(--green); }
.toast.out { animation: toastOut 0.4s ease forwards; }
@keyframes toastIn {
  from { transform: translateY(-18px) scale(0.6) rotate(-4deg); opacity: 0; }
  to { transform: translateY(0) scale(1) rotate(0); opacity: 1; }
}
@keyframes toastOut {
  to { transform: translateY(-14px) scale(0.7); opacity: 0; }
}

#fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }

/* ── reveal on scroll ────────────────────────── */
.reveal { opacity: 0; transform: translateY(26px); }
.reveal.in {
  opacity: 1; transform: translateY(0);
  transition: opacity 0.7s ease, transform 0.7s var(--bounce);
  transition-delay: var(--d, 0s);
}
/* cards keep their tilt after the reveal */
.card.reveal { transform: translateY(30px) rotate(0deg); }
.card.card-tilt-l.reveal.in { transform: translateY(0) rotate(-0.8deg); }
.card.card-tilt-r.reveal.in { transform: translateY(0) rotate(0.8deg); }
.card.reveal.in:hover { transform: rotate(0deg) translate(-3px, -6px); }

/* ═══════════════ DOCS PAGE ═══════════════ */
.page-head {
  max-width: 900px; margin: 0 auto; text-align: center;
  padding: clamp(1.5rem, 4vw, 3rem) 1rem 0.5rem;
}
.page-head h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  margin: 0.4rem 0 0.6rem;
  text-shadow: 0.13rem 0.13rem 0 var(--pale-peri);
}
.page-head p { font-size: 1.08rem; font-weight: 600; opacity: 0.75; margin: 0 auto; max-width: 60ch; }

.doc-toc {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem;
  max-width: 860px; margin: 1.6rem auto 0; padding: 0 1rem;
}
.doc-toc a {
  text-decoration: none; font-weight: 800; font-size: 0.88rem;
  background: #fff; border: 2.5px solid var(--ink); border-radius: 999px;
  padding: 0.3em 0.85em;
  box-shadow: 0.14rem 0.14rem 0 var(--ink);
  transition: transform 0.15s var(--bounce), background 0.2s;
}
.doc-toc a:hover { transform: translate(-1px, -2px); background: var(--pale-cyan); }

.doc {
  max-width: 860px; margin: 0 auto;
  padding: 1.6rem clamp(1rem, 4vw, 2rem) 3rem;
  display: flex; flex-direction: column; gap: 1.6rem;
}
.doc-card {
  background: #fff;
  border: 3px solid var(--ink); border-radius: 24px;
  padding: 1.7rem 1.9rem 1.5rem;
  box-shadow: var(--shadow);
  scroll-margin-top: var(--nav-h);
}
.doc-card h2 {
  font-family: var(--display); font-weight: 400; font-size: 1.55rem;
  margin: 0 0 0.8rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.doc-card h2 .doc-dot {
  width: 16px; height: 16px; border-radius: 5px; border: 2.5px solid var(--ink); flex: none;
}
.doc-card h3 { font-weight: 800; font-size: 1.05rem; margin: 1.2rem 0 0.4rem; }
.doc-card p { margin: 0 0 0.8rem; line-height: 1.66; font-size: 1rem; }
.doc-card p:last-child { margin-bottom: 0; }
.doc-card ul { margin: 0 0 0.8rem; padding-left: 1.2rem; line-height: 1.66; }
.doc-card li { margin-bottom: 0.35rem; }
.doc-card table {
  width: 100%; border-collapse: collapse; margin: 0.6rem 0 1rem;
  font-size: 0.98rem;
}
.doc-card th, .doc-card td {
  border: 2.5px solid var(--ink);
  padding: 0.5rem 0.8rem;
  text-align: left;
}
.doc-card th { background: var(--pale-gold); font-weight: 800; }
.doc-card tr:nth-child(even) td { background: var(--paper); }
.doc-note {
  background: var(--pale-cyan);
  border: 2.5px solid var(--ink); border-radius: 14px;
  padding: 0.8rem 1rem;
  font-size: 0.95rem; font-weight: 600;
}
.doc-foot { text-align: center; font-size: 0.9rem; opacity: 0.65; padding-bottom: 2rem; }
.doc-foot a { font-weight: 700; }

/* ═══════════════ APP PAGE ═══════════════ */
.app-wrap {
  max-width: 1180px; margin: 0 auto;
  padding: clamp(0.6rem, 2vw, 1.4rem) clamp(1rem, 3vw, 2rem) 3rem;
  display: flex; flex-direction: column; gap: 1.4rem;
}

.banner {
  display: flex; align-items: center; gap: 0.9rem;
  background: var(--pale-gold);
  border: 3px solid var(--ink); border-radius: 20px;
  padding: 0.9rem 1.3rem;
  box-shadow: var(--shadow);
  font-weight: 700; font-size: 0.99rem; line-height: 1.45;
}
.banner svg { width: 30px; height: 30px; flex: none; }
.banner b { font-weight: 800; }

.badge {
  display: inline-flex; align-items: center; gap: 0.4em;
  background: var(--ink); color: var(--yellow);
  border-radius: 999px; border: 2.5px solid var(--ink);
  font-weight: 800; font-size: 0.78rem; letter-spacing: 0.05em;
  padding: 0.28em 0.8em; text-transform: uppercase;
  white-space: nowrap;
}

.app-main {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.4rem;
  align-items: start;
}
.app-col { display: flex; flex-direction: column; gap: 1.4rem; min-width: 0; }

.panel {
  background: #fff;
  border: 3px solid var(--ink); border-radius: 24px;
  padding: 1.4rem 1.5rem 1.5rem;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  margin-bottom: 1rem;
}
.panel-head h2 { font-family: var(--display); font-weight: 400; font-size: 1.3rem; margin: 0; }
.panel-sub { margin: -0.6rem 0 1rem; font-size: 0.92rem; font-weight: 600; opacity: 0.65; }

.tag {
  font-weight: 800; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  border: 2.5px solid var(--ink); border-radius: 999px;
  padding: 0.22em 0.7em;
  background: var(--pale-peri);
  white-space: nowrap;
}
.tag-live { background: var(--pale-green); }
.tag-locked { background: var(--pale-pink); }

/* faction picker */
.faction-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}
.faction-tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  background: var(--paper);
  border: 3px solid var(--ink); border-radius: 18px;
  padding: 0.9rem 0.5rem 0.75rem;
  cursor: pointer;
  box-shadow: 0.18rem 0.18rem 0 var(--ink);
  transition: transform 0.18s var(--bounce), box-shadow 0.18s var(--bounce), background 0.2s;
  font-family: var(--body);
}
.faction-tile:hover { transform: translate(-1px, -3px); box-shadow: 0.26rem 0.32rem 0 var(--ink); }
.faction-swatch {
  width: 44px; height: 44px; border-radius: 12px;
  border: 3px solid var(--ink);
  box-shadow: 0.12rem 0.12rem 0 var(--ink);
}
.faction-name { font-weight: 800; font-size: 0.95rem; text-transform: capitalize; }
.faction-score { font-size: 0.8rem; font-weight: 700; opacity: 0.6; }
.faction-tile.selected {
  background: #fff;
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}
.faction-tile.selected::after {
  content: "PICKED";
  position: absolute; top: -12px; right: -6px;
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.05em;
  background: var(--green); border: 2.5px solid var(--ink); border-radius: 999px;
  padding: 0.2em 0.6em;
  transform: rotate(6deg);
}

/* stake box */
.stake-box { margin-top: 1.2rem; display: flex; flex-direction: column; gap: 0.7rem; }
.field-label { font-weight: 800; font-size: 0.82rem; letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.65; }
.input-row {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--paper);
  border: 3px solid var(--ink); border-radius: 16px;
  padding: 0.55rem 0.7rem 0.55rem 1rem;
}
.input-row input {
  flex: 1; min-width: 0;
  font-family: var(--body); font-weight: 800; font-size: 1.15rem;
  background: none; border: none; outline: none; color: var(--ink);
}
.input-row input:disabled { opacity: 0.5; cursor: not-allowed; }
.input-row .unit { font-weight: 800; font-size: 0.9rem; opacity: 0.6; }
.btn-max {
  font-weight: 800; font-size: 0.78rem;
  border: 2.5px solid var(--ink); border-radius: 999px;
  background: #fff; padding: 0.25em 0.7em; cursor: not-allowed; opacity: 0.55;
}
.stake-explain {
  margin: 0; font-size: 0.92rem; font-weight: 600; line-height: 1.55; opacity: 0.75;
}
.lock-note {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.9rem; font-weight: 700; opacity: 0.75;
  background: var(--pale-pink);
  border: 2.5px solid var(--ink); border-radius: 12px;
  padding: 0.55rem 0.8rem;
}
.lock-note svg { width: 17px; height: 17px; flex: none; }

/* key-value rows (position panel) */
.kv { display: flex; flex-direction: column; gap: 0.55rem; }
.kv-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-bottom: 2px dashed rgba(25, 26, 34, 0.18);
  padding-bottom: 0.5rem;
  font-size: 0.98rem;
}
.kv-row:last-child { border-bottom: none; padding-bottom: 0; }
.kv-row .k { font-weight: 700; opacity: 0.65; }
.kv-row .v { font-weight: 800; display: flex; align-items: center; gap: 0.4rem; }
.kv-empty { text-align: center; padding: 1.2rem 0.5rem; font-weight: 600; opacity: 0.7; font-size: 0.97rem; }

/* mini cube + stats */
.app-cube-frame { position: relative; width: 100%; aspect-ratio: 1.15; }
#app-cube { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
.app-hud { display: flex; flex-wrap: wrap; gap: 0.55rem; justify-content: center; margin-top: 0.4rem; }

/* activity feed */
.feed { display: flex; flex-direction: column; gap: 0.55rem; max-height: 330px; overflow: hidden; }
.feed-item {
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--paper);
  border: 2.5px solid var(--ink); border-radius: 14px;
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
  animation: feedIn 0.4s var(--bounce);
}
.feed-item b { font-weight: 800; font-family: ui-monospace, monospace; font-size: 0.84rem; }
.feed-item span { flex: 1; font-weight: 600; opacity: 0.75; }
.feed-item i { font-style: normal; font-weight: 800; color: var(--ink); background: var(--pale-green); border: 2px solid var(--ink); border-radius: 999px; padding: 0.05em 0.5em; font-size: 0.8rem; white-space: nowrap; }
@keyframes feedIn {
  from { transform: translateY(-10px) scale(0.92); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* wallet modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(25, 26, 34, 0.45);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 1rem;
}
.modal-card {
  width: min(400px, 100%);
  background: var(--paper);
  border: 3.5px solid var(--ink); border-radius: 26px;
  box-shadow: var(--shadow-big);
  padding: 1.5rem 1.5rem 1.3rem;
  animation: toastIn 0.35s var(--bounce);
}
.modal-card h2 { font-family: var(--display); font-weight: 400; font-size: 1.35rem; margin: 0 0 0.3rem; }
.modal-card .modal-sub { margin: 0 0 1.1rem; font-size: 0.92rem; font-weight: 600; opacity: 0.7; }
.w-opt {
  width: 100%;
  display: flex; align-items: center; gap: 0.8rem;
  background: #fff;
  border: 3px solid var(--ink); border-radius: 16px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
  font-family: var(--body); font-weight: 800; font-size: 1rem; color: var(--ink);
  box-shadow: 0.16rem 0.16rem 0 var(--ink);
  transition: transform 0.15s var(--bounce), box-shadow 0.15s var(--bounce);
  text-align: left;
}
.w-opt:hover:not(:disabled) { transform: translate(-1px, -2px); box-shadow: 0.24rem 0.28rem 0 var(--ink); }
.w-opt:disabled { opacity: 0.55; cursor: not-allowed; }
.w-opt .w-ic {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border: 2.5px solid var(--ink); border-radius: 12px;
}
.w-opt .w-name { flex: 1; }
.w-opt .w-note { font-size: 0.72rem; font-weight: 800; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.04em; }
.modal-close {
  width: 100%; margin-top: 0.4rem;
  background: none; border: none; cursor: pointer;
  font-family: var(--body); font-weight: 800; font-size: 0.92rem; color: var(--ink); opacity: 0.6;
  padding: 0.4rem;
}
.modal-close:hover { opacity: 1; }

/* connected wallet chip */
.wallet-connected {
  display: inline-flex; align-items: center; gap: 0.45em;
}
.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green); border: 2px solid var(--ink);
  display: inline-block;
}

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 1020px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    min-height: 0;
    text-align: center;
  }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .sub { max-width: 56ch; }
  .hint { transform-origin: center; }
  .cards { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-main { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --nav-h: 84px; }
  .nav-links { display: none; }
  .nav-inner { gap: 0.6rem; }
}
@media (max-width: 480px) {
  .nav-name, .nav .badge { display: none; }
  .nav-inner { padding-left: 0.6rem; }
  .title .tile { font-size: clamp(2.9rem, 15vw, 4.4rem); }
  .hud-chip { font-size: 0.85rem; padding: 0.2rem 0.5rem 0.2rem 0.32rem; }
  .hud-swatch { width: 14px; height: 14px; }
  .pill-order { min-width: 100%; order: 3; }
  .faction-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .banner { font-size: 0.92rem; }
}

/* ── reduced motion ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .blob, .doodle, .stage-ring, .marquee-track, .eyebrow-token, .hint, .footer-logo { animation: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
