/* The final plate expands in viewport coordinates. Neither layer has a frame. */
.ict-finale { position: absolute; inset: 0; z-index: 4; pointer-events: none; visibility: hidden; overflow: hidden; isolation: isolate; }
.ict-finale canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.ict-finale::before { content: ""; position: absolute; inset: 0; background: #030711; opacity: var(--night, 0); }
.ict-finale::after { content: ""; position: absolute; inset: 0; z-index: 1; background: #0d3a5c; opacity: var(--blue, 0); }
.ict-web-finale { position: fixed; inset: 0; z-index: 72; }

.ict-finale[hidden] { display: none; }
.ict-distances { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.ict-distances i { position: absolute; display: block; width: 0; height: var(--run); }
.ict-distances [data-finale-run] { height: var(--coda); }
.ict-story { --run: clamp(2400px, 405svh, 4400px); --coda: clamp(1200px, 172svh, 1820px); }
.ict-story.has-finale:not(.is-staged) .ict-notes { padding-bottom: calc(var(--screen) - var(--lead) + var(--coda)); }
.ict-story:is(.is-awaiting,.is-staged) { height: calc(var(--screen) + var(--run) + var(--coda)); }
.ict-story.is-staged .ict-walk { position: sticky; top: var(--header); height: var(--screen); min-height: 0; overflow: clip; align-items: center; }
.ict-story.is-staged .ict-notes { display: grid; align-items: center; padding-block: 0; }
.ict-story.is-staged .ict-step { grid-area: 1 / 1; min-height: 0; min-width: 0; pointer-events: none; visibility: hidden; }
.ict-story.is-staged .ict-step.is-fading-note { visibility: visible; }
.ict-story.is-staged .ict-step.is-current { visibility: visible; pointer-events: auto; }
.ict-story.is-staged .ict-note { position: relative; top: auto; padding-block: 0; }
.ict-story.is-staged .ict-desk { position: relative; top: auto; height: var(--screen); }
.ict-glass { transform: translateX(var(--camera-x, 0%)); }
body.is-experience-home .s-header { opacity: var(--masthead-opacity, 1); }
body.is-experience-home .s-header:has(:focus-visible) { opacity: 1; }
body.ict-immersed .s-header:not(:has(:focus-visible)) { pointer-events: none; }
.ict-story.ict-immersed .ict-desk, .ict-story.ict-immersed .ict-notes { pointer-events: none; }
.hc-archive, .ict-web-finale { --archive-surface: linear-gradient(180deg, #0d3a5c 0, #0d3a5c min(36vh, 300px), var(--s-ink, #0d0d0d) 78%); }
.hc-archive { padding:0; background:var(--archive-surface); }
.hc-archive-frame { padding:var(--hc-block) 0 clamp(38px,5vw,72px); background:var(--archive-surface); }
.ict-finale [data-finale-landscape] { z-index:4; }
.ict-finale [data-finale-cosmos] { z-index:3; }
.ict-finale .ict-finale-signature {
  position:absolute; top:46%; left:5%; width:90%; z-index:5; margin:0;
  transform:translateY(-50%); opacity:0; text-align:center; white-space:nowrap;
  color:#fff; font:600 clamp(19px,5.5vw,84px)/1.18 "Helvetica Neue",Helvetica,Arial,sans-serif;
  letter-spacing:-.035em;
}
@media (max-width: 760px) and (orientation: portrait), (max-width: 619px) {
  .ict-story.is-staged .ict-walk { display: flex; flex-direction: column; align-items: stretch; }
  .ict-story.is-staged .ict-desk { flex: 0 0 var(--fitted-desk, var(--desk)); height: var(--fitted-desk, var(--desk)); min-height: 0; order: -1; }
  .ict-story.is-staged .ict-notes { flex: 1; align-content: center; padding-inline: var(--g); }
  .ict-story.is-staged .ict-note { padding-block: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .ict-glass { transition: none; }
}

.ict-story .ict-notes, .ict-story .ict-plate figcaption, .ict-story .ict-foot, .ict-story .ict-chapters, .ict-story .ict-heading { opacity: var(--scene-text,1); }

.ict-front-name { color: #7fd0ff; }
.ict-story .ict-fallback { filter: none; }
@media (max-width: 760px) {
  .ict-story { --run: clamp(2160px, 390svh, 3650px); --coda: clamp(1050px, 154svh, 1480px); }
}

/* Match the first HTML paint to the interactive stage while the drawing engine loads. */
.ict-opening .ict-story:not(.is-ready) .ict-walk { min-height: var(--screen); align-items: center; }
.ict-opening .ict-story:not(.is-ready) .ict-step:not(:first-child) { display: none; }
.ict-opening .ict-story:not(.is-ready) .ict-notes { padding-block: 0; }
.ict-opening .ict-story:not(.is-ready) .ict-note { padding-block: 0; }
.ict-opening .ict-story:not(.is-ready) .ict-plate figcaption { display: flex; }
@media (max-width:760px) and (orientation:portrait), (max-width:619px) {
  .ict-opening .ict-story:not(.is-ready) .ict-walk { display: flex; flex-direction: column; align-items: stretch; }
  .ict-opening .ict-story:not(.is-ready) .ict-desk { order: -1; }
  .ict-opening .ict-story:not(.is-ready) .ict-notes { flex: 1; align-content: center; padding-inline: var(--g); }
}

/* Leave room for the full tower on short portrait phones. */
@media (max-width: 500px) and (max-height: 650px) and (orientation: portrait) {
  .ict-story { --desk: clamp(240px,50svh,320px); }
  .ict-desk .ict-heading > span { max-width:14ch; }
  .ict-desk .ict-heading button { white-space:nowrap; }
  .ict-desk .ict-foot { flex-wrap:nowrap; gap:6px; }
  .ict-desk .ict-foot > span { display:none; }
}

@media (max-width: 760px) and (max-height: 700px) and (orientation: portrait) {
  .ict-story.is-staged .ict-plate figcaption { display: none; }
  .ict-story.is-staged .ict-desk { padding-block: 4px; }
}
@media (max-width: 360px) and (max-height: 650px) and (orientation: portrait) {
  .ict-story.is-staged .ict-desk {
    display: grid; grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: 44px minmax(0, 1fr) auto; align-items: stretch;
  }
  .ict-story.is-staged .ict-heading { grid-area: 1 / 1; padding: 0; border: 0; }
  .ict-story.is-staged .ict-heading > span { display: none; }
  .ict-story.is-staged .ict-foot { grid-area: 1 / 2; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
  .ict-story.is-staged .ict-foot > span { display: none; }
  .ict-story.is-staged .ict-foot .ict-motion { font-size: 0; min-width: 30px; min-height: 40px; }
  .ict-story.is-staged .ict-foot .ict-motion::before { margin: 0; }
  .ict-story.is-staged .ict-plate { grid-area: 2 / 1 / 3 / 3; }
  .ict-story.is-staged .ict-chapters { grid-area: 3 / 1 / 4 / 3; }
}
