:root {
  --ink: #111;
  --paper: #fff;
  --paper-2: #fafaf7;
  --hi: #fff27a;      /* highlighter */
  --red: #ff4b4b;
  --wobble: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --wobble-2: 15px 255px 15px 225px / 225px 15px 255px 15px;
  --shadow: 6px 6px 0 var(--ink);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  color: var(--ink);
  background: var(--paper);
  /* faint notebook-paper dots */
  background-image: radial-gradient(#0000000d 1.2px, transparent 1.2px);
  background-size: 26px 26px;
  font-size: 20px;
  line-height: 1.4;
  overflow-x: hidden;
}
body.intro-active { overflow: hidden; }
img { display: block; max-width: 100%; user-select: none; -webkit-user-drag: none; }
a { color: inherit; }
mark {
  background: linear-gradient(100deg, transparent 2%, var(--hi) 4%, var(--hi) 94%, transparent 97%);
  padding: 0 .2em;
  color: inherit;
}
.boil { filter: url(#boil); }
.boil-soft { filter: url(#boil-soft); }

/* ================= BUTTONS ================= */
.btn {
  --bg: var(--ink);
  --fg: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  font-family: "Permanent Marker", cursive;
  font-size: 1.1rem;
  letter-spacing: .03em;
  text-decoration: none;
  color: var(--fg);
  background: var(--bg);
  border: 3px solid var(--ink);
  border-radius: var(--wobble);
  padding: .7em 1.4em;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(-2px, -2px) rotate(-1.5deg); box-shadow: 7px 7px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn-ghost { --bg: var(--paper); --fg: var(--ink); }
.btn-big { font-size: 1.5rem; padding: .7em 1.8em; }
.btn-small { font-size: .95rem; padding: .5em 1em; }
.btn-tiny { font-size: .8rem; padding: .25em .8em; box-shadow: 2px 2px 0 var(--ink); }

/* ================= INTRO ================= */
#intro {
  position: fixed; inset: 0; z-index: 100;
  background: var(--paper);
  background-image: radial-gradient(#00000012 1.2px, transparent 1.2px);
  background-size: 26px 26px;
  display: grid; place-items: center;
  overflow: hidden;
}
#intro.shake { animation: shake .28s ease; }
#intro.exit { animation: introExit .9s cubic-bezier(.7, -0.3, .3, 1) forwards; }
@keyframes introExit {
  0% { clip-path: circle(150% at 50% 50%); }
  100% { clip-path: circle(0% at 50% 50%); }
}
#skip {
  position: absolute; top: 18px; right: 22px; z-index: 3;
  background: none; border: none; font: inherit; font-size: 1.1rem;
  cursor: pointer; text-decoration: underline wavy; opacity: .55;
}
#skip:hover { opacity: 1; }

.scribble {
  position: absolute;
  width: min(95vmin, 820px);
  opacity: .08;
  stroke-dasharray: 2600;
  stroke-dashoffset: 2600;
  filter: url(#boil);
}
.play .scribble { animation: draw 1.2s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.intro-stage {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas: "face word" "face tag" "face btn";
  align-items: center;
  column-gap: clamp(20px, 4vw, 60px);
  padding: 20px;
}
.intro-face-wrap { grid-area: face; position: relative; width: clamp(180px, 30vw, 380px); }
.intro-face {
  width: 100%;
  transform: scale(0);
  filter: url(#boil);
}
.play .intro-face { animation: popFace 1s cubic-bezier(.2, 1.6, .4, 1) .6s forwards, wiggle 2.4s ease-in-out 1.8s infinite; }
@keyframes popFace {
  0%   { transform: scale(0) rotate(-30deg); }
  45%  { transform: scale(1.15, .8) rotate(6deg); }
  65%  { transform: scale(.9, 1.12) rotate(-4deg); }
  85%  { transform: scale(1.04, .97) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0) scale(1); }
  25% { transform: rotate(-3deg) scale(1.02); }
  50% { transform: rotate(2deg) scale(.99); }
  75% { transform: rotate(-1deg) scale(1.01); }
}

/* sweat drops */
.sweat {
  position: absolute; width: 18px; height: 26px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  border-top-left-radius: 0;
  transform: rotate(45deg) scale(0);
  opacity: 0;
}
.sweat.s1 { top: 8%; right: 2%; }
.sweat.s2 { top: 22%; left: -2%; width: 14px; height: 20px; }
.play .sweat { animation: drip 1.6s ease-in 2.2s infinite; }
.play .sweat.s2 { animation-delay: 2.9s; }
@keyframes drip {
  0% { opacity: 0; transform: translateY(0) rotate(45deg) scale(0); }
  15% { opacity: 1; transform: translateY(0) rotate(45deg) scale(1); }
  80% { opacity: 1; transform: translateY(40px) rotate(45deg) scale(1); }
  100% { opacity: 0; transform: translateY(55px) rotate(45deg) scale(.6); }
}

.intro-word {
  grid-area: word;
  position: relative;
  width: clamp(240px, 42vw, 560px);
  aspect-ratio: 1010 / 362;
}
.lt { position: absolute; opacity: 0; filter: url(#boil-soft); }
.lt0 { left: 0;      top: 10.77%; width: 27.03%; }
.lt1 { left: 26.83%; top: 1.10%;  width: 22.57%; }
.lt2 { left: 51.0%;  top: 0;      width: 22.38%; }
.lt3 { left: 74.36%; top: 2.21%;  width: 25.64%; }
.lt.slam { animation: slam .45s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes slam {
  0%   { opacity: 0; transform: translateY(-120%) scale(2.4) rotate(-20deg); }
  50%  { opacity: 1; transform: translateY(6%) scale(.85, 1.15) rotate(4deg); }
  70%  { transform: translateY(0) scale(1.12, .88) rotate(-2deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
.intro-word.done .lt { animation: slam .45s forwards, letterBob 1.6s ease-in-out infinite; }
.intro-word.done .lt1 { animation-delay: 0s, .15s; }
.intro-word.done .lt2 { animation-delay: 0s, .3s; }
.intro-word.done .lt3 { animation-delay: 0s, .45s; }
@keyframes letterBob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-6%) rotate(-2deg); }
}

.intro-tag {
  grid-area: tag;
  font-size: clamp(1.1rem, 2.4vw, 1.8rem);
  min-height: 1.6em;
  margin-top: .4em;
}
.caret { animation: blink .7s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }

#enter {
  grid-area: btn; justify-self: start;
  margin-top: .8em;
  opacity: 0; transform: scale(0) rotate(-10deg);
  pointer-events: none;
}
#enter.show {
  pointer-events: auto;
  animation: popBtn .5s cubic-bezier(.2, 1.8, .4, 1) forwards, btnPulse 1.4s ease-in-out .6s infinite;
}
@keyframes popBtn { to { opacity: 1; transform: scale(1) rotate(-2deg); } }
@keyframes btnPulse {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  50% { transform: scale(1.06) rotate(1deg); }
}

@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-8px, 5px) rotate(-.5deg); }
  40% { transform: translate(7px, -6px) rotate(.5deg); }
  60% { transform: translate(-5px, -3px); }
  80% { transform: translate(4px, 4px); }
}

/* start gate (needed so the browser lets sound play) */
#gate {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: inherit;
  transition: opacity .25s, transform .25s;
}
#gate.gone { opacity: 0; transform: scale(1.2); pointer-events: none; }
.gate-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; font: inherit; color: var(--ink);
}
.gate-btn img { width: clamp(120px, 22vw, 200px); filter: url(#boil); animation: wiggle 1.6s ease-in-out infinite; }
.gate-btn:hover img { animation-duration: .5s; }
.gate-label {
  font-family: "Permanent Marker", cursive; font-size: clamp(1.8rem, 5vw, 2.8rem);
  background: var(--ink); color: var(--paper);
  padding: .2em .9em; border-radius: var(--wobble);
  box-shadow: 5px 5px 0 #0003;
  animation: btnPulse 1.4s ease-in-out infinite;
}
.gate-sub { font-size: 1.2rem; opacity: .7; }
.gate-muted {
  background: none; border: none; font: inherit; font-size: 1rem;
  text-decoration: underline wavy; opacity: .5; cursor: pointer;
}
.gate-muted:hover { opacity: 1; }

/* flying mini faces (intro exit & clicks) */
.fly {
  position: fixed; z-index: 200; pointer-events: none;
  width: 54px;
  animation: fly 1.1s cubic-bezier(.2, .7, .4, 1) forwards;
}
@keyframes fly {
  0% { transform: translate(-50%, -50%) scale(.2) rotate(0); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(var(--s)) rotate(var(--r)); opacity: 0; }
}

@media (max-width: 760px) {
  .intro-stage {
    grid-template-columns: 1fr;
    grid-template-areas: "face" "word" "tag" "btn";
    justify-items: center;
    text-align: center;
    row-gap: 10px;
  }
  .intro-face-wrap { width: min(60vw, 280px); }
  .intro-word { width: min(78vw, 400px); }
  #enter { justify-self: center; font-size: 1.2rem; }
}

/* ================= NAV ================= */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px clamp(14px, 4vw, 40px);
  background: #ffffffee;
  backdrop-filter: blur(6px);
  border-bottom: 3px solid var(--ink);
}
.nav-right { display: flex; align-items: center; gap: 12px; }
.sound-btn {
  width: 46px; height: 46px; font-size: 1.3rem; cursor: pointer;
  background: var(--paper); border: 3px solid var(--ink);
  border-radius: 50% 45% 55% 48%;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s;
}
.sound-btn:hover { transform: rotate(-10deg) scale(1.08); }
.sound-btn.off { opacity: .55; }
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: "Permanent Marker", cursive; font-size: 1.5rem; }
.nav-logo img { width: 46px; transition: transform .3s; }
.nav-logo:hover img { transform: rotate(-12deg) scale(1.1); }
.nav nav { display: flex; gap: clamp(10px, 2.5vw, 30px); }
.nav nav a { text-decoration: none; font-size: 1.2rem; position: relative; }
.nav nav a::after {
  content: ""; position: absolute; left: -4%; right: -4%; bottom: 0; height: 40%;
  background: var(--hi); z-index: -1; transform: scaleX(0); transform-origin: left;
  transition: transform .2s; border-radius: 4px;
}
.nav nav a:hover::after { transform: scaleX(1); }
@media (max-width: 760px) { .nav nav { display: none; } }

/* ================= HERO ================= */
.hero {
  position: relative;
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: center;
  gap: clamp(20px, 4vw, 60px);
  padding: 40px clamp(18px, 6vw, 90px);
  max-width: 1300px; margin: 0 auto;
}
.hero-face-wrap { position: relative; justify-self: center; width: min(100%, 480px); }
.hero-face {
  width: 100%;
  cursor: pointer;
  animation: float 4s ease-in-out infinite;
  transition: transform .15s;
}
.hero-face.squish { animation: squish .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-16px) rotate(2deg); }
}
@keyframes squish {
  0% { transform: scale(1); }
  30% { transform: scale(1.2, .75); }
  60% { transform: scale(.88, 1.15); }
  100% { transform: scale(1); }
}
.speech {
  position: absolute; top: -4%; right: -6%;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--wobble);
  padding: .4em 1em;
  font-size: 1.3rem;
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(6deg);
  animation: bob 2.2s ease-in-out infinite;
  white-space: nowrap;
}
.speech::after {
  content: ""; position: absolute; left: 18%; bottom: -16px;
  width: 22px; height: 22px; background: var(--paper);
  border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
  transform: skewX(25deg) rotate(45deg);
}
@keyframes bob { 0%,100% { transform: rotate(6deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-6px); } }

