/* Modal Diagnostics journey page. Builds on ../styles.css (brand tokens, header, doors, contact).
   Each .scene is a tall section with a sticky stage; a canvas scrubs a frame sequence by scroll. */

.journey { background: var(--md-matte); }
.journey .site-header { background: rgba(12, 22, 34, 0.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom-color: rgba(229, 235, 240, 0.12); }
.journey .site-header .brand-name { color: var(--md-white); }
.journey .site-header .nav-list a { color: var(--md-silver); }
.journey .site-header .nav-list a:hover { color: var(--md-white); }
.journey .site-header :focus-visible { outline-color: var(--md-blue); }

.journey-progress { height: 2px; background: transparent; }
.journey-progress span { display: block; height: 100%; width: 100%; background: var(--md-blue); transform-origin: 0 50%; transform: scaleX(0); }

.scene { position: relative; height: 300vh; background: var(--md-matte); color: var(--md-white); }
.scene-long { height: 520vh; }
.scene-mid { height: 400vh; }
.scene-stage { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; }
.scene-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 400ms ease; }
.scene.has-frames .scene-canvas { opacity: 1; }

/* Clean placeholder for a slot whose footage has not arrived: flat field and one quiet bore ring */
.scene-placeholder { position: absolute; inset: 0; display: grid; place-items: center; background: var(--md-matte); transition: opacity 400ms ease; }
.scene.has-frames .scene-placeholder { opacity: 0; }
.ring { width: min(56vh, 70vw); aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(229, 235, 240, 0.14); box-shadow: inset 0 0 0 28px rgba(0, 16, 39, 0.55), inset 0 0 0 29px rgba(229, 235, 240, 0.08); transform: scale(var(--ring-scale, 1)); }

/* Shade keeps copy readable over footage */
.scene-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(12, 22, 34, 0.86) 0%, rgba(12, 22, 34, 0.25) 45%, rgba(12, 22, 34, 0.35) 100%); opacity: 0; }
.scene-shade-side { background: linear-gradient(to top, rgba(12, 22, 34, 0.88) 0%, rgba(12, 22, 34, 0.2) 42%, rgba(12, 22, 34, 0) 60%); }
.scene.has-frames .scene-shade { opacity: 1; }

.scene-copy { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding-top: calc(var(--header-h) + 32px); padding-bottom: 96px; pointer-events: none; }
.scene-long .scene-title { font-size: 40px; line-height: 44px; max-width: 16ch; }
.scene-long .scene-sub { max-width: 30ch; }
.nb { white-space: nowrap; }
.scene-chapter { margin-bottom: 24px; }
.scene-lines { display: grid; }
.scene-line { grid-area: 1 / 1; align-self: end; opacity: 0; will-change: opacity, transform; }
.scene-line h1, .scene-title { font-size: 56px; line-height: 60px; font-weight: 700; letter-spacing: -0.02em; color: var(--md-white); max-width: 14ch; text-wrap: balance; margin: 0; }
.scene-sub, .scene-line .tagline { font-size: 18px; line-height: 28px; color: var(--md-silver); margin-top: 16px; max-width: 40ch; }

.scroll-hint { position: absolute; left: 0; right: 0; bottom: 32px; text-align: center; transition: opacity 300ms ease; }
.render-note { position: absolute; right: var(--gutter); bottom: 24px; color: var(--md-silver); opacity: 0.8; }

/* Brand band: the master artwork, whole */
.mark-band { background: var(--md-matte); color: var(--md-white); padding-block: 96px; border-top: 1px solid rgba(229, 235, 240, 0.12); }
.mark-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 48px; }
.mark-grid .hero-art-frame { max-width: 440px; justify-self: start; }
.mark-line { font-size: 32px; line-height: 38px; font-weight: 700; letter-spacing: -0.01em; margin-top: 16px; max-width: 16ch; text-wrap: balance; }

.journey .doors { background: var(--md-white); }
.door-grid-flush { margin-top: 0; }

