/* Nakato Studio: the look of our games and of the game framework. A deep night, a fine pixel grid,
   stepped pixel borders, a mint glow; pixel type for titles, a readable face for reading. */
:root {
  --shadow: #0b0616;
  --ink: #140a24;
  --night: #1d1036;
  --plum: #2c1850;
  --violet: #45277a;
  --lilac: #8f6bd6;
  --mist: #d2c2ff;
  --cream: #fff4e0;
  --pink: #ff5fa2;
  --hot: #ff2e88;
  --yellow: #ffd84d;
  --mint: #5cf2b5;
  --red: #ff3b5c;
  --px: 4px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--shadow);
  color: var(--cream);
  font: 17px/1.65 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* The engine's pixel grid, very faint. */
  background-image:
    repeating-linear-gradient(0deg, rgba(143, 107, 214, 0.05) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(143, 107, 214, 0.035) 0 1px, transparent 1px 4px);
}
a { color: var(--mint); }
a:hover { color: var(--yellow); }
img, video, canvas { max-width: 100%; height: auto; display: block; }
.pixel { image-rendering: pixelated; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3, .btn, .tag, .nav a, .brand, .label { font-family: "Silkscreen", ui-monospace, monospace; font-weight: 400; letter-spacing: 0.5px; }
h1 { font-size: clamp(28px, 5vw, 46px); line-height: 1.15; margin: 0 0 16px; }
h2 { font-size: clamp(24px, 3.6vw, 34px); line-height: 1.2; margin: 0 0 22px; color: var(--yellow); }
h2 .num { color: var(--pink); margin-right: 10px; }
h3 { font-size: 20px; line-height: 1.3; margin: 0 0 8px; color: var(--cream); }
p { margin: 0 0 14px; }
.muted { color: var(--mist); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* Stepped pixel border: a box with its corners cut, like the engine's panels. */
.panel {
  background: var(--night);
  position: relative;
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--violet), 0 var(--px) 0 0 var(--violet),
    calc(var(--px) * -1) 0 0 0 var(--violet), var(--px) 0 0 0 var(--violet);
  margin: var(--px);
}

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(11, 6, 22, 0.9); backdrop-filter: blur(6px); border-bottom: 2px solid var(--plum); }
.top .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font-size: 18px; }
.brand img { width: 34px; height: 34px; }
.brand span { color: var(--pink); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.nav a { color: var(--mist); text-decoration: none; font-size: 15px; }
.nav a:hover { color: var(--yellow); }
.lang { display: flex; border: 2px solid var(--violet); }
.lang button { background: none; border: 0; color: var(--mist); font: 600 12px system-ui, sans-serif; padding: 5px 8px; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--violet); color: var(--cream); }
@media (max-width: 760px) { .nav .hide-sm { display: none; } }
@media (max-width: 480px) {
  .top .wrap { gap: 10px; }
  .brand { font-size: 15px; gap: 8px; }
  .brand img { width: 28px; height: 28px; }
  .nav { gap: 12px; }
  .nav .hide-xs { display: none; }
}

/* Hero: the splash, big */
.hero { padding: 36px 0 56px; }
.screen { position: relative; margin: 0 auto 34px; max-width: 980px; padding: 10px; background: var(--ink); box-shadow: 0 0 0 4px var(--plum), 0 0 0 8px var(--ink), 0 0 80px rgba(92, 242, 181, 0.18); }
.screen canvas { width: 100%; height: auto; aspect-ratio: 320 / 150; image-rendering: pixelated; cursor: pointer; }
.screen .hint { position: absolute; right: 18px; bottom: 16px; font: 600 12px system-ui, sans-serif; color: var(--mist); opacity: 0.75; pointer-events: none; }
.hero-text { max-width: 760px; margin: 0 auto; text-align: center; }
.hero-text p { font-size: 19px; color: var(--mist); }
.ctas { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 22px; }

/* Buttons: chunky, pixel-cornered, pressed on click */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 20px; font-size: 15px; line-height: 1;
  color: var(--ink); background: var(--mint); text-decoration: none; border: 0; cursor: pointer;
  box-shadow: 0 -4px 0 0 var(--ink) inset, 0 0 0 3px var(--ink);
  transition: transform 0.06s;
}
.btn:hover { color: var(--ink); background: var(--yellow); }
.btn:active { transform: translateY(2px); }
.btn.alt { background: var(--violet); color: var(--cream); }
.btn.alt:hover { background: var(--lilac); color: var(--cream); }
.btn.pink { background: var(--pink); }
.btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }
.btn small { font: 600 11px system-ui, sans-serif; opacity: 0.8; }