.hero-word { width: min(100%, 560px); margin-bottom: 14px; }
.tagline { font-size: clamp(1.4rem, 2.6vw, 2.1rem); margin-bottom: 24px; }
.ca {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 3px dashed var(--ink);
  border-radius: var(--wobble-2);
  padding: .5em 1em;
  margin-bottom: 26px;
  background: var(--paper);
  max-width: 100%;
}
.ca-label { font-family: "Permanent Marker", cursive; }
.ca code { font-family: inherit; font-size: 1.05rem; word-break: break-all; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-btns .btn { font-size: 1rem; padding: .65em 1.1em; }

.doodles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.doodles .d {
  position: absolute; font-family: "Permanent Marker", cursive;
  font-size: 2.4rem; opacity: .25; pointer-events: none;
  animation: drift 6s ease-in-out infinite;
}
.d1 { top: 8%; left: 4%; }
.d2 { top: 70%; left: 8%; animation-delay: -1s; font-size: 2rem; }
.d3 { top: 14%; right: 46%; animation-delay: -2s; }
.d4 { bottom: 10%; right: 6%; animation-delay: -3s; }
.d5 { top: 6%; right: 6%; animation-delay: -4s; }
.d6 { bottom: 4%; left: 46%; animation-delay: -5s; }
@keyframes drift {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  50% { transform: translate(10px, -18px) rotate(15deg); }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 30px; min-height: auto; }
  .hero-face-wrap { width: min(72vw, 340px); }
  .hero-word { margin: 0 auto 14px; }
  .hero-btns { justify-content: center; }
  .speech { right: -2%; }
}

