@font-face { font-family: "Lapka Sans"; src: url("/assets/fonts/LapkaSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lapka Sans"; src: url("/assets/fonts/LapkaSans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Lapka Sans Display"; src: url("/assets/fonts/LapkaSansDisplay-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --graphite: #222222;
  --deep: #1b1b1b;
  --panel: #2a2a2a;
  --line: #383838;
  --ivory: #f6eedf;
  --muted: #b5aea1;
  --emerald: #20c982;
  --amber: #f2b35b;
  --display: "Lapka Sans Display", "Lapka Sans", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--graphite); scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ivory);
  font: 18px/1.6 "Lapka Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; }
::selection { background: var(--emerald); color: var(--graphite); }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ---------- полоса прокрутки и шапка ---------- */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 50;
  background: linear-gradient(90deg, var(--emerald), #7cf0bf);
  transform-origin: 0 50%; transform: scaleX(var(--p, 0));
}

.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 24px;
  transition: background .4s var(--ease), backdrop-filter .4s, box-shadow .4s;
}
.bar.solid {
  background: rgba(27, 27, 27, .72);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 1px 0 rgba(246, 238, 223, .06);
}
.bar-logo { display: block; width: 40px; height: 40px; opacity: 0; transform: translateY(-6px) scale(.8); transition: .5s var(--ease); }
.bar.solid .bar-logo { opacity: 1; transform: none; }
.bar-logo img { width: 40px; height: 40px; display: block; border-radius: 10px; }
.bar-nav { display: flex; gap: 6px; margin-left: auto; }
.bar-nav a, .language-switch a {
  position: relative; display: inline-block; min-height: 40px; padding: 8px 12px;
  border-radius: 12px; text-decoration: none; font-size: 15px; color: var(--muted);
  transition: color .25s, background .25s;
}
.bar-nav a:hover, .language-switch a:hover { color: var(--ivory); background: rgba(246, 238, 223, .06); }
.language-switch { display: flex; gap: 2px; padding: 3px; border-radius: 14px; background: rgba(246, 238, 223, .05); }
.language-switch a { min-width: 44px; text-align: center; padding: 8px 10px; }
.language-switch a[aria-current="true"] { color: var(--graphite); background: var(--ivory); }

/* ---------- первый экран ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  overflow: hidden; isolation: isolate;
  padding: 110px 0 90px;
}
.hero-art {
  position: absolute; right: 0; bottom: 0; z-index: -3;
  width: min(74vw, 150vh); aspect-ratio: 3 / 2;
  transform: translate3d(var(--hx, 0px), calc(var(--hy, 0px) + var(--scroll, 0px) * .2), 0);
  transition: transform .9s var(--ease);
}
.hero-art img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; display: block;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%), linear-gradient(0deg, transparent 0%, #000 16%, #000 86%, transparent 100%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
  mask-image: linear-gradient(90deg, transparent 0%, #000 30%), linear-gradient(0deg, transparent 0%, #000 16%, #000 86%, transparent 100%);
  animation: art-in 1.8s var(--ease) both;
}
@keyframes art-in { from { opacity: 0; filter: blur(14px) brightness(.5); } to { opacity: 1; filter: none; } }

.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(600px 420px at var(--mx, 70%) var(--my, 50%), rgba(32, 201, 130, .10), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: linear-gradient(90deg, rgba(34, 34, 34, .9) 0%, rgba(34, 34, 34, .55) 32%, transparent 52%);
}
.hero-glow {
  position: absolute; pointer-events: none; mix-blend-mode: screen;
  left: 53%; top: 42%; width: 34%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(circle, rgba(32, 201, 130, .38), rgba(242, 179, 91, .12) 45%, transparent 70%);
  filter: blur(24px); animation: flicker 3.2s ease-in-out infinite;
}
@keyframes flicker { 0%,100% { opacity: .7; transform: scale(1); } 30% { opacity: 1; transform: scale(1.1); } 60% { opacity: .6; transform: scale(.95); } }

.embers { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

.hero-text { position: relative; width: min(560px, 100%); margin-left: max(24px, calc((100vw - 1160px) / 2 + 24px)); padding-right: 24px; }
.hero-logo {
  width: 150px; height: auto; display: block; margin: 0 0 10px -18px;
  mix-blend-mode: lighten;
  animation: logo-in 1.2s var(--ease) both;
}
@keyframes logo-in { from { opacity: 0; transform: translateY(18px) scale(.86); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }

.kicker {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--emerald);
}
.kicker::before { content: ""; width: 28px; height: 2px; background: currentColor; border-radius: 2px; }

h1 {
  font: 700 clamp(44px, 7.2vw, 88px)/1.02 var(--display);
  margin: 0 0 22px; letter-spacing: -.01em;
}
h1 .line { display: block; }
.rotator { color: var(--emerald); font-size: .74em; line-height: 1.08; min-height: 2.16em; position: relative; margin-top: .12em; }
.rot-word { display: inline; }
.rot-word .wd { display: inline-block; white-space: nowrap; }
.rot-word .ch { display: inline-block; opacity: 0; transform: translateY(.55em) rotate(8deg); filter: blur(4px); transition: opacity .45s var(--ease), transform .55s var(--ease), filter .45s; transition-delay: calc(var(--i) * 28ms); }
.rot-word.in .ch { opacity: 1; transform: none; filter: none; }
.rot-word.out .ch { opacity: 0; transform: translateY(-.45em) rotate(-6deg); filter: blur(4px); transition-delay: calc(var(--i) * 14ms); }

.lead { font-size: clamp(18px, 1.7vw, 21px); color: var(--muted); margin: 0 0 32px; max-width: 30em; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 14px 26px; border-radius: 999px;
  font-weight: 700; font-size: 17px; text-decoration: none;
  transition: transform .35s var(--ease), box-shadow .35s, background .3s, color .3s;
  will-change: transform;
}
.btn-main { background: var(--emerald); color: #0f2a1e; box-shadow: 0 10px 30px -8px rgba(32, 201, 130, .55); }
.btn-main:hover { box-shadow: 0 16px 40px -8px rgba(32, 201, 130, .75); }
.btn-ghost { border: 1.5px solid rgba(246, 238, 223, .22); color: var(--ivory); }
.btn-ghost:hover { background: var(--ivory); color: var(--graphite); border-color: var(--ivory); }
.btn span { transition: transform .3s var(--ease); }
.btn:hover span { transform: translate(3px, 2px); }
.btn-ghost:hover span { transform: translateX(4px); }

.scroll-hint {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  width: 26px; height: 42px; border-radius: 14px; border: 2px solid rgba(246, 238, 223, .35);
}
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--ivory); animation: wheel 1.8s var(--ease) infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- бегущая строка ---------- */
.marquee {
  position: relative; overflow: hidden; padding: 22px 0;
  border-block: 1px solid var(--line);
  background: var(--deep);
  transform: rotate(-1.2deg) scale(1.02);
  margin: 10px 0 0;
}
.marquee-track { display: flex; align-items: center; gap: 28px; width: max-content; animation: marquee 38s linear infinite; }
.marquee span { font: 700 clamp(22px, 3vw, 34px)/1 var(--display); white-space: nowrap; color: var(--ivory); }
.marquee span:nth-of-type(3n+2) { color: transparent; -webkit-text-stroke: 1.2px rgba(246, 238, 223, .55); }
.marquee i { width: 14px; height: 14px; flex: none; background: var(--emerald); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: spin 6s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- заголовки разделов ---------- */
.section-title {
  font: 700 clamp(34px, 4.6vw, 56px)/1.05 var(--display);
  margin: 0 0 56px; display: flex; align-items: baseline; gap: 18px;
}
.section-title .count { font-size: .38em; color: var(--emerald); letter-spacing: .1em; padding: 4px 10px; border: 1.5px solid currentColor; border-radius: 999px; transform: translateY(-.6em); }

/* ---------- витрины игр ---------- */
.games { padding: 130px 0 60px; }
.show {
  display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; gap: clamp(28px, 5vw, 72px);
  margin-bottom: clamp(90px, 12vw, 150px);
  --accent: var(--emerald);
}
.show.flip { grid-template-columns: 1fr 1.25fr; }
.show.flip .show-art { order: 2; }
.show-cafe { --accent: #f2b35b; --glow: rgba(242, 179, 91, .35); }
.show-rounds { --accent: #8ec5f2; --glow: rgba(142, 197, 242, .32); }
.show-itfits { --accent: #ff8a6b; --glow: rgba(255, 138, 107, .3); }

.show-art {
  position: relative; border-radius: 30px; overflow: hidden; aspect-ratio: 16 / 10.5;
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
  box-shadow: 0 30px 70px -30px var(--glow), 0 0 0 1px rgba(246, 238, 223, .07);
  background: var(--panel);
}
.show-art:hover { box-shadow: 0 40px 90px -28px var(--glow), 0 0 0 1px rgba(246, 238, 223, .14); }
.show-art > img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.06) translate3d(var(--px, 0), var(--py, 0), 0); transition: transform .8s var(--ease); }
.show-art:hover > img { transform: scale(1.1) translate3d(var(--px, 0), var(--py, 0), 0); }
.shine {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--sx, 50%) var(--sy, 50%), rgba(255, 255, 255, .55), transparent 60%);
}
.show-art:hover .shine { opacity: 1; }

.show-info h3 { font: 700 clamp(32px, 3.6vw, 46px)/1.05 var(--display); margin: 10px 0 14px; }
.show-info > p { color: var(--muted); margin: 0 0 20px; }
.show-icon {
  width: 84px; height: 84px; border-radius: 22px; display: block;
  box-shadow: 0 12px 30px -10px var(--glow), 0 0 0 1px rgba(246, 238, 223, .1);
  transition: transform .5s var(--ease);
}
.show:hover .show-icon { transform: rotate(-6deg) scale(1.06); }
.show-status {
  display: inline-block; margin: 22px 0 0; padding: 5px 12px; border-radius: 999px;
  font-size: 14px; font-weight: 700; color: var(--accent);
  border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent);
}
.show-status.live { color: #10241b; background: var(--emerald); border-color: var(--emerald); }
.show-status.live::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #10241b; animation: pulse 1.6s ease-in-out infinite; vertical-align: 1px; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 26px; list-style: none; }
.show-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-underline-offset: 4px; transition: color .25s; }
.text-link:hover { color: var(--ivory); }
.tags li { font-size: 14px; padding: 4px 12px; border-radius: 999px; background: rgba(246, 238, 223, .06); color: var(--ivory); }

