/* Wordmark font, self-hosted (SIL OFL, see assets/fonts/OFL-Unbounded.txt) */
@font-face {
  font-family: "Unbounded";
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/unbounded-700-latin.woff2") format("woff2");
}

:root {
  /* Sky, from the top of the page down to dusk */
  --sky-1: #dcedf9;
  --sky-2: #b4d6f1;
  --sky-3: #84b4e3;
  --dusk: #2b3c70;
  --space: #080b18;

  --ink: #0f1d30;
  --ink-muted: #3e5470;
  --star: #edf1f9;
  --star-muted: #9ba8c4;
  --orange: #ff8a3d;
  --line-sky: rgba(15, 29, 48, 0.18);
  --line-space: rgba(237, 241, 249, 0.16);

  --max: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, "Iowan Old Style", "Sitka Heading", Constantia, Georgia, serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--space);
  color: var(--ink);
  font: 17px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}

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

/* Bilingual content: every text exists as lang="en" and lang="de"; show one.
   Without JavaScript the page stays English. */
html:not([data-lang="de"]) [lang="de"]:not(html),
html[data-lang="de"] [lang="en"]:not(html) { display: none; }

/* Navigation: no bar, the text inverts against whatever sky is behind it. */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 18px max(16px, calc((100vw - var(--max)) / 2));
  color: #fff;
  mix-blend-mode: difference;
}

/* Wordmark: Unbounded with an orange cube as the dot of the j.
   The cube's place is measured for Unbounded 700 at line-height 1, in em. */
.wm {
  display: inline-block;
  font-family: "Unbounded", var(--font);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.055em;
  white-space: nowrap;
}
.wm__j { position: relative; display: inline-block; }
.wm__j > span { display: inline-block; clip-path: polygon(-1em 0.26em, 3em 0.26em, 3em 3em, -1em 3em); }
.wm__cube { position: absolute; left: -0.019em; top: -0.16em; width: 0.353em; height: 0.405em; overflow: visible; }

/* Brand: dragon + wordmark, outside the blended nav so the orange stays orange.
   --dark runs from 0 (over sky) to 1 (over space); main.js sets it while the dusk scrolls past,
   so the light and dark logo cross-fade and the wordmark colour follows. */
.brand {
  --dark: 0;
  position: fixed;
  top: 10px;
  left: max(16px, calc((100vw - var(--max)) / 2));
  z-index: 11;
  display: flex;
  align-items: center;
  gap: 8px;
  color: color-mix(in srgb, var(--star) calc(var(--dark) * 100%), var(--ink));
  font-size: 1.2rem;
  text-decoration: none;
}
.brand__icons { position: relative; width: 42px; height: 42px; flex: none; }
.brand__icon { position: absolute; inset: 0; width: 100%; height: 100%; }
.brand__icon--on-light { opacity: calc(1 - var(--dark)); }
.brand__icon--on-dark { opacity: var(--dark); }
.nav nav { display: flex; gap: clamp(14px, 3vw, 30px); }
.nav nav a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.nav nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav nav { align-items: center; }
.lang-switch { display: inline-flex; border: 1px solid currentColor; border-radius: 3px; }
.lang-switch button {
  padding: 3px 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font: 0.75rem var(--font-mono);
  letter-spacing: 0.08em;
  cursor: pointer;
  opacity: 0.55;
}
/* White on the blended nav, so the active language reads as a filled chip on any sky. */
.lang-switch button[aria-pressed="true"] { color: #000; background: #fff; opacity: 1; }

/* Altitude labels instead of section headings */
.altitude {
  margin: 0 0 28px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* Hero: open sky */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 96px 16px 120px;
  /* Clip sideways only: the cloud bank below may spill into the next section. */
  overflow-x: clip;
  z-index: 1;
  background: linear-gradient(var(--sky-1), var(--sky-2));
}
.hero::after {
  /* A soft cloud bank straddling the bottom edge, so there is no seam */
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -110px;
  height: 240px;
  background:
    radial-gradient(closest-side, rgba(255, 255, 255, 0.85), transparent) 5% 60% / 34% 100% no-repeat,
    radial-gradient(closest-side, rgba(255, 255, 255, 0.75), transparent) 32% 80% / 30% 90% no-repeat,
    radial-gradient(closest-side, rgba(255, 255, 255, 0.8), transparent) 60% 70% / 38% 100% no-repeat,
    radial-gradient(closest-side, rgba(255, 255, 255, 0.7), transparent) 92% 65% / 32% 95% no-repeat;
  pointer-events: none;
}
.hero__sim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

/* Hero intro (assets/js/hero-intro.js): while <html> has .intro, the hero waits for the
   three.js cubes; the script lands the cube on the logo and hands over to the page.
   The intro canvas is transparent, so the sky above shows through. */
.hero__intro,
.hero__intro-ring { position: absolute; pointer-events: none; }
.hero__intro { inset: 0; width: 100%; height: 100%; }
.hero__intro-ring { z-index: 1; overflow: visible; }
.intro .hero__logo,
.intro .hero__title,
.intro .hero__pron,
.intro .hero__claim,
.intro .hero__sub,
.intro .altitude--hero,
.intro .hero__sim { opacity: 0; }
.hero__title,
.hero__pron,
.hero__claim,
.hero__sub,
.altitude--hero,
.hero__sim { transition: opacity 0.8s ease; }

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 640px;
  pointer-events: none;
}
.hero__content button { pointer-events: auto; }
.hero__logo { width: clamp(150px, 36vw, 230px); margin: 0 auto 18px; }
.hero__title {
  margin: 0;
  font-size: clamp(3.4rem, 15vw, 7.5rem);
  line-height: 1;
  font-weight: 700;
}
.hero__pron {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 0;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}
.hero__pron .say { color: var(--ink); letter-spacing: 0.08em; }
.pron-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line-sky);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.pron-btn svg { width: 15px; height: 15px; fill: var(--ink); }
.pron-btn:hover { background: rgba(255, 255, 255, 0.5); }
.hero__claim {
  margin: 30px 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4.5vw, 2.2rem);
  font-style: italic;
}
.hero__sub { margin: 0 auto; color: var(--ink-muted); max-width: 30em; }
.altitude--hero {
  position: absolute;
  z-index: 1;
  left: max(16px, calc((100vw - var(--max)) / 2));
  bottom: 28px;
  margin: 0;
  color: var(--ink-muted);
}

