/* Marble Maze – website. Warm comic look like the game: cream cards, plum ink
   instead of black, yellow-to-orange halftone background, Lilita One + Fredoka. */

@font-face { font-family: "Lilita One"; src: url("assets/fonts/LilitaOne-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("assets/fonts/Fredoka.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }

:root {
  --ink: #4a2c40;
  --ink-soft: #7a5a6c;
  --cream: #fff6e0;
  --card: #fffaef;
  --line: #e8cca3;
  --yellow: #ffd23f;
  --orange: #ff8c42;
  --red: #ee4266;
  --green: #2ec27e;
  --blue: #3a86ff;
  --shadow: 0 10px 0 -4px rgba(140, 74, 26, .14), 0 18px 34px -16px rgba(140, 74, 26, .35);
  --radius: 22px;
  --display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Fredoka", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font: 500 18px/1.6 var(--body);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: .01em; margin: 0; line-height: 1.12; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Halftone background like the game menu. */
.halftone, .hero {
  background:
    radial-gradient(circle at 50% 50%, rgba(160, 70, 10, .12) 2.6px, transparent 3px) 0 0 / 26px 26px,
    radial-gradient(circle at 50% 50%, rgba(160, 70, 10, .12) 2.6px, transparent 3px) 13px 13px / 26px 26px,
    linear-gradient(180deg, #ffd65c 0%, #ffb84d 55%, #ff8c42 100%);
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 400 21px/1 var(--display); letter-spacing: .02em; text-decoration: none; cursor: pointer;
  padding: 16px 26px; border-radius: 18px; border: 0;
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.button.primary {
  color: #fff; background: var(--green);
  box-shadow: 0 5px 0 #1f9a62, 0 14px 24px -10px rgba(30, 120, 70, .6);
  text-shadow: 0 2px 0 rgba(20, 90, 50, .45);
}
.button.ghost { color: var(--ink); background: var(--card); box-shadow: 0 4px 0 var(--line), 0 12px 20px -12px rgba(140, 74, 26, .4); }
.button:hover { transform: translateY(-2px); filter: brightness(1.04); }
.button:active { transform: translateY(2px); }
.button:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ---------- Navigation ---------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 20; transition: background .25s, box-shadow .25s; }
.nav.scrolled { background: rgba(255, 246, 224, .93); backdrop-filter: blur(10px); box-shadow: 0 6px 20px -12px rgba(140, 74, 26, .5); }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 12px 22px; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 400 24px var(--display); text-decoration: none; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.nav nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav nav a { text-decoration: none; font-weight: 600; font-size: 16px; padding: 7px 12px; border-radius: 999px; transition: background .2s; }
.nav nav a:hover, .nav nav a.active { background: rgba(255, 255, 255, .7); }
.lang-switch { display: flex; background: var(--card); border-radius: 999px; padding: 3px; box-shadow: 0 3px 0 var(--line); }
.lang-switch a { text-decoration: none; font: 400 15px var(--display); padding: 6px 12px; border-radius: 999px; color: var(--ink-soft); }
.lang-switch a[aria-current] { background: var(--ink); color: #fff; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: min(100vh, 900px); display: grid; align-items: center; padding: 110px 22px 90px; overflow: hidden; }
.hero-inner { max-width: 1160px; margin: 0 auto; width: 100%; display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.tagline {
  font: 400 clamp(46px, 7vw, 92px)/1 var(--display); color: #fff;
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--ink);
}
.tagline span { display: block; color: var(--yellow); }
.lead { margin-top: 26px; font-size: 20px; font-weight: 500; max-width: 540px; }
.hero-actions { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.badge-android { font: 400 18px var(--display); padding: 12px 18px; border-radius: 14px; background: rgba(255, 255, 255, .55); }
.hero-art { display: grid; place-items: center; }
.hero-logo { width: min(500px, 100%); height: auto; filter: drop-shadow(0 22px 26px rgba(120, 50, 10, .35)); animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(2deg); } }
.scroll-hint { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); width: 30px; height: 48px; border: 3px solid var(--ink); border-radius: 18px; }
.scroll-hint span { position: absolute; left: 50%; top: 9px; width: 6px; height: 10px; margin-left: -3px; border-radius: 3px; background: var(--ink); animation: scroll 1.8s ease-in-out infinite; }
@keyframes scroll { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Facts ---------- */
.facts { position: relative; z-index: 2; margin-top: -44px; padding: 0 22px; }
.facts-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.fact { display: flex; align-items: center; gap: 14px; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.fact-icon { width: 36px; height: 36px; flex: none; fill: none; stroke: var(--orange); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fact strong { display: block; font: 400 30px/1 var(--display); }
.fact span { font-size: 15px; color: var(--ink-soft); font-weight: 600; }

/* ---------- Sections ---------- */
.section { max-width: 1160px; margin: 0 auto; padding: 110px 22px 0; }
.section-intro { max-width: 760px; margin-bottom: 40px; }
.section-intro > p:not(.eyebrow) { font-size: 19px; color: var(--ink-soft); margin-top: 16px; }
.eyebrow { font: 700 14px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--red); margin-bottom: 10px; }
h2 { font-size: clamp(34px, 4.6vw, 54px); }
.grad { color: var(--orange); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps li { display: flex; gap: 16px; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.steps li > span { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--yellow); font: 400 24px var(--display); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12); }
.steps h3 { font-size: 26px; margin-bottom: 6px; }
.steps p { color: var(--ink-soft); }

/* ---------- Screenshots ---------- */
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.shot { margin: 0; }
.shot-main { grid-column: 1 / -1; }
.shot button { display: block; width: 100%; padding: 0; border: 4px solid #fff; border-radius: 18px; overflow: hidden; cursor: zoom-in; background: #fff; box-shadow: var(--shadow); transition: transform .2s; }
.shot button:hover { transform: translateY(-3px); }
.shot img { width: 100%; height: auto; }
.shot figcaption { font-size: 15px; color: var(--ink-soft); margin-top: 10px; font-weight: 500; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1400px, 94vw); width: 100%; }
.lightbox::backdrop { background: rgba(74, 44, 64, .82); }
.lightbox img { width: 100%; border-radius: 16px; border: 4px solid #fff; }
.lightbox p { color: #fff; text-align: center; margin-top: 12px; font-weight: 600; }
.lightbox button { position: fixed; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--card); color: var(--ink); font: 400 30px/1 var(--display); cursor: pointer; box-shadow: 0 4px 0 var(--line); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; }
.lb-next { right: 20px; top: 50%; }

/* ---------- Boards & elements ---------- */
.boards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.board-card, .element { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); text-align: center; }
.board-card svg { width: 110px; height: 110px; margin: 0 auto 12px; }
.board-card h3, .element h3 { font-size: 24px; margin-bottom: 6px; }
.board-card p, .element p { font-size: 16px; color: var(--ink-soft); }
.surfaces { margin-top: 26px; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 22px 26px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.surfaces h3 { font-size: 22px; }
.surfaces ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.surfaces li { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.surfaces svg { width: 48px; height: 32px; }
.elements { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.element { position: relative; overflow: hidden; }
.element::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: var(--accent); }
.element svg { width: 96px; height: 96px; margin: 4px auto 12px; }

/* ---------- Video ---------- */
.video-frame { max-width: 980px; margin: 0 auto; border: 5px solid #fff; border-radius: 24px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.video-frame video { display: block; width: 100%; height: auto; aspect-ratio: 1280 / 576; background: #ffb84d; }

/* ---------- Modes ---------- */
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mode { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); border-top: 8px solid var(--accent); }
.mode h3 { font-size: 24px; margin-bottom: 8px; }
.mode p { color: var(--ink-soft); font-size: 16px; }

/* ---------- Languages ---------- */
.languages-layout { display: grid; grid-template-columns: 1fr 1.4fr; gap: 26px; align-items: start; }
.language-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.language-list li { display: flex; align-items: center; gap: 12px; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px 16px; font: 400 19px var(--display); }

/* ---------- Versions ---------- */
.versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.version { display: grid; grid-template-columns: 170px 1fr; gap: 22px; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.v-head { display: flex; flex-direction: column; gap: 6px; }
.v-tag { align-self: flex-start; font: 400 22px var(--display); background: var(--yellow); padding: 4px 14px; border-radius: 12px; }
.v-date { font-size: 15px; color: var(--ink-soft); font-weight: 600; }
.v-body h3 { font-size: 24px; margin-bottom: 6px; }
.v-body ul { margin: 0; padding-left: 20px; color: var(--ink-soft); }
.v-body li { margin: 4px 0; }
.versions-older { margin-top: 14px; }
.versions-older summary { cursor: pointer; font: 400 20px var(--display); padding: 10px 0; }
.versions-older .versions { margin-top: 10px; }

/* ---------- Privacy ---------- */
.legal { max-width: 860px; }
.legal h2 { margin-bottom: 16px; }
.legal-intro { font-size: 19px; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 18px; }
.legal h3 { font-size: 22px; margin: 26px 0 8px; }
.legal p { color: var(--ink-soft); margin-bottom: 10px; }
.legal-updated { font-size: 14px; margin-top: 24px; }

/* ---------- Footer ---------- */
footer { margin-top: 120px; padding: 34px 22px; background: var(--ink); color: #f3e3d3; }
.footer-inner { max-width: 1160px; margin: 0 auto; display: flex; gap: 20px; justify-content: space-between; align-items: center; flex-wrap: wrap; font-size: 15px; }
footer .brand { color: #fff; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-logo, .scroll-hint span { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Smaller screens ---------- */
@media (max-width: 1020px) {
  .nav nav { display: none; }
  .facts-inner, .modes { grid-template-columns: repeat(2, 1fr); }
  .boards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  .hero { min-height: auto; padding-top: 96px; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-art { order: -1; }
  .hero-logo { width: min(300px, 80%); }
  .lead { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .scroll-hint { display: none; }
  .facts { margin-top: 24px; }
  .shots { grid-template-columns: 1fr 1fr; }
  .languages-layout { grid-template-columns: 1fr; }
  .version { grid-template-columns: 1fr; gap: 10px; }
  .section { padding-top: 80px; }
}
@media (max-width: 480px) {
  .facts-inner, .boards, .modes, .shots { grid-template-columns: 1fr; }
  .language-list { grid-template-columns: 1fr 1fr; }
  .brand { font-size: 20px; }
}