/* пар над чашкой Манго */
.steam { position: absolute; left: 16%; top: 33%; width: 14%; overflow: visible; pointer-events: none; }
.steam path { fill: none; stroke: #fff; stroke-width: 8; stroke-linecap: round; filter: blur(1.5px) drop-shadow(0 0 3px rgba(120, 70, 30, .45)); stroke-dasharray: 60 200; animation: steam 3.6s ease-in-out infinite; opacity: 0; }
.steam path:nth-child(2) { animation-delay: -1.2s; }
.steam path:nth-child(3) { animation-delay: -2.4s; }
@keyframes steam { 0% { stroke-dashoffset: 0; opacity: 0; } 25% { opacity: .9; } 100% { stroke-dashoffset: -200; opacity: 0; } }

/* сердечки над Асей */
.hearts i {
  position: absolute; bottom: 30%; width: 18px; height: 18px; opacity: 0;
  background: #ff9bb0; clip-path: path("M9 16.5S1 11.6 1 6.3A4.2 4.2 0 0 1 9 4a4.2 4.2 0 0 1 8 2.3C17 11.6 9 16.5 9 16.5z");
  animation: heart 4.5s ease-in infinite;
}
.hearts i:nth-child(1) { left: 66%; animation-delay: 0s; }
.hearts i:nth-child(2) { left: 72%; animation-delay: -.9s; transform: scale(.7); }
.hearts i:nth-child(3) { left: 60%; animation-delay: -1.8s; }
.hearts i:nth-child(4) { left: 78%; animation-delay: -2.7s; }
.hearts i:nth-child(5) { left: 69%; animation-delay: -3.6s; }
@keyframes heart {
  0% { opacity: 0; transform: translateY(0) scale(.5) rotate(-10deg); }
  15% { opacity: .95; }
  100% { opacity: 0; transform: translateY(-180px) translateX(20px) scale(1.1) rotate(12deg); }
}

/* наклейки и снег «Всё влезет!» */
.stickers img {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: auto;
  filter: drop-shadow(0 10px 14px rgba(20, 22, 50, .45));
  animation: bob 5s ease-in-out infinite; animation-delay: var(--d);
  transform: translate3d(calc(var(--px, 0px) * -1.6), calc(var(--py, 0px) * -1.6), 0) rotate(var(--r));
}
@keyframes bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -12px; } }
.snow {
  position: absolute; inset: 0; pointer-events: none; opacity: .8;
  background-image:
    radial-gradient(2px 2px at 20px 30px, #fff, transparent 60%),
    radial-gradient(3px 3px at 120px 80px, #fff, transparent 60%),
    radial-gradient(2px 2px at 200px 150px, #fff, transparent 60%),
    radial-gradient(2.5px 2.5px at 60px 190px, #fff, transparent 60%),
    radial-gradient(2px 2px at 160px 20px, #fff, transparent 60%);
  background-size: 240px 220px;
  animation: snow 9s linear infinite;
}
@keyframes snow { to { background-position: 40px 220px; } }

/* ---------- принципы ---------- */
.how { padding: 40px 0 130px; }
.principles { display: grid; grid-template-columns: repeat(2, 1fr); max-width: 880px; gap: 20px; padding: 0; margin: 0; list-style: none; }
.principle {
  position: relative; padding: 32px 28px 30px; border-radius: 26px; overflow: hidden;
  background: linear-gradient(160deg, #2b2b2b, #242424);
  border: 1px solid var(--line);
  transition: transform .5s var(--ease), border-color .4s;
}
.principle::after {
  content: ""; position: absolute; inset: auto -40% -60% auto; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(32, 201, 130, .22), transparent 70%); opacity: 0; transition: opacity .5s;
}
.principle:hover { transform: translateY(-6px); border-color: rgba(32, 201, 130, .45); }
.principle:hover::after { opacity: 1; }
.principle svg { width: 52px; height: 52px; fill: none; stroke: var(--emerald); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.principle svg * { stroke-dasharray: 140; stroke-dashoffset: 140; transition: stroke-dashoffset 1.6s var(--ease) .2s; }
.principle.visible svg * { stroke-dashoffset: 0; }
.principle:hover svg { animation: wobble .6s var(--ease); }
@keyframes wobble { 30% { transform: rotate(-10deg) scale(1.1); } 60% { transform: rotate(6deg); } }
.principle h3 { font: 700 24px/1.2 var(--display); margin: 18px 0 8px; }
.principle p { margin: 0; color: var(--muted); font-size: 16px; }

/* ---------- подвал ---------- */
.foot { position: relative; overflow: hidden; border-top: 1px solid var(--line); padding-top: 40px; }
.foot-word {
  font: 700 clamp(64px, 17vw, 240px)/.85 var(--display); letter-spacing: .04em; text-align: center; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1.5px rgba(246, 238, 223, .16);
  background: radial-gradient(500px circle at var(--fx, 50%) 60%, rgba(32, 201, 130, .9), transparent 60%);
  -webkit-background-clip: text; background-clip: text;
  user-select: none;
}
.foot-row { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; padding-bottom: 34px; font-size: 15px; color: var(--muted); }
.to-top { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.to-top:hover { color: var(--ivory); }

/* ---------- появление при прокрутке ---------- */
.js .reveal { opacity: 0; transform: translateY(34px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--delay, 0s); }
.js .reveal.visible { opacity: 1; transform: none; }
.js .show.reveal .show-art { clip-path: inset(12% 8% 12% 8% round 30px); transition: clip-path 1.3s var(--ease), transform .6s var(--ease), box-shadow .6s var(--ease); }
.js .show.reveal.visible .show-art { clip-path: inset(0 0 0 0 round 30px); }
.js .hero .reveal { transform: translateY(24px); }

/* ---------- адаптив ---------- */
@media (max-width: 900px) {
  .show, .show.flip { grid-template-columns: 1fr; }
  .show.flip .show-art { order: 0; }
  .principles { grid-template-columns: 1fr; }
  .hero { align-items: flex-end; padding-bottom: 110px; }
  .hero-art { width: 100%; height: 64%; aspect-ratio: auto; inset: 0 0 auto 0; }
  .hero-art img { object-position: 62% 50%;
    -webkit-mask-image: linear-gradient(0deg, transparent 0%, #000 42%); mask-image: linear-gradient(0deg, transparent 0%, #000 42%); }
  .hero::after { background: linear-gradient(0deg, rgba(34, 34, 34, .92) 0%, rgba(34, 34, 34, .5) 40%, transparent 60%); }
  .hero-glow { display: none; }
  .hero-logo { display: none; }
  .bar-logo { opacity: 1; transform: none; }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .bar { padding: 10px 14px; gap: 8px; }
  .bar-nav { display: none; }
  .language-switch { margin-left: auto; }
  .games { padding-top: 90px; }
  .section-title { margin-bottom: 36px; }
  .hero-text { margin-left: 18px; padding-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .marquee-track { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
  .js .show.reveal .show-art { clip-path: none; }
  html { scroll-behavior: auto; }
}
