:root {
  --bg-night: #060913;
  --bg-dawn: #2d4f8f;
  --ink: #e9f0ff;
  --ink-muted: #c0cce2;
  --card: rgba(7, 11, 22, 0.56);
  --border: rgba(197, 214, 255, 0.18);
  --accent-cyan: #5cf2d6;
  --accent-red: #ff5a6e;
  --home-day-plane-left: 0.6667%;
  --home-day-plane-top: 5%;
  --home-day-plane-width: 93.9583%;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: radial-gradient(circle at 22% 20%, #3f67a8 0%, #1b2b4f 36%, #060913 100%);
  font-family: "Inter", sans-serif;
}

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.layer {
  position: absolute;
  inset: -5%;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.sky.day {
  background: linear-gradient(180deg, #5f89d3 0%, #5f87cc 26%, #2e3854 74%, #0a0f19 100%);
  opacity: calc(1 - var(--night-progress, 0));
}

.sky.night {
  background: radial-gradient(circle at 76% 14%, #3c5da8 0%, #132547 22%, #070d1a 68%, #03050d 100%);
  opacity: calc(var(--night-progress, 0) * (1 - var(--final-progress, 0)));
}

.sky.finale {
  background: radial-gradient(circle at 48% 18%, rgba(255, 188, 120, 0.35), transparent 30%),
    radial-gradient(circle at 80% 26%, rgba(95, 255, 229, 0.18), transparent 34%),
    radial-gradient(circle at 20% 66%, rgba(255, 98, 126, 0.12), transparent 42%);
  opacity: var(--final-progress, 0);
}

.haze {
  background-image: radial-gradient(circle at 16% 62%, rgba(255, 255, 255, 0.17), transparent 42%),
    radial-gradient(circle at 84% 38%, rgba(122, 185, 255, 0.2), transparent 48%),
    radial-gradient(circle at 60% 82%, rgba(124, 140, 255, 0.09), transparent 54%);
  mix-blend-mode: screen;
  opacity: 0.8;
}

.image-wrap {
  display: grid;
  place-items: center;
  inset: 0;
}

.image-wrap > img {
  width: min(1200px, 90vw);
  max-height: 72vh;
  object-fit: contain;
  filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.45));
}

.home-day-composite {
  position: relative;
  width: min(1200px, 90vw, 108vh);
  width: min(1200px, 90vw, 108svh);
  max-width: 100%;
  aspect-ratio: 600 / 400;
  overflow: hidden;
  filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.home-day-background {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-day-plane {
  position: absolute;
  left: var(--home-day-plane-left);
  top: var(--home-day-plane-top);
  width: var(--home-day-plane-width);
  aspect-ratio: 751 / 322;
  margin: 0;
  overflow: visible;
}

.home-day-plane-base {
  position: relative;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.home-day-plane-part {
  position: absolute;
  display: block;
  max-width: none;
}

.home-day-plane-part-right-wing {
  width: 31.6911%;
  height: 81.3665%;
  left: 26.6312%;
  top: -0.3106%;
  z-index: 80;
}

.home-day-plane-part-clouds {
  width: 55.9254%;
  height: 24.5342%;
  left: 25.4328%;
  top: 67.7019%;
  z-index: 70;
}

.home-day-plane-part-stage {
  width: 60.7190%;
  height: 21.1180%;
  left: 24.7669%;
  top: 35.7143%;
  z-index: 60;
}

.home-day-plane-part-supports {
  width: 54.1944%;
  height: 30.1242%;
  left: 27.9630%;
  top: 52.7950%;
  z-index: 50;
}

.home-day-plane-part-fuselage {
  width: 100%;
  height: 63.6646%;
  left: 0;
  top: 21.7391%;
  z-index: 40;
}

.home-day-plane-part-left-wing {
  width: 31.6911%;
  height: 81.3665%;
  left: 34.0879%;
  top: -0.6211%;
  z-index: 30;
}

.home-day-plane-part-wheel-base {
  width: 63.9148%;
  height: 19.5652%;
  left: 27.6964%;
  top: 80.4348%;
  z-index: 20;
}

.day-image {
  opacity: calc((1 - var(--night-progress, 0)) * (1 - var(--final-progress, 0)));
}

.night-image {
  opacity: calc(var(--night-progress, 0) * (1 - var(--final-progress, 0)));
}

.finale-image {
  opacity: var(--final-progress, 0);
}

.neon-glow {
  background: radial-gradient(circle at 51% 58%, rgba(255, 70, 90, 0.36), transparent 30%),
    radial-gradient(circle at 45% 55%, rgba(76, 255, 217, 0.3), transparent 28%),
    radial-gradient(circle at 50% 60%, rgba(255, 255, 255, 0.08), transparent 42%);
  opacity: calc((var(--night-progress, 0) * (1 - var(--final-progress, 0) * 0.4)) * 1.1);
  mix-blend-mode: screen;
}

.finale-sparks {
  background-image: radial-gradient(circle, rgba(255, 223, 149, 0.66) 1px, transparent 1.5px);
  background-size: 4px 4px;
  opacity: calc(var(--final-progress, 0) * 0.24);
  mix-blend-mode: screen;
}

.grain {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.08;
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 46%, rgba(0, 0, 0, 0.52) 100%);
}

.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  padding:
    max(calc(var(--chrome-top) + 48px), 8vh)
    max(20px, env(safe-area-inset-right))
    max(calc(var(--safe-bottom) + 44px), 12vh)
    max(20px, env(safe-area-inset-left));
  pointer-events: none;
}

.menu-shell {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 10;
}

.menu-toggle {
  width: 56px;
  height: 56px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  background: rgba(6, 9, 19, 0.56);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease, background-color 200ms ease;
}

.menu-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(150, 197, 255, 0.42);
}

.menu-toggle-lines {
  width: 22px;
  display: grid;
  gap: 5px;
}

.menu-toggle-lines span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: #d8e4fb;
  transition: transform 220ms ease, opacity 220ms ease;
}

.menu-shell.is-open .menu-toggle-lines span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-shell.is-open .menu-toggle-lines span:nth-child(2) {
  opacity: 0;
}

.menu-shell.is-open .menu-toggle-lines span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  z-index: 10;
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(6, 9, 19, 0.72);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 200ms ease, transform 200ms ease, visibility 200ms ease;
}

