/* The Base · landing (B4). One world: Apollo surface photography. A black sky, sunlit grey ground with ink type, capitals
   spaced like the plaque Apollo 11 left on the Moon, and one warm signal colour. Colours match docs/brand/README.md. */

@font-face {
  font-family: 'Jost';
  src: url('/assets/fonts/jost-latin-400-600.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --sky: #020308;
  --shadow: #0b0c10; /* ground the sun has not reached */
  --ground: #cbc8c1;
  --dawn: #a5a29b; /* ground in low sun */
  --ink: #14161a;
  --ink-soft: #45464a; /* secondary text on ground: 5.6:1 */
  --dust: #e8e6e1;
  --dust-soft: #a9a6a0; /* secondary text on sky */
  --signal: #ffb547;

  --gutter: clamp(20px, 4.2vw, 60px);
  --section: clamp(4.5rem, 10vw, 8.5rem);
  --rule: 1.5px;
  /* A registration cross, as on the glass plate of the Apollo cameras. It marks where a plate starts. */
  --cross: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='21'%3E%3Cpath d='M10.5 0v21M0 10.5h21' stroke='%2314161a' stroke-width='1.5'/%3E%3C/svg%3E");
  --arrive: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background: var(--sky);
  scrollbar-color: #6d6b66 var(--sky);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font: 400 clamp(1.0625rem, 0.98rem + 0.36vw, 1.25rem) / 1.5 'Jost', 'Century Gothic', 'Futura', system-ui, sans-serif;
  color: var(--ink);
  background: var(--sky);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection {
  background: var(--signal);
  color: var(--ink);
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd {
  margin: 0;
  padding: 0;
}

ol,
ul {
  list-style: none;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-underline-offset: 0.22em;
  text-decoration-thickness: var(--rule);
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--signal);
  color: var(--ink);
}

.skip:focus {
  top: 1rem;
}

/* The display voice: medium-weight capitals with open spacing. Used for headings, never for small labels above them. */
h1,
h2,
.plaque-main,
.band-time {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  text-wrap: balance;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────────────────────────────────────────────── */
.go {
  display: inline-block;
  padding: 1.05rem 1.9rem;
  background: var(--signal);
  color: var(--ink);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.16s ease-out, transform 0.12s ease-out;
}

.go:hover {
  background: #ffd08a;
}

.go:active {
  transform: translateY(1px);
}

.go:focus-visible {
  outline-color: var(--signal);
}

/* ── Top bar: over the sky, not sticky ───────────────────────────────────────────────────────────────────────────────── */
.top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 2.4vw, 1.9rem) var(--gutter);
  color: var(--dust);
}

.top-brand img {
  width: auto;
  height: clamp(2.1rem, 3.4vw, 2.75rem);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2vw, 1.75rem);
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
}

.lang {
  display: flex;
  gap: 0.15rem;
}

