:root {
  --ink: #e8efff;
  --ink-muted: #b7c4e4;
  --card: rgba(8, 11, 21, 0.65);
  --border: rgba(170, 190, 233, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  color: var(--ink);
  background: #04060f;
  font-family: "Inter", sans-serif;
}

.story-builder {
  position: relative;
  z-index: 2;
}

.story-builder-section {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding:
    max(calc(var(--chrome-top) + 36px), clamp(88px, 12vh, 132px))
    max(16px, env(safe-area-inset-right))
    max(calc(var(--safe-bottom) + 24px), clamp(32px, 6vh, 72px))
    max(16px, env(safe-area-inset-left));
}

.story-builder-section-intro {
  min-height: 100svh;
  align-items: start;
  padding-top: max(calc(var(--chrome-top) + 22px), clamp(66px, 8vh, 104px));
  padding-bottom: max(calc(var(--safe-bottom) + 12px), clamp(18px, 3.2vh, 40px));
}

.story-builder-parallax {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 22%, rgba(79, 131, 220, 0.16), transparent 34%),
    radial-gradient(circle at 76% 26%, rgba(255, 166, 102, 0.1), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.story-builder-inner {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 40%);
  gap: clamp(18px, 3vw, 36px);
  align-items: center;
}

.story-builder-section-intro .story-builder-inner {
  width: min(1780px, calc(100vw - 4px));
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-inline: auto;
  gap: 0;
}

.story-builder-intro-title {
  position: relative;
  z-index: 3;
  margin: 10px 0 clamp(-74px, -8vh, -28px);
  max-width: min(1400px, 94vw);
  padding-inline: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.8rem, 8vw, 7rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  color: #f5f8ff;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  text-wrap: balance;
}

.story-builder-hero-image {
  margin: clamp(-112px, -12vh, -34px) 0 0;
  width: 100%;
  display: grid;
  place-items: center;
}

.story-builder-hero-image img {
  width: min(100%, 2080px);
  height: auto;
  max-height: min(88vh, calc(100svh - 18px));
  object-fit: contain;
  object-position: center top;
  transform: scaleX(-1);
  filter: drop-shadow(0 20px 44px rgba(0, 0, 0, 0.42));
}

.story-builder-media,
.story-builder-card {
  min-height: clamp(260px, 58vh, 640px);
  border-radius: 22px;
  border: 1px dashed rgba(170, 190, 233, 0.22);
  background: rgba(8, 11, 21, 0.18);
  backdrop-filter: blur(4px);
}

.story-builder-card {
  min-height: clamp(220px, 42vh, 460px);
}

.story-builder-card-intro {
  position: relative;
  z-index: 2;
  width: min(1520px, calc(100vw - 12px));
  min-height: 0;
  padding: clamp(13px, 1.7vw, 22px);
  margin-top: clamp(-226px, -23vh, -108px);
  border-style: solid;
  border-color: rgba(170, 190, 233, 0.24);
  background: rgba(8, 11, 21, 0.62);
  backdrop-filter: blur(10px);
}

.story-builder-card-intro p {
  margin: 0;
  line-height: 1.44;
  color: #d6e2fb;
  font-size: clamp(0.9rem, 1vw, 1.03rem);
}

.story-builder-source-note {
  margin-top: 10px;
}

.story-builder-source-link {
  display: inline-flex;
  align-items: center;
  font-size: clamp(0.74rem, 0.88vw, 0.86rem);
  line-height: 1.35;
  color: rgba(212, 225, 255, 0.78);
  text-decoration: underline;
  text-decoration-thickness: 1.2px;
  text-underline-offset: 0.14em;
  transition: color 180ms ease;
}

.story-builder-source-link:hover {
  color: #f1f6ff;
}

.story-builder-section:nth-child(even) .story-builder-inner {
  grid-template-columns: minmax(320px, 40%) minmax(0, 1fr);
}

.story-builder-section:nth-child(even) .story-builder-media {
  order: 2;
}

.story-builder-section:nth-child(even) .story-builder-card {
  order: 1;
}

.story-builder-section-destroyed {
  overflow: hidden;
}

.story-builder-section-destroyed::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../assets/mriya-destroyed-2.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.story-builder-section-before-ruin {
  position: relative;
  min-height: 100svh;
  display: block;
  padding: 0;
  overflow: hidden;
  overflow: clip;
  z-index: 0;
  background: url("../assets/sky.jpg") center center / cover no-repeat;
}

.story-builder-section[data-section="4"] {
  position: relative;
  z-index: 1;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 18%, rgba(102, 144, 232, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(9, 18, 40, 0.94), rgba(5, 10, 22, 0.98));
}

.story-builder-section[data-section="4"] .story-builder-parallax {
  opacity: 0.45;
}

.site-footer {
  position: relative;
  z-index: 2;
  width: min(1180px, 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(220, 230, 249, 0.78);
}

.section-four-inner {
  grid-template-columns: minmax(0, 1fr) !important;
  width: min(1560px, calc(100vw - 36px));
  margin-inline: auto;
  align-self: end;
  margin-bottom: max(calc(var(--safe-bottom) + 18px), clamp(26px, 4.2vh, 64px));
  z-index: 2;
}

.section-four-card {
  width: min(1460px, 100%);
  margin: 0 auto;
  min-height: clamp(150px, 18vh, 220px);
  display: grid;
  align-items: center;
  padding: clamp(16px, 2.2vw, 26px) clamp(22px, 3vw, 34px);
  border-radius: 26px;
  border-color: rgba(173, 194, 236, 0.28);
  background:
    linear-gradient(118deg, rgba(36, 72, 140, 0.24), rgba(18, 30, 66, 0.08) 38%, rgba(38, 21, 34, 0.2) 100%),
    rgba(8, 13, 26, 0.74);
  box-shadow: 0 22px 68px rgba(0, 0, 0, 0.34);
}

.section-four-card h2 {
  margin: 0 0 14px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  line-height: 0.98;
  letter-spacing: 0.02em;
}

.section-four-card p {
  margin: 0;
  font-size: clamp(0.96rem, 1.08vw, 1.3rem);
  line-height: 1.46;
  color: #d8e4fb;
}

.section-four-card-panel {
  width: 100%;
}

.section-four-card-panel[hidden] {
  display: none;
}

.section-four-card-panel-help,
.section-four-card-panel-complete {
  display: grid;
  place-items: center;
  text-align: center;
}

.section-four-card-panel-complete {
  gap: 16px;
}

.section-four-help-text {
  max-width: 34ch;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.12rem, 2vw, 1.58rem);
  line-height: 1.28;
  color: #f4f7ff;
}

.section-four-complete-copy {
  max-width: 31ch;
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1rem, 1.7vw, 1.34rem);
  line-height: 1.32;
  color: rgba(235, 242, 255, 0.92);
}

