/* Urgaton — single stylesheet, no build step.
   Brand colour #6b78b4 comes from the old Publii theme; it is only 4.3:1 on white,
   so text and buttons use the darker --accent-strong and keep #6b78b4 for decoration. */

/* Self-hosted variable fonts (OFL, licences in /fonts): same look on every device,
   no request to Google. One file per family covers every weight. */
@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Exo";
  src: url("/fonts/exo.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #14172b;
  --text: #262a3d;
  --muted: #555b73;
  --accent: #6b78b4;
  --accent-strong: #414c8a;
  --accent-soft: #eceefa;
  --bg: #ffffff;
  --bg-soft: #f4f5fb;
  --line: #dde0ee;
  --space: #0b0d18;
  --space-2: #161b33;
  --space-text: #d9ddf2;
  --space-muted: #a9b0d6;
  --neon: #45e3ff;
  --radius: 12px;
  --page: 68rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --header-h: 64px;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Exo", "Figtree", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

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

a { color: var(--accent-strong); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--neon); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.2; margin: 0 0 0.6em; }
h2 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.wrap { width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }
.narrow { max-width: 44rem; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: #fff; padding: 0.75rem 1rem; border-radius: 8px;
}
.skip-link:focus { top: 1rem; color: #fff; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 1rem; }
.brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand img { height: 34px; width: auto; }

.nav-toggle {
  display: none;
  font: inherit; font-size: 0.95rem; font-weight: 600; color: var(--ink);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px;
  min-height: 44px; padding: 0 1.1rem; cursor: pointer;
  align-items: center; gap: 0.5rem;
}
.nav-toggle svg { width: 20px; height: 20px; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; }
.site-nav a {
  display: flex; align-items: center; min-height: 44px; padding: 0 0.8rem;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.97rem; border-radius: 8px;
}
.site-nav a:hover { background: var(--accent-soft); color: var(--ink); }

/* Mobile: the nav collapses behind the toggle, but only when JS is there to open it */
@media (max-width: 52rem) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(20, 23, 43, 0.12);
    display: none;
  }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { flex-direction: column; padding: 0.5rem var(--gutter) 1rem; }
  .js .site-nav a { min-height: 48px; font-size: 1.05rem; }
  html:not(.js) .site-header .wrap { flex-wrap: wrap; padding-block: 0.5rem; }
  html:not(.js) .site-nav ul { flex-wrap: wrap; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0 1.4rem; border-radius: 999px;
  font-weight: 700; font-size: 1rem; text-decoration: none;
  border: 2px solid transparent; transition: transform 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: #fff; color: var(--ink); }
.btn-primary:hover { background: var(--neon); color: var(--ink); }
.btn-ghost { border-color: rgba(255, 255, 255, 0.55); color: #fff; }
.btn-ghost:hover { border-color: #fff; color: #fff; background: rgba(255, 255, 255, 0.08); }
.btn-dark { background: var(--accent-strong); color: #fff; }
.btn-dark:hover { background: var(--ink); color: #fff; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: #111 url("img/pattern-1024.webp") center / 560px repeat;
  color: #fff;
  padding: clamp(3.5rem, 10vw, 7rem) 0 clamp(3rem, 8vw, 6rem);
  text-align: center;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(17, 17, 17, 0.55), rgba(17, 17, 17, 0.9));
}
.hero .wrap { position: relative; }
.hero h1 { margin: 0 auto 1.2rem; max-width: 34rem; }
.hero h1 img { width: 100%; filter: invert(1); }
.hero .eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.82rem; font-weight: 700; color: #c9cdea; margin-bottom: 1.4rem; }
.hero .lead { font-size: clamp(1.1rem, 1rem + 0.6vw, 1.3rem); max-width: 38rem; margin: 0 auto 2rem; color: #eef0fa; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

/* ---------- sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-soft { background: var(--bg-soft); }
.section-head { margin-bottom: 2rem; }
.kicker { color: var(--accent-strong); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.8rem; margin-bottom: 0.4rem; }
.section-head p { color: var(--muted); max-width: 40rem; }

.space {
  background: radial-gradient(ellipse at 80% 0%, #2a2160 0%, transparent 55%),
              radial-gradient(ellipse at 0% 100%, #0f3350 0%, transparent 50%), var(--space);
  color: var(--space-text);
}
.space h2, .space h3 { color: #fff; }
.space .kicker { color: var(--neon); }
.space .section-head p, .space .muted { color: var(--space-muted); }
.space a:not(.btn) { color: var(--neon); }
.space a:not(.btn):hover { color: #fff; }

/* ---------- SpaceMission42 ---------- */
.game-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 56rem) { .game-grid { grid-template-columns: 1.05fr 1fr; } }
.game-intro .title-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.game-intro .title-row img { width: 72px; height: 72px; border-radius: 16px; box-shadow: 0 0 24px rgba(69, 227, 255, 0.35); }
.game-intro .title-row h2 { margin: 0; }
.game-intro .lead { font-size: 1.2rem; color: #fff; }
.checks { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.checks li { position: relative; padding-left: 1.9rem; margin-bottom: 0.55rem; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 0.42em; width: 1.1rem; height: 1.1rem; border-radius: 50%;
  background: var(--neon) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%230b0d18' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat;
}
.section-soft .checks li::before, .section .checks li::before { background-color: var(--neon); }

.preview {
  border-radius: var(--radius); overflow: hidden; background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 50px rgba(0, 0, 0, 0.5);
}
.preview video { width: 100%; aspect-ratio: 548 / 308; object-fit: cover; }

.editions { display: grid; gap: 1rem; margin-top: 2.5rem; }
@media (min-width: 40rem) { .editions { grid-template-columns: 1fr 1fr; } }
.edition {
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius); padding: 1.4rem;
  display: flex; flex-direction: column; gap: 0.3rem;
}
.edition h3 { margin: 0; }
.edition p { margin: 0 0 0.9rem; color: var(--space-muted); }
.edition .play-badge { margin-top: auto; align-self: flex-start; display: inline-block; border-radius: 10px; }
.play-badge img { width: 200px; height: auto; }
.editions-note { margin-top: 1rem; color: var(--space-muted); font-size: 0.95rem; }

.gallery {
  list-style: none; margin: 2.5rem 0 0; padding: 0 0 0.75rem;
  display: grid; grid-auto-flow: column; grid-auto-columns: min(62vw, 240px); gap: 1rem;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: var(--accent) transparent;
}
.gallery li { scroll-snap-align: start; }
.gallery img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.1); }
.gallery-hint { font-size: 0.9rem; color: var(--space-muted); margin-top: 0.5rem; }
@media (min-width: 70rem) { .gallery { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); overflow: visible; } .gallery-hint { display: none; } }

.tech { display: grid; gap: 2rem; margin-top: 3rem; }
@media (min-width: 48rem) { .tech { grid-template-columns: 1fr 1fr; } }
.credits { font-size: 0.95rem; }

/* ---------- trailers ---------- */
.videos { display: grid; gap: 1.5rem; }
@media (min-width: 48rem) { .videos { grid-template-columns: 1fr 1fr; } }
.video { margin: 0; }
.video figcaption { margin-top: 0.7rem; }
.video figcaption strong { display: block; color: var(--ink); }
.video figcaption span { color: var(--muted); font-size: 0.95rem; }
.yt {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden; background: #000; border: 0; padding: 0; cursor: pointer;
}
.yt img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.yt:hover img { transform: scale(1.03); }
.yt .play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 76px; height: 54px; border-radius: 14px; background: rgba(0, 0, 0, 0.72);
  display: grid; place-items: center; transition: background 0.2s;
}
.yt:hover .play, .yt:focus-visible .play { background: #e00; }
.yt .play svg { width: 26px; height: 26px; fill: #fff; margin-left: 4px; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-note { color: var(--muted); font-size: 0.9rem; margin-top: 1.25rem; }

/* ---------- story ---------- */
.story-intro { display: grid; gap: 2rem; align-items: center; margin-bottom: 3rem; }
@media (min-width: 52rem) { .story-intro { grid-template-columns: 1fr 1fr; } }
.story-intro img { border-radius: var(--radius); }
.levels { display: grid; gap: 1.5rem; }
@media (min-width: 44rem) { .levels { grid-template-columns: 1fr 1fr; } }
.level { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.level img { width: 100%; aspect-ratio: 5 / 2; object-fit: cover; }
.level .body { padding: 1.1rem 1.25rem 1.25rem; }
.level .num { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-strong); }
.level h3 { margin: 0.2rem 0 0.5rem; }
.level p { margin: 0 0 0.6rem; }
.level .credit { font-size: 0.85rem; color: var(--muted); font-style: italic; margin: 0; }

/* ---------- how to play ---------- */
.howto { display: grid; gap: 2.5rem; }
@media (min-width: 52rem) { .howto { grid-template-columns: minmax(0, 20rem) 1fr; align-items: start; } }
.howto figure { margin: 0; }
/* Fixed box before the lazy image arrives: otherwise the page below it shifts after load and a
   visitor landing on /#updates ends up in the wrong place. */
.howto figure img { border-radius: var(--radius); margin-inline: auto; width: min(100%, 18.5rem); height: auto; aspect-ratio: 700 / 1360; }
.howto dl { margin: 0; }
.howto dt { font-weight: 700; color: var(--ink); margin-top: 1.1rem; }
.howto dt:first-child { margin-top: 0; }
.howto dd { margin: 0.25rem 0 0; }
.tip { margin-top: 2rem; background: var(--accent-soft); border-left: 5px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; padding: 1.25rem 1.4rem; }
.tip h3 { margin-bottom: 0.4rem; }
.tip ol { margin: 0.5rem 0 0.5rem; padding-left: 1.3rem; }
.tip li { margin-bottom: 0.3rem; }

/* ---------- updates ---------- */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 3px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1.6rem 1.6rem; }
.timeline li::before { content: ""; position: absolute; left: -9px; top: 0.35em; width: 15px; height: 15px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg-soft); }
.timeline time { display: block; font-weight: 700; color: var(--accent-strong); font-size: 0.95rem; }
.timeline p { margin: 0.15rem 0 0; }