/* ================= MARQUEE ================= */
.marquee {
  overflow: hidden;
  background: var(--ink); color: var(--paper);
  border-block: 3px solid var(--ink);
  transform: rotate(-1.5deg);
  margin: 30px -20px;
  padding: 12px 0;
}
.marquee-track {
  display: flex; gap: 28px; width: max-content;
  font-family: "Permanent Marker", cursive; font-size: 1.6rem;
  animation: marquee 22s linear infinite;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ================= SECTIONS ================= */
.section { max-width: 1200px; margin: 0 auto; padding: 90px clamp(18px, 5vw, 50px); }
.title {
  font-family: "Permanent Marker", cursive;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  text-align: center;
  margin-bottom: 50px;
  line-height: 1.1;
}
.title span {
  display: inline-block;
  position: relative;
  transform: rotate(-2deg);
}
.title span::after {
  /* scribbled underline */
  content: ""; position: absolute; left: -4%; right: -4%; bottom: -10px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 14' preserveAspectRatio='none'%3E%3Cpath d='M3 9 C 60 2 120 13 180 6 S 270 4 297 8' fill='none' stroke='%23111' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}

.card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--wobble);
  box-shadow: var(--shadow);
  padding: 26px 28px;
  transition: transform .2s ease;
}
.card:nth-child(even) { border-radius: var(--wobble-2); }
.card:hover { transform: rotate(0) translateY(-4px) !important; }
.tilt-l { transform: rotate(-1.5deg); }
.tilt-r { transform: rotate(1.5deg); }
.big { font-family: "Permanent Marker", cursive; font-size: 1.5rem; margin-bottom: 10px; }