@media (max-width: 860px) {
  .scene-line h1, .scene-title { font-size: 40px; line-height: 44px; }
  .scene-copy { padding-bottom: 80px; }
  .scene-long .scene-title { font-size: 32px; line-height: 38px; }
  .scene-shade-side { background: linear-gradient(to top, rgba(12, 22, 34, 0.9) 0%, rgba(12, 22, 34, 0.3) 50%, rgba(12, 22, 34, 0) 100%); }
  .mark-grid { grid-template-columns: 1fr; gap: 24px; }
  .mark-grid .hero-art-frame { justify-self: center; max-width: 360px; }
  .render-note { left: var(--gutter); right: auto; bottom: 20px; }
}

/* Reduced motion: no scrub. Each scene is one still screen with its copy shown. */
@media (prefers-reduced-motion: reduce) {
  .scene, .scene-long, .scene-mid { height: auto; }
  .scene-stage { position: relative; height: auto; min-height: 100vh; min-height: 100dvh; }
  .scene-copy { position: relative; min-height: 100vh; min-height: 100dvh; }
  .scene-lines { gap: 40px; }
  .scene-line { grid-area: auto; opacity: 1 !important; transform: none !important; }
  .scene-canvas, .scene-placeholder, .scene-shade { transition: none; }
  .scroll-hint, .motion-only { display: none; }
  /* All of a scene's copy shows at once here, so the still needs a full side shade behind it. */
  .scene-long .scene-shade { background: linear-gradient(to right, rgba(12, 22, 34, 0.94) 0%, rgba(12, 22, 34, 0.86) 38%, rgba(12, 22, 34, 0) 68%); }
}
@media (prefers-reduced-motion: reduce) and (max-width: 860px) {
  .scene-long .scene-shade { background: rgba(12, 22, 34, 0.8); }
}

/* Teardown cue on the move chapters: the system, apart, in a quiet circular frame */
.cue { position: absolute; right: var(--gutter); top: calc(var(--header-h) + 24px); margin: 0; display: grid; justify-items: center; gap: 8px; opacity: 0; transition: opacity 400ms ease; }
.scene.has-frames .cue { opacity: 1; }
.cue img { width: 136px; height: 136px; border-radius: 50%; object-fit: cover; object-position: 42% 50%; border: 1px solid rgba(229, 235, 240, 0.35); background: var(--md-matte); }
.cue figcaption { color: var(--md-white); text-shadow: 0 1px 8px rgba(0, 16, 39, 0.9); }
@media (max-width: 860px) { .cue img { width: 88px; height: 88px; } .cue figcaption { display: none; } }
@media (min-width: 1400px) { .cue { right: max(var(--gutter), calc((100vw - 1200px) / 2 + var(--gutter))); } }

/* Auto-scroll control: the page plays itself until the visitor takes over */
.autoscroll { position: fixed; right: var(--gutter); bottom: 56px; z-index: 6; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 16px; font: 400 12px/16px var(--md-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--md-white); background: rgba(12, 22, 34, 0.86); border: 1px solid rgba(229, 235, 240, 0.35); border-radius: var(--md-radius); cursor: pointer; transition: opacity 300ms ease, border-color 150ms ease, transform 100ms ease; }
.autoscroll[hidden] { display: none; }
.autoscroll:hover { border-color: var(--md-blue); }
.autoscroll:active { transform: translateY(1px); }
.autoscroll:focus-visible { outline: 3px solid var(--md-blue); outline-offset: 4px; }
.autoscroll.is-past { opacity: 0; pointer-events: none; }
.autoscroll-icon { width: 10px; height: 12px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.autoscroll.is-paused .autoscroll-icon { width: 0; height: 0; border: 0; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
@media (min-width: 1400px) { .autoscroll { right: max(var(--gutter), calc((100vw - 1200px) / 2 + var(--gutter))); } }
@media (max-width: 860px) { .autoscroll { bottom: 12px; right: 12px; width: 44px; padding: 0; justify-content: center; } .autoscroll-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }
@media (prefers-reduced-motion: reduce) { .autoscroll { display: none; } }
