/* RocketFlightIntro uses the parent theme's typography, palette and buttons. */
.section.rocket-flight-opening { padding-top: 2.5rem; padding-bottom: 2rem; }
.rocket-flight-back { display: block; width: fit-content; margin-bottom: 1rem; font-size: .9rem; }
.rocket-flight-opening h1 { margin: .35rem 0 .5rem; font-size: clamp(2rem, 4vw, 3.6rem); }
.rocket-flight-opening > .section-wrap > p { margin: 0 0 1.75rem; color: var(--l4c-muted); }
.rocket-flight { --flight-rocket-height: clamp(7.5rem, 11vw, 9rem); }
.rocket-flight button { font: inherit; cursor: pointer; }
.rocket-flight [hidden] { display: none !important; }
.rocket-flight :is(button, a):focus-visible,
.rocket-flight-lesson:focus { outline: 3px solid var(--l4c-purple); outline-offset: 5px; }
.rocket-flight button:disabled { cursor: default; }
.rocket-flight-scene {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(20rem, 32vw, 24rem);
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--l4c-border);
  border-radius: var(--l4c-radius);
  color: var(--l4c-ink);
  background: var(--l4c-white);
  text-align: left;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}
.flight-sprite > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.flight-sprite.has-sprite > .flight-sprite-fallback { display: none; }
.flight-landscape { position: absolute; inset: 0; pointer-events: none; }
.flight-landscape::before { position: absolute; inset: auto 0 0; height: 10%; content: ""; background: var(--l4c-green-soft); }
.flight-landscape > img { position: relative; object-fit: fill; }
.flight-pad { position: absolute; top: 89%; left: 10%; width: 8%; min-width: 2rem; height: .35rem; border-radius: 50%; background: var(--l4c-green-dark); }
.flight-vehicle {
  position: absolute;
  z-index: 2;
  left: var(--flight-x, 14%);
  top: calc(var(--flight-y, 75%) - var(--flight-rocket-height) / 2);
  width: calc(var(--flight-rocket-height) * .375);
  height: var(--flight-rocket-height);
  transform: translateX(-50%);
  pointer-events: none;
}
.flight-rocket { position: absolute; inset: 0; display: block; transform-origin: 50% 100%; transition: transform 1.7s ease-in-out, opacity .25s; }
.flight-body, .flight-nose { position: absolute; inset: 0; display: block; }
.flight-body { z-index: 1; }
.flight-nose { z-index: 0; transform-origin: 50% 13%; transition: transform 1.1s ease-in-out .15s; }
.flight-body-fallback { position: absolute; inset: 26% 0 0; background: #c7c9c5; clip-path: polygon(40% 0, 60% 0, 60% 70%, 100% 80%, 100% 98%, 60% 93%, 40% 93%, 0 98%, 0 80%, 40% 70%); }
.flight-nose-fallback { position: absolute; inset: 0 38% 73%; background: #df542c; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.flight-flame { position: absolute; top: 97%; left: -6%; width: 112%; height: 68%; opacity: 0; transform-origin: center top; transform: scaleY(.1); transition: opacity .2s, transform .3s; }
.flight-flame-fallback { display: block; width: 100%; height: 100%; border-radius: 40% 40% 70% 70%; background: linear-gradient(#f7e49a, #ef8a35 55%, transparent); }
.flight-chute { position: absolute; bottom: 75%; left: 50%; display: block; width: calc(var(--flight-rocket-height) * .95); height: calc(var(--flight-rocket-height) * 1.01); opacity: 0; transform: translateX(-50%) scale(.05); transform-origin: center bottom; transition: transform 1.2s ease-out .2s, opacity .3s .2s; }
.flight-chute-fallback { position: absolute; inset: 0; border-left: 1px solid #696855; border-right: 1px solid #696855; clip-path: polygon(0 0, 100% 0, 100% 45%, 50% 100%, 0 45%); }
.flight-chute-fallback::before { position: absolute; inset: 0 0 55%; border-radius: 100% 100% 0 0; content: ""; background: repeating-linear-gradient(90deg, #e74929 0 20%, #fff0ce 20% 40%); }
.flight-shock-cord { position: absolute; top: 26%; left: 50%; width: calc(var(--flight-rocket-height) * .53); height: calc(var(--flight-rocket-height) * .35); opacity: 0; transition: opacity .35s .15s; }
.flight-wind { position: absolute; top: 26%; left: 22%; width: 12%; min-width: 3.5rem; height: 20%; opacity: 0; transform: translateX(-1rem); transition: opacity .3s, transform 1s; }
.flight-wind .flight-sprite-fallback { color: #3387a2; font-size: 5rem; }
.flight-apogee-mark { position: absolute; top: var(--flight-y, 24%); left: calc(var(--flight-x, 50%) + var(--flight-rocket-height) * .55); width: 12%; border-top: 1px dashed var(--l4c-green); opacity: 0; transition: opacity .5s .5s; }
.flight-apogee-mark > span { position: absolute; right: 0; bottom: .3rem; font-size: .85rem; font-weight: 700; }
.flight-forces { position: absolute; top: calc(var(--flight-y, 75%) - var(--flight-rocket-height) / 2); left: calc(var(--flight-x, 14%) + var(--flight-rocket-height) * .35); display: flex; gap: 1.1rem; opacity: 0; transition: opacity .3s; pointer-events: none; }
.flight-force { position: relative; display: block; width: .65rem; border-radius: 2px; }
.flight-force::before { position: absolute; left: -.43rem; content: ""; border-right: .75rem solid transparent; border-left: .75rem solid transparent; }
.flight-force > span { position: absolute; left: 1.25rem; top: 1rem; white-space: nowrap; font-size: .85rem; font-weight: 700; }
.flight-force-thrust { height: calc(var(--flight-rocket-height) * .85); background: #ae4a19; }
.flight-force-thrust::before { top: -.8rem; border-bottom: 1rem solid #ae4a19; }
.flight-force-thrust > span { top: -1.6rem; left: -.8rem; color: #904018; }
.flight-force-weight { margin-top: calc(var(--flight-rocket-height) * .28); height: calc(var(--flight-rocket-height) * .48); background: var(--l4c-green-dark); }
.flight-force-weight::before { bottom: -.8rem; border-top: 1rem solid var(--l4c-green-dark); }
.flight-scene-prompt { position: absolute; z-index: 3; top: 1.15rem; left: 1.25rem; padding: .4rem .8rem; border: 1px solid var(--l4c-border); border-radius: 999px; background: rgb(255 255 255 / 94%); font-size: .85rem; font-weight: 700; }
.flight-scene-prompt { color: var(--l4c-ink); }
.flight-force-weight, .flight-apogee-mark { color: var(--l4c-green-dark); }
.flight-keyboard-hint { margin: .7rem 0 1rem; color: var(--l4c-muted); font-size: .8rem; }
.flight-progress { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: .8rem 0 1rem; padding: 0; list-style: none; }
.flight-progress li { position: relative; }
.flight-progress li + li::before { position: absolute; z-index: -1; top: 1.35rem; left: -50%; width: 100%; border-top: 1px solid var(--l4c-border); content: ""; }
.flight-progress button { display: flex; width: 100%; min-height: 3.2rem; flex-direction: column; align-items: center; gap: .35rem; padding: .2rem; border: 0; color: var(--l4c-muted); background: transparent; font-size: .85rem; }
.flight-step-number { display: grid; width: 2.2rem; height: 2.2rem; place-items: center; border: 1px solid var(--l4c-border); border-radius: 50%; background: var(--l4c-white); }
.flight-progress [aria-current="step"] { color: var(--l4c-green-dark); font-weight: 700; }
.flight-progress [aria-current="step"] .flight-step-number { border: 2px solid var(--l4c-green-dark); color: var(--l4c-white); background: var(--l4c-green-dark); outline: 3px solid var(--l4c-green-soft); outline-offset: 2px; }
.flight-progress .is-complete .flight-step-number { color: var(--l4c-green-dark); background: var(--l4c-green-soft); }
.flight-caption { max-width: 52rem; min-height: 7.5rem; }
.flight-caption [data-flight-title] { margin: .25rem 0 .4rem; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.flight-caption p { margin: 0; }
.flight-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.flight-navigation { display: flex; flex-wrap: wrap; gap: .65rem; }
.flight-navigation button:disabled { opacity: .5; transform: none; color: var(--l4c-muted); border-color: var(--l4c-border); background: transparent; }
.flight-complete { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--l4c-border); }
.flight-complete .button-row { margin-top: .75rem; }
.rocket-flight-lesson { scroll-margin-top: 8rem; }
.rocket-flight-lessons h3 { margin-top: 0; }
.rocket-flight-lessons > .section-wrap > p { margin-bottom: 2rem; }

.flight-trajectory { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.flight-path-guide, .flight-path-trail, .flight-arrow-head { fill: none; stroke: #287fa4; stroke-linecap: round; stroke-linejoin: round; }
.flight-path-guide { stroke-width: 1.5; stroke-dasharray: 4 7; opacity: .2; }
.flight-path-trail { stroke-width: 2.5; }
.flight-arrow-head { stroke-width: 1.5; }
[data-stage="ready"] .flight-trajectory { opacity: 0; }
.flight-history { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.flight-history-point { position: absolute; width: clamp(2.8rem, 5vw, 4rem); aspect-ratio: 1; transform: translate(-50%, -50%); border: 1.5px solid #287fa4; border-radius: 50%; background: rgb(255 255 255 / 96%); box-shadow: 0 2px 8px rgb(23 63 42 / 8%); }
.flight-history-model { position: absolute; inset: 12%; display: block; overflow: hidden; border-radius: 50%; }
.flight-history-rocket { position: absolute; top: 8%; left: 34%; width: 32%; height: 80%; }
.flight-history-chute { position: absolute; top: 1%; left: 18%; width: 64%; height: 55%; }
[data-model="recovery"] .flight-history-rocket { top: 50%; left: 42%; width: 18%; height: 45%; }
[data-model="apogee"] .flight-history-rocket { transform: rotate(90deg); }
.flight-history-number { position: absolute; right: -3px; bottom: -3px; display: grid; width: 1.15rem; height: 1.15rem; place-items: center; border-radius: 50%; background: var(--l4c-green-dark); color: white; font-size: .65rem; font-weight: 700; }
.flight-vehicle { z-index: 3; }

/* One persistent vehicle follows the parabola. Stage changes remain manual. */
[data-stage="launch"] .flight-forces { opacity: 1; }
:is([data-stage="launch"], [data-stage="flight"]) .flight-flame { opacity: 1; transform: scaleY(1); }
[data-stage="flight"] .flight-rocket { animation: flight-correct-disturbance 1.25s ease-out; }
[data-stage="flight"] .flight-wind { opacity: .85; transform: translateX(0); }
[data-stage="apogee"] .flight-rocket { transform-origin: center; transform: rotate(90deg); }
[data-stage="apogee"] .flight-apogee-mark { opacity: 1; }
:is([data-stage="recovery"], [data-stage="landing"]) .flight-chute { opacity: 1; transform: translateX(-50%) scale(1); }
:is([data-stage="recovery"], [data-stage="landing"]) .flight-nose { z-index: 2; transform: translate(calc(var(--flight-rocket-height) * .55), calc(var(--flight-rocket-height) * .45)) rotate(115deg); }
:is([data-stage="recovery"], [data-stage="landing"]) .flight-shock-cord { opacity: 1; }
[data-stage="landing"] .flight-rocket { transform: rotate(-78deg); transition-delay: 1.6s; }
[data-stage="landing"] .flight-nose { z-index: 2; transform: translate(calc(var(--flight-rocket-height) * .08), calc(var(--flight-rocket-height) * 1.1)) rotate(168deg); }
[data-stage="landing"] .flight-chute { transform: translate(-20%, 75%) scaleY(.12); transition-duration: 1.2s; transition-delay: 1.8s; }
[data-stage="landing"] .flight-shock-cord { top: 82%; left: calc(50% - var(--flight-rocket-height) * .72); width: calc(var(--flight-rocket-height) * .99); height: calc(var(--flight-rocket-height) * .18); border-right: 0; transition: top 1.4s 1.6s, left 1.4s 1.6s, width 1.4s 1.6s, height 1.4s 1.6s; }
@keyframes flight-correct-disturbance { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(13deg); } 55% { transform: rotate(-5deg); } 80% { transform: rotate(2deg); } }
@media (max-width: 600px) {
  .rocket-flight { --flight-rocket-height: 7.5rem; }
  .rocket-flight-scene { height: 24rem; }
  .flight-scene-prompt { left: .65rem; top: .65rem; font-size: .75rem; }
  .flight-force > span { font-size: .75rem; }
  .flight-force-weight > span { top: 1.3rem; }
  .flight-progress button { font-size: .7rem; }
  .flight-caption { min-height: 11rem; }
  .flight-actions { align-items: stretch; flex-direction: column; }
  .flight-navigation { display: grid; grid-template-columns: 1fr 1fr; }
  .flight-navigation .button { padding: .7rem .6rem; font-size: .85rem; }
  .flight-apogee-mark { width: 20%; }
  .flight-history-point { width: 2.2rem; }
  [data-stage="recovery"] .flight-scene-prompt { top: auto; bottom: .65rem; }
}
@media (prefers-reduced-motion: reduce) {
  .rocket-flight *, .rocket-flight *::before, .rocket-flight *::after { animation: none !important; transition: none !important; }
}

.flight-section-title { margin: 1.25rem 0 .65rem; font-size: 1.4rem; }
.flight-progress button { text-align: center; line-height: 1.3; }
.flight-topic-choices { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: 1.25rem 0 1.5rem; }
.flight-topic-choices > span { font-size: .85rem; color: var(--l4c-muted); margin-right: .25rem; }
.flight-topic-choices .button { min-height: 44px; padding: .45rem .8rem; font-size: .8rem; }
.flight-lesson-details { border-top: 1px solid var(--l4c-border); padding-top: 1rem; }
.flight-lesson-details summary { cursor: pointer; font-weight: 700; color: var(--l4c-green-dark); padding: .65rem .25rem; }
.flight-lesson-details > p { color: var(--l4c-muted); font-size: .9rem; }
.rocket-flight-lesson { padding: .25rem 0; border-bottom: 1px solid var(--l4c-border); scroll-margin-top: 6rem; }
.rocket-flight-lesson p { padding-inline: 1rem; }
.flight-lesson-details summary:focus-visible, .flight-topic-choices a:focus-visible { outline: 3px solid var(--l4c-purple); outline-offset: 3px; }

/* A stage opens the existing lesson directly below this flight instance. */
[data-flight-inline] > .flight-actions,[data-flight-topic] .flight-actions { justify-content:flex-end; }
.flight-inline-lessons { margin-top:32px; padding-top:30px; border-top:2px solid #507d2a; }
.flight-inline-status { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
/* Supplied artwork shares one launch position and one recovery coordinate frame. */
.flight-launch-rig { position:absolute; z-index:2; left:calc(var(--flight-pad-x, 14%) - var(--flight-rocket-height) * .264); top:calc(var(--flight-ground-y, 89%) - var(--flight-rocket-height) * 2); width:calc(var(--flight-rocket-height) * .5925); height:calc(var(--flight-rocket-height) * 2); transform:translateY(var(--flight-camera-y,0px)) scale(var(--flight-rail-scale,1)); transform-origin:44.6% 100%; pointer-events:none; }
[data-launch-phase="rail"] .flight-trajectory,[data-launch-phase="depart"] .flight-trajectory { opacity:0; }
[data-launch-phase="rail"] .flight-scene-prompt,[data-launch-phase="depart"] .flight-scene-prompt { left:auto; right:1rem; }
.flight-ready-illustration, .flight-standing-rail { position:absolute; inset:0; }
.flight-ready-illustration, .flight-standing-rail, .flight-launch-visual, .flight-apogee-visual, .flight-recovery-visual { display:none; }
[data-stage="ready"].has-ready-art .flight-ready-illustration,
.has-rail-art:not([data-stage="ready"]) .flight-standing-rail { display:block; }
.has-ready-art[data-stage="ready"] .flight-vehicle,
.has-ready-art .flight-pad { visibility:hidden; }
.flight-launch-visual { position:absolute; top:0; left:calc(50% - var(--flight-rocket-height) * .15); width:calc(var(--flight-rocket-height) * .896); height:calc(var(--flight-rocket-height) * 1.45); }
.has-launch-art[data-stage="launch"] .flight-launch-visual { display:block; }
.has-launch-art[data-stage="launch"] :is(.flight-rocket,.flight-forces) { visibility:hidden; }
.flight-apogee-visual { position:absolute; top:50%; left:50%; width:calc(var(--flight-rocket-height) * 1.05); height:calc(var(--flight-rocket-height) * .202); transform:translate(-50%,-50%); }
.has-apogee-updated-art[data-stage="apogee"] .flight-apogee-visual { display:block; }
.has-apogee-updated-art[data-stage="apogee"] .flight-rocket { visibility:hidden; }
.flight-stability-marker { position:absolute; z-index:4; left:50%; display:none; width:1rem; height:1rem; transform:translate(-50%,-50%); }
.flight-stability-marker>.flight-sprite { display:block; width:100%; height:100%; }
.flight-stability-marker b { position:absolute; top:-2px; left:calc(100% + 4px); padding:0 3px; border-radius:3px; color:#173f2a; background:rgb(255 255 255 / 95%); font-size:12px; line-height:20px; }
.flight-cg { top:50%; }
.flight-cp { top:76%; }
[data-stage="flight"] .flight-stability-marker { display:block; }
.flight-recovery-visual { position:absolute; left:calc(50% - var(--flight-rocket-height) * .50505 + var(--recovery-shift-x, 0px)); top:calc(50% - var(--flight-rocket-height) * .77441); width:calc(var(--flight-rocket-height) * 2.0202); height:calc(var(--flight-rocket-height) * 1.54882); }
.has-recovery-art[data-stage="recovery"] .flight-recovery-visual { display:block; }
.has-recovery-art[data-stage="recovery"] :is(.flight-rocket,.flight-chute,.flight-shock-cord) { visibility:hidden; }
.flight-landing-visual { display:none; position:absolute; left:calc(50% - var(--flight-rocket-height) * .50505); top:calc(50% - var(--flight-rocket-height) * .77441); width:calc(var(--flight-rocket-height) * 2.0202); height:calc(var(--flight-rocket-height) * 1.54882); overflow:visible; }
.flight-landing-visual>line { stroke:#1c2421; stroke-width:2.5; stroke-linecap:round; }
.has-landing-art[data-stage="landing"] .flight-landing-visual { display:block; }
.has-landing-art[data-stage="landing"] :is(.flight-rocket,.flight-chute,.flight-shock-cord) { visibility:hidden; }
.flight-recovery-label { position:absolute; z-index:4; bottom:1rem; left:1rem; display:none; padding:.35rem .65rem; border-radius:6px; color:#173f2a; background:rgb(255 255 255 / 96%); font-size:.8rem; font-weight:700; }
[data-stage="recovery"] .flight-recovery-label { display:block; }
[data-stage="ready"] .flight-scene-prompt { min-height:48px; display:flex; align-items:center; gap:.5rem; padding:.75rem 1.2rem; border:0; background:#507d2a; color:#fff; font-size:1.1rem; box-shadow:0 3px 10px rgb(23 63 42 / 20%); }
[data-stage="ready"] .rocket-flight-scene:hover .flight-scene-prompt { background:#34591c; }
@media(max-width:600px) {
 [data-stage="recovery"] .flight-scene-prompt { bottom:.65rem; right:.65rem; left:auto; }
 .flight-recovery-label { top:.65rem; bottom:auto; left:.65rem; font-size:.7rem; }
 [data-stage="ready"] .flight-scene-prompt { font-size:1rem; }
}
.flight-inline-hero { display:grid; grid-template-columns:1.1fr .9fr; align-items:center; gap:40px; margin-bottom:28px; }
.flight-inline-hero h2 { margin:0 0 14px; font-size:clamp(30px,3.5vw,42px); line-height:1.15; letter-spacing:-.02em; }
.flight-inline-hero .lesson-lead { margin:0; font-size:18px; }
.flight-inline-hero .lesson-figure { margin:0; }
.flight-inline-hero .lesson-figure img { height:220px; object-fit:contain; }
.flight-inline-lesson .lesson-section>h3 { font-size:26px; line-height:1.25; margin:0 0 18px; }
.flight-inline-lesson h4 { font-size:18px; line-height:1.35; margin:0 0 8px; color:#173f2a; }
.flight-inline-lesson :is([data-flight-lesson-title],[data-flight-section],details[id]) { scroll-margin-top:130px; }
@media(max-width:650px) {
 .flight-inline-hero { grid-template-columns:1fr; gap:22px; }
 .flight-inline-hero .lesson-figure img { height:190px; }
 .flight-inline-lessons { margin-top:24px; padding-top:24px; }
 .flight-inline-lesson .lesson-section>h3 { font-size:23px; }
}