.section-four-support-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(320px, 100%);
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid rgba(255, 245, 201, 0.46);
  background: linear-gradient(135deg, #ffe86f, #ffd047);
  color: #091018;
  text-decoration: none;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(0.92rem, 1.5vw, 1.08rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 18px 38px rgba(255, 214, 92, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.section-four-support-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 44px rgba(255, 214, 92, 0.36);
}

.section-four-support-link:focus-visible,
.section-four-assemble-button:focus-visible {
  outline: 2px solid rgba(255, 238, 120, 0.95);
  outline-offset: 3px;
}

.section-four-assemble-button {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(320px, calc(100vw - 44px));
  padding: 14px 24px;
  border: 1px solid rgba(255, 249, 198, 0.48);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 229, 111, 0.96), rgba(255, 199, 57, 0.94));
  color: #08111b;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(0.88rem, 1.3vw, 1rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 18px 40px rgba(255, 205, 58, 0.32);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.section-four-assemble-button:hover {
  transform: translate(-50%, calc(-50% - 1px));
  box-shadow: 0 22px 46px rgba(255, 205, 58, 0.4);
}

.section-four-assemble-button:disabled {
  cursor: default;
  opacity: 0.8;
  box-shadow: 0 14px 30px rgba(255, 205, 58, 0.2);
}

