@font-face {
  font-family: "Fredoka Local";
  src: url("assets/fonts/fredoka-700.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito Local";
  src: url("assets/fonts/nunito-600.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito Local";
  src: url("assets/fonts/nunito-700.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito Local";
  src: url("assets/fonts/nunito-800.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #201914;
  --bark: #5c4533;
  --deep-bark: #382a20;
  --cream: #f4dfbd;
  --sand: #dca672;
  --lavender: #d9b3e6;
  --milk: #fff8e9;
  --yellow: #fff071;
  --line: 4px solid var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--deep-bark); }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: "Nunito Local", "Trebuchet MS", sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}

button, a { font: inherit; }
a { color: inherit; }
button { cursor: pointer; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: .6rem .85rem;
  background: var(--yellow);
  border: var(--line);
}
.skip-link:focus { top: 1rem; }

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 100%;
  padding: 1.2rem clamp(1rem, 5vw, 5rem);
}
.nav {
  display: flex;
  justify-content: flex-end;
  gap: clamp(.8rem, 2.5vw, 2rem);
  align-items: center;
  max-width: 1320px;
  margin: 0 auto;
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.nav a { text-decoration-thickness: 2px; text-underline-offset: .3em; }
.nav-buy {
  padding: .42rem .72rem;
  border: 3px solid var(--ink);
  background: var(--yellow);
  text-decoration: none !important;
  transform: rotate(-1.5deg);
}

.hero {
  position: relative;
  padding: 5.5rem 1.2rem 1.8rem;
  overflow: hidden;
  background: var(--lavender);
  border-bottom: var(--line);
}
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(.6rem, 2vh, 1.4rem);
  width: min(1120px, 100%);
  margin: 0 auto;
}
.hero-logo {
  display: block;
  width: min(630px, 68vw);
  height: auto;
  transform: rotate(-1.2deg);
}
.hero-character {
  display: block;
  width: min(430px, 50vw);
  height: auto;
  margin: 0;
  object-fit: contain;
  filter: drop-shadow(0 13px 0 rgba(91, 69, 51, .18));
}

.section { padding: clamp(4.5rem, 9vw, 9rem) clamp(1.1rem, 7vw, 7rem); }
.section h2 {
  max-width: 11ch;
  margin: .2rem 0 1rem;
  font-family: "Fredoka Local", "Trebuchet MS", sans-serif;
  font-size: clamp(3rem, 6.6vw, 6.7rem);
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.025em;
  text-transform: uppercase;
}
.eyebrow {
  margin: 0;
  color: var(--bark);
  font-size: .73rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.lead { max-width: 41rem; margin: 0; font-size: clamp(1.1rem, 1.7vw, 1.4rem); font-weight: 700; }

.story {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(290px, .9fr);
  align-items: end;
  gap: clamp(2rem, 7vw, 8rem);
  overflow: hidden;
  background: var(--cream);
  border-bottom: var(--line);
}
.work-notes { margin-top: 2.25rem; }
.work-notes p {
  max-width: 34rem;
  margin: 0;
  padding: .8rem 0 .8rem 1rem;
  border-top: 3px solid var(--bark);
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  font-weight: 800;
}
.work-notes p:last-child { border-bottom: 3px solid var(--bark); }
.work-notes p::before { content: ""; display: inline-block; width: .55rem; height: .55rem; margin-right: .7rem; background: var(--yellow); border: 2px solid var(--ink); transform: rotate(16deg); }
.story-art { position: relative; min-height: 480px; align-self: stretch; }
.story-art img { position: absolute; z-index: 1; right: -4%; bottom: 0; width: min(480px, 42vw); height: auto; }
.wood-chip { position: absolute; display: block; z-index: 0; width: 52%; height: 1.25rem; background: var(--bark); border: 3px solid var(--ink); }
.chip-a { right: 9%; top: 20%; transform: rotate(-19deg); }
.chip-b { right: 1%; top: 39%; width: 35%; transform: rotate(23deg); }

.moment { background: var(--sand); border-bottom: var(--line); }
.moment-inner { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: clamp(1.3rem, 5vw, 5rem); max-width: 1100px; margin: 0 auto; }
.moment h2 { max-width: 10ch; }
.moment-stamp { display: grid; place-items: center; width: clamp(6rem, 15vw, 12rem); aspect-ratio: 1; margin-top: .35rem; color: var(--yellow); background: var(--bark); border: var(--line); border-radius: 47% 53% 44% 56% / 54% 43% 57% 46%; transform: rotate(-11deg); }
.moment-stamp span { font-size: clamp(2.5rem, 6vw, 5rem); line-height: 1; }

.log-game { background: var(--lavender); border-bottom: var(--line); }
.game-intro { max-width: 48rem; margin: 0 auto 2.5rem; }
.game-intro h2 { max-width: 8ch; }
.game-shell { width: min(920px, 100%); margin: 0 auto; }
.game-scoreboard { display: flex; flex-wrap: wrap; gap: .65rem 1.4rem; margin: 0 0 .85rem; color: var(--bark); font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.game-scoreboard p { display: flex; gap: .45rem; align-items: baseline; margin: 0; }
.game-scoreboard strong { color: var(--ink); font-family: "Courier New", monospace; font-size: 1.15rem; letter-spacing: 0; }
.game-stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; min-height: 300px; background: #b797cd; border: var(--line); border-radius: 5px 18px 4px 15px; touch-action: none; }
.game-stage canvas { display: block; width: 100%; height: 100%; min-height: 0; outline: none; }
.game-stage canvas:focus-visible { outline: 4px solid var(--yellow); outline-offset: -8px; }
.game-overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 1rem; padding: 2rem; color: var(--ink); background: rgba(244, 223, 189, .92); text-align: center; transition: opacity .18s ease, visibility .18s ease; }
.game-overlay.is-hidden { visibility: hidden; opacity: 0; pointer-events: none; }
.game-overlay p { max-width: 23rem; margin: 0; font-size: clamp(1.1rem, 2vw, 1.45rem); font-weight: 800; }
.game-start { padding: .75rem 1.05rem; color: var(--ink); background: var(--yellow); border: var(--line); border-radius: 2px 8px 2px 8px; font-weight: 900; }
.game-start:hover { transform: translateY(-2px) rotate(-1deg); }
.game-instructions { max-width: 45rem; margin: 1rem 0 0; color: var(--bark); font-size: .9rem; font-weight: 700; }

.token { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr); align-items: center; gap: clamp(2.4rem, 7vw, 8rem); background: var(--milk); border-bottom: var(--line); }
.token h2 { max-width: 8ch; }
.ticker-mark { display: inline-block; margin: -.25rem 0 1.15rem; padding: .25rem .55rem; color: var(--milk); background: var(--bark); border: 3px solid var(--ink); font-family: "Courier New", monospace; font-weight: 900; letter-spacing: .04em; transform: rotate(-2deg); }
.contract-board { position: relative; padding: clamp(1.35rem, 4vw, 2.5rem); background: var(--bark); color: var(--milk); border: var(--line); border-radius: 4px 16px 5px 18px; box-shadow: 9px 9px 0 var(--yellow); }
.board-label { margin: 0 0 .8rem; color: var(--yellow); font-size: .73rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.contract-value { display: block; min-height: 1.7em; overflow-wrap: anywhere; color: inherit; font-family: "Courier New", monospace; font-size: clamp(.8rem, 1.4vw, 1rem); font-weight: 800; }
.copy-button { display: inline-block; margin-top: 1.2rem; padding: .72rem 1rem; color: var(--ink); background: var(--yellow); border: var(--line); border-radius: 2px 8px 2px 8px; font-weight: 900; }
.copy-button:hover { transform: translateY(-2px) rotate(-1deg); }
.copy-button:focus-visible, a:focus-visible { outline: 4px solid #fff; outline-offset: 4px; }
.copy-button[disabled] { cursor: not-allowed; opacity: .55; transform: none; }
.copy-feedback { min-height: 1.35em; margin: .8rem 0 0; font-size: .84rem; font-weight: 800; }

.chart { color: var(--milk); background: var(--deep-bark); border-bottom: var(--line); }
.chart .eyebrow { color: var(--yellow); }
.chart-heading { max-width: 54rem; }
.chart h2 { max-width: 9ch; margin-bottom: 1.35rem; }
.chart-intro { max-width: 45rem; margin: 0; font-size: 1.05rem; font-weight: 700; }
.dex-frame { min-height: 400px; margin-top: 2.5rem; overflow: hidden; background: #251b15; border: 4px solid var(--cream); border-radius: 3px 14px 4px 11px; }
.dex-frame iframe { display: block; width: 100%; height: 560px; border: 0; background: #251b15; }
.dex-status { display: grid; min-height: 400px; place-items: center; padding: 2rem; color: var(--cream); text-align: center; font-size: 1.05rem; font-weight: 800; }
.dex-link { display: inline-block; margin-top: 1.2rem; color: var(--yellow); font-weight: 900; text-decoration-thickness: 2px; text-underline-offset: .35em; }

.footer { display: grid; grid-template-columns: minmax(180px, .5fr) minmax(0, 1fr); gap: clamp(2rem, 7vw, 8rem); align-items: center; padding: clamp(3rem, 7vw, 6rem) clamp(1.1rem, 7vw, 7rem); color: var(--cream); background: var(--bark); }
.footer-mark img { display: block; width: min(345px, 100%); height: auto; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .15)); }
.footer-line { max-width: 34rem; margin: 0 0 1.2rem; font-size: clamp(1.25rem, 2.2vw, 1.9rem); font-weight: 900; line-height: 1.15; }
.footer-contract { display: flex; flex-wrap: wrap; gap: .65rem 1rem; align-items: center; padding-bottom: 1rem; border-bottom: 3px solid rgba(255, 248, 233, .58); }
.footer-contract .contract-value { flex: 1 1 18rem; }
.copy-button-dark { margin: 0; background: var(--yellow); }
.footer-links { display: flex; flex-wrap: wrap; gap: .7rem 1.25rem; margin: 1.3rem 0; font-weight: 900; }
.footer-links a { color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: .3em; }
.disclaimer { max-width: 44rem; margin: 0; color: #ead8bb; font-size: .77rem; }

@media (max-width: 760px) {
  .topbar { padding: .85rem 1rem; }
  .nav { justify-content: center; gap: .85rem; font-size: .68rem; }
  .hero { padding-top: 4.6rem; }
  .hero-logo { width: min(620px, 94vw); }
  .hero-character { width: min(500px, 92vw); }
  .story, .token, .footer { grid-template-columns: 1fr; }
  .story { gap: 1rem; }
  .story-art { min-height: 440px; }
  .story-art img { right: 50%; bottom: 0; width: min(420px, 100%); transform: translateX(50%); }
  .chip-a { right: 14%; top: 16%; }
  .chip-b { right: 5%; top: 31%; }
  .moment-inner { gap: 1.2rem; }
  .moment-stamp { width: 5.5rem; }
  .game-stage { min-height: 260px; }
  .game-scoreboard { justify-content: space-between; gap: .4rem .7rem; }
  .contract-board { box-shadow: 6px 6px 0 var(--yellow); }
  .dex-frame, .dex-status { min-height: 330px; }
  .dex-frame iframe { height: 430px; }
  .footer { gap: 1.7rem; }
  .footer-mark { max-width: 250px; }
}

@media (max-width: 390px) {
  .nav a:first-child, .nav a:nth-child(2) { display: none; }
  .game-scoreboard { font-size: .66rem; }
  .game-scoreboard strong { font-size: 1rem; }
  .section h2 { font-size: clamp(2.75rem, 15vw, 3.5rem); }
  .moment-inner { grid-template-columns: 1fr; }
  .moment-stamp { width: 4.7rem; }
  .footer-contract .copy-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