.menu-shell.is-open .site-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.menu-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c4d2f2;
  transition: color 200ms ease, transform 200ms ease, background-color 200ms ease;
}

.menu-link:hover {
  color: #f4f8ff;
  transform: translateX(2px);
}

.menu-link.is-active {
  color: #05121d;
  background: linear-gradient(135deg, #84f3de, #96c5ff);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lang-switcher {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(6, 9, 19, 0.56);
  backdrop-filter: blur(8px);
}

.lang-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  min-width: 48px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c4d2f2;
  background: transparent;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.lang-btn:hover {
  color: #f4f8ff;
  transform: translateY(-1px);
}

.lang-btn.is-active {
  color: #05121d;
  background: linear-gradient(135deg, #84f3de, #96c5ff);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

h1 {
  margin: 10px 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.8rem, 8vw, 7rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.lede {
  margin: 0;
  max-width: 700px;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  color: #dde7fa;
}

.scroll-note {
  margin: 18px 0 0;
  font-size: 0.92rem;
  color: #a5b7d8;
}

main {
  position: relative;
  z-index: 3;
}

.story {
  padding:
    max(calc(var(--chrome-top) + 88px), 18vh)
    16px
    max(calc(var(--safe-bottom) + 120px), 30vh);
  display: grid;
  gap: min(52vh, 520px);
  max-width: 940px;
  margin: 0 auto;
}

.story-card {
  border: 1px solid var(--border);
  background: var(--card);
  backdrop-filter: blur(8px);
  border-radius: 18px;
  padding: 22px;
  min-height: 68vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.22);
  transform: translateY(calc(var(--night-progress, 0) * -6px));
  transition: transform 350ms ease;
}

.story-card h2 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0 0 10px;
  font-size: clamp(1.2rem, 2.6vw, 1.9rem);
  letter-spacing: 0.01em;
}

.story-card p {
  margin: 0;
  line-height: 1.68;
  color: #d5e0f8;
}

.story-card-with-media {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  align-items: center;
  gap: 28px;
}

.story-card-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.story-card-figure {
  position: relative;
  width: 100%;
  align-self: center;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.story-card-figure-button {
  appearance: none;
  display: block;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  perspective: 1400px;
  touch-action: manipulation;
}

.story-card-figure-button:focus-visible {
  outline: 3px solid rgba(132, 243, 222, 0.82);
  outline-offset: 4px;
}

.story-card-figure-rotor {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

.story-card-figure-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.story-card-figure-face-back {
  transform: rotateY(180deg);
}

.story-card-figure-sunset {
  max-width: 400px;
  justify-self: end;
  aspect-ratio: 1 / 1;
}

.story-card-figure-board {
  max-width: 420px;
  justify-self: end;
  aspect-ratio: 600 / 583;
}

.story-card-figure-lights {
  max-width: 380px;
  justify-self: end;
  aspect-ratio: 600 / 642;
}

.story-card-figure-blueprint {
  max-width: 420px;
  justify-self: end;
  aspect-ratio: 600 / 572;
}

.story-card-figure-workshop {
  max-width: 420px;
  justify-self: end;
  aspect-ratio: 600 / 562;
}

.story-card-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.story-card-figure-sunset img {
  object-position: right center;
  transform: scale(1.26);
  transform-origin: right center;
}

.story-card-figure-board img {
  object-fit: contain;
}

.story-card-figure-lights img {
  object-fit: contain;
}

.story-card-figure-blueprint img {
  object-fit: contain;
}

.story-card-figure-workshop img {
  object-fit: cover;
}

.story-card-link {
  margin-top: 18px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(150, 197, 255, 0.42);
  background: linear-gradient(135deg, rgba(132, 243, 222, 0.16), rgba(150, 197, 255, 0.14));
  color: #eef7ff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: transform 200ms ease, border-color 200ms ease, background-color 200ms ease, color 200ms ease;
}

.story-card-link:hover {
  transform: translateY(-1px);
  border-color: rgba(132, 243, 222, 0.62);
  background: linear-gradient(135deg, rgba(132, 243, 222, 0.24), rgba(150, 197, 255, 0.2));
  color: #ffffff;
}

@keyframes story-card-figure-spin {
  from {
    transform: rotateY(0deg);
  }

  to {
    transform: rotateY(var(--home-flip-deg, 1440deg));
  }
}

.story-card-figure-button.is-flipping .story-card-figure-rotor {
  animation: story-card-figure-spin var(--home-flip-duration, 1680ms) cubic-bezier(0.24, 0.68, 0.22, 1) both;
}

.site-footer {
  position: relative;
  z-index: 3;
  width: min(1040px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 0 0 max(22px, env(safe-area-inset-bottom));
}

.site-disclaimer {
  margin: 0;
  text-align: center;
  font-size: clamp(0.76rem, 1vw, 0.9rem);
  line-height: 1.48;
  color: rgba(233, 240, 255, 0.84);
}

@media (max-width: 820px) {
  .image-wrap img {
    width: 112vw;
    max-height: 58vh;
  }

  .hero {
    justify-content: flex-start;
    padding-top: 18vh;
  }

  .scroll-note {
    display: none;
  }

  .story {
    padding: 14vh 16px 24vh;
    gap: 30vh;
  }

  .story-card {
    min-height: 54vh;
  }

  .story-card-with-media {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .story-card-figure {
    max-width: none;
  }

  .story-card-figure-sunset,
  .story-card-figure-board,
  .story-card-figure-lights,
  .story-card-figure-blueprint,
  .story-card-figure-workshop {
    aspect-ratio: 1.35 / 1;
    justify-self: stretch;
  }

  .story-card-figure img {
    min-height: 0;
  }

  .site-footer {
    width: min(calc(100% - 20px), 100%);
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .site-disclaimer {
    font-size: 0.72rem;
    line-height: 1.42;
  }
}

@media (max-width: 1024px) {
  .image-wrap img {
    width: min(1220px, 98vw);
    max-height: min(66svh, 640px);
  }

  .hero {
    justify-content: flex-start;
    padding-top: max(calc(var(--chrome-top) + 56px), 16vh);
  }

  .story {
    gap: min(24vh, 240px);
    padding-top: max(calc(var(--chrome-top) + 72px), 14vh);
    padding-bottom: max(calc(var(--safe-bottom) + 84px), 20vh);
  }

  .story-card {
    min-height: auto;
    padding: clamp(18px, 3vw, 24px);
  }

  .story-card-with-media {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .story-card-copy,
  .story-card-figure {
    width: 100%;
  }

  .story-card-figure {
    max-width: none;
    justify-self: stretch;
  }

  .story-card-figure-sunset,
  .story-card-figure-board,
  .story-card-figure-lights,
  .story-card-figure-blueprint,
  .story-card-figure-workshop {
    max-width: none;
    aspect-ratio: 1.45 / 1;
  }
}

@media (max-width: 767px) {
  .image-wrap {
    place-items: end center;
    padding:
      max(calc(var(--chrome-top) + 96px), 16vh)
      0
      max(calc(var(--safe-bottom) + 18px), 6vh);
  }

  .image-wrap img {
    width: min(110vw, 760px);
    max-height: min(44svh, 340px);
  }

  .hero {
    min-height: 100vh;
    min-height: 100svh;
    justify-content: flex-start;
    padding-top: max(calc(var(--chrome-top) + 44px), 11vh);
    padding-bottom: max(calc(var(--safe-bottom) + 220px), 34svh);
  }

  .eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.15em;
  }

  h1 {
    margin-top: 6px;
    font-size: clamp(2.2rem, 12vw, 3.7rem);
  }

  .lede {
    max-width: 22rem;
    font-size: clamp(0.92rem, 4.2vw, 1.02rem);
    line-height: 1.48;
  }

  .scroll-note {
    margin-top: 14px;
    font-size: 0.82rem;
  }

  .story {
    padding-top: max(calc(var(--chrome-top) + 78px), 16vh);
    gap: min(18vh, 160px);
    padding-inline: 12px;
  }

  .story-card {
    border-radius: 16px;
    padding: 18px;
  }

  .story-card h2 {
    font-size: clamp(1.1rem, 5.3vw, 1.48rem);
  }

  .story-card p {
    line-height: 1.58;
    font-size: 0.95rem;
  }

  .story-card-link {
    width: 100%;
    justify-content: center;
  }
}

@media (max-height: 740px) and (orientation: landscape) {
  .image-wrap {
    place-items: end center;
    padding:
      calc(var(--chrome-top) + 16px)
      0
      max(calc(var(--safe-bottom) + 10px), 4vh);
  }

  .hero {
    min-height: 100vh;
    min-height: 100svh;
    justify-content: flex-start;
    padding-top: calc(var(--chrome-top) + 18px);
    padding-bottom: max(calc(var(--safe-bottom) + 124px), 34svh);
  }

  .image-wrap img {
    width: min(78vw, 620px);
    max-height: min(56svh, 250px);
  }

  h1 {
    font-size: clamp(2rem, 7vw, 3.4rem);
  }

  .lede {
    max-width: min(88vw, 860px);
    font-size: clamp(0.9rem, 2.6vw, 1.04rem);
    line-height: 1.42;
  }

  .story {
    padding-top: max(calc(var(--chrome-top) + 68px), 18vh);
    gap: min(16vh, 140px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .layer,
  .story-card {
    transition: none !important;
    transform: none !important;
  }
}