.section-four-assemble-button:disabled:hover {
  transform: translate(-50%, -50%);
  box-shadow: 0 14px 30px rgba(255, 205, 58, 0.2);
}

.section-four-assemble-button[hidden] {
  display: none;
}

.section-four-plane-visual {
  position: absolute;
  left: 0;
  top: clamp(82px, 14vh, 188px);
  width: 751px;
  height: 322px;
  margin: 0;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
  transform-origin: top left;
  transform: translate3d(calc(-100% - 8vw), 0, 0) scale(1);
  transition: opacity 180ms ease, visibility 180ms ease;
  will-change: transform;
}

.section-four-plane-base {
  position: relative;
  width: 751px;
  height: 322px;
  overflow: visible;
  transform: scaleX(1);
  transform-origin: center center;
  transition: transform 220ms ease-out;
  will-change: transform;
}

.section-four-plane-visual.is-mirrored .section-four-plane-base {
  transform: scaleX(-1);
}

.section-four-plane-part {
  position: absolute;
  display: block;
  max-width: none;
  height: auto;
  pointer-events: none;
}

.story-builder-section[data-section="4"].is-assembling .section-four-plane-visual {
  opacity: 0;
  visibility: hidden;
}

.section-four-assembly-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.section-four-assembly-layer[hidden] {
  display: none;
}

.section-four-price-layer {
  position: fixed;
  inset: 0;
  z-index: 11;
  pointer-events: none;
}

.section-four-price-popup {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 11;
  margin: 0;
  pointer-events: none;
  user-select: none;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.5rem, 6vw, 5.6rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.04em;
  white-space: nowrap;
  color: #ff4538;
  opacity: 0;
  transform: translate3d(0, 16px, 0) scale(0.94);
  text-shadow:
    0 0 18px rgba(255, 58, 38, 0.24),
    0 10px 28px rgba(0, 0, 0, 0.34);
  transition: opacity 140ms ease-out, transform 140ms ease-out;
  will-change: opacity, transform;
}

.section-four-price-popup.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.section-four-price-popup.is-leaving {
  opacity: 0;
  transform: translate3d(0, -14px, 0) scale(1.03);
}

.section-four-assembly-piece {
  position: fixed;
  left: 0;
  top: 0;
  max-width: none;
  pointer-events: none;
  user-select: none;
  touch-action: none;
  transform: translate3d(0, 0, 0);
  transform-origin: top left;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.2));
  will-change: transform, filter;
}

.section-four-assembly-piece.is-draggable {
  pointer-events: auto;
  cursor: grab;
}

.section-four-assembly-piece.is-dragging {
  cursor: grabbing;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.26));
}

.section-four-assembly-piece.is-near-target {
  filter:
    drop-shadow(0 0 12px rgba(255, 241, 84, 0.98))
    drop-shadow(0 0 28px rgba(255, 216, 58, 0.78))
    drop-shadow(0 14px 22px rgba(0, 0, 0, 0.24));
}

.section-four-assembly-piece.is-snapped {
  pointer-events: none;
}

.section-four-plane-part-right-wing {
  width: 238px;
  height: 262px;
  left: 200px;
  top: -1px;
  z-index: 80;
}

.section-four-plane-part-clouds {
  width: 420px;
  height: 79px;
  left: 191px;
  top: 218px;
  z-index: 70;
}

.section-four-plane-part-stage {
  width: 456px;
  height: 68px;
  left: 186px;
  top: 115px;
  z-index: 60;
}

.section-four-plane-part-supports {
  width: 407px;
  height: 97px;
  left: 210px;
  top: 170px;
  z-index: 50;
}

.section-four-plane-part-fuselage {
  width: 751px;
  height: 205px;
  left: 0;
  top: 70px;
  z-index: 40;
}

.section-four-plane-part-left-wing {
  width: 238px;
  height: 262px;
  left: 256px;
  top: -2px;
  z-index: 30;
}

.section-four-plane-part-wheel-base {
  width: 480px;
  height: 63px;
  left: 208px;
  top: 259px;
  z-index: 20;
}

