:root {
  --bg: #050507;
  --ink: #eceef2;
  --muted: #8b8f9a;
  --faint: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.12);
  --lilac: #b9b4ff;
  --display: "Josefin Sans", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --wrap: min(1120px, calc(100% - 40px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; }
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px;
  border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(circle, rgba(185, 180, 255, 0.10), transparent 62%);
  transform: translate3d(50vw, 40vh, 0); transition: opacity .4s;
}

/* навигация */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  width: 100%; padding: 14px max(20px, calc((100% - 1120px) / 2));
  background: linear-gradient(to bottom, rgba(5, 5, 7, 0.96), rgba(5, 5, 7, 0.7) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); letter-spacing: .32em; font-size: 15px; }
.brand img { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.links { display: flex; gap: 28px; font-family: var(--display); font-size: 13px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); }
.links a:hover { color: var(--ink); }
.socials { display: flex; gap: 10px; }
.icon {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); transition: border-color .2s, background .2s;
}
.icon:hover { border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .04); }
.icon svg { width: 16px; height: 16px; fill: var(--ink); }

/* первый экран */
.hero {
  width: var(--wrap); margin: 0 auto; min-height: min(calc(100vh - 66px), 920px);
  display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 40px; padding: 40px 0 60px;
}
.kicker { font-family: var(--display); font-size: 13px; letter-spacing: .5em; color: var(--muted); margin: 0 0 22px; }
.kicker::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lilac); margin-right: 14px; box-shadow: 0 0 12px var(--lilac); animation: blink 3.4s infinite; }
h1 { margin: 0; line-height: 0; }
.wordmark { width: min(459px, 100%); filter: drop-shadow(0 0 24px rgba(255, 255, 255, .12)); }
.ticker { font-family: var(--display); font-weight: 300; font-size: 28px; letter-spacing: .45em; margin: 22px 0 6px; }
.lead { font-family: var(--display); font-weight: 300; font-size: 20px; letter-spacing: .06em; color: var(--muted); margin: 0 0 34px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.cta.center { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px;
  border-radius: 999px; border: 1px solid var(--line); font-family: var(--display); font-size: 14px;
  letter-spacing: .2em; text-transform: uppercase; transition: transform .2s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .4); }
.btn.primary { background: var(--ink); color: #08080a; border-color: var(--ink); }
.btn.primary:hover { background: #fff; }
[hidden] { display: none !important; }

.ca-box {
  margin-top: 28px; display: inline-flex; align-items: center; gap: 12px; max-width: 100%;
  padding: 12px 16px; border-radius: 14px; border: 1px solid var(--faint); background: rgba(255, 255, 255, .02);
  font-size: 14px; color: var(--muted);
}
.ca-box.wide { display: flex; justify-content: center; margin: 28px auto 0; width: fit-content; }
.ca-box .dot { width: 8px; height: 8px; border-radius: 50%; background: #e7c66b; box-shadow: 0 0 10px #e7c66b; flex: none; }
.ca-box code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.ca-box button {
  flex: none; cursor: pointer; border: 1px solid var(--line); background: none; color: var(--ink);
  border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 12px; letter-spacing: .12em;
}
.ca-box button:hover { border-color: rgba(255, 255, 255, .4); }

.hero-art { position: relative; display: grid; place-items: center; }
.halo {
  position: absolute; width: 115%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(185, 180, 255, .13) 0%, rgba(185, 180, 255, .045) 30%, rgba(185, 180, 255, 0) 60%);
}
.creature.cutout { -webkit-mask-image: none; mask-image: none; max-width: 520px; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .6)); }
.creature {
  position: relative; width: 100%; max-width: 560px;
  -webkit-mask-image: radial-gradient(ellipse 50% 58% at 50% 56%, #000 45%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 58% at 50% 56%, #000 45%, transparent 100%);
  animation: breathe 6s ease-in-out infinite;
}

/* полоса со сценой */
.strip { width: 100%; margin: 20px 0 0; position: relative; }
.strip img {
  width: 100%; max-height: 440px; object-fit: cover;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}
.strip p { text-align: center; font-family: var(--display); font-weight: 300; letter-spacing: .3em; color: var(--muted); font-size: 13px; text-transform: uppercase; margin: 18px 0 0; }

/* разделы */
section h2 {
  font-family: var(--display); font-weight: 300; font-size: clamp(30px, 4vw, 44px);
  letter-spacing: .22em; text-transform: uppercase; text-align: center; margin: 0 0 30px;
}
.about, .moments, .token { width: var(--wrap); margin: 0 auto; padding: 120px 0 0; }
.about-lead { max-width: 640px; margin: 0 auto; text-align: center; font-size: 19px; color: #c8cbd3; }
.facts { list-style: none; padding: 0; margin: 50px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.facts li {
  border: 1px solid var(--faint); border-radius: 18px; padding: 26px 24px; background: rgba(255, 255, 255, .015);
  font-family: var(--display); font-weight: 300; font-size: 18px; letter-spacing: .04em;
}
.facts span { display: block; font-size: 13px; letter-spacing: .3em; color: var(--lilac); margin-bottom: 12px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  margin: 0; border-radius: 20px; overflow: hidden; border: 1px solid var(--faint); background: #0b0b0e;
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), border-color .3s; transform-style: preserve-3d;
}
.card:hover { border-color: rgba(255, 255, 255, .22); }
.card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card figcaption { padding: 16px 20px 18px; font-family: var(--display); font-weight: 300; letter-spacing: .1em; color: #c8cbd3; }

.specs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0; }
.specs div { border: 1px solid var(--faint); border-radius: 18px; padding: 22px 24px; background: rgba(255, 255, 255, .015); }
.specs dt { font-family: var(--display); font-size: 12px; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); }
.specs dd { margin: 10px 0 0; font-family: var(--display); font-size: 22px; letter-spacing: .06em; overflow-wrap: break-word; }
.safety { text-align: center; color: var(--muted); font-size: 14px; margin: 22px auto 0; max-width: 560px; }

.join { width: var(--wrap); margin: 0 auto; padding: 150px 0 110px; text-align: center; }
.join-line { font-family: var(--display); font-weight: 200; font-size: clamp(36px, 6vw, 72px); line-height: 1.15; letter-spacing: .04em; margin: 0 0 40px; }
.join-line em { font-style: normal; color: var(--lilac); }

.foot {
  width: var(--wrap); margin: 0 auto; padding: 30px 0 50px; border-top: 1px solid var(--faint);
  display: flex; justify-content: space-between; gap: 30px; color: #6c707a; font-size: 13px;
}
.foot p { margin: 0; }
.foot p:last-child { max-width: 620px; text-align: right; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #08080a; padding: 10px 18px; border-radius: 999px; font-size: 14px;
  transition: opacity .25s, transform .25s; z-index: 20;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* появление при прокрутке */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.018); } }
