/* The game's own font, served from this site (no third-party font service). */
@font-face { font-family: "Baloo 2"; src: url("/fonts/Baloo2.ttf") format("truetype"); font-weight: 400 800; font-display: swap; }
/* Look: taken from the key art. Royal blue night with a soft glow at the top, a vertical conveyor belt,
   chunky shapes with a thick dark outline and a 3D edge, one warm gold accent for buttons and numbers. */
:root {
  --night: #141833;        /* page background, bottom of the key art */
  --navy: #2b3567;         /* top of the key art */
  --panel: #232b58;
  --panel-hi: #2e3870;
  --panel-edge: #181e42;   /* the 3D edge under panels */
  --ink: #12152a;          /* the thick outline every game object has */
  --text: #f1f3fc;
  --muted: #aab3d8;
  --belt: #5c6591;
  --belt-slat: #464e7c;
  --gold: #fdc83d;
  --gold-hi: #ffdf7a;
  --gold-dark: #9a6a08;
  --blue: #599dff;
  --blue-deep: #2f63c9;
  --display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 24px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background:
    radial-gradient(900px 560px at 22% -80px, rgba(80, 98, 190, .55), transparent 70%),
    radial-gradient(700px 520px at 85% 120px, rgba(89, 157, 255, .16), transparent 70%),
    linear-gradient(180deg, var(--navy) 0, var(--night) 760px) var(--night);
  background-repeat: no-repeat;
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  overflow-x: hidden;
}
.wrap { max-width: 1080px; margin: 0 auto; }
h1, h2, h3 { font-family: var(--display); line-height: 1.05; text-wrap: balance; margin: 0; font-weight: 800; }
p { margin: 0; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-hi); }
a:focus-visible, .button:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 10px; }
section[id] { scroll-margin-top: 20px; }

/* ---------- Top bar: back to the studio, jump links ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 18px; }
.studio-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--muted); font: 700 1rem/1 var(--display); }
.studio-link img { width: 40px; height: 40px; }
.studio-link:hover { color: var(--text); }
.jump { display: flex; gap: 4px; }
.jump a { color: var(--muted); text-decoration: none; font: 700 .98rem/1 var(--display); padding: 10px 12px 8px; border-radius: 12px; }
.jump a:hover { color: var(--text); background: rgba(255,255,255,.06); }
@media (max-width: 1000px) { .jump { display: none; } }
.studio-link span, .jump a { white-space: nowrap; }

/* ---------- Hero: words left, a running sort machine right (like the key art) ---------- */
.hero { display: grid; gap: 28px; align-items: center; padding-block: 36px 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); padding-block: 56px 16px; } }
.hero-text { display: grid; gap: 22px; justify-items: start; }
@media (max-width: 859px) { .hero-text { justify-items: center; text-align: center; } }
.app-row { display: flex; align-items: center; gap: 14px; }
.app-row img { width: 64px; height: 64px; border-radius: 16px; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); }
.app-row span { color: var(--muted); font: 600 .98rem/1.3 var(--display); text-align: left; }
.app-row b { display: block; color: var(--text); font-size: 1.1rem; }
.wordmark {
  font-size: clamp(3.6rem, 12vw, 6.6rem); letter-spacing: .005em; color: #fff; line-height: .95;
  /* thick dark outline + blue 3D edge, like the logo in the game */
  -webkit-text-stroke: .1em var(--ink); paint-order: stroke fill;
  text-shadow: 0 .08em 0 var(--blue), 0 .11em 0 var(--ink);
  margin-bottom: .1em;
}
.pill {
  display: inline-block; font: 800 clamp(1.05rem, 2.6vw, 1.35rem)/1 var(--display); letter-spacing: .06em; text-transform: uppercase;
  color: #3d2603; background: linear-gradient(var(--gold-hi), var(--gold)); border: 4px solid var(--ink); border-radius: 999px;
  padding: 12px 30px 9px; box-shadow: 0 6px 0 var(--gold-dark), 0 6px 0 4px var(--ink);
}
.tagline { font: 600 clamp(1.15rem, 3vw, 1.4rem)/1.4 var(--display); color: var(--muted); max-width: 30ch; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }
@media (max-width: 859px) { .actions { justify-content: center; } }
.button {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer;
  font: 800 1.15rem/1 var(--display); color: #3d2603; background: linear-gradient(var(--gold-hi), var(--gold));
  border: 3px solid var(--ink); border-radius: 18px; padding: 15px 24px 12px;
  box-shadow: 0 7px 0 var(--gold-dark), 0 7px 0 3px var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.button:hover { color: #3d2603; filter: brightness(1.05); }
.button:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--gold-dark), 0 2px 0 3px var(--ink); }
.button.ghost { color: var(--text); background: linear-gradient(var(--panel-hi), var(--panel)); box-shadow: 0 7px 0 var(--panel-edge), 0 7px 0 3px var(--ink); }
.button.ghost:active { box-shadow: 0 2px 0 var(--panel-edge), 0 2px 0 3px var(--ink); }
.button svg { width: 22px; height: 22px; }
.soon { font-size: .92rem; color: var(--muted); }