.before-ruin-stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
  padding: clamp(88px, 11vh, 132px) 0;
}

.before-ruin-stage::before,
.before-ruin-stage::after {
  content: "";
  position: absolute;
  inset: 0;
}

.before-ruin-stage::before {
  background: linear-gradient(180deg, rgba(3, 8, 18, 0.1), rgba(3, 8, 18, 0.42));
}

.before-ruin-stage::after {
  background:
    radial-gradient(circle at 24% 26%, rgba(255, 255, 255, 0.16), transparent 26%),
    radial-gradient(circle at 72% 34%, rgba(173, 222, 255, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(4, 8, 16, 0.14), rgba(4, 8, 16, 0.38));
  pointer-events: none;
}

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

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

.story-sky {
  background: radial-gradient(circle at 22% 14%, #2e4b86 0%, #13223f 24%, #080f1e 50%, #03050b 100%);
}

.story-haze {
  background-image: radial-gradient(circle at 74% 30%, rgba(255, 160, 80, 0.2), transparent 42%),
    radial-gradient(circle at 30% 74%, rgba(82, 220, 255, 0.18), transparent 38%),
    radial-gradient(circle at 55% 45%, rgba(255, 255, 255, 0.08), transparent 52%);
  mix-blend-mode: screen;
  opacity: 0.85;
}

.before-plate,
.after-plate,
.wing-left,
.wing-right {
  display: grid;
  place-items: center;
}

.before-plate img,
.after-plate img,
.wing-left img,
.wing-right img {
  max-width: min(1200px, 86vw);
  max-height: 60vh;
  object-fit: contain;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.45));
}

.before-plate img,
.after-plate img {
  transform: translateY(9vh);
}

.before-plate {
  opacity: calc(1 - var(--memory-progress, 0));
}

.after-plate {
  opacity: calc(var(--memory-progress, 0) * (1 - var(--rebirth-progress, 0) * 0.35));
}

.after-plate img {
  width: min(1020px, 78vw);
  border-radius: 18px;
  border: 1px solid rgba(245, 176, 150, 0.35);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
}

.wing-left,
.wing-right {
  opacity: calc(var(--rebirth-progress, 0) * 1.1);
}

.wing-left {
  justify-items: start;
  align-items: start;
}

.wing-left img {
  width: min(760px, 56vw);
  transform: translate(-8vw, -14vh);
}

.wing-right {
  justify-items: end;
  align-items: end;
}

.wing-right img {
  width: min(880px, 60vw);
  transform: translate(7vw, 14vh);
}

.beam {
  mix-blend-mode: screen;
  opacity: calc(var(--rebirth-progress, 0) * 0.72);
}

.beam-left {
  background: linear-gradient(200deg, transparent 20%, rgba(114, 246, 255, 0.42) 45%, transparent 72%);
}

.beam-right {
  background: linear-gradient(160deg, transparent 24%, rgba(255, 125, 199, 0.37) 48%, transparent 72%);
}

.spark-dust {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.7) 1px, transparent 1.5px);
  background-size: 3px 3px;
  opacity: calc(var(--rebirth-progress, 0) * 0.16 + 0.03);
}

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

.noise {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 8;
  opacity: 0.06;
}

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

.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: 12;
  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: 12;
  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);
}

.story-hero {
  position: relative;
  z-index: 4;
  min-height: 100vh;
  padding: 14vh 20px 8vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 1100px;
  margin: 0 auto;
}

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

.story-hero h1 {
  margin: 12px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.2rem, 7vw, 5.4rem);
  line-height: 0.94;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  max-width: 12ch;
  text-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.hero-lede {
  margin: auto auto 0;
  max-width: 980px;
  padding: 14px 20px;
  font-size: clamp(1rem, 2.2vw, 1.28rem);
  line-height: 1.7;
  color: #d9e6ff;
  border: 1px solid rgba(181, 199, 236, 0.24);
  border-radius: 14px;
  background: rgba(8, 12, 22, 0.46);
  backdrop-filter: blur(8px);
}