section { padding: 72px 0; }
section.band { background: rgba(29, 16, 54, 0.55); border-top: 2px solid var(--plum); border-bottom: 2px solid var(--plum); }

/* The shelf of cartridges */
.shelf { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 300px)); gap: 34px; justify-content: center; margin-bottom: 48px; }
.cart { position: relative; padding: 14px 14px 30px; background: var(--lilac); color: var(--ink); text-decoration: none; display: block;
  box-shadow: 0 0 0 4px var(--plum), 0 10px 0 0 var(--plum), 0 14px 30px rgba(0,0,0,0.5); transition: transform 0.12s; }
.cart:hover { transform: translateY(-6px); color: var(--ink); }
.cart::before { /* the ridges on top */ content: ""; display: block; height: 8px; margin: -4px 10px 10px;
  background: repeating-linear-gradient(90deg, #3a2a52 0 6px, transparent 6px 12px); }
.cart::after { /* the contacts at the bottom */ content: ""; position: absolute; left: 22px; right: 22px; bottom: 8px; height: 10px;
  background: repeating-linear-gradient(90deg, var(--yellow) 0 6px, var(--plum) 6px 12px); }
.cart .label { background: var(--night); border: 4px solid var(--mint); aspect-ratio: 16 / 10; overflow: hidden; display: grid; place-items: center; }
.cart .label img { width: 100%; height: 100%; object-fit: cover; }
.cart .name { font-family: "Silkscreen", monospace; font-size: 20px; margin: 12px 4px 0; display: flex; justify-content: space-between; align-items: center; }
.cart .status { font: 700 11px system-ui, sans-serif; text-transform: uppercase; letter-spacing: 1px; padding: 4px 6px; background: var(--ink); color: var(--mint); }
.cart.next { background: var(--violet); }
.cart.next .label { border-color: var(--lilac); }
.cart.next .label b { font-family: "Silkscreen", monospace; font-size: 54px; color: var(--lilac); animation: blink 1.4s steps(2) infinite; }
.cart.next .status { color: var(--yellow); }
@keyframes blink { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .cart.next .label b { animation: none; } .cart, .btn { transition: none; } }

/* Journal */
.posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.post { padding: 22px; }
.post time { font: 700 12px system-ui, sans-serif; color: var(--pink); text-transform: uppercase; letter-spacing: 1px; }
.post h3 { margin-top: 8px; }

/* Studio */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; margin: 28px 0 0; }
.pillar { padding: 22px; }
.pillar .icon { font-family: "Silkscreen", monospace; color: var(--mint); font-size: 26px; margin-bottom: 6px; }

/* Contact */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.box { padding: 28px; }
.hidden { display: none; }
.todo { color: var(--yellow); font-style: italic; }

footer { padding: 36px 0 48px; border-top: 2px solid var(--plum); color: var(--mist); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; }
footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--mist); }

/* The pixel rain of the secret code */
#rain { position: fixed; inset: 0; pointer-events: none; z-index: 50; image-rendering: pixelated; }

/* Languages: only the chosen one shows. */
[data-l]:not(.on) { display: none !important; }

/* ---------- A game's page ---------- */
.game-hero { position: relative; min-height: min(78vh, 720px); display: grid; place-items: center; text-align: center; overflow: hidden; border-bottom: 2px solid var(--plum); }
.game-hero .bg { position: absolute; inset: 0; background-size: cover; background-position: center; image-rendering: pixelated; filter: saturate(1.1); transform: scale(1.04); }
.game-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 6, 22, 0.55) 0%, rgba(11, 6, 22, 0.78) 55%, var(--shadow) 100%); }
.game-hero .inner { position: relative; z-index: 1; padding: 72px 16px 56px; max-width: 900px; }
.game-hero .logo { width: min(640px, 92%); height: auto; margin: 0 auto 6px; image-rendering: pixelated; filter: drop-shadow(0 6px 0 var(--ink)); }
.game-hero .tag { display: inline-block; font-size: 15px; color: var(--yellow); margin-bottom: 18px; }
.game-hero .pitch { font-size: clamp(18px, 2.2vw, 22px); color: var(--cream); max-width: 720px; margin: 0 auto; text-shadow: 0 2px 0 var(--ink); }
.game-hero .ctas { margin-top: 28px; }
.game-hero .meta { margin-top: 18px; font: 600 13px system-ui, sans-serif; color: var(--mist); letter-spacing: 0.5px; }