.machine {
  position: relative; height: 440px; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; align-items: center;
  padding-inline: 8px;
}
.belt-v {
  position: relative; height: 100%; overflow: hidden; border-inline: 6px solid var(--ink);
  background: repeating-linear-gradient(180deg, var(--belt) 0 34px, var(--belt-slat) 34px 40px);
  box-shadow: inset 9px 0 0 #737ca9, inset -9px 0 0 #3e4570;
  -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
          mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
  animation: run-v 1.1s linear infinite;
}
@keyframes run-v { to { background-position: 0 40px; } }
.belt-v .tok { position: absolute; left: 50%; width: 112px; height: 112px; margin-left: -56px; top: -130px; animation: drop 7.2s linear infinite; }
.belt-v .tok:nth-child(2) { animation-delay: -1.8s; }
.belt-v .tok:nth-child(3) { animation-delay: -3.6s; }
.belt-v .tok:nth-child(4) { animation-delay: -5.4s; }
@keyframes drop { to { top: 100%; } }
.zone-area { position: relative; height: 100%; display: grid; place-items: center; }
.zone {
  width: 200px; height: 200px; border-radius: 40px; margin-top: 90px;
  border: 5px solid var(--ink); background: rgba(47, 99, 201, .35);
  box-shadow: inset 0 0 0 5px #4d86f0, 0 0 60px rgba(89, 157, 255, .25);
  display: grid; place-items: center;
}
.zone::after { content: ""; width: 92px; height: 92px; border-radius: 18px; border: 5px solid rgba(124, 178, 255, .6); }
.lift { position: absolute; width: 190px; height: 190px; left: 50%; top: 50%; margin: -170px 0 0 -95px; transform: rotate(-9deg); animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 18px 14px rgba(0,0,0,.35)); }
@keyframes bob { 50% { transform: rotate(-6deg) translateY(-12px); } }
.spark { position: absolute; width: 12px; height: 34px; border-radius: 8px; background: var(--gold); left: 50%; top: 50%; }
.spark.s1 { margin: -235px 0 0 -6px; }
.spark.s2 { margin: -215px 0 0 -110px; transform: rotate(-50deg); }
.spark.s3 { margin: -215px 0 0 98px; transform: rotate(50deg); }
@media (max-width: 859px) {
  .machine { height: 320px; grid-template-columns: 110px minmax(0, 1fr); max-width: 420px; width: 100%; margin-inline: auto; }
  .belt-v .tok { width: 84px; height: 84px; margin-left: -42px; top: -100px; }
  .zone { width: 150px; height: 150px; border-radius: 30px; margin-top: 70px; }
  .zone::after { width: 68px; height: 68px; border-radius: 14px; }
  .lift { width: 140px; height: 140px; margin: -125px 0 0 -70px; }
  .spark { width: 10px; height: 26px; }
  .spark.s1 { margin: -172px 0 0 -5px; }
  .spark.s2 { margin: -158px 0 0 -82px; }
  .spark.s3 { margin: -158px 0 0 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .belt-v, .belt-v .tok, .lift { animation: none; }
  .belt-v .tok:nth-child(1) { top: 2%; } .belt-v .tok:nth-child(2) { top: 30%; } .belt-v .tok:nth-child(3) { top: 58%; } .belt-v .tok:nth-child(4) { display: none; }
}

/* ---------- Sections ---------- */
section { padding-block: 84px 0; }
.eyebrow { font: 800 .85rem/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.section-head { display: grid; gap: 12px; margin-bottom: 30px; }
.section-head h2 { font-size: clamp(2rem, 6vw, 3rem); }
.lead { color: var(--muted); max-width: 62ch; }

/* every panel is a chunky game object: outline + 3D edge */
.card {
  background: linear-gradient(var(--panel-hi), var(--panel)); border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: 0 8px 0 var(--panel-edge), 0 8px 0 3px var(--ink);
}

/* how to play: a real sequence, so it is numbered */
.steps { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); counter-reset: step; }
.step { padding: 24px; display: grid; gap: 12px; align-content: start; position: relative; }
.step-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.step-top svg { width: 76px; height: 76px; }
.step-num {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font: 800 1.35rem/1 var(--display); color: #3d2603; padding-top: 3px;
  background: linear-gradient(var(--gold-hi), var(--gold)); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink);
}
.step-num::before { counter-increment: step; content: counter(step); }
.step h3 { font-size: 1.55rem; }
.step p { color: var(--muted); }

