@font-face { font-family: "Fredoka"; src: url("/assets/fonts/fredoka.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("/assets/fonts/spacemono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("/assets/fonts/spacemono-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --lime: #9be22d;
  --lime-deep: #5b8f28;
  --sky: #7ec8f2;
  --sky-light: #bfe6fb;
  --ink: #1b3b23;
  --white: #ffffff;
  --common: #9aa3a8;
  --rare: #3d8fe0;
  --epic: #9b5de5;
  --gold: #f2b705;
  --radius: 28px;
  --shadow: 0 10px 0 rgba(27, 59, 35, 0.18), 0 24px 48px rgba(27, 59, 35, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Fredoka", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky) 0%, var(--sky-light) 60%, #e6f6ff 100%);
  background-attachment: fixed;
  line-height: 1.5;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.cloud { position: absolute; background: #fff; border-radius: 999px; opacity: .9; filter: drop-shadow(0 6px 0 rgba(27,59,35,.06)); animation: drift 60s linear infinite; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 55%; height: 170%; left: 12%; bottom: 20%; }
.cloud::after { width: 38%; height: 130%; right: 14%; bottom: 25%; }
.c1 { width: 180px; height: 44px; top: 12%; left: -10%; animation-duration: 70s; }
.c2 { width: 120px; height: 30px; top: 38%; left: 60%; animation-duration: 90s; animation-delay: -30s; }
.c3 { width: 220px; height: 52px; top: 68%; left: 20%; animation-duration: 110s; animation-delay: -60s; }
.c4 { width: 140px; height: 36px; top: 88%; left: 80%; animation-duration: 80s; animation-delay: -10s; }
@keyframes drift { from { transform: translateX(-20vw); } to { transform: translateX(120vw); } }

header.nav, main, footer { position: relative; z-index: 1; }

.nav {
  position: sticky; top: 12px; margin: 12px auto 0; width: min(1160px, calc(100% - 24px));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 14px 10px 10px; background: rgba(255,255,255,.85); backdrop-filter: blur(10px);
  border-radius: 999px; box-shadow: 0 6px 0 rgba(27,59,35,.12); z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { border-radius: 50%; }
.wordmark { font-weight: 700; font-size: 1.35rem; letter-spacing: -.01em; }
.ticker { font-family: "Space Mono", monospace; font-weight: 700; font-size: .78rem; background: var(--sky); padding: 3px 9px; border-radius: 999px; }
.nav nav { display: flex; gap: 4px; }
.nav nav a { text-decoration: none; font-weight: 600; padding: 8px 14px; border-radius: 999px; transition: background .2s; }
.nav nav a:hover { background: var(--lime); }

main { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }

.entry { font-family: "Space Mono", monospace; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--lime-deep); margin: 0 0 8px; }
h1, h2, h3 { margin: 0; line-height: 1.05; letter-spacing: -.02em; }
h1 { font-size: clamp(2.6rem, 6.5vw, 5rem); font-weight: 700; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 700; }
h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
p { margin: 0 0 12px; }
.quiet { opacity: .78; }

.hero { padding: 64px 0 56px; text-align: center; }
.hero-copy { display: flex; flex-direction: column; align-items: center; }
.hero h1 { max-width: 16ch; }
.lead { font-size: clamp(1.15rem, 2vw, 1.4rem); max-width: 34ch; margin-top: 18px; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.btn { display: inline-block; text-decoration: none; font-weight: 700; font-size: 1.05rem; padding: 14px 24px; border-radius: 999px; transition: transform .15s, box-shadow .15s; }
.btn.primary { background: var(--lime); box-shadow: 0 6px 0 var(--lime-deep); }
.btn.ghost { background: #fff; box-shadow: 0 6px 0 rgba(27,59,35,.18); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--lime-deep); }

.hero-art { position: relative; margin: 48px 0 0; border-radius: 40px; overflow: hidden; border: 8px solid #fff; box-shadow: 0 0 0 6px var(--lime), var(--shadow); }
.hero-art picture { display: block; }
.hero-art img { width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; object-position: 50% 60%; animation: breathe 9s ease-in-out infinite; }
.eye-light { position: absolute; top: 18.5%; left: 50%; transform: translateX(-50%); width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #fff, 0 0 18px var(--sky); animation: blink 3.2s steps(1) infinite; }
@keyframes blink { 0%, 86% { opacity: 1; } 87%, 93% { opacity: .1; } 94% { opacity: 1; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }

.card { background: #fff; border-radius: var(--radius); padding: clamp(24px, 4vw, 48px); box-shadow: var(--shadow); }
.about { margin: 24px 0 88px; }
.about h2 { max-width: 20ch; margin-bottom: 18px; }
.about p { font-size: 1.15rem; max-width: 62ch; }

section { scroll-margin-top: 96px; }
.section-head { margin-bottom: 28px; }
.sub { font-size: 1.1rem; margin-top: 10px; max-width: 52ch; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.guide, .rarity, .sightings { margin-bottom: 88px; }

.creature { display: grid; grid-template-columns: 140px 1fr; gap: 22px; align-items: start; background: #fff; border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.portrait { width: 140px; height: 140px; border-radius: 32px; overflow: hidden; background: var(--sky); border: 5px solid var(--lime); }
.portrait img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.portrait.gold { position: relative; border-color: var(--gold); background: radial-gradient(circle at 40% 35%, #fff6c9, var(--gold) 55%, #b88400); display: grid; place-items: center; filter: blur(.6px); }
.portrait.gold .q { font-size: 4rem; font-weight: 700; color: rgba(255,255,255,.9); text-shadow: 0 4px 0 rgba(120,80,0,.35); }
.shimmer { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.75) 50%, transparent 70%); animation: shimmer 2.8s ease-in-out infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.legendary { background: linear-gradient(160deg, #fffbea, #fff); outline: 3px solid rgba(242,183,5,.45); }
.facts { margin: 6px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.facts dt { font-family: "Space Mono", monospace; font-size: .75rem; font-weight: 700; text-transform: uppercase; opacity: .6; padding-top: 3px; }
.facts dd { margin: 0; }

.tier { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); border-top: 10px solid var(--c); }
.tier .gem { display: block; width: 38px; height: 38px; border-radius: 12px; transform: rotate(45deg); background: var(--c); margin: 6px 0 18px 6px; box-shadow: inset -6px -6px 0 rgba(0,0,0,.15), inset 5px 5px 0 rgba(255,255,255,.5); }
.tier h3 { color: var(--c); filter: brightness(.8); }
.tier.common { --c: var(--common); }
.tier.rare { --c: var(--rare); }
.tier.epic { --c: var(--epic); }
.tier.legend { --c: var(--gold); }
.tier.legend .gem { animation: glint 2.4s ease-in-out infinite; }
@keyframes glint { 50% { box-shadow: inset -6px -6px 0 rgba(0,0,0,.15), inset 5px 5px 0 rgba(255,255,255,.5), 0 0 22px var(--gold); } }

.note { background: #fff; border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); border-left: 10px solid var(--lime); }
.note.legend { border-left-color: var(--gold); background: linear-gradient(160deg, #fffbea, #fff); }

.token { margin-bottom: 64px; }
.token-head { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.token-head img { border-radius: 18px; image-rendering: pixelated; }
.token-head .entry { margin-bottom: 4px; }
.status { margin-left: auto; font-family: "Space Mono", monospace; font-weight: 700; font-size: .85rem; padding: 8px 14px; border-radius: 999px; background: #eef2f0; border: 2px dashed var(--lime-deep); }
.status.live { background: var(--lime); border-style: solid; }
#token-body p { font-size: 1.1rem; max-width: 64ch; }
.addr { font-family: "Space Mono", monospace; word-break: break-all; }

.foot { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 40px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; border-top: 2px solid rgba(27,59,35,.15); }
.foot-brand { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.foot-brand img { border-radius: 50%; image-rendering: pixelated; }
.foot p { margin: 0; font-size: .9rem; }

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

@media (max-width: 960px) {
  .hero { padding-top: 40px; }
  .grid.four { grid-template-columns: repeat(2, 1fr); }
  .grid.three, .grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav nav { display: none; }
  .creature { grid-template-columns: 1fr; }
  .portrait { width: 110px; height: 110px; }
  .grid.four { grid-template-columns: 1fr 1fr; gap: 14px; }
  .tier { padding: 18px; }
  .hero-art { border-radius: 28px; border-width: 6px; margin-top: 36px; }
  .hero-art img { aspect-ratio: 4 / 3; }
  .eye-light { top: 15%; }
  .status { margin-left: 0; }
}