.trailer-block { max-width: 1040px; margin: 0 auto; }
.trailer-block video { width: 100%; height: auto; background: var(--ink); box-shadow: 0 0 0 4px var(--plum), 0 0 0 8px var(--ink), 0 0 80px rgba(255, 46, 136, 0.18); }

.center { text-align: center; }
.lead { font-size: 19px; color: var(--mist); max-width: 720px; margin: 0 auto 36px; }

/* Three steps, same-size pictures */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; counter-reset: step; }
.step { padding: 0 0 20px; overflow: hidden; }
.step img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: pixelated; border-bottom: 4px solid var(--violet); }
.step h3, .step p { padding: 0 20px; }
.step h3 { margin-top: 18px; }
.step h3::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 10px; background: var(--pink); color: var(--ink); font-size: 16px; vertical-align: 2px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* Modes: a regular grid of cards */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.mode { overflow: hidden; }
.mode img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; image-rendering: pixelated; }
.mode div { padding: 16px 18px 18px; }
.mode h3 { font-size: 17px; color: var(--yellow); }
.mode p { margin: 0; font-size: 15px; color: var(--mist); }
@media (max-width: 960px) { .modes { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .modes { grid-template-columns: 1fr; } }
.also { margin-top: 26px; color: var(--mist); text-align: center; }

/* Demo / full game */
.compare { max-width: 900px; margin: 0 auto; }
.compare table { width: 100%; border-collapse: collapse; font-size: 15px; }
.compare th, .compare td { text-align: left; padding: 14px 16px; border-bottom: 2px solid var(--plum); vertical-align: top; }
.compare thead th { font-family: "Silkscreen", monospace; font-weight: 400; color: var(--yellow); font-size: 15px; }
.compare td:first-child { color: var(--mist); }
.compare .yes { color: var(--mint); font-weight: 600; }
.compare .no { color: var(--lilac); }
.table-scroll { overflow-x: auto; }

/* The press kit */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: 15px; margin: 0; }
.facts dt { color: var(--mist); }
.facts dd { margin: 0; }
.press-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.press-shots a { display: block; box-shadow: 0 0 0 3px var(--plum); }
.press-shots a:hover { box-shadow: 0 0 0 3px var(--mint); }
.press-shots img { width: 100%; height: auto; image-rendering: pixelated; }
.crumbs { font: 600 13px system-ui, sans-serif; color: var(--mist); margin-bottom: 14px; }
.crumbs a { color: var(--mist); }

/* The picture viewer */
.lb-zoom { cursor: zoom-in; }
.lb-open, .lb-open body { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 24px; background: rgba(11, 6, 22, 0.94); }
.lb[hidden] { display: none; }
.lb figure { margin: 0; display: grid; justify-items: center; gap: 14px; min-width: 0; }
.lb img { max-width: 100%; max-height: calc(100vh - 150px); width: auto; height: auto; image-rendering: pixelated; box-shadow: 0 0 0 4px var(--plum), 0 0 0 8px var(--ink), 0 0 80px rgba(92, 242, 181, 0.15); }
.lb figcaption { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: center; color: var(--cream); font-family: "Silkscreen", monospace; font-size: 16px; }
.lb-count { color: var(--mist); font: 600 13px system-ui, sans-serif; }
.lb-download { font-size: 12px; padding: 10px 14px; }
.lb-download[hidden], .lb-nav[hidden] { display: none; }
.lb button { font-family: "Silkscreen", monospace; color: var(--cream); background: var(--violet); border: 0; cursor: pointer; box-shadow: 0 0 0 3px var(--ink); }
.lb button:hover { background: var(--lilac); }
.lb-nav { width: 52px; height: 52px; font-size: 20px; }
.lb-close { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; font-size: 18px; }
@media (max-width: 700px) {
  .lb { grid-template-columns: 1fr; padding: 64px 10px 20px; }
  .lb-nav { position: absolute; bottom: 18px; }
  .lb-prev { left: 18px; }
  .lb-next { right: 18px; }
  .lb img { max-height: calc(100vh - 200px); }
}
