/*
 * Kiki Adventures promotional site.
 *
 * Dark, pixel-first: every screenshot is nearest-neighbour scaled so the art
 * stays sharp instead of being smoothed into mush by the browser, and the
 * palette is taken from the game's own.
 */

:root {
  --bg: #07070f;
  --bg-raised: #0e1020;
  --bg-card: #121527;
  --line: #242a44;
  --text: #dfe5f5;
  --muted: #8d99bd;
  --dim: #5d6789;
  --cyan: #8ff2f6;
  --cyan-deep: #2fc6d9;
  --gold: #f4d548;
  --violet: #b98cff;
  --rose: #ff5d73;
  --radius: 10px;
  --max: 1100px;
}

* { box-sizing: border-box; }

/*
 * The topbar is sticky, so a jump to #install parks the section's own heading
 * underneath it: at phone width the bar is two rows tall and the H2 ended up
 * entirely behind it, with nothing on screen saying where you had arrived.
 * scroll-padding leaves the bar's height plus a little air above every anchor.
 */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}
@media (max-width: 860px) {
  html { scroll-padding-top: 124px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* A faint starfield wash, so the page reads as the same place as the game. */
  background-image:
    radial-gradient(1200px 600px at 78% -10%, rgba(47, 198, 217, .10), transparent 60%),
    radial-gradient(900px 500px at 10% 8%, rgba(185, 140, 255, .09), transparent 60%);
  background-attachment: fixed;
}

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

/* Screenshots are pixel art; never let the browser smooth them. */
.hero-shot img, .shots img { image-rendering: pixelated; width: 100%; }

a { color: var(--cyan); }
a:hover { color: #fff; }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.skip {
  position: absolute; left: -9999px;
  background: var(--cyan); color: #04060c; padding: 10px 16px; border-radius: 6px;
}
.skip:focus { left: 12px; top: 12px; z-index: 100; }

/* ------------------------------------------------------------------ topbar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 12px max(16px, calc((100vw - var(--max)) / 2));
  background: rgba(7, 7, 15, .88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font-weight: 700; letter-spacing: .12em; font-size: 14px;
}
.brand img { image-rendering: pixelated; border-radius: 6px; }
.topbar nav { display: flex; gap: 18px; flex-wrap: wrap; margin-right: auto; }
.topbar nav a {
  color: var(--muted); text-decoration: none; font-size: 14px;
  padding: 4px 0; border-bottom: 1px solid transparent;
}
.topbar nav a:hover { color: var(--cyan); border-bottom-color: var(--cyan-deep); }

.lang {
  background: transparent; color: var(--cyan);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer;
}
.lang:hover { border-color: var(--cyan-deep); background: rgba(47, 198, 217, .08); }

/* -------------------------------------------------------------------- main */
main { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

section { padding: 56px 0; border-bottom: 1px solid var(--line); }
section:last-child { border-bottom: 0; }

h2 {
  font-size: 28px; margin: 0 0 8px;
  letter-spacing: .02em;
}
h3 { font-size: 17px; margin: 22px 0 6px; color: var(--cyan); }
p { margin: 0 0 14px; }
.lede { color: var(--muted); max-width: 62ch; }
.note { color: var(--dim); font-size: 14px; }

/* -------------------------------------------------------------------- hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 40px; align-items: center;
  padding: 56px 0 64px;
}
.logo { image-rendering: pixelated; width: min(100%, 420px); margin-bottom: 8px; }
.tagline { color: var(--gold); font-size: 15px; letter-spacing: .08em; margin-bottom: 18px; }
.blurb { color: var(--muted); max-width: 52ch; }

.badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.badge {
  font-size: 12px; letter-spacing: .05em;
  color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 11px;
  background: var(--bg-raised);
}

.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.button {
  display: inline-block; text-decoration: none;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 20px; color: var(--text);
  background: var(--bg-card);
  font-size: 15px;
}
.button:hover { border-color: var(--cyan-deep); color: #fff; }
.button.primary {
  background: linear-gradient(180deg, #2fc6d9, #1d8fa4);
  border-color: #56dce9; color: #04121a; font-weight: 600;
}
.button.primary:hover { filter: brightness(1.1); color: #04121a; }
.button.small { padding: 7px 14px; font-size: 14px; }

.hero-shot {
  margin: 0; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: #000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
}

/* ------------------------------------------------------------------- grids */
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 26px;
}
.grid article {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}
.grid h3 { margin-top: 0; }
.grid p { color: var(--muted); font-size: 15px; margin-bottom: 0; }
.grid article p + p { margin-top: 14px; }

/* --------------------------------------------------------------- shot grid */
.shots {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  margin-top: 26px;
}
.shots figure {
  margin: 0; background: #000;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.shots figcaption {
  padding: 10px 14px; font-size: 13px; color: var(--muted);
  background: var(--bg-card); border-top: 1px solid var(--line);
}
.shots .wide { grid-column: 1 / -1; }

/* -------------------------------------------------------------------- tabs */
.tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin: 26px 0 0; border-bottom: 1px solid var(--line); padding-bottom: 0;
}
.tabs button {
  background: transparent; border: 1px solid transparent; border-bottom: 0;
  color: var(--muted); font: inherit; font-size: 14px;
  padding: 9px 16px; cursor: pointer;
  border-radius: 8px 8px 0 0;
}
.tabs button:hover { color: var(--cyan); }
.tabs button[aria-selected="true"] {
  color: var(--text); background: var(--bg-card);
  border-color: var(--line); margin-bottom: -1px;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 20px 22px 24px;
}
.panel h3 { margin-top: 0; }
.panel p { color: var(--muted); max-width: 66ch; }

pre {
  background: #05060d; border: 1px solid var(--line);
  border-radius: 8px; padding: 14px 16px;
  overflow-x: auto; font-size: 13.5px; line-height: 1.6;
  color: #cfe3ff;
}
pre code { color: inherit; }

/* ------------------------------------------------------------------ footer */
.spotlight {
  background: var(--bg-card);
  border: 1px solid var(--cyan-deep);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 22px 0;
}
.spotlight h3 { margin-top: 0; }
.spotlight p { color: var(--muted); max-width: 66ch; }
.spotlight p:last-child { margin-bottom: 0; }

footer {
  max-width: var(--max); margin: 0 auto;
  padding: 34px 16px 56px;
  color: var(--dim); font-size: 14px;
  border-top: 1px solid var(--line);
}
footer .small { font-size: 13px; }
footer .made { color: var(--muted); font-style: italic; margin-top: 18px; }

/* ------------------------------------------------------------ narrow width */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; }
  .topbar { gap: 12px; }
  .topbar nav { order: 3; width: 100%; gap: 14px; }
  h2 { font-size: 24px; }
  section { padding: 40px 0; }
}