/* ---------- soundtrack / contact ---------- */
.split { display: grid; gap: 2rem; }
@media (min-width: 48rem) { .split { grid-template-columns: 1fr 1fr; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
.card h3 { margin-bottom: 0.5rem; }
.mail { font-size: clamp(1.15rem, 1rem + 1vw, 1.5rem); font-weight: 700; overflow-wrap: anywhere; }
.social { display: flex; gap: 0.6rem; margin-top: 1rem; }
.social a {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink);
}
.social a:hover { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
.social svg { width: 22px; height: 22px; fill: currentColor; }

/* ---------- footer ---------- */
.site-footer { background: var(--space); color: var(--space-muted); padding: 2.5rem 0 3rem; font-size: 0.95rem; }
.site-footer .wrap { display: grid; gap: 1.25rem; }
.site-footer a { color: #fff; display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; justify-content: center; }
.site-footer .links a { min-width: 0; justify-content: flex-start; }
.site-footer a:hover { color: var(--neon); }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.site-footer p { margin: 0; }
.site-footer .logo-mark { width: 40px; height: 40px; filter: invert(1); opacity: 0.85; }

/* ---------- plain document pages (privacy, 404) ---------- */
.doc { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.doc h1 { font-size: clamp(1.8rem, 1.4rem + 2vw, 2.6rem); }
.doc h2 { font-size: 1.35rem; margin-top: 2.2rem; }
.doc .meta { color: var(--muted); }
.doc ul { padding-left: 1.3rem; }
.doc li { margin-bottom: 0.4rem; }
.doc .notice { background: var(--accent-soft); border-radius: var(--radius); padding: 1rem 1.25rem; }
