/* A shared stage; the object and the clipped window are separate layers. */
.hero:has(.motion-showcase) { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(24px, 3vw, 52px); }
.hero:has(.motion-showcase) h1 { font-size: clamp(48px, 5.5vw, 88px); line-height: 1.04; letter-spacing: -.055em; }
.motion-showcase { position: relative; min-width: 0; align-self: center; padding-block: 18px 6px; }
.motion-projects { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; position: relative; z-index: 12; }
.motion-projects button { border: 0; background: transparent; border-radius: 20px; color: var(--muted); padding: 10px 13px; font-size: 14px; min-height: 44px; cursor: pointer; white-space: nowrap; }
.motion-projects button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.motion-projects button:hover { box-shadow: inset 0 0 0 1px var(--line); }
.motion-stage { position: relative; width: 100%; height: clamp(390px, 36vw, 505px); isolation: isolate; --motion-accent: #ffb870; perspective: 900px; touch-action: pan-y; }
.motion-window { position: absolute; inset: 40px 24px 56px; overflow: hidden; border-radius: 24px; background: radial-gradient(ellipse at 50% 95%, #394969, #17283b 45%, #091626 95%); border: 1px solid #61788c; box-shadow: 0 30px 65px -25px #182d5370; }
.motion-window::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(125deg, #ffffff12, transparent 40%); }
.motion-window-bar { position: absolute; inset: 0 0 auto; padding: 15px 18px; display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #d9e8ee; font-size: 12px; z-index: 4; }
.motion-window-bar span:last-child { color: #abc0d1; }
.motion-grid { position: absolute; inset: 0; background-image: linear-gradient(#9db9d512 1px, transparent 1px), linear-gradient(90deg, #9db9d512 1px, transparent 1px); background-size: 40px 40px; mask-image: linear-gradient(transparent, #000); }
.motion-front-frame { position: absolute; inset: 40px 24px 56px; border: 2px solid #adc6d869; border-radius: 24px; pointer-events: none; z-index: 3; box-shadow: inset 0 0 0 5px #0a18222b; }
.motion-launch-light { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at 50% 90%, #ffcd8eaa, #ffb45633 25%, transparent 55%); }
.motion-rocket-rig { display: none; position: absolute; top: 50%; left: 50%; height: 89%; aspect-ratio: 2 / 3; transform: translate(-50%, -50%) scale(.75); transform-origin: center; z-index: 2; will-change: transform; pointer-events: none; }
.motion-rocket-rig > img { height: 100%; width: 100%; max-width: none; object-fit: contain; position: relative; filter: drop-shadow(8px 10px 10px #02081850); }
.motion-exhaust { position: absolute; width: 18%; height: 44%; top: 94%; left: 41%; transform-origin: center top; background: url('./assets/smoke.png') center / cover; filter: sepia(1) saturate(5) brightness(2.2); mix-blend-mode: screen; mask-image: radial-gradient(ellipse at 50% 0, #000 10%, #0009 35%, transparent 68%); opacity: 0; }
.motion-rocket-world { position: absolute; max-width: none; width: 140%; left: -20%; bottom: -45%; opacity: .15; pointer-events: none; mask-image: radial-gradient(ellipse, #000 35%, transparent 72%); }
.motion-smoke { position: absolute; width: 100%; max-width: none; bottom: -16%; left: 0; pointer-events: none; z-index: 4; opacity: 0; mask-image: radial-gradient(ellipse, #000 15%, #000b 39%, transparent 68%); }
.motion-smoke-back { z-index: 1; width: 86%; bottom: -5%; left: 7%; }
.motion-stage:not([data-scene="rocket"]) .motion-smoke,
.motion-stage:not([data-scene="rocket"]) .motion-launch-light,
.motion-stage:not([data-scene="rocket"]) .motion-rocket-world { display: none; }
.motion-stage[data-scene="rocket"] .motion-rocket-rig { display: block; }
.motion-stage[data-scene="rocket"] .motion-window { background: radial-gradient(ellipse at 50% 90%, #4a5364, #23354d 42%, #0b1b30); }
.motion-flight-object { display: none; position: absolute; inset: 0; width: 108%; left: -4%; align-items: center; justify-content: center; z-index: 4; transform: scale(.6); will-change: transform; pointer-events: none; filter: drop-shadow(0 20px 14px #020a175c); }
.motion-flight-object img { width: 100%; max-width: none; height: auto; }
.motion-stage[data-scene="flight"] .motion-flight-object { display: flex; }
.motion-stage[data-scene="flight"] .motion-window { background: radial-gradient(ellipse at 50% 68%, #7a9cae, #243d5a 53%, #12253b); }
.motion-aircraft-picker { display: none; position: absolute; bottom: 66px; left: 50%; transform: translateX(-50%); gap: 4px; padding: 4px; z-index: 10; border: 1px solid #b9d3e83b; border-radius: 22px; background: #0d2037d9; }
.motion-stage[data-scene="flight"] .motion-aircraft-picker { display: flex; }
.motion-aircraft-picker button { border: 0; color: #c6d6e3; font-size: 13px; background: transparent; min-width: 72px; min-height: 36px; border-radius: 18px; cursor: pointer; }
.motion-aircraft-picker button[aria-pressed="true"] { background: #eff6fa; color: #17283b; }
.motion-gl { position: absolute; inset: 0; z-index: 5; pointer-events: none; visibility: hidden; }
.motion-stage[data-gl-ready="pet"] .motion-gl, .motion-stage[data-gl-ready="globe"] .motion-gl { visibility: visible; }
.motion-gl canvas { width: 100%; height: 100%; display: block; }
.motion-stage:not([data-scene="globe"]):not([data-scene="pet"]) .motion-gl { visibility: hidden; }
.motion-pet-window { display: none; position: absolute; inset: 50px 10% 20%; padding: 18px 22px; border: 1px solid #ffffff36; border-radius: 14px; color: #fff7ed; background: #ffffff0a; }
.motion-pet-window > span { font-size: 13px; }
.motion-pet-window p { font-size: clamp(22px, 2.4vw, 34px); font-weight: 600; line-height: 1.4; letter-spacing: -.025em; margin: 16px 0; }
.motion-pet-window > div { font-size: 13px; color: #e6cdb5; }
.motion-stage[data-scene="pet"] .motion-window { background: radial-gradient(ellipse at 70% 100%, #ba8f61, #604933 65%, #342d28); }
.motion-stage[data-scene="pet"] .motion-pet-window { display: block; }
.motion-perch { display: none; position: absolute; right: 10%; bottom: 28px; color: var(--ink); border-bottom: 3px solid var(--ink); padding: 8px 18px 12px; font-size: 14px; font-weight: 600; z-index: 1; }
.motion-stage[data-scene="pet"] .motion-perch { display: block; }
.motion-map-poster { display: none; position: absolute; inset: 20% 7%; opacity: .6; }
.motion-map-poster img { width: 100%; height: 100%; object-fit: contain; }
.motion-stage[data-scene="globe"] .motion-map-poster { display: block; }
.motion-stage[data-gl-ready="globe"] .motion-map-poster { visibility: hidden; }
.motion-stage[data-scene="globe"] .motion-window { background: radial-gradient(ellipse at center, #13343c, #06191f 80%); }
.motion-map-credit { display: none; position: absolute; bottom: 66px; left: 42px; font-size: 12px; color: #b9d8d4; z-index: 6; }
.motion-stage[data-scene="globe"] .motion-map-credit { display: block; }
.motion-race-road { display: none; position: absolute; width: 100%; height: 100%; image-rendering: pixelated; }
.motion-race-car { display: none; position: absolute; width: 21%; height: auto; bottom: 10%; left: 48%; image-rendering: pixelated; transform-origin: center bottom; z-index: 5; pointer-events: none; }
.motion-stage[data-scene="racer"] .motion-race-road,
.motion-stage[data-scene="racer"] .motion-race-car { display: block; }
.motion-stage[data-scene="racer"] .motion-window-bar { background: linear-gradient(#152131bd, transparent); }
.motion-controls { position: relative; z-index: 11; display: flex; align-items: center; gap: 10px; padding: 0 24px; }
.motion-controls button { min-height: 42px; padding: 9px 15px; border-radius: 22px; cursor: pointer; font-size: 14px; }
.motion-play { color: var(--white); background: var(--ink); border: 1px solid var(--ink); min-width: 68px; }
.motion-replay { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.motion-progress { flex: 1; min-width: 24px; display: flex; }
.motion-progress input { accent-color: var(--blue); width: 100%; height: 36px; margin: 0; cursor: pointer; }
.motion-controls output { color: var(--muted); font-size: 12px; width: 32px; font-variant-numeric: tabular-nums; }
.motion-caption { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 22px 24px 0; }
.motion-caption h2 { font-size: clamp(22px, 2vw, 28px); line-height: 1.3; margin: 0 0 8px; letter-spacing: -.03em; }
.motion-caption p { font-size: 14px; color: var(--muted); margin: 0; max-width: 26em; line-height: 1.65; }
.motion-caption > a { flex: 0 0 auto; font-size: 14px; line-height: 1.6; text-underline-offset: 5px; padding-block: 3px; }
.motion-message { color: var(--muted); font-size: 13px; line-height: 1.5; min-height: 20px; margin: 12px 24px 0; }
.motion-message:empty { margin-block: 0; min-height: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.motion-showcase button:focus-visible, .motion-showcase input:focus-visible, .motion-caption a:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.motion-stage[data-reduced-motion="true"] .motion-flight-object,
.motion-stage[data-reduced-motion="true"] .motion-rocket-rig { will-change: auto; }
.flight-lab-plane { transform: translate3d(var(--flight-x, 0px), var(--flight-y, 0px), 0) scale(var(--flight-scale, 1)) rotate(var(--flight-bank, 0deg)); transition: none; }
.flight-lab-model:hover .flight-lab-plane, .flight-lab-model:focus-visible .flight-lab-plane { transform: translate3d(var(--flight-x, 0px), var(--flight-y, 0px), 0) scale(var(--flight-scale, 1)) rotate(var(--flight-bank, 0deg)); }
@media (max-width: 1100px) {
  .hero:has(.motion-showcase) { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 20px; }
  .motion-stage { height: 390px; }
  .motion-projects button { padding-inline: 9px; font-size: 14px; }
  .motion-caption { display: block; }
  .motion-caption > a { display: inline-block; margin-top: 12px; }
}
@media (max-width: 850px) {
  .hero:has(.motion-showcase) { grid-template-columns: 1fr; padding-top: 32px; gap: 16px; }
  .hero:has(.motion-showcase) h1 { max-width: 650px; font-size: clamp(44px, 8vw, 70px); margin-block: 20px; }
  .hero:has(.motion-showcase) .hero-lead { max-width: 600px; }
  .hero:has(.motion-showcase) .hero-proof { display: none; }
  .motion-showcase { width: min(100%, 620px); margin-inline: auto; padding-block: 0 16px; }
  .motion-stage { height: clamp(355px, 69vw, 490px); }
  .motion-caption { display: flex; }
  .motion-caption > a { margin-top: 0; }
  .motion-pet-window p { font-size: 28px; }
}
@media (max-width: 480px) {
  .motion-projects { justify-content: flex-start; gap: 1px; }
  .motion-projects button { padding: 8px 9px; font-size: 14px; }
  .motion-stage { height: 350px; }
  .motion-window, .motion-front-frame { inset: 36px 8px 52px; border-radius: 18px; }
  .motion-controls { padding-inline: 4px; gap: 7px; }
  .motion-caption { margin-inline: 4px; display: block; }
  .motion-caption > a { margin-top: 12px; }
  .motion-message { margin-inline: 4px; }
  .motion-pet-window { padding: 15px; inset: 48px 8% 16%; }
  .motion-pet-window p { font-size: 23px; margin-block: 12px; }
  .motion-map-credit { left: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .motion-stage *, .motion-stage *::before, .motion-stage *::after { transition: none !important; animation: none !important; }
}