.reveal { opacity: 0; translate: 0 40px; transition: opacity .6s ease, translate .6s cubic-bezier(.2, 1.4, .4, 1); }
.reveal.in { opacity: 1; translate: 0 0; }

.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }

/* hold game */
.hold-game {
  margin-top: 60px;
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 30px;
}
.hold-game h3 { font-family: "Permanent Marker", cursive; font-size: 1.8rem; }
.hold-btn { position: relative; overflow: hidden; min-width: 220px; user-select: none; -webkit-user-select: none; touch-action: none; }
.hold-btn span { position: relative; z-index: 1; mix-blend-mode: difference; color: #fff; }
.hold-btn i { position: absolute; inset: 0; background: var(--hi); transform: scaleX(0); transform-origin: left; }
.hold-btn.holding { animation: shake .3s linear infinite; }
.hold-result { font-size: 1.3rem; min-width: 140px; }
@media (max-width: 760px) { .hold-game { grid-template-columns: 1fr; text-align: center; justify-items: center; } }

/* tokenomics */
.token-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.stat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 34px 20px; }
.stat:nth-child(odd) { transform: rotate(-1.5deg); }
.stat:nth-child(even) { transform: rotate(1.5deg); }
.stat-num { font-family: "Permanent Marker", cursive; font-size: clamp(1.6rem, 2.6vw, 2.4rem); }
.stat-label { font-size: 1.15rem; opacity: .8; }
@media (max-width: 900px) { .token-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .token-grid { grid-template-columns: 1fr; } }

/* steps */
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.steps li { position: relative; padding-top: 44px; }
.steps b {
  position: absolute; top: -26px; left: 22px;
  width: 54px; height: 54px; display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  border-radius: 50% 45% 55% 48%;
  font-family: "Permanent Marker", cursive; font-size: 1.6rem;
  transform: rotate(-8deg);
}
.steps h3 { font-family: "Permanent Marker", cursive; font-size: 1.4rem; margin-bottom: 8px; }
@media (max-width: 1000px) { .steps { grid-template-columns: 1fr 1fr; row-gap: 50px; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* roadmap */
.road { position: relative; display: grid; gap: 40px; max-width: 760px; margin: 0 auto; }
.road-line { position: absolute; left: 50%; top: 0; height: 100%; width: 20px; transform: translateX(-50%); z-index: -1; }
.road-line path { fill: none; stroke: var(--ink); stroke-width: 3; stroke-dasharray: 12 10; vector-effect: non-scaling-stroke; }
.phase { width: 78%; }
.phase:nth-child(odd) { justify-self: end; transform: rotate(1.2deg); }
.phase:nth-child(even) { justify-self: start; transform: rotate(-1.2deg); }
.phase h3 { font-family: "Permanent Marker", cursive; font-size: 1.6rem; margin: 6px 0; }
.pill {
  display: inline-block; background: var(--hi);
  border: 2px solid var(--ink); border-radius: 999px;
  padding: 0 .8em; font-size: 1rem;
}
@media (max-width: 640px) { .phase { width: 100%; } .road-line { display: none; } }

/* CTA */
.cta { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 26px; }
.cta-face { width: min(60vw, 260px); animation: float 3s ease-in-out infinite; }
.cta-title { font-family: "Permanent Marker", cursive; font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.15; }

/* footer */
.footer {
  border-top: 3px solid var(--ink);
  padding: 50px 20px 40px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.footer-word { width: 160px; }
.footer p { max-width: 640px; font-size: 1.05rem; opacity: .8; }
.footer .small { font-size: .95rem; opacity: .55; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 30px; z-index: 300;
  transform: translate(-50%, 200px) rotate(-2deg);
  background: var(--ink); color: var(--paper);
  padding: .6em 1.4em; border-radius: var(--wobble);
  font-size: 1.2rem;
  opacity: 0;
  transition: transform .35s cubic-bezier(.2, 1.6, .4, 1), opacity .2s;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translate(-50%, 0) rotate(-2deg); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .boil, .boil-soft, .lt, .intro-face, .scribble { filter: none !important; }
}