.lang button {
  padding: 0.55rem 0.5rem;
  border: 0;
  background: none;
  color: var(--dust-soft);
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.lang button[aria-pressed='true'] {
  color: var(--dust);
  text-decoration: underline;
  text-decoration-thickness: var(--rule);
  text-underline-offset: 0.4em;
}

.enter {
  padding: 0.6rem 1.15rem;
  border: var(--rule) solid var(--dust);
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.16s ease-out, color 0.16s ease-out;
}

.enter:hover {
  background: var(--dust);
  color: var(--ink);
}

/* ── Hero: from orbit ────────────────────────────────────────────────────────────────────────────────────────────────── */
.hero {
  /* The Moon's box: a square whose centre is the Moon's centre. moon.js draws the live Moon exactly where this picture sits
     (scenes.js reads the box), and the Moon's radius is 31% of the box (MOON_SHARE there). */
  --moon-box: 124vw;
  --moon-x: 50vw;
  --moon-y: 25svh;
  position: relative;
  min-height: 100svh;
  padding: calc(var(--moon-y) + 45vw) var(--gutter) 3rem;
  overflow: clip;
  color: var(--dust);
  background: var(--sky) url('/assets/img/stars-900.webp') center top / cover no-repeat;
}

.hero-moon,
.hero-live {
  position: absolute;
  max-width: none;
  pointer-events: none;
}

.hero-moon {
  left: calc(var(--moon-x) - var(--moon-box) / 2);
  top: calc(var(--moon-y) - var(--moon-box) / 2);
  width: var(--moon-box);
  height: var(--moon-box);
  transform-origin: 50% 50%;
}

.hero-live {
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.9s ease-out;
}

/* scenes.js sets this once the live Moon has drawn its first frame. */
.hero.is-live .hero-live {
  opacity: 1;
}

.hero.is-live .hero-moon {
  opacity: 0;
  transition: opacity 0.9s ease-out;
}

.hero-say {
  position: relative;
  max-width: 37rem;
}

h1 {
  font-size: clamp(2rem, 1.1rem + 4.2vw, 4.25rem);
  line-height: 1.06;
}

h1 span {
  display: block;
}

.hero-sub {
  margin: 1.5rem 0 2rem;
  max-width: 33rem;
  color: #c9c6c0;
}

.hero-note {
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: var(--dust-soft);
}

@media (min-width: 900px) {
  .hero {
    --moon-box: min(68vw, 116svh);
    --moon-x: 27vw;
    --moon-y: 52svh;
    display: grid;
    align-items: center;
    padding: 6rem var(--gutter) 3rem 56vw;
    background-image: url('/assets/img/stars-1920.webp');
  }
}

/* ── Ground: sunlit regolith ─────────────────────────────────────────────────────────────────────────────────────────── */
.ground {
  position: relative;
  padding: var(--section) var(--gutter);
  color: var(--ink);
  background:
    var(--cross) var(--gutter) 1.75rem no-repeat,
    var(--cross) 50% 1.75rem no-repeat,
    var(--cross) calc(100% - var(--gutter)) 1.75rem no-repeat,
    linear-gradient(rgb(203 200 193 / 0.8), rgb(203 200 193 / 0.8)),
    var(--ground) url('/assets/img/ground.webp') 0 0 / 512px;
}

/* The first plate arrives as the horizon: its top edge is the curve of the Moon. */
.what {
  z-index: 2;
  margin-top: -3.5vw;
  padding-top: calc(var(--section) + 2vw);
  border-radius: 50% 50% 0 0 / 5vw 5vw 0 0;
  /* The crosses follow the curve: the middle one sits highest. */
  background-position: var(--gutter) calc(1.75rem + 3.5vw), 50% 1.75rem, calc(100% - var(--gutter)) calc(1.75rem + 3.5vw), 0 0, 0 0;
}

.plate {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.25rem, 5vw, 4.5rem);
  max-width: 84rem;
  margin: 0 auto;
}

@media (min-width: 900px) {
  .plate {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
  }

  .plate-stack {
    grid-template-columns: minmax(0, 1fr);
  }

  /* A heading keeps its long list company instead of leaving half the plate empty. */
  .plate > .plate-lead:first-child {
    position: sticky;
    top: 2.5rem;
  }

  .plate-stack .plate-lead {
    max-width: 46rem;
  }
}

h2 {
  margin-bottom: 1.4rem;
  font-size: clamp(1.7rem, 1.15rem + 2.3vw, 2.9rem);
  line-height: 1.1;
}

.plate-lead p {
  max-width: 34em;
  text-wrap: pretty;
}

.plate-lead p + p {
  margin-top: 1em;
}

.plate-lead .claim {
  margin-top: 2rem;
  font-size: 1.3em;
  font-weight: 500;
  line-height: 1.3;
}

/* A ruled list: who does what, or what a thing is. The term sits beside its description on wide screens. */
.crew > div {
  display: grid;
  gap: 0.25rem 1.5rem;
  padding: 1.05rem 0;
  border-top: var(--rule) solid var(--ink);
}

.crew > div:last-child {
  border-bottom: var(--rule) solid var(--ink);
}

.crew dt {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.crew dd {
  text-wrap: pretty;
}

@media (min-width: 620px) {
  .crew > div {
    grid-template-columns: 12.5rem minmax(0, 1fr);
  }
}

/* ── The agentic flow: four stops on one rail. flow.js lights them in turn and waits at the gate for a click. ────────── */
.flow {
  --lamp: 1.1rem;
  display: grid;
  gap: 2.25rem;
  margin-top: 0.5rem;
}

.flow-node {
  position: relative;
  display: grid;
  gap: 0.35rem;
  align-content: start;
  justify-items: start;
  padding-left: 3.4rem;
  min-height: 3rem;
}

/* The rail, drawn as its own line so it can run down the side on phones and across the top on wide screens. */
.flow-node::before {
  content: '';
  position: absolute;
  left: 1.2rem;
  top: 0;
  bottom: -2.25rem;
  width: var(--rule);
  background: var(--ink);
}

.flow-node:last-child::before {
  bottom: auto;
  height: 1rem;
}

.flow-node b {
  font-weight: 600;
  font-size: 1.1em;
  letter-spacing: 0.02em;
}

.flow-lamp,
.flow-ring {
  position: absolute;
  left: 1.2rem;
  top: 0.15rem;
  translate: -50% 0;
  background: var(--ground);
}

.flow-lamp {
  width: var(--lamp);
  height: var(--lamp);
  border: var(--rule) solid var(--ink);
  border-radius: 50%;
  transition: background-color 0.2s ease-out;
}

.flow-node.is-on .flow-lamp {
  background: var(--signal);
}

.flow-ring {
  top: -0.35rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  overflow: visible;
}

.flow-ring > circle {
  fill: var(--ground);
  stroke: var(--ink);
  stroke-width: 3.5;
}

.flow-token {
  transform-origin: 60px 60px;
}

.flow-token circle {
  fill: var(--signal);
  stroke: var(--ink);
  stroke-width: 3.5;
}

.flow-loop li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  transition: color 0.2s ease-out;
}

