/* Hexmallow Studios — site styles */

@font-face {
  font-family: "Baloo 2";
  src: url("fonts/baloo2.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("fonts/nunito.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --night: #1e1848;
  --night-2: #2a2163;
  --night-line: rgba(255, 255, 255, 0.14);
  --violet: #7b61e8;
  --lilac: #efeaff;
  --lilac-2: #e2daff;
  --puff: #fffdf8;
  --gold: #f9b13e;
  --gold-deep: #c46f0e;
  --mint: #43c987;
  --mint-deep: #1d7a51;
  --ink: #231c4a;
  --ink-soft: #544c7d;
  --on-night: #f3efff;
  --on-night-soft: #bdb4e6;

  --display: "Baloo 2", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.625rem;
  --step-3: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);
  --step-4: clamp(2.2rem, 1.6rem + 2.6vw, 3.25rem);
  --step-5: clamp(2.6rem, 1.6rem + 4.4vw, 4.6rem);

  --hex: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0 50%);
  --wrap: 1160px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5.5rem; -webkit-tap-highlight-color: rgba(249, 177, 62, 0.25); }

body {
  margin: 0;
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--lilac);
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--step-5); font-weight: 700; }
h2 { font-size: var(--step-4); font-weight: 700; }
h3 { font-size: var(--step-2); font-weight: 600; }
p { margin: 0; text-wrap: pretty; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.measure { max-width: 62ch; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  background: var(--gold); color: var(--ink); padding: 0.5rem 1rem; border-radius: 12px;
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(30, 24, 72, 0.86);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  color: var(--on-night);
  border-bottom: 1px solid var(--night-line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 4.5rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none;
  font-family: var(--display); font-weight: 700; font-size: 1.35rem; line-height: 1;
}
.brand img { width: 44px; height: 44px; }
.brand span small { display: block; font-size: 0.68rem; font-weight: 700; color: var(--gold); letter-spacing: 0.08em; margin-top: 0.125rem; }

.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav a {
  text-decoration: none; font-weight: 700; padding: 0.5rem 1rem; border-radius: 999px;
  color: var(--on-night); transition: background-color 0.15s ease;
}
.nav a:hover { background: rgba(255, 255, 255, 0.1); }
.nav a[aria-current="page"] { background: rgba(249, 177, 62, 0.18); color: var(--gold); }
.nav .lang {
  margin-left: 0.5rem; border: 1.5px solid var(--night-line); padding: 0.5rem 0.75rem;
  font-size: var(--step--1);
}
.menu-btn {
  display: none; background: none; border: 1.5px solid var(--night-line); color: var(--on-night);
  border-radius: 12px; padding: 0.5rem 0.75rem; font: 700 0.95rem var(--body); cursor: pointer;
  touch-action: manipulation;
}

@media (max-width: 760px) {
  .menu-btn { display: inline-flex; }
  .nav {
    position: absolute; inset: 100% 0 auto 0; flex-direction: column; align-items: stretch;
    padding: 0.75rem var(--gutter) 1.25rem; background: var(--night);
    border-bottom: 1px solid var(--night-line); display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: 0.75rem 1rem; font-size: 1.1rem; }
  .nav .lang { margin: 0.5rem 0 0; text-align: center; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; justify-content: center;
  font: 700 1.05rem/1.1 var(--body); text-decoration: none; cursor: pointer;
  padding: 1rem 1.5rem; border-radius: 18px; border: 0; touch-action: manipulation;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn svg { flex: none; }
.btn-gold {
  background: linear-gradient(#ffd27a, var(--gold));
  color: #3b2300;
  box-shadow: inset 0 -4px 0 rgba(196, 111, 14, 0.55), 0 4px 8px rgba(20, 12, 60, 0.16);
}
.btn-gold:hover { transform: translateY(-1px); }
.btn-gold:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgba(196, 111, 14, 0.55); }
.btn-ghost {
  color: inherit; background: transparent; border: 2px solid currentColor; opacity: 0.92;
}
.btn-ghost:hover { opacity: 1; background: rgba(255, 255, 255, 0.06); }
.btn-soon {
  background: rgba(255, 255, 255, 0.08); color: var(--on-night-soft);
  border: 2px dashed rgba(255, 255, 255, 0.25); cursor: default;
}
.store-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* ---------- Hero ---------- */

.hero {
  position: relative; overflow: hidden; color: var(--on-night);
  background: var(--night);
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(6rem, 12vw, 9rem);
}
.stars {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 28% 68%, #fff 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 44% 14%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 58% 82%, #fff 50%, transparent 52%),
    radial-gradient(2px 2px at 71% 18%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 86% 60%, #fff 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 93% 28%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 6% 84%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 36% 40%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 64% 48%, #fff 50%, transparent 52%);
  opacity: 0.75;
}
.hero::after {
  /* the planet horizon the page rests on */
  content: ""; position: absolute; left: -10%; right: -10%; bottom: -1px; height: clamp(3.5rem, 8vw, 6rem);
  background: var(--lilac); border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center;
}
.hero h1 { color: #fff; }
.hero h1 .line { display: block; }
.hero .lede { margin-top: 1.25rem; font-size: var(--step-1); line-height: 1.5; color: var(--on-night-soft); max-width: 34ch; }
.hero .store-row { margin-top: 2rem; }

.shot-stage { position: relative; aspect-ratio: 1 / 1; width: min(100%, 520px); justify-self: center; }
.shot-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.shot-stage .mascot {
  position: absolute; left: 50%; top: 48%; width: 46%; translate: -50% -50%;
  filter: drop-shadow(0 18px 30px rgba(10, 6, 40, 0.55));
}
.trail { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 2 16; opacity: 0.85; }
/* Without JS or with reduced motion, the shot is shown already landed. */
.trail-mask { fill: none; stroke: #fff; stroke-width: 16; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 0; }
.ball { fill: #fff; filter: drop-shadow(0 0 8px rgba(255,255,255,0.85)); }
.target-ring { fill: none; stroke: var(--gold); stroke-width: 7; }
.target-core { fill: var(--gold); transform-box: fill-box; transform-origin: center; }
.target-glow { fill: rgba(249, 177, 62, 0.25); transform-box: fill-box; transform-origin: center; opacity: 0; }
.launch { fill: none; stroke: rgba(255,255,255,0.55); stroke-width: 3; stroke-dasharray: 3 6; }

/* The one orchestrated moment: a shot launches, bends around the mascot and lands. */
.play .trail-mask { stroke-dashoffset: 1; animation: draw 2.4s cubic-bezier(.2,.7,.3,1) forwards; }
.play .target-core { animation: pop 0.5s ease-out 2.35s both; }
.play .target-glow { animation: glow 0.9s ease-out 2.35s both; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(0.4); } to { transform: scale(1); } }
@keyframes glow { 0% { transform: scale(0.3); opacity: 1; } 100% { transform: scale(1.7); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .shot-stage { width: min(100%, 380px); order: -1; margin-bottom: -1rem; }
}

/* ---------- Sections ---------- */

.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.hero + .section, .page-hero + .section { padding-top: clamp(1rem, 3vw, 2rem); }
.section-head { display: grid; gap: 0.75rem; margin-bottom: 2rem; }
.section-head p { color: var(--ink-soft); max-width: 60ch; font-size: var(--step-1); line-height: 1.5; }
.link-arrow { font-weight: 700; color: var(--ink); }

/* Orbita feature */
.game-orbita {
  position: relative; overflow: hidden; border-radius: 36px; color: var(--on-night);
  background: var(--night-2);
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 2rem; padding: clamp(1.75rem, 4vw, 3.25rem);
  box-shadow: 0 30px 60px -30px rgba(30, 24, 72, 0.55);
}
.game-title { display: flex; align-items: center; gap: 1rem; }
.game-title img { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 8px 20px rgba(0,0,0,0.35); }
.game-title p { color: var(--gold); font-weight: 700; }
.game-orbita .copy { display: grid; gap: 1.5rem; align-content: start; }
.game-orbita .copy > p { color: var(--on-night-soft); font-size: var(--step-1); line-height: 1.5; max-width: 40ch; }
.facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.facts li {
  font-weight: 700; font-size: var(--step--1); padding: 0.5rem 0.75rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--night-line);
}
.phone {
  position: relative; justify-self: center; width: min(100%, 270px); aspect-ratio: 480 / 1074;
  border-radius: 38px; padding: 9px; background: linear-gradient(160deg, #565081, #2a2552);
  box-shadow: 0 30px 50px -20px rgba(0,0,0,0.6), inset 0 0 0 2px rgba(255,255,255,0.12);
  rotate: 4deg;
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 30px; }

.modes { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.modes li { display: flex; gap: 0.5rem; align-items: baseline; }
.modes li::before { content: ""; width: 0.875rem; height: 0.875rem; clip-path: var(--hex); background: var(--mint-deep); flex: none; translate: 0 0.125rem; }

/* Promise (how we make games) */
.promise { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 3vw, 2.5rem); }
.promise article { padding-top: 1.25rem; border-top: 3px solid var(--ink); }
.promise h3 { margin-bottom: 0.5rem; }
.promise p { color: var(--ink-soft); }

/* Studio band */
.studio-band {
  display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center;
  background: var(--puff); border-radius: 40px; padding: clamp(1.75rem, 5vw, 3.5rem);
  box-shadow: 0 2px 0 var(--lilac-2), 0 30px 60px -40px rgba(35, 28, 74, 0.35);
}
.studio-band img { width: min(100%, 360px); justify-self: center; }
.studio-band .copy { display: grid; gap: 1rem; }
.studio-band p { color: var(--ink-soft); font-size: var(--step-1); line-height: 1.5; }
.btn-ink { background: var(--ink); color: #fff; box-shadow: inset 0 -4px 0 rgba(0,0,0,0.35); width: fit-content; }
.btn-ink:hover { transform: translateY(-1px); }

/* ---------- Inner pages ---------- */

.page-hero {
  position: relative; overflow: hidden; color: var(--on-night); background: var(--night);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(5rem, 10vw, 7rem);
}
.page-hero::after {
  content: ""; position: absolute; left: -10%; right: -10%; bottom: -1px; height: clamp(3rem, 7vw, 5rem);
  background: var(--lilac); border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero p { color: var(--on-night-soft); font-size: var(--step-1); margin-top: 1rem; max-width: 46ch; }

.orbita-hero { display: grid; grid-template-columns: 1fr 0.8fr; gap: 2rem; align-items: center; }
.orbita-hero img.art { width: min(100%, 420px); justify-self: center; }
.orbita-hero .store-row { margin-top: 1.75rem; }

.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.rule { display: grid; grid-template-columns: 88px 1fr; gap: 1rem; align-items: center; }
.rule img { width: 88px; height: 88px; border-radius: 24px; }
.rule h3 { font-size: var(--step-1); }
.rule p { color: var(--ink-soft); font-size: var(--step--1); line-height: 1.5; }

.screens { display: flex; gap: clamp(1rem, 4vw, 3rem); justify-content: center; align-items: flex-start; }
.screens .phone { width: min(44vw, 250px); }
.screens .phone:nth-child(2) { rotate: -3deg; margin-top: 2.5rem; }
.screens .phone.wide { aspect-ratio: 480 / 658; }

.story { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem 2rem; align-items: center; }
.cast { display: flex; }
.cast img { width: 120px; height: 120px; border-radius: 32px; border: 4px solid var(--lilac); }
.cast img + img { margin-left: -1.5rem; rotate: 6deg; }
.story p { color: var(--ink-soft); font-size: var(--step-1); line-height: 1.5; max-width: 52ch; }

.worlds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.worlds figure { margin: 0; }
.worlds img { border-radius: 24px; aspect-ratio: 1; object-fit: cover; width: 100%; }
.worlds figcaption { font-family: var(--display); font-weight: 700; font-size: var(--step-1); margin-top: 0.5rem; }

.feature-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem 2.5rem; }
.feature-list h3 { font-size: var(--step-1); margin-bottom: 0.25rem; }
.feature-list p { color: var(--ink-soft); }

.legal-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-weight: 700; }

.prose { display: grid; gap: 1rem; max-width: 64ch; }
.prose p { color: var(--ink-soft); font-size: var(--step-1); line-height: 1.55; }
.prose h2 { font-size: var(--step-3); margin-top: 1rem; }

.facts-table { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 2rem; margin: 0; }
.facts-table dt { font-weight: 700; }
.facts-table dd { margin: 0; color: var(--ink-soft); }

.split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }

/* Contact */
.mail-card {
  background: var(--puff); border-radius: 28px; padding: clamp(1.5rem, 4vw, 2.25rem);
  display: grid; gap: 1rem; box-shadow: 0 2px 0 var(--lilac-2);
}
.mail-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.mail-address { font-family: var(--display); font-weight: 700; font-size: clamp(1.15rem, 0.9rem + 1.3vw, 1.75rem); word-break: break-all; }
.copy-status { font-weight: 700; color: var(--mint-deep); min-height: 1.6em; }
.socials { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0; }
.socials a {
  display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; font-weight: 700;
  padding: 0.5rem 1rem; border-radius: 14px; background: var(--lilac-2);
}
.socials a:hover { background: #d4c9ff; }
.faq { display: grid; gap: 0.75rem; }
.faq details { background: var(--puff); border-radius: 20px; padding: 0 1.25rem; box-shadow: 0 2px 0 var(--lilac-2); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1rem 0; font-family: var(--display); font-weight: 700;
  font-size: var(--step-1); display: flex; justify-content: space-between; gap: 1rem; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.6rem; line-height: 1; color: var(--violet); transition: rotate 0.2s ease; }
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { padding-bottom: 1.25rem; color: var(--ink-soft); }

/* ---------- Footer ---------- */

.site-footer { background: var(--night); color: var(--on-night); padding: 3.5rem 0 2rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 2rem; }
.footer-grid img { width: 180px; }
.footer-grid h2 { font-size: var(--step-0); font-family: var(--body); font-weight: 700; color: var(--on-night-soft); margin-bottom: 0.75rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.footer-grid a { text-decoration: none; font-weight: 700; }
.footer-grid a:hover { text-decoration: underline; }
.footer-mail { margin-top: 1rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.footer-mail button {
  font: 700 0.8rem var(--body); color: var(--ink); background: var(--gold); border: 0; border-radius: 999px;
  padding: 0.25rem 0.75rem; cursor: pointer; touch-action: manipulation;
}
.footer-mail button:hover { background: #ffc964; }
.footer-bottom {
  margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--night-line);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--on-night-soft); font-size: var(--step--1);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .game-orbita, .game-mathle, .studio-band, .orbita-hero, .split { grid-template-columns: 1fr; }
  .promise, .rules { grid-template-columns: 1fr; }
  .worlds { grid-template-columns: repeat(2, 1fr); }
  .feature-list { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .story { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .btn { width: 100%; }
  .btn-ink { width: 100%; }
  .screens .phone:nth-child(2) { margin-top: 0; }
}


/* ================= v2 ================= */

/* Hero: the studio's own animated logo */
.hero-logo { width: min(100%, 500px); justify-self: center; margin-block: -2.5rem -1.5rem; }
@media (max-width: 860px) { .hero-logo { width: min(100%, 360px); order: -1; margin-block: -2rem -2.5rem; } }

/* Games dropdown */
.nav-games { position: relative; }
.nav-games-btn {
  display: inline-flex; align-items: center; gap: 0.25rem; background: none; border: 0; color: var(--on-night);
  font: 700 var(--step-0)/1.6 var(--body); padding: 0.5rem 1rem; border-radius: 999px; cursor: pointer;
  touch-action: manipulation; transition: background-color 0.15s ease;
}
.nav-games-btn:hover { background: rgba(255, 255, 255, 0.1); }
.nav-games-btn svg { transition: rotate 0.2s ease; }
.nav-games[data-open="true"] .nav-games-btn svg { rotate: 180deg; }
.nav-games[data-current="true"] .nav-games-btn { background: rgba(249, 177, 62, 0.18); color: var(--gold); }
.games-menu {
  display: none; position: absolute; top: calc(100% + 0.5rem); left: 50%; translate: -50% 0; min-width: 15rem;
  background: var(--puff); color: var(--ink); border-radius: 20px; padding: 0.5rem;
  box-shadow: 0 20px 40px -12px rgba(10, 6, 40, 0.55); gap: 0.25rem;
}
.nav-games[data-open="true"] .games-menu { display: grid; }
@media (hover: hover) and (min-width: 761px) {
  .nav-games:hover .games-menu { display: grid; }
  .nav-games::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 0.6rem; }
}
.games-menu a { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem; border-radius: 14px; color: var(--ink); }
.games-menu a:hover, .games-menu a[aria-current="page"] { background: var(--lilac); }
.games-menu img, .games-menu .mini-mathle svg { width: 36px; height: 36px; border-radius: 10px; flex: none; display: block; }
.games-menu b { display: block; font-family: var(--display); font-size: 1.1rem; line-height: 1.1; }
.games-menu small { color: var(--ink-soft); font-weight: 700; font-size: 0.8rem; }
@media (max-width: 760px) {
  .nav-games-btn { width: 100%; justify-content: space-between; padding: 0.75rem 1rem; font-size: 1.1rem; }
  .games-menu { position: static; translate: none; box-shadow: none; background: rgba(255,255,255,0.06); color: var(--on-night); margin: 0.25rem 0 0.5rem; }
  .games-menu a { color: var(--on-night); }
  .games-menu a:hover, .games-menu a[aria-current="page"] { background: rgba(255,255,255,0.1); }
  .games-menu small { color: var(--on-night-soft); }
}

/* Phone mockups (design/store/iphone_frame_plain.png) */
.phone-img { width: min(100%, 240px); height: auto; filter: drop-shadow(0 24px 30px rgba(20, 12, 60, 0.35)); }
.orbita-phone { display: grid; place-items: center; }
.orbita-phone .phone-img { width: min(100%, 250px); }
.phones-pair { display: flex; justify-content: center; gap: clamp(1rem, 5vw, 3.5rem); margin-top: 3rem; }
.phones-pair .phone-img { width: min(42vw, 260px); }

.text-link { font-weight: 700; color: var(--gold); width: fit-content; }
.btn-mint { background: linear-gradient(#5fe0a0, var(--mint)); color: #06311d; box-shadow: inset 0 -4px 0 rgba(29, 122, 81, 0.5); width: fit-content; }
.btn-mint:hover { transform: translateY(-1px); }

/* Mathle card */
.game-mathle {
  margin-top: 1.5rem; border-radius: 32px; color: var(--ink);
  background: #d3f3e2;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center;
  padding: clamp(1.75rem, 4vw, 3rem);
}
.game-mathle .copy { display: grid; gap: 1rem; align-content: start; }
.game-mathle .game-title svg { border-radius: 22px; flex: none; box-shadow: 0 8px 20px rgba(42, 33, 71, 0.3); }
.game-mathle .game-title p { color: var(--mint-deep); font-weight: 700; }
.game-mathle .copy > p { color: #34485a; max-width: 44ch; }
.soon {
  display: inline-block; font-weight: 700; font-size: var(--step--1); padding: 0.25rem 0.75rem; border-radius: 999px;
  background: #fff; color: var(--mint-deep); border: 1.5px solid #9fdcbc; width: fit-content;
}
.modes { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.modes li { display: flex; gap: 0.5rem; align-items: baseline; }
.modes li::before { content: ""; width: 0.875rem; height: 0.875rem; clip-path: var(--hex); background: var(--mint-deep); flex: none; translate: 0 0.125rem; }

/* Mathle board */
.board-panel {
  --blank: #3f3470; justify-self: center; background: #2a2147; border-radius: 28px; padding: clamp(1rem, 3vw, 1.5rem);
  box-shadow: inset 0 -6px 0 rgba(0,0,0,0.25), 0 24px 40px -20px rgba(42, 33, 71, 0.7);
}
.board { display: grid; gap: 0.5rem; perspective: 600px; }
.board-row { display: grid; grid-template-columns: repeat(6, clamp(2.4rem, 6.4vw, 3.4rem)); gap: 0.5rem; }
.board-panel.lg .board-row { grid-template-columns: repeat(6, clamp(2.6rem, 8vw, 4rem)); }
.tile {
  --final: #4a3d78; --ink-final: #fff;
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 14px;
  font: 700 clamp(1.2rem, 3.2vw, 1.9rem)/1 var(--display);
  background: var(--final); color: var(--ink-final); box-shadow: inset 0 -4px 0 rgba(0,0,0,0.22);
}
.tile.ok { --final: var(--mint); --ink-final: #06311d; }
.tile.near { --final: var(--gold); --ink-final: #3b2300; }
.tile.empty { background: transparent; border: 2px solid #3f3470; box-shadow: none; }
.board.armed .tile:not(.empty) { background: var(--blank); color: #fff; }
.board.play .tile:not(.empty) { animation: flip 0.5s cubic-bezier(.2,.7,.3,1) var(--d) both; }
@keyframes flip {
  0% { transform: rotateX(0); background: var(--blank); color: #fff; }
  49.9% { transform: rotateX(90deg); background: var(--blank); color: #fff; }
  50% { transform: rotateX(90deg); background: var(--final); color: var(--ink-final); }
  100% { transform: rotateX(0); background: var(--final); color: var(--ink-final); }
}
.legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; justify-content: center; font-size: var(--step--1); color: #d9d1f5; margin: 1rem 0 0; }
.legend span { display: inline-flex; align-items: center; gap: 0.5rem; }
.legend i { width: 0.9rem; height: 0.9rem; border-radius: 4px; display: inline-block; }
.legend .k-ok { background: var(--mint); } .legend .k-near { background: var(--gold); } .legend .k-no { background: #4a3d78; outline: 1px solid #6b5ca6; }

/* Boosters */
.boosters { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.boosters li { display: grid; grid-template-columns: 72px 1fr; gap: 1rem; align-items: center; background: var(--puff); border-radius: 22px; padding: 1rem; box-shadow: 0 2px 0 var(--lilac-2); }
.boosters img { width: 72px; height: 72px; border-radius: 18px; }
.boosters h3 { font-size: var(--step-1); }
.boosters p { color: var(--ink-soft); font-size: var(--step--1); line-height: 1.45; }

/* Planets */
.planets-band { position: relative; background: var(--night); color: var(--on-night); }
.planets-band .wrap { position: relative; }
.planets-band .section-head p { color: var(--on-night-soft); }
.planets { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.planet { background: var(--night-2); border-radius: 22px; overflow: hidden; border: 1px solid var(--night-line); }
.planet .map { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.planet-body { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.75rem 1rem; margin-top: -1.5rem; }
.planet h3 { min-width: 0; overflow-wrap: anywhere; }
.planet .logo { width: 56px; height: 56px; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.45)); flex: none; }
.planet h3 { font-size: var(--step-1); margin-top: 1.25rem; }
.planet.is-soon .map { filter: grayscale(0.7) brightness(0.7); }
.planet { position: relative; }
.planet-soon {
  position: absolute; top: 0.5rem; right: 0.5rem; font-weight: 700; font-size: 0.78rem; padding: 0.25rem 0.75rem; border-radius: 999px;
  background: rgba(30, 24, 72, 0.88); color: var(--gold); border: 1px solid rgba(249, 177, 62, 0.55);
}

/* Village */
.village-band { background: #eef4ff; }
.village-phones { display: flex; gap: clamp(1rem, 4vw, 2.5rem); justify-content: center; }
.village-phones .phone-img { width: min(30vw, 240px); }
.buildings-h { margin: 3rem 0 1.25rem; }
.buildings { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
.buildings li { background: #fff; border-radius: 20px; padding: 0.75rem; display: grid; gap: 0.5rem; justify-items: center; text-align: center; box-shadow: 0 2px 0 #d7e3fb; }
.buildings img { width: 100%; max-width: 110px; aspect-ratio: 1; object-fit: contain; }
.buildings span { font-weight: 700; font-size: var(--step--1); line-height: 1.3; }

/* CTA band */
.cta-band {
  margin-top: 3rem; display: grid; grid-template-columns: auto 1fr auto; gap: 1.5rem; align-items: center;
  background: var(--night); color: var(--on-night); border-radius: 32px; padding: clamp(1.5rem, 4vw, 2.5rem);
}
.cta-band img { width: 96px; height: 96px; border-radius: 24px; }
.cta-band h2 { font-size: var(--step-3); }
.cta-band p { color: var(--on-night-soft); margin-top: 0.5rem; }

/* Mathle page */
.mathle-hero { background: #231b4a; }
.mathle-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; }
.mathle-hero .soon { margin-top: 1rem; background: rgba(67,201,135,0.16); color: var(--mint); border-color: rgba(67,201,135,0.5); }
.mathle-mark svg { border-radius: 28px; box-shadow: 0 12px 30px rgba(0,0,0,0.35); margin-bottom: 1.25rem; }
.mathle-rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.mathle-rules li { display: grid; grid-template-columns: 3.4rem 1fr; gap: 1rem; align-items: center; }
.tile.sample { width: 3.4rem; }
.mathle-rules h3 { font-size: var(--step-1); }
.mathle-rules p { color: var(--ink-soft); }
.rule-note { margin-top: 1.25rem; font-weight: 700; }
.feature-list.one { grid-template-columns: 1fr; }

@media (max-width: 1000px) {
  .planets { grid-template-columns: repeat(3, 1fr); }
  .buildings { grid-template-columns: repeat(4, 1fr); }
  .boosters { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .mathle-hero-grid, .game-mathle { grid-template-columns: 1fr; }
  .cta-band { grid-template-columns: 1fr; justify-items: start; }
}
@media (max-width: 600px) {
  .planets { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .planet .logo { width: 44px; height: 44px; }
  .planet h3 { font-size: 1.05rem; }
  .planet-soon { font-size: 0.7rem; }
  .buildings { grid-template-columns: repeat(3, 1fr); }
  .boosters { grid-template-columns: 1fr; }
  .village-phones { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 1rem; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .village-phones .phone-img { width: 62vw; flex: none; scroll-snap-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .board.play .tile { animation: none; }
  .nav-games-btn svg { transition: none; }
}

/* Objects strip, crew, 15 buildings */
.objects { margin-top: 2rem; background: var(--puff); border-radius: 22px; padding: 1rem 1.25rem; box-shadow: 0 2px 0 var(--lilac-2); display: grid; gap: 0.75rem; }
.objects h3 { font-size: var(--step-1); }
.objects ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.objects li { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; background: var(--lilac); border-radius: 999px; padding: 0.25rem 1rem 0.25rem 0.25rem; }
.objects li:not(:has(img)) { padding-left: 1rem; }
.objects li img { width: 36px; height: 36px; border-radius: 999px; }
.objects p { color: var(--ink-soft); }
.crew { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.crew li {
  display: grid; grid-template-rows: auto 1fr; justify-items: center; text-align: center; gap: 1rem;
  border-radius: 32px; padding: 1.75rem 1.5rem 1.5rem; overflow: hidden;
  background: #e6dfff;
}
.crew li:nth-child(3) { background: #d8f5e4; }
.crew li:nth-child(2) { background: #ffe2ee; }
.crew img { width: auto; height: 300px; object-fit: contain; }
.crew h3 { font-size: var(--step-3); margin-bottom: 0.5rem; }
.crew p { color: var(--ink-soft); }
.wardrobe { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
.wardrobe li { background: #fff; border-radius: 20px; padding: 1rem 0.5rem 0.75rem; display: grid; justify-items: center; gap: 0.5rem; text-align: center; box-shadow: 0 2px 0 #d7e3fb; }
.wardrobe img { width: auto; height: 120px; object-fit: contain; }
.wardrobe span { font-weight: 700; font-size: var(--step--1); }
.buildings { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1000px) { .buildings { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 860px) { .crew { grid-template-columns: 1fr; } .wardrobe { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .crew img { height: 250px; } }
@media (max-width: 600px) { .buildings { grid-template-columns: repeat(3, 1fr); } }

/* Footer (reference: dreamgames.com, goodjobgames.com) */
.footer-top { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; padding-bottom: 2rem; border-bottom: 1px solid var(--night-line); }
.footer-logo img { width: 170px; height: auto; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.footer-nav a { font-family: var(--display); font-weight: 700; font-size: var(--step-1); text-decoration: none; padding: 0.5rem 1rem; border-radius: 999px; }
.footer-nav a:hover { background: rgba(255,255,255,0.08); }
.footer-mid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem; padding: 2rem 0; }
.footer-mid h2 { font-size: var(--step--1); font-family: var(--body); font-weight: 700; color: var(--on-night-soft); margin-bottom: 1rem; }
.badges { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.badge {
  display: inline-flex; align-items: center; gap: 0.75rem; min-width: 11.5rem; padding: 0.5rem 1rem 0.5rem 0.75rem;
  border-radius: 14px; background: #000; color: #fff; text-decoration: none; border: 1.5px solid rgba(255,255,255,0.35);
  transition: border-color 0.15s ease;
}
a.badge:hover { border-color: #fff; text-decoration: none !important; }
.badge small { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em; line-height: 1.1; opacity: 0.85; }
.badge b { display: block; font-family: var(--body); font-weight: 700; font-size: 1.2rem; line-height: 1.15; }
.badge.is-soon { opacity: 0.55; cursor: default; }
.socials-row { list-style: none; padding: 0; margin: 0; display: flex; gap: 0.5rem; }
.s-btn { width: 46px; height: 46px; border-radius: 999px; display: grid; place-items: center; color: #fff; transition: transform 0.15s ease; }
.s-btn:hover { transform: translateY(-2px); }
.s-btn svg { width: 22px; height: 22px; }
.s-instagram { background: radial-gradient(circle at 30% 110%, #fdd56e 0%, #f7792b 30%, #d6266d 60%, #8e3ad3 100%); }
.s-tiktok { background: #000; border: 1px solid rgba(255,255,255,0.25); }
.s-facebook { background: #1877f2; }
.footer-mail { margin: 0; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; font-weight: 700; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; }
.footer-legal a { color: var(--on-night-soft); }
.footer-legal a:hover { color: #fff; }
.footer-bottom { margin-top: 0; }
@media (max-width: 860px) { .footer-mid { grid-template-columns: 1fr; gap: 1.75rem; } .footer-nav a { padding-left: 0; } }
@media (prefers-reduced-motion: reduce) { .s-btn { transition: none; } }
.get-h { display: flex; align-items: center; gap: 0.5rem; }
.get-h img { width: 28px; height: 28px; border-radius: 8px; }
.footer-mid h2 { display: flex; align-items: center; min-height: 28px; }

/* ================= v12: unslop polish ================= */
.facts-line { color: var(--on-night-soft); font-size: var(--step-0); line-height: 1.5; max-width: 44ch; }
.orbita-hero .facts-line { margin-top: 1rem; }
@media (min-width: 901px) { .studio-band { grid-template-columns: 0.9fr 1.1fr; align-items: start; } }
.studio-band h2 { max-width: 12ch; }
.legend { justify-content: flex-start; gap: 0.5rem 1rem; }
.legend span { white-space: nowrap; }
.board-panel.lg .legend { justify-content: center; max-width: none; font-size: 0.875rem; gap: 0.5rem 0.75rem; }
@media (max-width: 860px) { .hero-logo { margin-block: -2rem 0; } }
/* Phones: a smaller logo keeps the Google Play button on the first screen. */
@media (max-width: 600px) { .hero-logo { width: min(66%, 240px); margin-block: -1.25rem 0; } }
.game-mathle .game-title p { color: #176241; }
.s-youtube { background: #ff0033; }
.s-youtube svg path:last-child { fill: #ff0033; }
.s-youtube svg path:first-child { fill: #fff; }

/* Orbita mini level (How to play) */
.demo-wrap { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.demo-stage {
  position: relative; aspect-ratio: 360 / 600; border-radius: 28px; overflow: hidden; background: var(--night);
  box-shadow: 0 24px 40px -20px rgba(20, 12, 60, 0.5);
}
.demo canvas { display: block; width: 100%; height: 100%; }
.demo canvas:focus-visible { outline-offset: -4px; border-radius: 28px; }
.demo-grab {
  position: absolute; left: 33.333%; top: 78.333%; width: 33.333%; height: 20%;
  border-radius: 50%; touch-action: none; cursor: grab;
}
@media (hover: hover) and (pointer: fine) { .demo-grab { inset: 0; width: auto; height: auto; border-radius: 0; } }
.demo.is-aiming .demo-grab { cursor: grabbing; }
.demo-status { margin-top: 1rem; font-weight: 700; text-align: center; min-height: 3.2em; text-wrap: balance; }
.demo-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.demo-actions .btn-ghost { color: var(--ink); }
.rules-stack { grid-template-columns: 1fr; gap: 1.5rem; }
@media (max-width: 900px) {
  .demo-wrap { grid-template-columns: 1fr; }
  .demo { width: min(100%, 360px); justify-self: center; }
  .rules-stack { order: -1; }
}
.demo-actions [hidden] { display: none; }
.rules-stack { max-width: 32rem; } .rules-stack .rule p { font-size: var(--step-0); }

/* Legal pages (privacy, terms, account deletion) */
.legal-wrap { max-width: 46rem; }
.legal-page h1 { font-size: var(--step-4); line-height: 1.15; margin-bottom: 0.75rem; }
.legal-back { margin-bottom: 1.5rem; font-weight: 700; }
.legal-back a::before { content: "‹ "; }
.legal-text .date { color: var(--ink-soft); margin-bottom: 2rem; }
.legal-text h2 { font-size: var(--step-2); margin: 2.25rem 0 0.5rem; }
.legal-text p, .legal-text li { max-width: 68ch; line-height: 1.65; }
.legal-text p + p { margin-top: 0.75rem; }
.legal-text ul, .legal-text ol { padding-left: 1.25rem; margin: 0.75rem 0; display: grid; gap: 0.375rem; }
.legal-text ul { list-style: disc; }
.legal-text ol { list-style: decimal; }
.legal-text a, .legal-mail a, .legal-game a { text-decoration: underline; text-underline-offset: 0.15em; }
.legal-text table { border-collapse: collapse; margin: 1rem 0; width: 100%; }
.legal-text th, .legal-text td { border: 1px solid rgba(44, 31, 99, 0.18); padding: 0.5rem 0.75rem; text-align: left; vertical-align: top; }
.legal-lede { color: var(--ink-soft); margin-bottom: 2rem; }
.legal-game { padding: 1.5rem 0; border-top: 1px solid rgba(44, 31, 99, 0.15); }
.legal-game h2 { font-size: var(--step-2); margin-bottom: 0.75rem; }
.legal-game ul { display: grid; gap: 0.5rem; font-weight: 700; }
.legal-mail { margin-top: 1.5rem; }