.chapters {
  position: relative;
  z-index: 5;
  padding: min(92vh, 920px) 16px 2vh;
  display: grid;
  gap: min(40vh, 420px);
  max-width: 1100px;
  margin: 0 auto;
}

.chapter {
  min-height: 82vh;
  display: grid;
  align-items: center;
}

.chapter-before-ruin {
  position: relative;
}

.before-ruin-track {
  position: relative;
  z-index: 1;
  width: min(1020px, 84vw);
  margin-left: clamp(20px, 6vw, 88px);
  display: grid;
  gap: clamp(18px, 3vh, 28px);
  will-change: transform;
}

.chapter-before-ruin .chapter-card {
  position: relative;
  z-index: 2;
  width: min(680px, 100%);
}

.before-ruin-copy {
  background: rgba(8, 13, 26, 0.62);
}

.before-ruin-flight {
  position: relative;
  z-index: 1;
  margin: 0;
  pointer-events: none;
}

.before-ruin-flight img {
  display: block;
  width: min(980px, 84vw);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 20px 42px rgba(0, 0, 0, 0.4));
}

.chapter-card {
  border: 1px solid var(--border);
  background: var(--card);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 12px 55px rgba(0, 0, 0, 0.28);
}

.chapter-card h2 {
  margin: 0 0 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.35rem, 2.8vw, 2.15rem);
  letter-spacing: 0.02em;
}

.chapter-card p {
  margin: 0;
  line-height: 1.72;
  color: #d6e2fb;
}

.chapter-gallery {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.chapter-gallery img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(186, 204, 239, 0.32);
  object-fit: cover;
  min-height: 190px;
}

.chapter-gallery.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chapter-gallery.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.assembly-section {
  position: relative;
  z-index: 6;
  margin-top: 8vh;
  margin-bottom: 0;
}

.assembly-intro {
  margin-bottom: 8vh;
}

.assembly-scroll {
  position: relative;
  height: 150vh;
}

.assembly-sticky {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 6vh 0 0;
}

.assembly-canvas {
  position: relative;
  width: min(1200px, 92vw);
  aspect-ratio: 1530 / 1020;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(182, 202, 240, 0.26);
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.45);
  background: rgba(10, 16, 28, 0.6);
}

.assembly-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.assembly-part {
  position: absolute;
  opacity: 0.16;
  will-change: transform, opacity;
  transform-origin: center center;
  pointer-events: none;
}

.assembly-shadow {
  width: 87.5%;
  left: 6.9%;
  top: 70.6%;
  z-index: 1;
}

.assembly-wheels {
  width: 60%;
  left: 19.2%;
  top: 64.2%;
  z-index: 2;
}

.assembly-fuselage {
  width: 93.8%;
  left: 0.1%;
  top: 32%;
  z-index: 4;
}

.assembly-stage {
  width: 54.8%;
  left: 21.2%;
  top: 44.5%;
  z-index: 6;
}

.assembly-supports {
  width: 50.8%;
  left: 23.3%;
  top: 53.1%;
  z-index: 5;
}

.assembly-right-support {
  width: 1.69%;
  left: 73.2%;
  top: 52.7%;
  z-index: 7;
}

.assembly-left-wings {
  width: 29.8%;
  left: 16.4%;
  top: 25.2%;
  z-index: 3;
}

.assembly-right-wing {
  width: 29.9%;
  left: 24.5%;
  top: 25.2%;
  z-index: 8;
}

