:root {
  color-scheme: dark;
  --paper: oklch(15.5% 0.008 270);
  --surface: oklch(20% 0.01 270);
  --surface-glass: oklch(15.5% 0.008 270 / .72);
  --fill: oklch(100% 0 0 / .07);
  --fill-hover: oklch(100% 0 0 / .12);
  --fill-strong: oklch(100% 0 0 / .18);
  --hairline: oklch(100% 0 0 / .07);
  --ink: oklch(96% 0.005 270);
  --muted: oklch(72% 0.012 270);
  --faint: oklch(56% 0.012 270);
  --accent: oklch(64% 0.21 22);
  --accent-hover: oklch(68% 0.21 22);
  --focus: oklch(64% 0.21 22 / .45);
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-pill: 999px;
  --sh-1: 0 1px 2px oklch(0% 0 0 / .28), 0 6px 16px oklch(0% 0 0 / .22);
  --sh-2: 0 2px 6px oklch(0% 0 0 / .3), 0 18px 40px oklch(0% 0 0 / .45);
  --blur: blur(24px) saturate(1.8);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --fast: .2s;
  --gut: 48px;
  --wrap: 1120px;

  --ease-scale: linear(0.002 0%, 0.084 2%, 0.191 4%, 0.316 6%, 0.449 8%, 0.582 10%, 0.707 12%, 0.815 14%, 0.928 17%, 1.006 20%, 1.115 25%, 1.198 30%, 1.257 35%, 1.295 40%, 1.318 50%, 1.286 60%, 1.218 70%, 1.135 80%, 1.054 90%, 1 100%);
  --ease-rot: linear(0 0%, 0.054 2%, 0.105 4%, 0.154 6%, 0.202 8%, 0.247 10%, 0.290 12%, 0.332 14%, 0.390 17%, 0.445 20%, 0.527 25%, 0.600 30%, 0.663 35%, 0.718 40%, 0.807 50%, 0.872 60%, 0.917 70%, 0.948 80%, 0.972 90%, 1 100%);
  --ease-slide: linear(0 0%, 0.057 2%, 0.138 4%, 0.228 6%, 0.314 8%, 0.380 10%, 0.427 12%, 0.471 14%, 0.533 17%, 0.592 20%, 0.680 25%, 0.757 30%, 0.823 35%, 0.880 40%, 0.967 50%, 1.021 60%, 1.046 70%, 1.048 80%, 1.030 90%, 1 100%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-synthesis: none; }
h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: -0.02em; line-height: 1.15; font-weight: 700; }
p { margin: 0; text-wrap: pretty; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a.link { color: var(--accent); font-weight: 600; }
a.link:hover { color: var(--accent-hover); }
::selection { background: var(--focus); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 20px; border-radius: var(--r-pill); font: 600 15px var(--font); color: var(--ink); background: var(--fill-hover); white-space: nowrap; transition: background-color var(--fast), transform var(--fast) var(--ease); }
.btn:hover { background: var(--fill-strong); }
.btn:active { transform: scale(.97); }
.btn.primary { color: #fff; background: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.quiet { background: var(--fill); }
.btn.quiet:hover { background: var(--fill-hover); }
.btn.sm { height: 32px; padding: 0 14px; font-size: 14px; }
.btn.lg { height: 44px; padding: 0 24px; }
.status { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; color: var(--muted); background: var(--fill); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 var(--gut);
  background: var(--surface-glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 1px 0 var(--hairline);
}
.top-mark img { width: 40px; }
.top nav { display: flex; align-items: center; gap: 4px; }
.top nav a:not(.btn) { padding: 6px 12px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; color: var(--muted); transition: background-color var(--fast), color var(--fast); }
.top nav a:not(.btn):hover { background: var(--fill); color: var(--ink); }
.top nav .btn { margin-left: 8px; }

.hero {
  --mx: 0;
  --my: 0;
  min-height: calc(100svh - 64px);
  display: grid; place-items: center; align-content: center; gap: 40px;
  padding: 64px 24px 96px;
}
.logo {
  position: relative;
  width: min(64vw, 400px);
  aspect-ratio: 788 / 695;
  margin: 0;
  cursor: pointer;
}
.piece { position: absolute; transition: translate .25s ease-out; }
.frame { left: 0; top: 0; width: 100%; translate: calc(var(--mx) * 8px) calc(var(--my) * 8px); }
.a { left: 13.96%; top: 19.57%; width: 38.32%; translate: calc(var(--mx) * -18px) calc(var(--my) * -14px); }
.g { left: 48.22%; top: 19.42%; width: 38.07%; translate: calc(var(--mx) * 24px) calc(var(--my) * 18px); }
.mask { top: 80.86%; width: 50%; overflow: hidden; }
.mask img { width: 100%; }
.apais { left: 0; }
.games { left: 50%; }

:is(html.intro .logo, .logo.replay) .frame {
  animation: pop .8s var(--ease-scale) .3s both, spin 1s var(--ease-rot) .3s both;
}
:is(html.intro .logo, .logo.replay) .a { animation: pop .48s var(--ease-scale) 1.06s both; }
:is(html.intro .logo, .logo.replay) .g { animation: pop .48s var(--ease-scale) 1.34s both; }
:is(html.intro .logo, .logo.replay) .apais img { animation: from-right .6s var(--ease-slide) 1.7s both; }
:is(html.intro .logo, .logo.replay) .games img { animation: from-left .6s var(--ease-slide) 1.7s both; }
html.intro .after { animation: fade-in .7s ease 2.3s both; }

@keyframes pop { from { scale: 0; } to { scale: 1; } }
@keyframes spin { from { rotate: 45deg; } to { rotate: 540deg; } }
@keyframes from-right { from { translate: 100% 0; } to { translate: 0 0; } }
@keyframes from-left { from { translate: -100% 0; } to { translate: 0 0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.hero-text { display: grid; justify-items: center; gap: 28px; text-align: center; }
.hero-line { font-size: clamp(20px, 2.4vw, 22px); font-weight: 600; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.section { max-width: var(--wrap); margin: 0 auto; padding: 96px var(--gut); }
.section h2 { font-size: clamp(34px, 4.6vw, 48px); letter-spacing: -0.03em; line-height: 1.05; margin-bottom: 16px; }
.eyebrow { margin-bottom: 12px; font-size: 14px; font-weight: 600; color: var(--accent); }
.lead { max-width: 56ch; font-size: 18px; color: var(--muted); }
.cards { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { padding: 24px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); }
.card h3 { margin-bottom: 8px; font-size: 20px; }
.card p { font-size: 15px; color: var(--muted); }

.android { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.android .lead { margin-bottom: 24px; }
.android-art { margin: 0; overflow: hidden; border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.android-art img { transition: scale var(--fast) var(--ease); }
.android-art:hover { box-shadow: var(--sh-2); }
.android-art:hover img { scale: 1.03; }

.contact .lead { margin-bottom: 24px; }
.mail { font-size: clamp(22px, 3.4vw, 34px); font-weight: 700; letter-spacing: -0.02em; color: var(--accent); }
.mail:hover { color: var(--accent-hover); }

.bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  margin: 32px var(--gut) 0; padding: 28px 0 40px;
  box-shadow: 0 -1px 0 var(--hairline);
  font-size: 14px; color: var(--faint);
}
.bottom a:hover { color: var(--ink); }
.bottom-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }

@media (max-width: 700px) {
  :root { --gut: 20px; }
  .top nav a[href^="#"] { display: none; }
  .section { padding-block: 64px; }
  .android { grid-template-columns: 1fr; }
  .android-art { max-width: 72vw; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .piece, .btn, .android-art img { transition: none; }
}
