:root {
  --bg: #0b0d12;
  --bg-2: #11141b;
  --surface: #161a23;
  --surface-2: #1d2230;
  --line: #262c3b;
  --text: #e8eaf0;
  --muted: #9aa3b5;
  --accent: #3ee6d0;
  --accent-ink: #04201c;
  --warm: #ffb547;
  --pink: #ff5fa2;
  --radius: 14px;
  --wrap: 1180px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', var(--font);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
svg { width: 1.1em; height: 1.1em; flex: none; }

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.narrow { width: min(820px, 100% - 32px); }
.muted { color: var(--muted); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: #c7cddb; max-width: 62ch; }
.eyebrow { font: 600 .8rem/1.2 var(--display); text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: 1rem; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(11, 13, 18, .82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 1.1rem var(--display); letter-spacing: -0.01em; }
.brand b { color: var(--accent); font-weight: 600; margin-left: 2px; }
.brand-mark { width: 28px; height: 28px; color: var(--accent); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: .95rem; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav .lang, .footer .lang { border: 1px solid var(--line); color: var(--text); font: 600 .8rem var(--display); letter-spacing: .08em; padding: 6px 10px; border-radius: 8px; text-decoration: none; }
.nav-toggle { display: none; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; font: 500 .95rem var(--font); }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav { position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 12px 16px 20px; background: var(--bg); border-bottom: 1px solid var(--line); display: none; }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px; }
  .nav .lang { align-self: flex-start; margin-top: 8px; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 10px; font: 600 .98rem var(--font); text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .15s, background .15s, border-color .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #63f0de; }
.btn-ghost { border-color: var(--line); background: var(--surface); color: var(--text); }
.btn-ghost:hover { border-color: #3a4256; }
.btn-small { padding: 8px 12px; font-size: .88rem; border-color: var(--line); background: var(--surface-2); }
.btn-link { background: none; border: none; color: var(--accent); padding-inline: 4px; }
.btn.is-disabled { opacity: .6; cursor: default; transform: none; }
.btn em { font-style: normal; font-weight: 500; color: var(--warm); font-size: .85em; }

/* Hero */
.hero { position: relative; padding: clamp(48px, 8vw, 104px) 0 40px; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px; background: radial-gradient(closest-side, rgba(62, 230, 208, .14), transparent 70%); pointer-events: none; }
.hero::after { content: ''; position: absolute; inset: auto auto -30% -20%; width: 60vw; height: 60vw; max-width: 700px; max-height: 700px; background: radial-gradient(closest-side, rgba(255, 95, 162, .08), transparent 70%); pointer-events: none; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; transform: rotate(-2deg); }
.tile { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.tile:nth-child(2) { transform: translateY(24px); }
.tile:nth-child(4) { transform: translateY(24px); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.tile:hover img { transform: scale(1.05); }
.tile span { position: absolute; left: 10px; bottom: 10px; font: 600 .8rem var(--display); background: rgba(11, 13, 18, .8); padding: 4px 8px; border-radius: 6px; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-tiles { transform: none; }
  .tile:nth-child(2), .tile:nth-child(4) { transform: none; }
}

.stats { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.stats li { padding: 20px 22px; border-left: 1px solid var(--line); }
.stats li:first-child { border-left: 0; }
.stats b { display: block; font: 700 clamp(1.5rem, 2.6vw, 2rem)/1.1 var(--display); color: var(--text); }
.stats span { color: var(--muted); font-size: .9rem; }
@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats li:nth-child(3) { border-left: 0; }
  .stats li:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* Sections */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section.alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 40px; }
.section-head.sub { margin: 64px 0 24px; }
.grid { display: grid; gap: 20px; }
.grid.games { grid-template-columns: repeat(2, 1fr); }
.grid.tools { grid-template-columns: repeat(3, 1fr); }
.grid.packages { grid-template-columns: repeat(4, 1fr); }
.grid.team { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) { .grid.packages { grid-template-columns: repeat(2, 1fr); } .grid.tools { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .grid.games, .grid.tools, .grid.packages, .grid.team { grid-template-columns: 1fr; } }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card-media { display: block; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1b2030, #10131a); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-media img { transform: scale(1.03); }
.card-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.card-body > p { color: #c7cddb; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; font-size: .85rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.tool { padding: 22px; }
.tool p { color: #c7cddb; font-size: .95rem; }

.pill { display: inline-block; font: 600 .72rem/1 var(--display); letter-spacing: .06em; text-transform: uppercase; padding: 6px 9px; border-radius: 999px; border: 1px solid currentColor; }
.pill-live { color: var(--accent); }
.pill-soon { color: var(--warm); }
.pill-beta { color: #9fb4ff; }
.pill-archived { color: var(--muted); }

.metrics { list-style: none; padding: 0; margin: 4px 0 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metrics li { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.metrics b { display: block; font: 700 1.15rem/1.2 var(--display); }
.metrics span { display: block; color: var(--muted); font-size: .78rem; line-height: 1.35; }
@media (max-width: 420px) { .metrics { grid-template-columns: 1fr 1fr; } }

img.pixel, .pixel img { image-rendering: pixelated; }

/* Flow */
.flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; counter-reset: s; }
.flow li { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.flow li:not(:last-child)::after { content: ''; position: absolute; right: -10px; top: 32px; width: 8px; height: 8px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); transform: rotate(45deg); }
.flow li:last-child { border-color: var(--accent); }
.flow-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--accent); font: 700 .85rem var(--display); margin-bottom: 12px; }
.flow b { display: block; font-family: var(--display); margin-bottom: 6px; }
.flow p { color: var(--muted); font-size: .9rem; margin: 0; }
@media (max-width: 960px) {
  .flow { grid-template-columns: 1fr; }
  .flow li:not(:last-child)::after { right: auto; left: 32px; top: auto; bottom: -10px; transform: rotate(135deg); }
}

.story { margin-top: 32px; background: linear-gradient(135deg, rgba(62, 230, 208, .08), rgba(255, 95, 162, .05)); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.story p { color: #c7cddb; max-width: 70ch; }
.story-figure { display: grid; gap: 8px; margin: 18px 0 8px; max-width: 520px; }
.story-figure span { display: block; height: 22px; border-radius: 6px; background: var(--surface-2); position: relative; }
.story-figure span::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); min-width: 6px; border-radius: 6px; background: var(--warm); }
.story-figure span:last-child::before { background: var(--accent); }
.story-figure i { position: absolute; right: 8px; top: 0; font: 600 .75rem/22px var(--display); font-style: normal; color: var(--text); }
.story-figure span:last-child i { color: var(--accent-ink); }

/* Packages */
.package { padding: 24px; position: relative; }
.package.is-highlight { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pkg-n { font: 600 .8rem var(--display); color: var(--muted); letter-spacing: .1em; }
.package h3 { margin-top: 10px; }
.pkg-price { display: flex; flex-direction: column; margin-bottom: 14px; }
.pkg-price b { font: 700 1.35rem var(--display); color: var(--accent); }
.pkg-price span { color: var(--muted); font-size: .88rem; }
.package > p:last-child { color: #c7cddb; font-size: .95rem; margin: 0; }

.own { margin-top: 32px; display: grid; grid-template-columns: .9fr 1.1fr; gap: 32px; padding: 32px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); }
.own p { color: #c7cddb; }
@media (max-width: 860px) { .own { grid-template-columns: 1fr; padding: 24px; } }
.checks { list-style: none; padding: 0; margin: 0 0 1.5em; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 30px; }
.checks li::before { content: ''; position: absolute; left: 0; top: .3em; width: 18px; height: 18px; border-radius: 50%; background: rgba(62, 230, 208, .15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%233ee6d0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; }

/* Team */
.member { display: flex; align-items: center; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); font: 700 1rem var(--display); flex: none; }
.member b { display: block; font-family: var(--display); }
.member span { color: var(--muted); font-size: .9rem; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font: 600 1.08rem var(--display); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--accent); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq p { color: #c7cddb; margin: 12px 0 0; }

/* CTA */
.cta { background: radial-gradient(ellipse at 20% 0%, rgba(62, 230, 208, .16), transparent 60%), var(--bg-2); border-top: 1px solid var(--line); }
.cta-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 32px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 32px 0; font-size: .92rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.footer a { color: var(--muted); }
.footer p { margin: 6px 0 0; font-size: .85rem; }

/* Project page */
.project { padding: 32px 0 80px; }
.back { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: 24px; }
.back:hover { color: var(--accent); }
.project-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.project-cover { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); aspect-ratio: 16 / 9; }
.project-cover img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .project-hero-grid { grid-template-columns: 1fr; } }
.project-body { display: grid; grid-template-columns: 1.4fr .9fr; gap: 40px; margin-top: 56px; align-items: start; }
.project-body h2 { font-size: 1.5rem; margin-top: 1.4em; }
.project-body h2:first-child { margin-top: 0; }
.project-body section > p { color: #c7cddb; }
.project-body .story { margin-top: 0; position: sticky; top: 88px; }
@media (max-width: 860px) { .project-body { grid-template-columns: 1fr; } .project-body .story { position: static; } }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gallery figure.wide { grid-column: 1 / -1; background: #fff; }
.gallery figcaption { padding: 10px 14px; color: var(--muted); font-size: .85rem; background: var(--surface); }
.gallery img { width: 100%; }
.project > .wrap > section { margin-top: 56px; }
.project-cta { text-align: center; padding: 48px 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); }

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

/* Arcade link */
.nav .nav-arcade { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); border: 1px solid rgba(62, 230, 208, .35); margin-left: 6px; }
.nav .nav-arcade:hover { color: var(--accent); background: rgba(62, 230, 208, .08); }
.hero-arcade { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; color: var(--accent); text-decoration: none; font-weight: 600; }
.hero-arcade:hover { text-decoration: underline; }
@media (max-width: 860px) { .nav .nav-arcade { margin-left: 0; align-self: flex-start; } }