.assembly-clouds {
  width: 52.4%;
  left: 17.7%;
  top: 65.4%;
  z-index: 9;
}

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 48px, 0);
  transition: opacity 680ms ease, transform 680ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (max-width: 920px) {
  .story-builder-section {
    padding-top: max(calc(var(--chrome-top) + 28px), 92px);
  }

  .section-four-inner {
    width: min(100%, calc(100vw - 10px));
    margin-bottom: clamp(64px, 9vh, 108px);
  }

  .section-four-card {
    min-height: 148px;
    padding: clamp(16px, 4.4vw, 24px);
    border-radius: 20px;
  }

  .section-four-card h2 {
    margin-bottom: 10px;
    font-size: clamp(1.56rem, 6.1vw, 2.24rem);
  }

  .section-four-card p {
    font-size: clamp(0.94rem, 3vw, 1.14rem);
    line-height: 1.48;
  }

  .section-four-help-text {
    font-size: clamp(1rem, 4.4vw, 1.26rem);
    line-height: 1.34;
  }

  .section-four-support-link,
  .section-four-assemble-button {
    min-width: min(280px, calc(100vw - 32px));
    padding: 13px 20px;
    font-size: 0.84rem;
  }

  .section-four-plane-visual {
    top: clamp(74px, 13vh, 154px);
  }

  .story-builder-section-intro {
    min-height: 100svh;
    padding-top: 66px;
    padding-bottom: 12px;
  }

  .story-builder-inner,
  .story-builder-section:nth-child(even) .story-builder-inner {
    grid-template-columns: 1fr;
  }

  .story-builder-section-intro .story-builder-inner {
    width: min(100%, calc(100vw - 4px));
    gap: 0;
  }

  .story-builder-intro-title {
    margin-bottom: clamp(-30px, -4.2vh, -10px);
    max-width: min(96vw, 680px);
    letter-spacing: 0.03em;
  }

  .story-builder-hero-image {
    margin-top: -28px;
  }

  .story-builder-media,
  .story-builder-card,
  .story-builder-section:nth-child(even) .story-builder-media,
  .story-builder-section:nth-child(even) .story-builder-card {
    order: initial;
  }

  .story-builder-media {
    min-height: clamp(220px, 42vh, 420px);
  }

  .story-builder-card {
    min-height: clamp(180px, 30vh, 280px);
  }

  .story-builder-hero-image img {
    width: min(100%, 1440px);
    max-height: min(56vh, calc(100svh - 104px));
  }

  .story-builder-card-intro {
    width: min(100%, calc(100vw - 6px));
    min-height: 0;
    padding: clamp(11px, 3.1vw, 16px);
    margin-top: clamp(-74px, -9vh, -30px);
  }

  .story-builder-card-intro p {
    line-height: 1.38;
    font-size: clamp(0.84rem, 2.8vw, 0.94rem);
  }

  .story-builder-source-note {
    margin-top: 8px;
  }

  .story-builder-source-link {
    font-size: 0.72rem;
    line-height: 1.34;
  }

  .story-hero {
    padding-top: 17vh;
  }

  .before-plate img,
  .after-plate img,
  .wing-left img,
  .wing-right img {
    max-width: 108vw;
    max-height: 46vh;
  }

  .before-plate img,
  .after-plate img {
    transform: translateY(7vh);
  }

  .wing-left img {
    transform: translate(-20vw, -10vh);
  }

  .wing-right img {
    transform: translate(20vw, 10vh);
  }

  .chapters {
    gap: 28vh;
    padding-top: min(72vh, 680px);
    padding-bottom: 1vh;
  }

  .chapter {
    min-height: 72vh;
  }

  .chapter-before-ruin {
    min-height: 100svh;
  }

  .before-ruin-stage {
    padding: clamp(78px, 12vh, 112px) 0;
  }

  .before-ruin-track {
    width: min(92vw, 760px);
    margin-left: clamp(12px, 4vw, 28px);
    gap: 16px;
  }

  .before-ruin-flight img {
    width: min(92vw, 760px);
  }

  .chapter-before-ruin .chapter-card {
    width: min(100%, 92vw);
  }

  .chapter-gallery.two-up,
  .chapter-gallery.three-up {
    grid-template-columns: 1fr;
  }

  .assembly-scroll {
    height: 140vh;
  }

  .assembly-canvas {
    width: 98vw;
  }

  .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) {
  .section-four-plane-visual {
    top: clamp(48px, 9vh, 108px);
  }

  .section-four-inner {
    align-self: start;
    margin-top: clamp(220px, 30vh, 360px);
    margin-bottom: max(calc(var(--safe-bottom) + 12px), 12px);
  }

  .section-four-card {
    width: min(100%, calc(100vw - 20px));
  }

  .section-four-assembly-piece {
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.22));
  }
}