/* Worlds: one game per altitude */
.world { padding: clamp(64px, 10vw, 120px) 16px; scroll-margin-top: 0; }
.world--sky { background: linear-gradient(var(--sky-2), var(--sky-3)); color: var(--ink); }
.world--space { color: var(--star); }
/* Tablestead: back down from orbit to 76 cm, a workshop table under a warm lamp */
.world--table {
  color: var(--star);
  background: radial-gradient(ellipse 80% 45% at 50% 0%, rgba(255, 160, 80, 0.13), transparent 75%);
}
.world__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.world__inner > .altitude { grid-column: 1 / -1; margin-bottom: 0; }
.world--space .world__text { order: 2; }
.world__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.05;
  font-weight: 700;
}
.working-title {
  display: inline-block;
  margin: 8px 0 0;
  padding: 1px 7px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
}
.working-title + .working-title { margin-left: 6px; }
.world__tagline {
  margin: 10px 0 18px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
}
.world--sky .world__text p:not(.world__tagline) { color: var(--ink-muted); }
.world--space .world__text p:not(.world__tagline),
.world--table .world__text p:not(.world__tagline) { color: var(--star-muted); }
.facts {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}
.world__shot { margin: 0; }
.world__shot img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 3px;
}
.world--sky .world__shot img { box-shadow: 0 30px 60px -30px rgba(15, 29, 48, 0.45); }
.world--space .world__shot img,
.world--table .world__shot img { box-shadow: 0 0 0 1px var(--line-space); }

/* Features and gallery below each game */
.features,
.gallery {
  max-width: var(--max);
  margin: clamp(40px, 6vw, 64px) auto 0;
}
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px clamp(24px, 5vw, 56px);
  padding: 0;
  list-style: none;
}
.features li { padding-top: 14px; }
.world--sky .features li { border-top: 1px solid var(--line-sky); color: var(--ink-muted); }
.world--space .features li,
.world--table .features li { border-top: 1px solid var(--line-space); color: var(--star-muted); }
.features strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-serif);
  font-size: 1.15rem;
}
.world--sky .features strong { color: var(--ink); }
.world--space .features strong,
.world--table .features strong { color: var(--star); }

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.shot {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: zoom-in;
}
.shot img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 3px;
  transition: transform 0.2s;
}
.shot:hover img { transform: translateY(-3px); }
.world--sky .shot img { box-shadow: 0 16px 30px -18px rgba(15, 29, 48, 0.5); }
.world--space .shot img,
.world--table .shot img { box-shadow: 0 0 0 1px var(--line-space); }
.shot span {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.lightbox {
  max-width: min(1280px, 94vw);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--star);
}
.lightbox::backdrop { background: rgba(8, 11, 24, 0.88); }
.lightbox img { width: 100%; height: auto; max-height: 82vh; object-fit: contain; border-radius: 3px; }
.lightbox__caption { margin: 10px 0 0; font-family: var(--font-mono); font-size: 0.85rem; text-align: center; }
.lightbox__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(8, 11, 24, 0.7);
  color: var(--star);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

