* { box-sizing: border-box; }

:root {
  --bg: #14161f;
  --surface: #1c1f2b;
  --surface-2: #232736;
  --text: #eef0f7;
  --muted: #a9aec4;
  --green: #4be07b;
  --blue: #37c8ff;
  --violet: #8f7bff;
  --radius: 18px;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 26px 26px;
  overflow-x: hidden;
}

/* --- фоновые блоки --- */
.bg-blocks { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.block {
  position: absolute; width: 60px; height: 60px; border-radius: 12px;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  opacity: .12; animation: float 9s ease-in-out infinite;
}
.b1 { top: 12%; left: 5%; }
.b2 { top: 65%; left: 8%; width: 40px; height: 40px; animation-delay: -2s; background: linear-gradient(135deg, var(--green), var(--blue)); }
.b3 { top: 25%; right: 6%; animation-delay: -4s; background: linear-gradient(135deg, #ff8ab4, #ffd36e); }
.b4 { top: 78%; right: 10%; width: 34px; height: 34px; animation-delay: -6s; }
.b5 { top: 45%; left: 46%; width: 26px; height: 26px; animation-delay: -3s; background: linear-gradient(135deg, var(--green), var(--violet)); }
.b6 { top: 5%; left: 60%; width: 46px; height: 46px; animation-delay: -7s; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(0deg);} 50% { transform: translateY(-26px) rotate(18deg);} }

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

/* --- header --- */
.header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 14px 5vw;
  background: rgba(20,22,31,.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; letter-spacing: 1px; }
.logo__mark { width: 30px; height: 30px; animation: spinLogo 8s linear infinite; }
@keyframes spinLogo { to { transform: rotate(360deg); } }
.logo__accent { color: var(--green); }
.nav { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: .95rem;
  padding: 8px 13px; border-radius: 10px; transition: .2s;
}
.nav a:hover, .nav a.active { color: #fff; background: rgba(255,255,255,.09); }

/* --- кнопки --- */
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  font-weight: 700; font-size: 1rem; color: #10131b;
  padding: 13px 26px; border-radius: 14px; transition: transform .15s, box-shadow .2s;
}
.btn:hover { transform: translateY(-3px); }
.btn--small { padding: 9px 18px; font-size: .9rem; background: var(--green); box-shadow: 0 6px 18px rgba(75,224,123,.3); }
.btn--primary { background: linear-gradient(135deg, var(--green), var(--blue)); box-shadow: 0 8px 24px rgba(55,200,255,.32); }
.btn--ghost { background: transparent; color: var(--text); border: 2px solid rgba(255,255,255,.25); }

/* --- hero --- */
.hero {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px;
  align-items: center; padding: 70px 5vw 60px;
}
.eyebrow { color: var(--green); font-weight: 700; margin: 0 0 10px; letter-spacing: .5px; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.1; margin: 0 0 16px; }
.grad { background: linear-gradient(90deg, var(--green), var(--blue), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 1.1rem; line-height: 1.65; max-width: 560px; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.stats { display: flex; gap: 26px; margin-top: 36px; flex-wrap: wrap; }
.stat b { display: block; font-size: 1.9rem; color: var(--green); }
.stat span { font-size: .85rem; color: var(--muted); }

/* --- сцена аватара --- */
.scene { position: relative; height: 380px; }
.avatar { position: absolute; left: 50%; top: 40px; width: 150px; transform: translateX(-50%); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0);} 50% { transform: translateX(-50%) translateY(-18px);} }
.avatar__head { position: relative; width: 84px; height: 74px; margin: 0 auto; background: linear-gradient(#ffd36e, #ffb347); border-radius: 14px; box-shadow: inset -6px -6px 0 rgba(0,0,0,.12); }
.avatar__head i { position: absolute; top: 26px; width: 12px; height: 14px; background: #2b2b2b; border-radius: 3px; }
.avatar__head i:first-child { left: 20px; }
.avatar__head i:nth-child(2) { right: 20px; }
.avatar__head u { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); width: 30px; height: 12px; border-bottom: 4px solid #2b2b2b; border-radius: 0 0 20px 20px; }
.avatar__body { width: 96px; height: 92px; margin: 8px auto 0; background: linear-gradient(#37c8ff, #1d9fe0); border-radius: 12px; box-shadow: inset -6px -6px 0 rgba(0,0,0,.12); }
.avatar__arm { position: absolute; top: 92px; width: 30px; height: 86px; background: linear-gradient(#ffd36e, #ffb347); border-radius: 10px; }
.avatar__arm.l { left: 4px; transform-origin: top; animation: wave 2.4s ease-in-out infinite; }
.avatar__arm.r { right: 4px; }
@keyframes wave { 0%,100% { transform: rotate(8deg);} 50% { transform: rotate(-28deg);} }
.avatar__leg { position: absolute; top: 174px; width: 44px; height: 74px; background: linear-gradient(#8f7bff, #6a56e0); border-radius: 10px; }
.avatar__leg.l { left: 32px; }
.avatar__leg.r { right: 32px; }
.platform { position: absolute; height: 34px; border-radius: 10px; background: linear-gradient(#4be07b, #24a95a); box-shadow: 0 10px 0 rgba(0,0,0,.25); }
.p1 { left: 8%; bottom: 46px; width: 46%; }
.p2 { right: 4%; bottom: 110px; width: 32%; background: linear-gradient(#8f7bff, #6a56e0); }
.coin {
  position: absolute; right: 12%; top: 20px; width: 58px; height: 58px;
  display: grid; place-items: center; font-weight: 900; color: #7a5200;
  background: linear-gradient(#ffe27a, #ffb800); border-radius: 50%;
  border: 4px solid #fff; box-shadow: 0 8px 20px rgba(255,184,0,.4);
  animation: spinCoin 3.4s linear infinite;
}
@keyframes spinCoin { 0%,100% { transform: rotateY(0) translateY(0);} 50% { transform: rotateY(180deg) translateY(-20px);} }
.spark { position: absolute; width: 14px; height: 14px; background: #fff; clip-path: polygon(50% 0,61% 39%,100% 50%,61% 61%,50% 100%,39% 61%,0 50%,39% 39%); animation: twinkle 2s ease-in-out infinite; }
.s1 { left: 20%; top: 30px; }
.s2 { right: 30%; top: 150px; animation-delay: .7s; }
.s3 { left: 40%; bottom: 130px; animation-delay: 1.3s; }
@keyframes twinkle { 0%,100% { opacity: .2; transform: scale(.6);} 50% { opacity: 1; transform: scale(1.2);} }

/* --- секции --- */
.section { padding: 64px 5vw; }
/* якоря не должны прятаться под sticky-хедером */
.section[id] { scroll-margin-top: 84px; }
.section--alt { background: rgba(255,255,255,.03); border-block: 1px solid rgba(255,255,255,.06); }
.section h2 { font-size: clamp(1.5rem, 3vw, 2.3rem); margin: 0 0 8px; }
.section__sub { color: var(--muted); margin: 0 0 26px; }

/* --- фильтры и карточки --- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.chip {
  border: 0; cursor: pointer; padding: 10px 18px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: .92rem; transition: .2s;
}
.chip:hover { color: #fff; transform: translateY(-2px); }
.chip.active { background: linear-gradient(135deg, var(--green), var(--blue)); color: #10131b; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  border: 1px solid rgba(255,255,255,.07);
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-8px) rotate(-.5deg); box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.card.hide { display: none; }
.card__cover {
  height: 130px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--g1), var(--g2));
}
.card__cover span { font-size: 3.4rem; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); transition: transform .25s; }
.card:hover .card__cover span { transform: scale(1.2) rotate(-8deg); }
.card__body { padding: 16px 18px 18px; }
.card__body h3 { margin: 0 0 6px; font-size: 1.12rem; }
.card__body p { margin: 0 0 14px; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.card__meta { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 700; color: var(--green); }
.empty { color: var(--muted); text-align: center; margin-top: 30px; }

/* --- факты --- */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin-top: 26px; }
.fact { background: var(--surface); padding: 22px; border-radius: var(--radius); border-left: 5px solid var(--green); transition: transform .2s; }
.fact:hover { transform: translateX(6px); }
.fact:nth-child(2n) { border-left-color: var(--blue); }
.fact:nth-child(3n) { border-left-color: var(--violet); }
.fact b { display: block; font-size: 1.5rem; margin-bottom: 6px; }
.fact span { color: var(--muted); line-height: 1.55; font-size: .95rem; }

/* --- шаги --- */
.steps { list-style: none; margin: 0 0 34px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; counter-reset: s; }
.steps li { background: var(--surface); padding: 24px 20px; border-radius: var(--radius); position: relative; }
.steps li span {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--green), var(--blue)); color: #10131b;
  font-weight: 900; font-size: 1.2rem; margin-bottom: 12px;
}
.steps li b { display: block; margin-bottom: 8px; }
.steps li p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.55; }

.code-box { background: #10131b; border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(255,255,255,.09); max-width: 640px; }
.code-box__bar { display: flex; align-items: center; gap: 7px; padding: 11px 15px; background: #1a1e2b; font-size: .82rem; color: var(--muted); }
.code-box__bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.code-box__bar i:nth-child(2) { background: #febc2e; }
.code-box__bar i:nth-child(3) { background: #28c840; }
.code-box__bar span { margin-left: 8px; }
.code-box pre { margin: 0; padding: 20px; overflow-x: auto; font-family: 'JetBrains Mono', Consolas, monospace; font-size: .9rem; line-height: 1.7; color: #dbe0f0; }
.code-box .k { color: var(--violet); }
.code-box .s { color: var(--green); }
.code-box .n { color: var(--blue); }
.code-box .c { color: #6c7290; }

/* --- квиз --- */
.quiz { background: var(--surface); border-radius: var(--radius); padding: 30px; max-width: 720px; border: 1px solid rgba(255,255,255,.08); }
.quiz__q { font-size: 1.25rem; font-weight: 700; margin: 0 0 20px; }
.quiz__answers { display: grid; gap: 12px; }
.ans {
  text-align: left; border: 2px solid rgba(255,255,255,.12); background: var(--surface-2);
  color: var(--text); padding: 14px 18px; border-radius: 14px; font-size: 1rem;
  cursor: pointer; transition: .18s; font-weight: 600;
}
.ans:hover:not(:disabled) { border-color: var(--blue); transform: translateX(6px); }
.ans.right { background: rgba(75,224,123,.2); border-color: var(--green); }
.ans.wrong { background: rgba(255,95,103,.2); border-color: #ff5f67; }
.ans:disabled { cursor: default; }
.quiz__score { color: var(--muted); margin: 18px 0 0; }
.quiz__score b { color: var(--green); }
.quiz__win { font-size: 1.3rem; font-weight: 800; color: var(--green); margin: 0 0 16px; }

/* --- советы --- */
.tips { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin-top: 26px; }
.tip { background: var(--surface); border-radius: var(--radius); padding: 24px; transition: .2s; border-top: 4px solid var(--blue); }
.tip:hover { transform: translateY(-6px); }
.tip:nth-child(2n) { border-top-color: var(--green); }
.tip span { font-size: 2rem; }
.tip b { display: block; margin: 10px 0 6px; }
.tip p { margin: 0; color: var(--muted); line-height: 1.55; font-size: .93rem; }

/* --- footer и toast --- */
.footer { padding: 34px 5vw; text-align: center; color: var(--muted); border-top: 1px solid rgba(255,255,255,.07); font-size: .92rem; }
.footer__note { color: var(--green); margin-top: 8px; }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 140%);
  background: linear-gradient(135deg, var(--green), var(--blue)); color: #10131b;
  padding: 14px 26px; border-radius: 14px; font-weight: 800; z-index: 50;
  box-shadow: 0 12px 30px rgba(0,0,0,.4); transition: transform .35s cubic-bezier(.2,1.4,.4,1);
}
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .hero__art { order: -1; }
  .scene { height: 320px; }
  .avatar { top: 10px; }
  .p1 { bottom: 30px; }
  .nav { display: none; }
}