@media (max-width: 767px) {
  .story-builder-section {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-top: max(calc(var(--chrome-top) + 22px), 80px);
  }

  .story-builder-intro-title {
    font-size: clamp(2.1rem, 10.5vw, 3.5rem);
  }

  .story-builder-hero-image {
    margin-top: -12px;
  }

  .story-builder-card-intro {
    width: min(100%, calc(100vw - 10px));
    margin-top: clamp(-40px, -5vh, -16px);
    padding: 12px;
  }

  .story-builder-card-intro p {
    font-size: 0.88rem;
    line-height: 1.44;
  }

  .before-ruin-stage {
    padding: max(calc(var(--chrome-top) + 34px), clamp(72px, 12vh, 104px)) 0 max(calc(var(--safe-bottom) + 20px), 24px);
  }

  .before-ruin-track {
    width: min(96vw, 680px);
    margin-left: 8px;
    gap: 12px;
  }

  .before-ruin-flight img {
    width: min(96vw, 680px);
  }

  .chapter-before-ruin .chapter-card {
    width: min(100%, calc(100vw - 18px));
  }

  .section-four-plane-visual {
    top: clamp(28px, 7vh, 64px);
  }

  .section-four-inner {
    width: min(100%, calc(100vw - 8px));
    align-self: start;
    margin-top: clamp(210px, 32vh, 296px);
    margin-bottom: max(calc(var(--safe-bottom) + 12px), 12px);
  }

  .section-four-card {
    width: min(100%, calc(100vw - 8px));
    min-height: auto;
    padding: 14px 14px 16px;
    border-radius: 18px;
  }

  .section-four-card h2 {
    font-size: clamp(1.34rem, 7vw, 1.82rem);
  }

  .section-four-card p,
  .section-four-complete-copy {
    font-size: 0.94rem;
    line-height: 1.42;
  }

  .section-four-help-text {
    font-size: clamp(0.96rem, 4.6vw, 1.12rem);
  }

  .section-four-support-link,
  .section-four-assemble-button {
    min-width: min(100%, calc(100vw - 20px));
    padding: 12px 16px;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
  }

  .section-four-price-popup {
    font-size: clamp(1.9rem, 10vw, 3.3rem);
  }
}

@media (max-height: 740px) and (orientation: landscape) {
  .story-builder-section {
    padding-top: max(calc(var(--chrome-top) + 16px), 72px);
  }

  .story-builder-section-intro {
    padding-top: max(calc(var(--chrome-top) + 12px), 52px);
  }

  .story-builder-hero-image img {
    max-height: min(60svh, 380px);
  }

  .before-ruin-stage {
    padding-top: max(calc(var(--chrome-top) + 18px), 64px);
  }

  .section-four-plane-visual {
    top: clamp(8px, 4vh, 28px);
  }

  .section-four-inner {
    align-self: start;
    width: min(100%, calc(100vw - 28px));
    margin-top: clamp(168px, 46vh, 244px);
    margin-bottom: max(calc(var(--safe-bottom) + 8px), 8px);
  }

  .section-four-card {
    padding: 12px 14px 14px;
  }

  .section-four-card h2 {
    margin-bottom: 8px;
    font-size: clamp(1.2rem, 4.8vw, 1.8rem);
  }

  .section-four-card p,
  .section-four-complete-copy {
    font-size: 0.88rem;
    line-height: 1.34;
  }

  .section-four-help-text {
    font-size: clamp(0.9rem, 3.2vw, 1.04rem);
  }

  .section-four-support-link,
  .section-four-assemble-button {
    min-width: min(280px, calc(100vw - 24px));
    padding: 11px 14px;
    font-size: 0.76rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-layer,
  .before-ruin-flight img,
  [data-reveal] {
    transform: none !important;
    transition: none !important;
  }

  .section-four-plane-visual,
  .section-four-plane-base,
  .section-four-assemble-button,
  .section-four-support-link,
  .section-four-assembly-piece,
  .section-four-price-popup {
    transition: none !important;
  }
}