/* Dusk: the climb from sky to orbit */
.dusk {
  height: clamp(160px, 30vh, 320px);
  background: linear-gradient(var(--sky-3), var(--dusk) 55%, var(--space));
}

/* Space: everything below the dusk, with a sparse star field */
.space {
  position: relative;
  color: var(--star);
  background-color: var(--space);
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 37% 62%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 68% 27%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 84% 74%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 55% 90%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 22% 82%, rgba(255, 255, 255, 0.4), transparent);
  background-size: 420px 420px;
}

.block {
  max-width: calc(var(--max) + 32px);
  margin: 0 auto;
  padding: clamp(64px, 10vw, 112px) 16px;
}
.block__title {
  margin: 0 0 20px;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.1;
}
.block p { color: var(--star-muted); max-width: 40em; }
.block .lead { color: var(--star); font-size: 1.2rem; }

.btn {
  display: inline-block;
  margin-top: 14px;
  padding: 12px 22px;
  border: 1px solid var(--star);
  border-radius: 3px;
  color: var(--star);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--star); color: var(--space); }

.play {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(28px, 6vw, 72px);
  align-items: start;
}
.play__facts { margin: 6px 0 0; }
.play__facts div { padding: 16px 0; border-top: 1px solid var(--line-space); }
.play__facts div:last-child { border-bottom: 1px solid var(--line-space); }
.play__facts dt {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange);
}
.play__facts dd { margin: 4px 0 0; color: var(--star-muted); }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line-space);
  color: var(--star-muted);
  font-size: 0.9rem;
}
.footer p { margin: 0; }

/* Key art at the top of the Handle with Space section (same picture as the devlog hero) */
.world__hero { max-width: var(--max); margin: 0 auto clamp(40px, 6vw, 72px); }
.world__hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px var(--line-space); }
.world--sky .world__hero img { box-shadow: 0 30px 60px -30px rgba(15, 29, 48, 0.45); }

/* Devlog page: German only, out in space next to Handle with Space */
.page-space { background: var(--space); }
.page-space .todo { color: #ff7a6b; }
.devlog { min-height: 100vh; padding-top: 88px; }
.devlog__head,
.devlog__entries { max-width: calc(var(--max) + 32px); margin: 0 auto; padding: 0 16px; }
.devlog__hero { margin: 0; }
.devlog__hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; }
.devlog__intro { max-width: 760px; margin: 40px auto 0; }
.devlog__title { margin: 0 0 14px; font-family: var(--font-serif); font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.05; }
.devlog__title span {
  display: block;
  margin-top: 10px;
  color: var(--orange);
  font: 0.85rem var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.devlog .lead { margin: 0; color: var(--star); font-size: 1.2rem; }
.devlog__note { color: var(--star-muted); font: 0.78rem var(--font-mono); letter-spacing: 0.06em; }
.devlog__entries { padding-bottom: clamp(64px, 10vw, 112px); }
.entry { max-width: 760px; margin: 56px auto 0; padding-top: 40px; border-top: 1px solid var(--line-space); }
.entry__meta {
  margin: 0 0 6px;
  color: var(--star-muted);
  font: 0.78rem var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.entry__title { margin: 0 0 20px; font-family: var(--font-serif); font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.15; }
.entry video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; border-radius: 3px; }
.entry__story { margin-top: 20px; }
.entry__story p { color: var(--star-muted); }

/* Placeholders for pictures and videos that are still to come */
.slot {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(237, 241, 249, 0.28);
  border-radius: 3px;
  background: rgba(237, 241, 249, 0.03);
  color: var(--star-muted);
  font: 0.78rem var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.slot--hero { aspect-ratio: 16 / 9; }
.slot--video { aspect-ratio: 16 / 9; }

/* Legal page: plain paper */
.page-plain { background: var(--sky-1); }
.legal { max-width: 760px; margin: 0 auto; padding: 96px 16px 64px; color: var(--ink); }
.legal h1 { font-family: var(--font-serif); font-size: 2rem; }
.legal h2 { margin-top: 2em; font-size: 1.15rem; }
.legal p, .legal li { color: var(--ink-muted); }
.page-plain .footer { color: var(--ink-muted); border-top-color: var(--line-sky); }
.todo { color: #b8322a; font-weight: 700; }

@media (max-width: 1112px) {
  .footer { margin: 0 16px; }
}

@media (max-width: 760px) {
  .world__inner, .play, .features { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .nav nav a[href="#studio"] { display: none; }
  .world--space .world__text { order: 0; }
  .world__shot { order: -1; }
  .world__inner > .altitude { order: -2; }
}
