/* The DOM anchor defines framing; camera and planar reflection share it. */
.stage-flow { --studio-height: max(100dvh, 640px); --story-logo-shift: 0; --studio-turn-degrees: 0; --studio-logo-scale: .7; }
.hero-studio { height: var(--studio-height); margin-bottom: calc(-1 * var(--studio-height)); background: radial-gradient(ellipse at 26% 55%, #102a3b, #030c13 72%); }
.stage-flow .hero { min-height: var(--studio-height); }
.hero-studio__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 220ms ease; }
.hero-studio[data-state="ready"] .hero-studio__canvas { opacity: 1; }
.hero-studio__anchor { position: absolute; left: 4%; top: 56%; width: 45%; aspect-ratio: 10.4 / 5.95; transform: translate(var(--story-logo-offset), -50%) scale(var(--studio-logo-scale)); }
/* No bitmap request during normal startup. CSS also works when scripts are disabled. */
.hero-studio__poster { position: absolute; inset: 0; }
.hero-studio__poster::before {
  position: absolute;
  left: 0;
  top: 56%;
  width: 53%;
  aspect-ratio: 1200 / 1067;
  transform: translate(var(--story-logo-offset), -47%) scale(var(--studio-logo-scale));
  mask-image: linear-gradient(transparent, #000 15%, #000 80%, transparent), linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-composite: intersect;
}
html:not(.studio-module) .hero-studio__poster::before,
.hero-studio[data-state="fallback"] .hero-studio__poster::before {
  content: "";
  background: url("/assets/hero-3d/poster.webp") center / contain no-repeat;
}
.hero-studio__shade { position: absolute; inset: 0; background: linear-gradient(90deg, transparent 35%, rgb(3 12 19 / .2) 60%, rgb(3 12 19 / .4)), linear-gradient(180deg, rgb(3 12 19 / .4), transparent 25%); }
.stage-flow .hero-content { left: 55%; width: min(570px, 41%); top: 49%; transform: translateY(-50%); }
.stage-flow .hero h1 { font-size: clamp(48px, 5.5vw, 88px); line-height: .98; white-space: normal; }
.stage-flow .hero-eyebrow { color: var(--primary); letter-spacing: .09em; font-size: 12px; }
.stage-flow .hero-lead { color: #becbd4; max-width: 510px; }
.stage-flow .hero-cta { left: 55%; top: calc(49% + 174px); bottom: auto; }
.stage-flow .hero-cta .button:first-child { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.stage-flow .hero-cta .button:first-child:hover { background: var(--primary-light); border-color: var(--primary-light); }
.stage-flow .hero-cta .button:last-child { background: rgb(5 18 27 / .3); border-color: var(--primary); color: var(--primary); backdrop-filter: blur(12px); }
.stage-flow .hero-cta .button:last-child:hover { border-color: var(--primary); color: var(--link-hover); }
.stage-flow:is([data-reveal-phase="running"], [data-reveal-phase="done"]) .hero-content-inner { animation: studio-copy-in 850ms cubic-bezier(.16,1,.3,1) both; }
.stage-flow:is([data-reveal-phase="running"], [data-reveal-phase="done"]) .hero-cta { animation: studio-copy-in 700ms 120ms cubic-bezier(.16,1,.3,1) both; }
@keyframes studio-copy-in { from { opacity: 0; transform: translateY(22px); filter: blur(7px); } to { opacity: 1; transform: none; filter: blur(0); } }
@media (min-width: 1800px) { .hero-studio__anchor { left: 5%; width: 43%; } .stage-flow .hero-content { width: 640px; } }
@media (max-width: 991px) and (min-height: 500px) {
 .stage-flow { --studio-height: max(100dvh, 760px); --story-logo-shift: 24; --story-logo-shift-max: 235; }
 .hero-studio__anchor { left: 9%; top: 65%; width: 82%; max-height: 37%; }
 .hero-studio__poster::before { top: 65%; width: 100%; }
 .hero-studio__shade { background: linear-gradient(180deg, rgb(3 12 19 / .4), transparent 45%); }
 .stage-flow .hero-content { top: calc(var(--header-height) + 30px); left: 28px; width: calc(100% - 56px); transform: none; }
 .stage-flow .hero h1 { font-size: clamp(42px, 7vw, 68px); }
 .stage-flow .hero-lead { max-width: 620px; margin-top: 16px; font-size: 15px; line-height: 1.45; }
 .stage-flow .hero-cta { top: auto; bottom: 48px; left: 28px; }
 .hero-scroll-indicator { bottom: 16px; }
}
@media (max-width: 480px) and (min-height: 500px) {
 .stage-flow { --studio-height: max(100dvh, 710px); }
 .stage-flow .hero-content { left: 22px; width: calc(100% - 44px); top: calc(var(--header-height) + 25px); }
 .stage-flow .hero h1 { font-size: clamp(40px, 11.8vw, 56px); }
 .stage-flow .hero-eyebrow { font-size: 10px; }
 .stage-flow .hero-lead { font-size: 14px; }
 .hero-studio__anchor { left: 5%; width: 90%; top: 65%; }
 .stage-flow .hero-cta { left: 22px; bottom: 51px; }
}
@media (max-height: 499px) {
 .stage-flow { --studio-height: 540px; --story-logo-shift: 0; }
 .hero-studio__anchor { width: 43%; left: 4%; top: 55%; }
 .stage-flow .hero-content { left: 52%; width: 44%; top: 47%; transform: translateY(-50%); }
 .stage-flow .hero h1 { font-size: 40px; }
 .stage-flow .hero-lead { font-size: 14px; line-height: 1.4; }
 .stage-flow .hero-cta { left: 52%; top: calc(47% + 135px); bottom: auto; }
}
@media (prefers-reduced-motion: reduce) {
 .stage-flow:is([data-reveal-phase="running"], [data-reveal-phase="done"]) .hero-content-inner, .stage-flow:is([data-reveal-phase="running"], [data-reveal-phase="done"]) .hero-cta { animation: none; }
 .hero-studio__canvas, .hero-studio__poster { transition: none; }
}

/* Keep copy hidden from the first paint until the first rendered 3D frame. */
html.studio-module .stage-flow:not([data-reveal-phase="running"]):not([data-reveal-phase="done"]) :is(.hero-content-inner, .hero-cta, .hero-scroll-indicator) { visibility: hidden; opacity: 0; animation: none; transform: translateY(22px); pointer-events: none; }

/* A sticky heading otherwise runs over the scrolling fact icons on phones. */
@media (max-width: 600px) {
 .stage-flow .facts-story__intro { position: relative; top: auto; padding-top: 32px; padding-bottom: 18px; }
 .stage-flow .fact-steps { margin-top: 0; }
}

/* Follow the facts layout: phone copy on the left, tablet and desktop copy on the right. */
@media (max-width: 991px) {
 .stage-flow { --studio-turn-degrees: -45; }
 .hero-studio__anchor { transform: translate(var(--story-logo-offset), -50%) scale(calc(var(--studio-logo-scale) * (1 - .38 * var(--studio-park, 0)))); }
}
@media (max-width: 767px) {
 .stage-flow .fact-steps { padding-left: var(--facts-content-inset); padding-right: 44%; }
}
@media (max-width: 767px) and (max-height: 499px) {
 .stage-flow { --story-logo-shift: 49; --story-logo-shift-max: 480; }
}
@media (min-width: 768px) and (max-width: 991px) {
 .stage-flow { --studio-turn-degrees: 45; --story-logo-shift: -24; }
}
/* In wide and short landscape layouts the logo already starts on the left. */
@media (min-width: 992px),
       (min-width: 768px) and (max-width: 991px) and (max-height: 499px) {
 .stage-flow { --studio-turn-degrees: 45; --story-logo-shift: -2; }
 .hero-studio__anchor { transform: translate(var(--story-logo-offset), -50%) scale(calc(var(--studio-logo-scale) * (1 - .12 * var(--studio-park, 0)))); }
}