.flow-loop li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.45rem;
  height: var(--rule);
  background: currentColor;
}

.flow-loop li.is-on {
  color: var(--ink);
  font-weight: 600;
}

.flow-approve {
  display: none;
  margin-top: 0.5rem;
  padding: 0.5rem 1.1rem;
  border: var(--rule) solid var(--ink);
  background: var(--signal);
  color: var(--ink);
  font: 600 0.9375rem/1 inherit;
  font-family: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.16s ease-out, opacity 0.2s ease-out;
}

.flow-approve:disabled {
  background: none;
  opacity: 0.45;
  cursor: default;
}

.flow-approve:not(:disabled):hover {
  background: #ffd08a;
}

.flow-xp {
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.25s ease-out;
}

.flow-node.is-on .flow-xp {
  opacity: 1;
}

/* The diagram only plays, and only asks for a click, when motion is allowed (scenes.js adds .motion). */
.motion .flow-approve {
  display: inline-block;
}

@media (min-width: 900px) {
  .flow {
    grid-template-columns: 1fr 1.35fr 1.15fr 1fr;
    gap: 0;
    margin-top: 1.5rem;
  }

  .flow-node {
    padding: 3.6rem 2rem 0 0;
  }

  .flow-node::before {
    left: 0;
    right: 0;
    top: 1.2rem;
    bottom: auto;
    width: auto;
    height: var(--rule);
  }

  .flow-node:last-child::before {
    right: auto;
    width: 1rem;
    height: var(--rule);
  }

  .flow-lamp,
  .flow-ring {
    left: 0;
    top: 1.2rem;
    translate: 0 -50%;
  }
}