/* factory upgrades: one tile per machine part, icon in a dark slot */
.upgrades { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.upgrade { display: grid; grid-template-columns: 76px 1fr; gap: 18px; align-items: center; padding: 18px 22px 18px 18px; }
.slot { width: 76px; height: 76px; border-radius: 20px; background: var(--night); border: 3px solid var(--ink); box-shadow: inset 0 4px 0 rgba(0,0,0,.35); display: grid; place-items: center; }
.slot svg { width: 52px; height: 52px; }
.upgrade h3 { font-size: 1.3rem; margin-bottom: 4px; }
.upgrade p { color: var(--muted); font-size: .98rem; }

/* game facts: big gold numbers */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.fact { padding: 22px 16px 18px; text-align: center; display: grid; gap: 6px; }
.fact b {
  display: block; font: 800 3rem/1 var(--display); color: var(--gold); font-variant-numeric: tabular-nums;
  -webkit-text-stroke: .07em var(--ink); paint-order: stroke fill; text-shadow: 0 .06em 0 var(--ink);
}
.fact span { color: var(--muted); font-size: .95rem; }
.facts + .lead { margin-top: 26px; }

/* release: the key art as a framed banner with the store note below */
.release { overflow: hidden; }
.release img { width: 100%; height: auto; display: block; border-bottom: 3px solid var(--ink); }
.release-body { padding: clamp(20px, 4vw, 34px); display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between; }
.release-body .section-head { margin: 0; }
.store {
  display: inline-flex; align-items: center; gap: 12px; padding: 12px 20px; border-radius: 16px;
  background: var(--ink); border: 2px solid #3a4378; color: var(--text); font: 700 1rem/1.15 var(--display);
}
.store svg { width: 30px; height: 30px; flex: none; }
.store small { display: block; color: var(--muted); font-weight: 600; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }

/* support: questions that open on tap + contact card */
.support { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .support { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }
.faq { display: grid; gap: 12px; }
.faq details { background: var(--panel); border: 3px solid var(--ink); border-radius: 18px; transition: background .15s; }
.faq details:hover, .faq details[open] { background: var(--panel-hi); }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 58px 15px 20px; position: relative;
  font: 700 1.12rem/1.3 var(--display);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; padding-top: 2px;
  background: linear-gradient(var(--gold-hi), var(--gold)); color: #3d2603; border: 2px solid var(--ink); font: 800 1.25rem/1 var(--display);
}
.faq details[open] summary::after { content: "–"; }
.faq summary:focus-visible { outline-offset: -3px; border-radius: 15px; }
.faq .answer { padding: 0 20px 18px; color: var(--muted); display: grid; gap: 8px; }
.faq .answer b { color: var(--text); }
.path { font-family: var(--display); font-weight: 600; color: var(--text); white-space: nowrap; background: rgba(0,0,0,.25); padding: 1px 7px; border-radius: 7px; }
.contact { padding: 24px; display: grid; gap: 14px; }
@media (min-width: 860px) { .contact { position: sticky; top: 20px; } }
.contact h3 { font-size: 1.55rem; }
.contact p, .contact li { color: var(--muted); }
.contact ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.mail { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.mail code { font: 700 1.02rem/1.2 var(--body); color: var(--text); background: var(--night); border: 2px solid var(--ink); border-radius: 12px; padding: 11px 12px; user-select: all; overflow-wrap: anywhere; }
.copy { font-size: 1rem; padding: 11px 16px 9px; }
.copy-status { color: var(--gold); font-size: .9rem; min-height: 1.2em; }

/* privacy policy: long-form text on a calm panel */
.policy { padding: clamp(22px, 4vw, 40px); display: grid; gap: 14px; }
.policy > * { max-width: 70ch; }
.policy h3 { font-size: 1.3rem; margin-top: 12px; }
.policy p, .policy li { color: var(--muted); }
.policy .todo { color: var(--gold); font-weight: 700; }

footer {
  margin-top: 96px; padding-block: 28px 40px; border-top: 3px solid var(--ink); box-shadow: 0 -3px 0 #232b58;
  color: var(--muted); font-size: .92rem; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center;
}
footer strong { font-family: var(--display); color: var(--text); font-size: 1.1rem; }

/* ---------- Language switcher ---------- */
.topbar-right { display: flex; align-items: center; gap: 12px; }
.langs { display: flex; gap: 4px; }
.langs a { color: var(--muted); text-decoration: none; font: 700 .95rem/1 var(--display); padding: 9px 10px 7px; border-radius: 10px; border: 2px solid transparent; }
.langs a:hover { color: var(--text); }
.langs a[aria-current="page"] { color: var(--text); background: var(--panel-hi); border-color: var(--ink); }
/* narrow phones: the logo alone leads home, the text stays for screen readers */
@media (max-width: 440px) {
  .studio-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