@keyframes blink { 0%, 92%, 100% { opacity: 1; } 95% { opacity: .15; } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; min-height: auto; padding-top: 10px; gap: 10px; }
  .hero-art { order: -1; }
  .wordmark { margin: 0 auto; width: min(340px, 86%); }
  .cta { justify-content: center; }
  .ca-box { justify-content: center; }
  .links { display: none; }
  .facts, .grid { grid-template-columns: 1fr 1fr; }
  .specs { grid-template-columns: 1fr 1fr; }
  .about, .moments, .token { padding-top: 90px; }
  .foot { flex-direction: column; }
  .foot p:last-child { text-align: left; }
}
@media (max-width: 560px) {
  .facts, .grid { grid-template-columns: 1fr; }
  .ticker { font-size: 22px; }
  .specs dd { font-size: 18px; letter-spacing: .02em; }
  .lead { font-size: 17px; }
  .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .creature, .kicker::before { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .cursor-glow { display: none; }
}


/* игра */
button.btn { background: transparent; color: var(--ink); cursor: pointer; }
.play { width: var(--wrap); margin: 0 auto; padding: 120px 0 0; }
.play-sub { text-align: center; color: var(--muted); max-width: 560px; margin: -12px auto 30px; }
.game {
  position: relative; border-radius: 24px; overflow: hidden; border: 1px solid var(--faint);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 60px rgba(185, 180, 255, .05);
}
.game canvas { display: block; width: 100%; height: min(62vh, 540px); touch-action: none; cursor: pointer; outline: none; }
.game canvas:focus-visible { box-shadow: inset 0 0 0 2px rgba(185, 180, 255, .5); }
.hud {
  position: absolute; top: 16px; left: 22px; right: 22px; display: flex; gap: 24px; pointer-events: none;
  font-family: var(--display); letter-spacing: .14em; font-size: 16px;
}
.hud b { font-weight: 400; }
.hud-star { color: #ffe6a0; }
.hud-best { margin-left: auto; color: var(--muted); }
.overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 8px; padding-top: 6%; text-align: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(5, 5, 7, .55), rgba(5, 5, 7, .1) 65%, transparent);
}
.overlay.over { justify-content: center; padding-top: 0; background: rgba(5, 5, 7, .72); }
.ov-logo { width: min(280px, 56%); filter: drop-shadow(0 0 20px rgba(255, 255, 255, .15)); }
.ov-sub { font-family: var(--display); letter-spacing: .5em; color: var(--lilac); margin: 0 0 10px; font-size: 15px; }
.ov-hint, .ov-best { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.ov-result { font-family: var(--display); font-weight: 300; font-size: clamp(34px, 6vw, 58px); margin: 0; letter-spacing: .04em; }
.ov-new { margin: 0; color: #ffe6a0; font-family: var(--display); letter-spacing: .4em; font-size: 14px; }
.ov-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; padding: 0 16px; }
@media (max-width: 760px) {
  .game canvas { height: auto; aspect-ratio: 4 / 3; }   /* шире поле — видно препятствия заранее */
}
@media (max-width: 560px) {
  .ov-actions .btn { width: auto; min-height: 40px; padding: 0 16px; font-size: 12px; }
  .hud { font-size: 14px; gap: 14px; left: 14px; right: 14px; }
}

/* режим скриншота (?shot): без ожидания анимаций и без растяжения на высоту окна */
.shot .hero { min-height: 860px; }
.shot .reveal { opacity: 1; transform: none; transition: none; }

/* звук */
button.icon { background: transparent; color: var(--ink); cursor: pointer; padding: 0; }
.sound svg { width: 18px; height: 18px; fill: var(--ink); stroke: var(--ink); }
.sound .wave { display: none; }
.sound.on .wave { display: inline; }
.sound.on .mute { display: none; }
.sound.on { border-color: rgba(185, 180, 255, .55); box-shadow: 0 0 14px rgba(185, 180, 255, .25); }
.game-sound { position: absolute; top: 12px; right: 12px; z-index: 3; background: rgba(5, 5, 7, .5); }
.game .hud { right: 64px; }
