/*
  The walk. Two characters, a human and an AI, stand at the bottom of the screen and walk from one
  section to the next. The layout rules apply only when js/journey.js adds "journey" to <html>
  (screens wider than 1180px). Otherwise the page is the stacked layout from board.css, and the
  pair appears once, at the end of the page.
*/

:root {
  --hill: #ebe6d9;
  --hill-2: #e3ddce;
  --duo-h: clamp(170px, 27vh, 250px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --hill: #141917;
    --hill-2: #181e1b;
  }
}

.frame {
  display: contents;
}

.wide-only,
.scene {
  display: none;
}

html.journey .wide-only {
  display: block;
}

/* ---------- The characters ---------- */

.duo {
  --hi: 0deg;
  /* human, inner arm */
  --ho: 0deg;
  /* human, outer arm */
  --ri: 0deg;
  /* robot, inner arm */
  --ro: 0deg;
  /* robot, outer arm */
  width: 270px;
  margin: 0.5rem auto 0;
}

.duo svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.shadow {
  fill: var(--ink);
  opacity: 0.12;
}

.ol {
  stroke: var(--ink);
  stroke-opacity: 0.35;
  stroke-width: 1;
}

.skin {
  fill: #f0b98a;
}

.hair {
  fill: #1c1c1e;
}

.shirt {
  fill: #34363c;
}

.shirt-d {
  fill: #f6f5f1;
}

.zip {
  fill: none;
  stroke: #b9bbbd;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.tee {
  display: none;
}

.cuff {
  fill: #34363c;
  display: none;
}

.button {
  fill: #34363c;
  display: none;
}

.pants {
  fill: #f4f2ec;
}

.shoe {
  fill: #17181a;
}

.glass {
  fill: none;
  stroke: #55585d;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.eye-white {
  fill: #fff;
}

.pupil {
  fill: #1c1c1e;
}

.brow {
  fill: none;
  stroke: #1c1c1e;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.nose {
  fill: none;
  stroke: #d99a6c;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.mouth {
  fill: #f0b98a;
  stroke: #f0b98a;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.suit {
  fill: #2a2c33;
}

.tie {
  fill: #2f9e55;
}

.metal {
  fill: #d5dbde;
}

.metal-d {
  fill: #9aa5ab;
}

.visor {
  fill: #1b2226;
}

.antenna {
  stroke: #9aa5ab;
  stroke-width: 3;
}

.glow {
  fill: #6fe08a;
}

.pulse {
  animation: pulse 1.8s ease-in-out infinite alternate;
}

.eyes {
  animation: blink 4.5s infinite;
}

/* Arms turn at the shoulder. The angles come from the pose. */
.arm {
  transition: transform 0.5s ease;
}

.h-in {
  transform: rotate(var(--hi));
}

.h-out {
  transform: rotate(var(--ho));
}

.r-in {
  transform: rotate(var(--ri));
}

.r-out {
  transform: rotate(var(--ro));
}

.person {
  animation: breathe 2.8s ease-in-out infinite alternate;
}

/* ---------- Poses ---------- */

/* Walking, and saying hello: hand in hand. */
.duo[data-pose="walk"],
.duo[data-pose="hello"] {
  --hi: -53deg;
  --ri: 53deg;
}

.duo[data-pose="hello"] .h-out {
  animation: wave-left 0.7s ease-in-out infinite alternate;
}

.duo[data-pose="hello"] .r-out {
  animation: wave-right 0.7s ease-in-out infinite alternate;
}

/* Both hold the rocket. */
.duo[data-pose="releases"] {
  --hi: -33deg;
  --ri: 33deg;
}

/* Both carry the crate. */
.duo[data-pose="shipped"] {
  --hi: -22deg;
  --ri: 22deg;
}

/* Both lift the trophy. */
.duo[data-pose="proof"] {
  --hi: -127deg;
  --ri: 127deg;
}

/* Both turn the gear. */
.duo[data-pose="builds"] {
  --hi: -30deg;
  --ri: 30deg;
}

/* High five. */
.duo[data-pose="contact"] {
  --hi: -127deg;
  --ri: 127deg;
  --ho: 150deg;
  --ro: -150deg;
}

.duo[data-pose="contact"] .person {
  animation: hop 0.55s ease-in-out infinite alternate;
}