/* ── One day: four bands. Shadow, low sun, then full sun twice. ───────────────────────────────────────────────────────── */
.day-head {
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

.day-head h2,
.day-head p {
  max-width: 84rem;
  margin-inline: auto;
}

.day-head p {
  max-width: 34em;
  margin-inline: 0;
}

@media (min-width: 1464px) {
  .day-head p {
    margin-left: calc((100% - 84rem) / 2);
  }
}

.day-bands {
  overflow: clip; /* the sliding shadow must never widen the page */
}

.band {
  position: relative;
  display: grid;
  gap: 0.9rem 3rem;
  padding: clamp(2.75rem, 6vw, 5rem) max(var(--gutter), calc((100% - 84rem) / 2));
  overflow: clip;
}

@media (min-width: 900px) {
  .band {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: baseline;
  }
}

.band-time {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.9rem;
  font-size: clamp(2.2rem, 1.3rem + 3.6vw, 4.25rem);
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
}

.band-time span {
  font-size: 1.0625rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.5;
  text-transform: none;
}

.band-time .band-word {
  font-size: 0.62em;
  font-weight: 500;
  letter-spacing: 0.045em;
  line-height: 1.05;
  text-transform: uppercase;
}

.band h3 {
  margin-bottom: 0.5rem;
  font-size: 1.3em;
  font-weight: 600;
  line-height: 1.25;
}

.band p {
  max-width: 34em;
  text-wrap: pretty;
}

.band-night {
  background: var(--shadow);
  color: var(--dust);
  padding-bottom: calc(clamp(2.75rem, 6vw, 5rem) + 4vw);
}

.band-night .band-time span {
  color: var(--dust-soft);
}

.band-dawn {
  background: var(--dawn);
  overflow: visible;
}

/* The edge of the shadow: hard and slanted, the way it falls on the Moon. */
.band-dawn::before {
  content: '';
  position: absolute;
  inset: -4vw 0 auto;
  height: calc(4vw + 1px);
  background: var(--dawn);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

/* The night still lying on the dawn band. scenes.js slides it away as you scroll; without motion it is simply not there. */
.band-shade {
  display: none;
  position: absolute;
  inset: -4vw -30% 0 0;
  z-index: 1;
  background: var(--shadow);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 14% 100%);
}

.motion .band-shade {
  display: block;
}

.band-sun {
  background:
    linear-gradient(rgb(203 200 193 / 0.8), rgb(203 200 193 / 0.8)),
    var(--ground) url('/assets/img/ground.webp') 0 0 / 512px;
}

.band-sun + .band-sun {
  padding-top: 0;
}

/* ── The game: a strip of film ───────────────────────────────────────────────────────────────────────────────────────── */
.game {
  padding-bottom: 0;
}

.film {
  display: grid;
  gap: 1rem;
  margin: clamp(3rem, 6vw, 5rem) calc(var(--gutter) * -1) 0;
  padding: 1.25rem var(--gutter) 1.5rem;
  background: #060607;
  color: var(--dust);
}

.frame img {
  width: 100%;
  height: auto;
}

.frame p {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.2rem 1rem;
  padding-top: 0.6rem;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.frame p span + span {
  color: var(--dust-soft);
}

@media (min-width: 900px) {
  .game {
    overflow: clip;
  }

  .film {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    width: calc(112% + var(--gutter) * 2);
    margin-left: calc(-6% - var(--gutter));
    padding-inline: calc(6% + var(--gutter));
  }
}

/* ── Made by humans: the plaque ──────────────────────────────────────────────────────────────────────────────────────── */
.plaque {
  --glint: 30%;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1.1rem;
  width: 100%;
  max-width: 35rem;
  aspect-ratio: 8 / 5;
  padding: 1.5rem;
  border-radius: 3px;
  color: #1b1c1f;
  text-align: center;
  background:
    radial-gradient(circle at 1.1rem 1.1rem, #6d6f74 0 0.22rem, transparent 0.24rem),
    radial-gradient(circle at calc(100% - 1.1rem) 1.1rem, #6d6f74 0 0.22rem, transparent 0.24rem),
    radial-gradient(circle at 1.1rem calc(100% - 1.1rem), #6d6f74 0 0.22rem, transparent 0.24rem),
    radial-gradient(circle at calc(100% - 1.1rem) calc(100% - 1.1rem), #6d6f74 0 0.22rem, transparent 0.24rem),
    linear-gradient(104deg, transparent calc(var(--glint) - 22%), rgb(255 255 255 / 0.75) var(--glint), transparent calc(var(--glint) + 22%)),
    linear-gradient(180deg, #dcdddf, #b7b9be 46%, #c9cacd 56%, #a6a8ad);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9), inset 0 -1px 0 rgb(0 0 0 / 0.25), 0 1.4rem 2.2rem -1.3rem rgb(0 0 0 / 0.75);
}

.plaque img {
  width: clamp(2.6rem, 7vw, 3.75rem);
  filter: brightness(0.12);
}

.plaque-main {
  font-size: clamp(1.05rem, 0.7rem + 1.9vw, 1.75rem);
  letter-spacing: 0.14em;
  line-height: 1.35;
}

.plaque-main span,
.plaque-small span {
  display: block;
}

.plaque-small {
  font-size: clamp(0.7rem, 0.55rem + 0.7vw, 0.875rem);
  letter-spacing: 0.2em;
  line-height: 1.7;
  text-transform: uppercase;
}

/* ── Questions ───────────────────────────────────────────────────────────────────────────────────────────────────────── */
.faq-list details {
  border-top: var(--rule) solid var(--ink);
}

.faq-list details:last-child {
  border-bottom: var(--rule) solid var(--ink);
}

.faq-list summary {
  position: relative;
  padding: 1.1rem 3rem 1.1rem 0;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

/* The same registration cross, used as the plus sign. It turns into a × when the answer is open. */
.faq-list summary::after {
  content: '';
  position: absolute;
  right: 0.2rem;
  top: 50%;
  width: 21px;
  height: 21px;
  margin-top: -10.5px;
  background: var(--cross) center no-repeat;
  transition: rotate 0.3s var(--arrive);
}

.faq-list details[open] summary::after {
  rotate: 45deg;
}

.faq-list details p {
  max-width: 36em;
  padding: 0 0 1.4rem;
  text-wrap: pretty;
}

.last-call {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  max-width: 84rem;
  margin: clamp(3.5rem, 8vw, 6rem) auto 0;
  font-size: 1.3em;
  font-weight: 500;
}

.last-call .go:hover {
  background: var(--ink);
  color: var(--ground);
}

.last-call .go:focus-visible {
  outline-color: var(--ink);
}

/* ── Footer: in the shadow of the base ───────────────────────────────────────────────────────────────────────────────── */
.foot {
  display: grid;
  gap: 1.1rem;
  padding: clamp(2.5rem, 6vw, 4rem) var(--gutter) 3rem;
  background: var(--shadow);
  color: var(--dust-soft);
  font-size: 0.9375rem;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  color: var(--dust);
}

.foot-credits {
  max-width: 36em;
  text-wrap: pretty;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
