/* Same narrative and native scroll timeline as desktop, composed for a portrait viewport.
   JS measures these layouts before pinning; short screens and enlarged text keep the complete flow. */
.home-page [data-viewport-changing] :is(.journey-step, .journey-layer, .hs-track-panel, .hs-track-copy, .hs-flow-detail, .hs-gicus-shot) { transition: none !important; }
.home-page .journey-rail-short { display: none; }
/* Touch snap points for the held scenes' steps (home/sceneSteps.ts): invisible, never in the way,
   and a fling cannot pass one. */
.scene-stops { position: absolute; top: 0; left: 0; width: 1px; height: 0; pointer-events: none; }
.scene-stops > span { position: absolute; left: 0; width: 1px; height: 1px; opacity: 0; scroll-snap-align: start; scroll-snap-stop: always; }

@media (max-width: 1080px) and (min-height: 620px) and (prefers-reduced-motion: no-preference) {
  .home-page .home-opening[data-pinned="true"] { --opening-travel: 190svh; --opening-settle: .4; }
  .home-page [data-pinned="true"] .opening-welcome-inner { min-height: 0; height: var(--opening-height); align-items: flex-start; padding-block: clamp(28px, 5svh, 56px) 0; }
  .home-page [data-pinned="true"] .opening-copy { width: 100%; }
  .home-page [data-pinned="true"] .opening-copy h1 { font-size: clamp(2rem, 8.6vw, 3.25rem); margin-top: 18px; }
  .home-page [data-pinned="true"] .opening-lead { margin-top: 18px; font-size: 1rem; line-height: 1.65; }
  .home-page [data-pinned="true"] .opening-art { left: 50%; bottom: auto; width: min(80vw, 380px, 40svh); }
  .home-page [data-pinned="true"] .opening-route-backdrop { height: 100%; mask-image: none; }
  .home-page [data-pinned="true"] .opening-cue { bottom: max(20px, calc(env(safe-area-inset-bottom, 0px) + 12px)); }
  .home-page [data-pinned="true"] .opening-skip { top: calc(var(--opening-height) - 58px - env(safe-area-inset-bottom, 0px)); }
  .home-page [data-pinned="true"] .opening-bridge { padding-block: 32px; }
  .home-page [data-pinned="true"] .opening-message h2 { font-size: clamp(1.875rem, 7.5vw, 3rem); }

  /* Keep the resolved home hero on one screen, with the route panel present before release. */
  .home-page [data-pinned="true"] .opening-finale { display: flex; flex-direction: column; }
  .home-page [data-pinned="true"] .hero-stage { flex: 1; min-height: 0; }
  .home-page [data-pinned="true"] .hero-main { flex: 1; align-content: center; padding-block: 24px; }
  .home-page [data-pinned="true"] .hero-copy { max-width: 100%; }
  .home-page [data-pinned="true"] .hero .hero-title { font-size: clamp(2rem, 8.2vw, 3.25rem); }
  .home-page [data-pinned="true"] .hero-subtitle { margin-top: 18px; line-height: 1.6; }
  .home-page [data-pinned="true"] .hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
  .home-page [data-pinned="true"] .hero-actions > a { padding: 10px; min-height: 48px; text-align: center; font-size: .875rem; }
  .home-page [data-pinned="true"] .hero-proof { margin-top: 18px; gap: 8px; }
  .home-page [data-pinned="true"] .hero-proof li { font-size: .75rem; }
  .home-page [data-pinned="true"] .hero-proof ul { gap: 5px 12px; }
  .home-page [data-pinned="true"] .hero-visual { position: absolute; inset: 0; height: 100%; }
  .home-page [data-pinned="true"] .hero-visual img { object-position: 64% center; }
  .home-page [data-pinned="true"] .hero-visual::after { background: linear-gradient(90deg, rgb(16 20 25 / 94%), rgb(16 20 25 / 65%)); }
  .home-page [data-pinned="true"] .hero-routes { flex: none; width: 100%; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .home-page [data-pinned="true"] .hero-routes h2 { padding: 14px 16px 4px; font-size: 1rem; }
  .home-page [data-pinned="true"] .hero-routes a { padding: 10px 16px; gap: 10px; }
  .home-page [data-pinned="true"] .hero-route-icon { width: 32px; height: 32px; }
  .home-page [data-pinned="true"] .hero-route-icon svg { width: 22px; height: 22px; }
  .home-page [data-pinned="true"] .hero-route-text { font-size: .875rem; }
  .home-page [data-pinned="true"] .hero-route-arrow { width: 28px; height: 28px; }

  /* Services: the visual wipes above the explanation, both held as one scene. */
  .home-page .journey[data-mobile-pinned="true"] { --journey-height: calc(100svh - var(--header-height)); --journey-ease: cubic-bezier(.22, .8, .2, 1); height: calc(var(--journey-height) + 180svh); }
  /* The explanation takes the height its longest step needs and the picture takes all the rest
     (at least 150px): a fixed 23svh left the boards and the GICUS screen too small to read while
     space sat empty under the text. The fit probe measures the whole shell, so a phone where text
     plus the smallest picture does not fit keeps the stacked flow. */
  .home-page [data-mobile-pinned="true"] .journey-shell { display: grid; grid-template-rows: minmax(150px, 1fr) auto; position: sticky; top: var(--header-height); height: var(--journey-height); overflow: clip; }
  .home-page [data-mobile-pinned="true"] .journey-stage { position: relative; display: block; overflow: clip; background: var(--hs-panel); }
  .home-page [data-mobile-pinned="true"] :is(.journey-layers, .journey-layer) { position: absolute; inset: 0; }
  .home-page [data-mobile-pinned="true"] .journey-layer { clip-path: inset(100% 0 0); transition: clip-path 550ms var(--journey-ease); }
  .home-page [data-mobile-pinned="true"] .journey-layer:is([data-state="current"], [data-state="past"]) { clip-path: inset(0); }
  .home-page [data-mobile-pinned="true"] .journey-visual--board { padding: 16px 20px 16px 64px; }
  .home-page [data-mobile-pinned="true"] .journey-board { width: auto; height: 100%; max-width: 100%; max-height: 100%; }
  .home-page [data-mobile-pinned="true"] .journey-numerals { position: absolute; left: 20px; bottom: 20px; width: 2em; height: 1em; overflow: hidden; color: var(--brand); font-size: 2rem; font-weight: 700; line-height: 1; }
  .home-page [data-mobile-pinned="true"] .journey-numerals span { position: absolute; inset: 0; translate: 0 110%; transition: translate 450ms ease; }
  .home-page [data-mobile-pinned="true"] .journey-numerals span[data-current] { translate: none; }
  .home-page [data-mobile-pinned="true"] .journey-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: #d3dae2; }
  .home-page [data-mobile-pinned="true"] .journey-progress span { display: block; height: 100%; background: var(--brand); transform: scaleX(var(--journey-progress, 0)); transform-origin: left; }
  .home-page [data-mobile-pinned="true"] .journey-steps { width: min(calc(100% - 2 * var(--gutter)), 600px); height: auto; grid-template-rows: auto auto; gap: 0; padding: 0; }
  .home-page [data-mobile-pinned="true"] .journey-rail { display: flex; justify-content: space-between; gap: 8px; list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
  .home-page [data-mobile-pinned="true"] .journey-rail a { display: flex; align-items: center; gap: 6px; min-height: 44px; color: #6e7985; font-size: .75rem; }
  .home-page [data-mobile-pinned="true"] .journey-rail a[aria-current] { color: var(--blue); }
  .home-page [data-mobile-pinned="true"] .journey-rail a > b { flex-shrink: 0; white-space: nowrap; }
  .home-page [data-mobile-pinned="true"] .journey-rail-label { display: none; }
  .home-page [data-mobile-pinned="true"] .journey-rail-short { display: inline; white-space: nowrap; }
  /* Every line saved here goes to the picture above, so the copy is set a little tighter. */
  .home-page [data-mobile-pinned="true"] .journey-step { grid-area: 2 / 1; min-height: 0; align-content: center; padding-block: 10px 12px; gap: 0; opacity: 0; visibility: hidden; translate: 0 16px; transition: opacity 300ms ease, translate 500ms ease; }
  .home-page [data-mobile-pinned="true"] .journey-step[data-current] { opacity: 1; visibility: visible; translate: none; transition-delay: 0s; }
  .home-page [data-mobile-pinned="true"] .journey-step-media { display: none; }
  .home-page [data-mobile-pinned="true"] .journey-step-copy h3 { font-size: 1.375rem; line-height: 1.35; }
  .home-page [data-mobile-pinned="true"] .journey-step-body { margin-top: 8px; font-size: .9375rem; line-height: 1.5; }
  .home-page [data-mobile-pinned="true"] .journey-step-items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; margin-top: 10px; }
  .home-page [data-mobile-pinned="true"] .journey-step-items li { padding-block: 5px; font-size: .8125rem; line-height: 1.35; }
  .home-page [data-mobile-pinned="true"] .journey-step-note { margin-top: 6px; font-size: .75rem; line-height: 1.4; }
  .home-page [data-mobile-pinned="true"] .journey-step-action { margin-top: 6px; }

  /* Tracks: keep the panel's 10:7 proportions when it lands in the two-by-two comparison. */
  .home-page .hs-tracks-scene[data-mobile-pinned="true"] { --tracks-stage: calc(100svh - var(--header-height)); --tracks-hold: 1; height: calc(var(--tracks-stage) + 250svh); }
  .home-page [data-mobile-pinned="true"] .hs-tracks-stage { position: sticky; top: var(--header-height); display: grid; align-content: center; height: var(--tracks-stage); padding-block: 12px; overflow: clip; }
  .home-page [data-mobile-pinned="true"] .hs-top { gap: 10px; margin-bottom: 20px; }
  .home-page [data-mobile-pinned="true"] .hs-heading h2 { font-size: 1.625rem; }
  .home-page [data-mobile-pinned="true"] .hs-label { margin-top: 8px; font-size: .75rem; }
  .home-page [data-mobile-pinned="true"] .hs-intro { font-size: 1rem; line-height: 1.5; }
  .home-page [data-mobile-pinned="true"] .hs-tracks-area { display: grid; align-items: center; }
  .home-page [data-mobile-pinned="true"] :is(.hs-tracks, .hs-track, .hs-tracks-overview) { grid-area: 1 / 1; }
  .home-page [data-mobile-pinned="true"] .hs-tracks { gap: 0; }
  .home-page [data-mobile-pinned="true"] .hs-track { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 16px; }
  .home-page [data-mobile-pinned="true"] .hs-track-panel { width: min(100%, 270px); min-height: 0; aspect-ratio: 10 / 7; padding: 18px; border-radius: 18px; transform-origin: 0 0; transition: opacity 250ms ease, transform 600ms var(--home-arrive); }
  .home-page [data-mobile-pinned="true"] .hs-track h3 { margin-top: auto; font-size: 2rem; }
  .home-page [data-mobile-pinned="true"] .hs-track h3 span { margin-top: 6px; font-size: .75rem; }
  .home-page [data-mobile-pinned="true"] .hs-track-panel .track-marks { height: 32px; padding-inline: 8px; }
  .home-page [data-mobile-pinned="true"] .hs-track-panel .track-marks img { height: 18px; }
  .home-page [data-mobile-pinned="true"] .hs-track-panel .track-marks--set img { height: 24px; }
  .home-page [data-mobile-pinned="true"] .hs-track-label { margin-bottom: 6px; }
  .home-page [data-mobile-pinned="true"] .hs-track-fit { font-size: 1.25rem; line-height: 1.4; }
  .home-page [data-mobile-pinned="true"] .hs-track-how { margin-top: 10px; line-height: 1.55; }
  .home-page [data-mobile-pinned="true"] .hs-track-key { margin-top: 12px; padding: 6px 12px; }
  .home-page [data-mobile-pinned="true"] .hs-track[data-state="next"] .hs-track-panel { opacity: 0; transform: translateX(36px); }
  .home-page [data-mobile-pinned="true"] .hs-track[data-state="past"] .hs-track-panel { opacity: 0; transform: translate(var(--slot-x), calc(var(--slot-y) + 20px)) scale(var(--slot-s)); }
  .home-page [data-mobile-pinned="true"] .hs-track[data-state="gathered"] .hs-track-panel { transform: translate(var(--slot-x), var(--slot-y)) scale(var(--slot-s)); transition-duration: 700ms; transition-delay: calc(var(--track-index) * 50ms); }
  .home-page [data-mobile-pinned="true"] .hs-track[data-state="gathered"] h3 span { opacity: 0; }
  .home-page [data-mobile-pinned="true"] .hs-track-copy { transition: opacity 250ms ease, translate 450ms ease; }
  .home-page [data-mobile-pinned="true"] .hs-track:not([data-state="current"]) .hs-track-copy { opacity: 0; visibility: hidden; translate: 0 12px; }
  .home-page [data-mobile-pinned="true"] .hs-tracks-overview { margin: 0; }
  .home-page [data-mobile-pinned="true"] .hs-tracks-overview ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
  .home-page [data-mobile-pinned="true"] .hs-tracks-mini { visibility: hidden; min-height: 0; padding: 0; overflow: hidden; }
  .home-page [data-mobile-pinned="true"] .hs-tracks-mini > * { display: none; }
  .home-page [data-mobile-pinned="true"] :is(.hs-tracks-overview-title, .hs-tracks-sum) { opacity: 0; transition: opacity 350ms ease; }
  .home-page [data-mobile-pinned="true"][data-step="all"] :is(.hs-tracks-overview-title, .hs-tracks-sum) { opacity: 1; transition-delay: 350ms; }
  .home-page [data-mobile-pinned="true"] .hs-tracks-sum { margin-top: 8px; }
  /* The note stays with the comparison: it arrives with the two-by-two, in the same screen. */
  .home-page [data-mobile-pinned="true"] .hs-tracks-foot { gap: 10px; margin-top: 18px; opacity: 0; pointer-events: none; transition: opacity 350ms ease; }
  .home-page [data-mobile-pinned="true"] .hs-tracks-foot .hs-note { font-size: .8125rem; line-height: 1.55; }
  .home-page [data-mobile-pinned="true"][data-step="all"] .hs-tracks-foot { opacity: 1; pointer-events: auto; transition: opacity 350ms ease 500ms; }
  .home-page [data-mobile-pinned="true"] .hs-tracks-foot:focus-within { opacity: 1; pointer-events: auto; }

  /* GICUS: four touch targets above one shared explanation and screen. */
  .home-page .hs-gicus-scene[data-mobile-pinned="true"] { --gicus-stage: calc(100svh - var(--header-height)); height: calc(var(--gicus-stage) + 220svh); }
  .home-page [data-mobile-pinned="true"] .hs-gicus-stage { position: sticky; top: var(--header-height); height: var(--gicus-stage); display: grid; align-content: center; padding-block: 12px calc(76px + env(safe-area-inset-bottom, 0px)); overflow: clip; }
  .home-page [data-mobile-pinned="true"] .hs-gicus-panel { position: relative; isolation: isolate; width: min(calc(100% - 2 * var(--gutter)), 560px); padding: 12px 0; gap: 18px; background: none; }
  .home-page [data-mobile-pinned="true"] .hs-gicus-panel::before { position: absolute; z-index: -1; inset-block: calc((100% - var(--gicus-stage)) * var(--gicus-expand, 0) / 2 - 54px); inset-inline: calc(-16px - (var(--gicus-viewport, 100vw) - 100% - 32px) * var(--gicus-expand, 0) / 2); border-radius: calc(24px * (1 - var(--gicus-expand, 0))); background: var(--hs-panel); content: ''; }
  .home-page [data-mobile-pinned="true"] .hs-gicus-copy h3 { font-size: 1.5rem; }
  .home-page [data-mobile-pinned="true"] .hs-gicus-scroll-note { display: flex; margin-top: 10px; }
  .home-page [data-mobile-pinned="true"] .hs-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 16px; border-bottom: 0; gap: 12px 6px; }
  .home-page [data-mobile-pinned="true"] .hs-flow li { display: contents; }
  .home-page [data-mobile-pinned="true"] .hs-flow h4 { grid-row: 1; }
  .home-page [data-mobile-pinned="true"] .hs-flow-trigger { min-height: 52px; height: 100%; padding: 6px; align-items: center; border-bottom: 2px solid #c5ccd5; color: #53677b; transition: color 250ms, border-color 250ms; }
  .home-page [data-mobile-pinned="true"] .hs-flow li[data-current] .hs-flow-trigger { color: var(--brand-hover); border-color: var(--brand); }
  .home-page [data-mobile-pinned="true"] .hs-flow-title { font-size: .875rem; text-align: center; }
  .home-page [data-mobile-pinned="true"] .hs-flow-stage { display: none; }
  .home-page [data-mobile-pinned="true"] .hs-flow-detail { grid-column: 1 / -1; grid-row: 2; opacity: 0; visibility: hidden; translate: 0 8px; transition: opacity 250ms, translate 400ms; }
  .home-page [data-mobile-pinned="true"] .hs-flow li[data-current] .hs-flow-detail { opacity: 1; visibility: visible; translate: none; transition-delay: 0s; }
  .home-page [data-mobile-pinned="true"] .hs-flow-detail p { line-height: 1.55; }
  .home-page [data-mobile-pinned="true"] .hs-flow-detail .hs-flow-role { margin-top: 6px; padding: 0; }
  .home-page [data-mobile-pinned="true"] .hs-flow-inline-screen { display: none; }
  /* The whole GICUS screen stays in view (no zoomed crop); on a phone it may run past the text
     column almost to the screen edges so its parts stay legible. */
  .home-page [data-mobile-pinned="true"] .hs-gicus-screen { display: block; width: min(calc(100vw - 24px), 560px, calc((var(--gicus-stage) - 440px) * 1.6)); justify-self: center; transform: translateY(calc(12px * (1 - var(--gicus-expand, 0)))) scale(calc(1 - .04 * var(--gicus-finish, 0))); }
  .home-page [data-mobile-pinned="true"] .hs-gicus-screen .gicus-window { border-radius: 12px; }
  .home-page [data-mobile-pinned="true"] .hs-gicus-screen .gicus-window-bar { height: 28px; padding-inline: 10px; }
  .home-page [data-mobile-pinned="true"] .hs-gicus-screen .hs-gicus-shot { translate: 0 18px; transition: opacity 300ms, translate 550ms, visibility 0s 300ms; }
  .home-page [data-mobile-pinned="true"] .hs-gicus-shot[data-current] { translate: none; transition-delay: 0s; }
  .home-page [data-mobile-pinned="true"] .hs-gicus-screen-caption { margin-top: 8px; font-size: .875rem; }
  .home-page [data-mobile-pinned="true"] .hs-gicus-actions-wrap { position: absolute; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: 100%; padding: 0; background: none; opacity: var(--gicus-finish, 0); translate: 0 calc(18px * (1 - var(--gicus-finish, 0))); pointer-events: none; }
  .home-page [data-mobile-pinned="true"][data-actions-visible] .hs-gicus-actions-wrap, .home-page [data-mobile-pinned="true"] .hs-gicus-actions-wrap:focus-within { pointer-events: auto; }
  .home-page [data-mobile-pinned="true"] .hs-gicus-actions-wrap:focus-within { opacity: 1; translate: none; }
  .home-page [data-mobile-pinned="true"] .hs-gicus-actions { flex-direction: row; gap: 8px; padding-inline: var(--gutter); }
  .home-page [data-mobile-pinned="true"] .hs-gicus-actions .button-link { width: auto; min-width: 0; min-height: 48px; padding: 10px 16px; font-size: .875rem; gap: 6px; }

  /* The finished statement stays on screen while the visitor reads; on a phone whose address bar
     has folded away, the extra height below it is the statement's own dark ground, not the next
     scene showing through. */
  .home-page .manifesto-scene { padding-bottom: calc(100lvh - 100svh); }

  /* A held scene owns its reveals; ordinary section observers must not restart its content. */
  .home-page [data-mobile-pinned="true"] :is(.home-reveal-pending, .home-reveal-in),
  .home-page [data-mobile-pinned="true"] .home-reveal-in :is(.hs-track-panel, .hs-track-copy > *, .hs-tracks-overview-title, li) { opacity: 1; animation: none; }
  /* …except the comparison heading, which belongs to the gathered two-by-two only: shown during the
     single-track steps it sat on top of the current panel. */
  .home-page .hs-tracks-scene[data-mobile-pinned="true"]:not([data-step="all"]) .hs-tracks-overview-title { opacity: 0; }

  @media (max-height: 740px) {
    .home-page [data-mobile-pinned="true"] .journey-step { padding-block: 10px; }
    .home-page [data-mobile-pinned="true"] .hs-label { display: none; }
    .home-page [data-mobile-pinned="true"] .hs-top { gap: 8px; margin-bottom: 16px; }
    .home-page [data-mobile-pinned="true"] .hs-track-panel { width: min(100%, 250px); }
  }
}