.duo.walking .person {
  animation: hop-small 0.26s ease-in-out infinite alternate;
}

.duo.walking .leg.l,
.duo.walking .h-out {
  animation: swing 0.52s ease-in-out infinite alternate;
}

.duo.walking .leg.r,
.duo.walking .r-out {
  animation: swing 0.52s ease-in-out infinite alternate-reverse;
}

/* ---------- Props ---------- */

.prop {
  opacity: 0;
  transform: scale(0.5);
  transform-origin: 180px 150px;
  transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.duo[data-pose="releases"] .prop-releases,
.duo[data-pose="shipped"] .prop-shipped,
.duo[data-pose="proof"] .prop-proof,
.duo[data-pose="builds"] .prop-builds,
.duo[data-pose="contact"] .prop-contact {
  opacity: 1;
  transform: none;
}

.flame {
  fill: #f2a23a;
  transform-origin: 180px 160px;
  animation: flicker 0.18s ease-in-out infinite alternate;
}

.fin {
  fill: #d9634a;
}

.porthole {
  fill: #7fc4e8;
  stroke: #9aa5ab;
  stroke-width: 2;
}

.crate {
  fill: #c39a62;
}

.tape {
  fill: #e4c896;
}

.mark {
  fill: none;
  stroke: #5b4526;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gold {
  stroke: #d9a93a;
  stroke-width: 3;
}

.gold-fill {
  fill: #d9a93a;
}

.gear {
  transform-origin: 180px 140px;
  animation: spin 7s linear infinite;
}

.teeth {
  fill: none;
  stroke: #9aa5ab;
  stroke-width: 9;
  stroke-dasharray: 7 6.09;
}

.hole {
  fill: var(--paper);
}

.spark {
  fill: none;
  stroke: #d9a93a;
  stroke-width: 3;
  stroke-linecap: round;
  transform-origin: 180px 46px;
  animation: pop 0.55s ease-in-out infinite alternate;
}

@keyframes breathe {
  to {
    transform: translateY(-1.5px);
  }
}

@keyframes hop {
  to {
    transform: translateY(-7px);
  }
}

@keyframes hop-small {
  to {
    transform: translateY(-3px);
  }
}

@keyframes swing {
  from {
    transform: rotate(20deg);
  }

  to {
    transform: rotate(-20deg);
  }
}

@keyframes wave-left {
  from {
    transform: rotate(150deg);
  }

  to {
    transform: rotate(122deg);
  }
}

@keyframes wave-right {
  from {
    transform: rotate(-150deg);
  }

  to {
    transform: rotate(-122deg);
  }
}

@keyframes pulse {
  from {
    opacity: 0.55;
  }
}

@keyframes blink {

  0%,
  94%,
  100% {
    transform: scaleY(1);
  }

  97% {
    transform: scaleY(0.1);
  }
}

@keyframes flicker {
  to {
    transform: scaleY(0.7);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pop {
  from {
    transform: scale(0.75);
    opacity: 0.6;
  }
}

/* ---------- The walk layout (wide screens) ---------- */

html.journey body {
  height: 100dvh;
  overflow: hidden;
}

html.journey .top {
  position: relative;
  z-index: 5;
  background: var(--paper);
}

html.journey .status {
  display: none;
}

html.journey .frames {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.frames button {
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  background: none;
  color: var(--muted);
  font: 500 0.8rem/1 var(--sans);
  cursor: pointer;
}

.frames button:hover {
  color: var(--ink);
}

.frames button[aria-current="true"] {
  background: var(--ink);
  color: var(--paper);
}

html.journey .stage {
  position: fixed;
  inset: 57px 0 0 0;
  overflow: hidden;
}

/* The sections sit side by side. --i is the stop the pair is at; the whole row slides under them. */
html.journey .board {
  display: flex;
  gap: 0;
  width: max-content;
  max-width: none;
  height: 100%;
  margin: 0;
  padding: 0;
  transform: translateX(calc(var(--i, 0) * -100vw));
  transition: transform var(--walk, 1.5s) cubic-bezier(0.6, 0, 0.3, 1);
}

html.journey .frame {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-content: center;
  width: 100vw;
  height: calc(100% - var(--duo-h) - 56px);
  padding: 12px max(1.5rem, calc((100vw - 1400px) / 2)) 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

html.journey .row-title {
  margin-top: 0;
}

html.journey .contact {
  margin-top: 0;
  padding: 2.5rem 2.25rem;
}

html.journey .contact h2 {
  font-size: 3.2rem;
}

/* Hills and ground behind the pair. They slide slower than the sections, which gives depth. */
html.journey .scene {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hills,
.ground {
  position: absolute;
  left: 0;
  right: 0;
  transition: background-position var(--walk, 1.5s) cubic-bezier(0.6, 0, 0.3, 1);
}

.hills {
  bottom: calc(34px + var(--duo-h) * 0.125);
  height: 130px;
  background:
    radial-gradient(ellipse 50% 100% at 50% 100%, var(--hill-2) 99.5%, transparent 100%) calc(var(--i, 0) * -34vw) 100% / 420px 70px repeat-x,
    radial-gradient(ellipse 50% 100% at 50% 100%, var(--hill) 99.5%, transparent 100%) calc(var(--i, 0) * -18vw + 180px) 100% / 760px 125px repeat-x;
}

.ground {
  bottom: 0;
  height: calc(34px + var(--duo-h) * 0.125);
  border-top: 2px solid var(--before);
  background:
    linear-gradient(90deg, var(--before) 0 26px, transparent 26px) calc(var(--i, 0) * -100vw) 14px / 90px 2px repeat-x;
}

html.journey .duo {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 3;
  width: calc(var(--duo-h) * 1.5);
  margin: 0 0 0 calc(var(--duo-h) * -0.75);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {

  .duo *,
  .duo {
    animation: none !important;
  }

  html.journey .board,
  .hills,
  .ground {
    transition: none;
  }
}

/* ---------- The 3D scene (js/world3d.js) ---------- */

.world3d {
  display: none;
}

html.journey .world3d {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: calc(var(--duo-h) * 1.75 + 34px);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 38%);
  mask-image: linear-gradient(to bottom, transparent, #000 38%);
}

html.journey .board {
  position: relative;
  z-index: 2;
}

/* Once the 3D scene is drawing, the flat pair and the CSS hills step aside. */
html.journey.has3d .duo,
html.journey.has3d .scene {
  display: none;
}

/* ---------- The sky (wide screens): day in the light theme, night in the dark one ---------- */

:root {
  --sky-top: #cbe4f5;
  --sky-mid: #e1eff6;
  --sky-haze: #f3f1df;
  --cloud: #fff;
  --cloud-opacity: 0.92;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sky-top: #090e1b;
    --sky-mid: #0f1a2d;
    --sky-haze: #182a33;
    --cloud: #1b2942;
    --cloud-opacity: 1;
  }
}

.sky {
  display: none;
}

/* Deeper colour overhead, haze where the sky meets the hills. */
html.journey .stage {
  background: linear-gradient(to bottom,
      var(--sky-top) 0%,
      var(--sky-mid) calc(100% - var(--duo-h) * 2.3),
      var(--sky-haze) calc(100% - var(--duo-h) * 1.35),
      var(--sky-haze) 100%);
}

html.journey .sky {
  display: block;
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* With a sky behind it, the land needs only a short fade at its top edge. */
html.journey .world3d {
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%);
  mask-image: linear-gradient(to bottom, transparent, #000 14%);
}

.sun,
.moon {
  position: absolute;
  top: 30px;
  right: max(5.5rem, calc((100vw - 1400px) / 2 + 4rem));
  width: 62px;
  height: 62px;
  border-radius: 50%;
}

.cloud {
  position: absolute;
  width: var(--w);
  height: calc(var(--w) * 0.3);
  border-radius: 999px;
  background: var(--cloud);
  opacity: calc(var(--cloud-opacity) * var(--fade, 1));
  translate: calc(var(--i, 0) * var(--drift, -2vw)) 0;
  transition: translate var(--walk, 1.5s) cubic-bezier(0.6, 0, 0.3, 1);
  animation: cloud-float var(--float, 46s) ease-in-out infinite alternate;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: var(--cloud);
}

.cloud::before {
  left: 16%;
  bottom: 30%;
  width: 42%;
  aspect-ratio: 1;
}

.cloud::after {
  right: 15%;
  bottom: 36%;
  width: 30%;
  aspect-ratio: 1;
}

/* Three high clouds under the header, two low ones that drift behind the peaks. */
.cloud-1 { --w: 150px; top: 44px; left: 38%; --drift: -1.5vw; }
.cloud-2 { --w: 96px; top: 84px; left: 61%; --drift: -2.5vw; --float: 58s; --fade: 0.87; }
.cloud-3 { --w: 110px; top: 58px; left: 17%; --drift: -2vw; --float: 52s; --fade: 0.92; }
.cloud-4 { --w: 170px; bottom: calc(var(--duo-h) * 1.44); left: 9%; --drift: -3vw; --float: 64s; }
.cloud-5 { --w: 190px; bottom: calc(var(--duo-h) * 1.47); left: 70%; --drift: -3.5vw; --float: 70s; }

@keyframes cloud-float {
  to { transform: translateX(5vw); }
}

/* Day */

@media (prefers-color-scheme: light) {
  .moon,
  .stars,
  .shooting-star {
    display: none;
  }

  .sun {
    background: radial-gradient(circle at 42% 40%, #fffbe0, #ffe08a 62%, #ffcf63);
    box-shadow:
      0 0 0 13px rgba(255, 219, 120, 0.26),
      0 0 0 30px rgba(255, 219, 120, 0.13),
      0 0 110px 55px rgba(255, 226, 150, 0.5);
    animation: sun-glow 7s ease-in-out infinite alternate;
  }

  /* Rays: thin wedges around the sun, turning slowly. */
  .sun::before {
    content: "";
    position: absolute;
    inset: -58px;
    border-radius: 50%;
    background: repeating-conic-gradient(rgba(255, 214, 110, 0.4) 0deg 5deg, transparent 5deg 30deg);
    -webkit-mask-image: radial-gradient(circle, transparent 0 51px, #000 53px, transparent 86px);
    mask-image: radial-gradient(circle, transparent 0 51px, #000 53px, transparent 86px);
    animation: sun-turn 90s linear infinite;
  }
}

@keyframes sun-glow {
  to {
    box-shadow:
      0 0 0 16px rgba(255, 219, 120, 0.3),
      0 0 0 36px rgba(255, 219, 120, 0.15),
      0 0 130px 65px rgba(255, 226, 150, 0.58);
  }
}

@keyframes sun-turn {
  to { transform: rotate(360deg); }
}

/* Night */

@media (prefers-color-scheme: dark) {
  .sun {
    display: none;
  }

  /* Solid clouds, so the stars behind them do not show through. */
  .sky .cloud {
    --fade: 1;
  }

  /* A full moon: pale disc, three craters, a wide cool glow. */
  .moon {
    background:
      radial-gradient(circle at 32% 34%, rgba(160, 172, 196, 0.55) 0 5px, transparent 6px),
      radial-gradient(circle at 63% 58%, rgba(160, 172, 196, 0.5) 0 8px, transparent 9px),
      radial-gradient(circle at 40% 74%, rgba(160, 172, 196, 0.45) 0 4px, transparent 5px),
      radial-gradient(circle at 40% 36%, #fbfcff, #dfe6f3 70%, #c7d1e4);
    box-shadow:
      0 0 0 12px rgba(190, 210, 255, 0.07),
      0 0 0 28px rgba(190, 210, 255, 0.04),
      0 0 120px 50px rgba(150, 185, 255, 0.28);
    animation: moon-glow 8s ease-in-out infinite alternate;
  }

  /* Each layer is one dot; its box shadows are the stars. The two layers twinkle out of step. */
  .stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    animation: twinkle 3.4s ease-in-out infinite alternate;
  }

  .stars-1 {
    box-shadow:
      45.3vw 33.8vh 0 0 rgba(255, 244, 220, 0.74),
      85.1vw 11.8vh 0 0 rgba(255, 244, 220, 0.74),
      79.0vw 6.1vh 0 0 rgba(255, 244, 220, 0.59),
      63.3vw 35.9vh 0 0 rgba(255, 244, 220, 0.73),
      61.4vw 9.9vh 0 0.6px rgba(255, 255, 255, 0.76),
      4.0vw 52.8vh 0 0 rgba(214, 228, 255, 0.86),
      44.1vw 50.6vh 0 0 rgba(214, 228, 255, 0.81),
      1.0vw 5.6vh 0 0 rgba(255, 244, 220, 0.71),
      99.1vw 50.5vh 0 0 rgba(255, 255, 255, 0.68),
      51.3vw 2.3vh 0 0 rgba(255, 255, 255, 0.59),
      84.3vw 23.5vh 0 0 rgba(255, 255, 255, 0.89),
      21.6vw 55.7vh 0 0.6px rgba(255, 244, 220, 0.7),
      39.8vw 4.8vh 0 0 rgba(214, 228, 255, 0.86),
      33.9vw 19.0vh 0 0.6px rgba(255, 255, 255, 0.71),
      13.8vw 42.6vh 0 0.6px rgba(214, 228, 255, 0.74),
      18.1vw 33.8vh 0 0 rgba(255, 244, 220, 0.63),
      76.7vw 25.4vh 0 0 rgba(255, 255, 255, 0.71),
      0.5vw 51.9vh 0 0 rgba(255, 255, 255, 0.79),
      21.4vw 24.0vh 0 0 rgba(255, 255, 255, 0.81),
      4.7vw 9.2vh 0 0 rgba(255, 244, 220, 0.55),
      33.1vw 18.1vh 0 0.6px rgba(255, 244, 220, 0.59),
      63.5vw 1.4vh 0 0 rgba(255, 255, 255, 0.8),
      95.5vw 29.3vh 0 0 rgba(255, 255, 255, 0.9),
      62.6vw 19.0vh 0 0 rgba(255, 244, 220, 0.79),
      19.3vw 44.5vh 0 0 rgba(214, 228, 255, 0.63),
      87.8vw 36.4vh 0 0 rgba(255, 255, 255, 0.59),
      51.2vw 15.7vh 0 0 rgba(214, 228, 255, 0.71),
      82.0vw 36.0vh 0 0 rgba(255, 244, 220, 0.62),
      97.2vw 8.0vh 0 0 rgba(255, 244, 220, 0.81),
      61.3vw 17.2vh 0 0 rgba(255, 255, 255, 0.63),
      7.3vw 25.0vh 0 0 rgba(214, 228, 255, 0.57),
      37.0vw 34.5vh 0 0.6px rgba(214, 228, 255, 0.69),
      97.6vw 39.6vh 0 0 rgba(255, 255, 255, 0.78),
      58.9vw 55.5vh 0 0 rgba(214, 228, 255, 0.69),
      95.8vw 1.8vh 0 0 rgba(255, 244, 220, 0.74),
      31.3vw 8.6vh 0 0.6px rgba(214, 228, 255, 0.73),
      73.5vw 54.1vh 0 0 rgba(214, 228, 255, 0.83),
      35.3vw 41.3vh 0 0 rgba(214, 228, 255, 0.9),
      94.0vw 2.3vh 0 0 rgba(255, 244, 220, 0.56),
      38.4vw 35.2vh 0 0 rgba(255, 244, 220, 0.58),
      11.9vw 15.8vh 0 0 rgba(255, 244, 220, 0.68),
      69.2vw 27.7vh 0 0 rgba(255, 244, 220, 0.77),
      74.8vw 2.3vh 0 0 rgba(255, 255, 255, 0.74),
      95.3vw 7.2vh 0 0 rgba(214, 228, 255, 0.81),
      25.8vw 1.2vh 0 0 rgba(255, 255, 255, 0.82),
      51.8vw 45.3vh 0 0 rgba(214, 228, 255, 0.92),
      88.8vw 20.0vh 0 0 rgba(214, 228, 255, 0.63),
      80.1vw 45.4vh 0 0.6px rgba(255, 255, 255, 0.64);
  }

  .stars-2 {
    box-shadow:
      58.2vw 19.3vh 0 0.6px rgba(255, 255, 255, 0.75),
      70.9vw 57.0vh 0 0 rgba(214, 228, 255, 0.62),
      47.2vw 55.6vh 0 0 rgba(255, 244, 220, 0.7),
      49.4vw 19.3vh 0 0 rgba(214, 228, 255, 0.94),
      32.2vw 49.8vh 0 0 rgba(255, 244, 220, 0.79),
      70.7vw 34.4vh 0 0 rgba(255, 255, 255, 0.87),
      64.0vw 24.6vh 0 0.6px rgba(214, 228, 255, 0.86),
      24.0vw 8.9vh 0 0.6px rgba(214, 228, 255, 0.8),
      11.3vw 32.4vh 0 0 rgba(255, 255, 255, 0.7),
      68.3vw 12.4vh 0 0 rgba(255, 255, 255, 0.62),
      75.3vw 32.3vh 0 0.6px rgba(214, 228, 255, 0.64),
      53.9vw 56.8vh 0 0 rgba(255, 255, 255, 0.95),
      39.5vw 47.6vh 0 0 rgba(255, 244, 220, 0.58),
      38.9vw 27.3vh 0 0.6px rgba(255, 255, 255, 0.9),
      37.8vw 34.3vh 0 0 rgba(214, 228, 255, 0.87),
      46.4vw 39.3vh 0 0.6px rgba(255, 244, 220, 0.84),
      92.0vw 7.8vh 0 0 rgba(255, 255, 255, 0.71),
      97.3vw 32.4vh 0 0 rgba(255, 244, 220, 0.68),
      85.2vw 21.2vh 0 0.6px rgba(255, 244, 220, 0.73),
      42.2vw 16.9vh 0 0 rgba(255, 255, 255, 0.64),
      43.0vw 2.6vh 0 0 rgba(255, 255, 255, 0.82),
      47.1vw 60.0vh 0 0 rgba(255, 244, 220, 0.76),
      68.7vw 56.8vh 0 0 rgba(255, 255, 255, 0.93),
      75.5vw 26.6vh 0 0 rgba(255, 244, 220, 0.88),
      63.7vw 31.6vh 0 0 rgba(214, 228, 255, 0.77),
      67.0vw 57.3vh 0 0 rgba(214, 228, 255, 0.79),
      84.7vw 58.1vh 0 0 rgba(255, 255, 255, 0.78),
      41.2vw 7.3vh 0 0.6px rgba(255, 244, 220, 0.7),
      96.5vw 31.2vh 0 0 rgba(255, 244, 220, 0.87),
      12.6vw 6.0vh 0 0.6px rgba(214, 228, 255, 0.92),
      41.5vw 57.4vh 0 0 rgba(214, 228, 255, 0.66),
      49.3vw 20.7vh 0 0 rgba(214, 228, 255, 0.92),
      52.5vw 7.0vh 0 0 rgba(214, 228, 255, 0.56),
      13.3vw 46.9vh 0 0.6px rgba(255, 255, 255, 0.63),
      1.7vw 17.4vh 0 0 rgba(214, 228, 255, 0.65),
      10.9vw 44.0vh 0 0.6px rgba(214, 228, 255, 0.75),
      71.6vw 42.2vh 0 0 rgba(255, 244, 220, 0.56),
      41.4vw 32.0vh 0 0.6px rgba(255, 244, 220, 0.63);
    animation-duration: 5.1s;
    animation-delay: -2s;
  }

  /* Every so often a shooting star crosses under the header. */
  .shooting-star {
    position: absolute;
    top: 26px;
    left: 56%;
    width: 120px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(to left, transparent, rgba(255, 255, 255, 0.95));
    opacity: 0;
    animation: shoot 13s ease-in 4s infinite;
  }
}

@keyframes moon-glow {
  to {
    box-shadow:
      0 0 0 14px rgba(190, 210, 255, 0.09),
      0 0 0 32px rgba(190, 210, 255, 0.05),
      0 0 140px 60px rgba(150, 185, 255, 0.36);
  }
}

@keyframes twinkle {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

@keyframes shoot {
  0% { opacity: 0; transform: translate(0, 0) rotate(-19deg); }
  1% { opacity: 1; }
  6% { opacity: 0; transform: translate(-300px, 104px) rotate(-19deg); }
  100% { opacity: 0; transform: translate(-300px, 104px) rotate(-19deg); }
}

@media (prefers-reduced-motion: reduce) {
  .sun,
  .sun::before,
  .moon,
  .stars,
  .cloud {
    animation: none;
    transition: none;
  }

  .shooting-star {
    display: none;
  }
}

/* ---------- Narrow screens: the page scrolls, and the pair walks along in a band at the bottom ---------- */

:root {
  --band: min(34vh, 260px);
}

html.stroll body {
  padding-bottom: calc(var(--band) + 46px);
}

html.stroll body::after {
  content: "";
  position: fixed;
  inset: auto 0 0 0;
  z-index: 3;
  height: calc(var(--band) + 46px);
  background: linear-gradient(to bottom, transparent, var(--paper) 36%);
  pointer-events: none;
}

html.stroll .world3d {
  display: block;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 46px;
  z-index: 4;
  width: 100%;
  height: var(--band);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%);
  mask-image: linear-gradient(to bottom, transparent, #000 30%);
}

html.stroll.has3d .duo {
  display: none;
}

/* ---------- What to do next ---------- */

.js-only {
  display: none;
}

html.journey .js-only,
html.stroll .js-only {
  display: inline-block;
}

html.journey .guide,
html.stroll .guide {
  position: fixed;
  z-index: 6;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.18);
  white-space: nowrap;
}

.guide .btn {
  padding: 0.75rem 1.1rem;
  background: none;
  color: var(--ink);
  font-size: 0.9rem;
  cursor: pointer;
}

.guide .btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.guide .btn-next {
  padding-inline: 1.4rem;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
  font-weight: 600;
  animation: beckon 1.6s ease-out infinite;
}

/* The Next button pulses until the visitor has moved once. */
html.moved .guide .btn-next {
  animation: none;
}

@keyframes beckon {
  from {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent);
  }

  to {
    box-shadow: 0 0 0 16px transparent;
  }
}

.dots {
  display: flex;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dots button {
  display: block;
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--before);
  cursor: pointer;
}

.dots button[aria-current="true"] {
  background: var(--accent);
  transform: scale(1.35);
}

.guide-hint {
  padding-right: 0.9rem;
  font: 400 0.72rem/1 var(--mono);
  color: var(--muted);
}

html.stroll .guide {
  bottom: 10px;
  gap: 0.5rem;
}

html.stroll .guide-hint {
  display: none;
}

@media (max-width: 480px) {
  html.stroll .dots {
    display: none;
  }

  html.stroll .guide .btn {
    padding-inline: 0.9rem;
  }
}

/* A section is a scroll area, so the browser can focus it. It needs no focus ring of its own. */
html.journey .frame:focus,
html.journey .frame:focus-visible {
  outline: none;
}

/* ---------- Phone: a shorter band for the pair, and roles that open on tap ---------- */

@media (max-width: 760px) {
  :root {
    --band: 150px;
  }

  html.stroll body {
    padding-bottom: calc(var(--band) + 66px);
  }

  html.stroll body::after {
    height: calc(var(--band) + 66px);
    background: linear-gradient(to bottom, transparent, var(--paper) 22%);
  }

  html.stroll .world3d {
    bottom: 58px;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%);
    mask-image: linear-gradient(to bottom, transparent, #000 14%);
  }

  /* The bar spans the screen: Back on the left, the next step on the right */
  html.stroll .guide {
    left: 10px;
    right: 10px;
    bottom: 8px;
    transform: none;
    justify-content: space-between;
    box-shadow: none;
  }

  html.stroll .guide .btn-next {
    flex: 1;
    text-align: center;
  }

  /* The pair has no titles of its own to point at here, so every section shows its name */
  html.stroll .row-title.wide-only {
    display: block;
  }

  html.stroll #hello > .row-title {
    display: none;
  }

  /* Release history: each role shows one line; tapping it opens the details */
  html.stroll .tap-hint {
    display: inline;
    margin-left: 0.5rem;
    letter-spacing: 0;
    text-transform: none;
    color: var(--accent);
  }

  html.stroll .releases li {
    cursor: pointer;
  }

  html.stroll .releases li:not(.open) .notes {
    display: none;
  }

  html.stroll .releases h3::after {
    content: " +";
    font-weight: 400;
    color: var(--accent);
  }

  html.stroll .releases li.open h3::after {
    content: " −";
  }
}

/* The flat fallback pair runs too: the same steps, faster. */
.duo.walking.running .person {
  animation-duration: 0.16s;
}

.duo.walking.running .leg,
.duo.walking.running .h-out,
.duo.walking.running .r-out {
  animation-duration: 0.3s;
}
