/* Keep loading copy in document flow. Earlier cinematic layers position the
   artwork; the HUD, title, transmission and controls each need their own space. */
#boot {
  display: grid;
  place-items: stretch;
  grid-template-rows: auto minmax(min-content, 1fr) auto;
  row-gap: clamp(18px, 3vh, 32px);
  padding: max(24px, env(safe-area-inset-top)) max(25px, 5.5vw, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(25px, 5.5vw, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
#boot[hidden], #boot [hidden] { display: none !important; }
#boot .boot-hud, #boot .boot-body, #boot .boot-footer { position: relative; z-index: 4; min-width: 0; }
#boot .boot-hud { display: grid; gap: 22px; }
#boot .boot-topline, #boot .boot-camera, #boot .boot-content,
#boot .boot-arrival-console, #boot .boot-progress, #boot .boot-cast,
#boot .boot-footer {
  position: static;
  inset: auto;
  transform: none;
  min-width: 0;
}
#boot .boot-topline { gap: 16px; flex-wrap: wrap; font-size: 8px; line-height: 1.6; letter-spacing: .2em; }
#boot .boot-camera { gap: 10px; font-size: 8px; line-height: 1.6; letter-spacing: .1em; flex-wrap: wrap; }
#boot .boot-camera small { font-size: 7px; }
#boot .boot-body { display: grid; grid-template-columns: minmax(0, 57%) minmax(0, 1fr); align-items: center; gap: 6%; }
#boot .boot-main { display: flex; flex-direction: column; gap: clamp(18px, 2.6vh, 26px); min-width: 0; padding-block: 12px; }
#boot .boot-content { display: flex; flex-direction: column; gap: 17px; width: 100%; max-width: none; padding: 0; text-align: left; }
#boot .boot-credit { margin: 0; font-size: 8px; line-height: 1.6; letter-spacing: .2em; }
#boot .boot-title { margin: 0; font-size: clamp(40px, 7.2vw, 110px); line-height: 1.12; letter-spacing: -.04em; white-space: nowrap; }
#boot .boot-tagline { margin: 0; max-width: 100%; font-size: clamp(15px, 1.6vw, 21px); line-height: 1.5; }
#boot .boot-heartline { width: min(380px, 90%); height: 42px; margin: 4px 0; }
#boot .boot-message { margin: 0; max-width: 100%; min-height: 0; font-size: 9px; line-height: 1.8; letter-spacing: .06em; overflow-wrap: anywhere; }
#boot .boot-cast-preview { margin: 0; max-width: 100%; }
#boot .boot-cast-preview summary { min-height: 32px; }
#boot .boot-cast-preview p { max-width: 100%; }
#boot .boot-actions { margin: 0; gap: 18px; flex-wrap: wrap; }
#boot .boot-enter, #boot .boot-quiet { min-height: 44px; }
#boot .boot-audio-note { margin: 0; max-width: 100%; }
#boot .boot-retry { margin: 0; align-self: flex-start; }
#boot .boot-arrival-console { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 460px; padding: 18px 20px; }
#boot .boot-arrival-console > p:first-child { margin: 0; gap: 8px 16px; flex-wrap: wrap; line-height: 1.6; }
#boot .boot-arrival-console h2 { margin: 0; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.3; }
#boot .boot-console-meter { width: min(210px, 100%); }
#boot .boot-arrival-console > p:last-child { margin: 0; max-width: 100%; font-size: 8px; line-height: 1.8; overflow-wrap: anywhere; }
#boot .boot-progress { width: 100%; max-width: 460px; }
#boot .boot-progress-label { font-size: 8px; line-height: 1.6; letter-spacing: .14em; margin-bottom: 10px; }
#boot .boot-cast { width: 100%; max-width: 320px; justify-self: end; align-self: end; gap: 9px; padding-bottom: 48px; overflow-wrap: anywhere; }
#boot .boot-cast strong { font-size: clamp(32px, 4vw, 61px); line-height: 1.2; }
#boot .boot-cast > p { margin: 6px 0 0; }
#boot .boot-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; width: 100%; font-size: 7px; line-height: 1.6; letter-spacing: .14em; }
#boot .boot-footer > div { display: flex; flex-wrap: wrap; gap: 20px; }
#boot .boot-footer button { min-height: 44px; }
#boot:not([data-state=idle]) .boot-heartline { display: none; }
#boot:not([data-state=idle]) .boot-title { font-size: clamp(40px, 6vw, 80px); }
#boot[data-state=idle] .boot-arrival-console { display: none; }

@media (max-width: 850px) and (min-width: 651px) {
  #boot .boot-body { grid-template-columns: minmax(0, 62%) minmax(0, 1fr); gap: 5%; }
  #boot .boot-title { font-size: clamp(40px, 7.2vw, 65px); }
  #boot .boot-cast { padding-bottom: 28px; }
  #boot .boot-cast > p { font-size: 13px; }
}
@media (max-width: 650px) {
  #boot { row-gap: 20px; padding-inline: max(25px, env(safe-area-inset-left)) max(25px, env(safe-area-inset-right)); }
  #boot .boot-hud { gap: 15px; }
  #boot .boot-topline { font-size: 6px; letter-spacing: .12em; gap: 8px 14px; }
  #boot .boot-topline > span:last-child { font-size: 6px; letter-spacing: .08em; }
  #boot .boot-camera { font-size: 7px; gap: 8px; }
  #boot .boot-camera small { font-size: 6px; }
  #boot .boot-body { display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 24px; }
  #boot .boot-cast { order: -1; align-self: flex-start; width: 55%; max-width: 240px; padding: 0; gap: 6px; }
  #boot .boot-cast > span { font-size: 6px; line-height: 1.5; }
  #boot .boot-cast strong { font-size: 33px; }
  #boot .boot-cast small { font-size: 7px; line-height: 1.5; }
  #boot .boot-cast > p { display: none; }
  #boot .boot-main { gap: 18px; padding: 0; }
  #boot .boot-content { gap: 13px; }
  #boot .boot-credit { font-size: 7px; }
  #boot .boot-title, #boot:not([data-state=idle]) .boot-title { font-size: clamp(36px, 10.4vw, 65px); }
  #boot .boot-tagline { font-size: 15px; max-width: 100%; }
  #boot .boot-heartline { height: 28px; margin: 0; }
  #boot .boot-message { font-size: 8px; line-height: 1.7; }
  #boot .boot-arrival-console { max-width: none; padding: 14px 15px; gap: 9px; }
  #boot .boot-arrival-console > p:first-child { font-size: 7px; }
  #boot .boot-arrival-console h2 { font-size: 25px; }
  #boot .boot-console-meter { width: min(170px, 100%); height: 14px; }
  #boot .boot-arrival-console > p:last-child { font-size: 7px; }
  #boot .boot-progress { max-width: none; }
  #boot .boot-progress-label { font-size: 7px; margin-bottom: 9px; }
  #boot .boot-footer { font-size: 6px; }
  #boot .boot-footer > div { gap: 16px; }
  #boot .boot-footer button { font-size: 8px; }
}
@media (max-height: 740px) {
  #boot { row-gap: 14px; padding-block: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-bottom)); }
  #boot .boot-hud { gap: 12px; }
  #boot .boot-main { gap: 14px; padding-block: 0; }
  #boot .boot-content { gap: 11px; }
  #boot .boot-heartline { height: 24px; margin: 0; }
  #boot .boot-title { font-size: clamp(36px, 7.2vw, 64px); }
  #boot:not([data-state=idle]) .boot-title { font-size: clamp(36px, 6vw, 56px); }
  #boot .boot-credit { font-size: 7px; }
  #boot .boot-tagline { display: block; font-size: 14px; }
  #boot .boot-arrival-console { padding: 12px 14px; gap: 8px; }
  #boot .boot-arrival-console h2 { font-size: 23px; }
  #boot .boot-console-meter { height: 12px; }
  #boot .boot-cast { padding-bottom: 16px; }
}
@media (max-height: 740px) and (max-width: 650px) {
  #boot .boot-body { gap: 18px; }
  #boot .boot-cast { padding: 0; gap: 4px; }
  #boot .boot-cast strong { font-size: 28px; }
  #boot .boot-title, #boot:not([data-state=idle]) .boot-title { font-size: clamp(34px, 10.4vw, 54px); }
  #boot .boot-tagline { font-size: 13px; }
  #boot:not([data-state=idle]) .boot-credit { display: none; }
  #boot .boot-message { font-size: 8px; }
  #boot .boot-arrival-console h2 { font-size: 22px; }
}
@media (max-height: 520px) and (min-width: 651px) {
  #boot { padding-block: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-bottom)); row-gap: 12px; }
  #boot .boot-hud { gap: 8px; }
  #boot .boot-body { grid-template-columns: minmax(0, 72%) minmax(0, 1fr); gap: 4%; }
  #boot .boot-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 14px 22px; align-items: center; }
  #boot .boot-content { grid-column: 1 / -1; }
  #boot:not([data-state=idle]) .boot-content { grid-column: auto; }
  #boot .boot-progress { grid-column: 1 / -1; }
  #boot .boot-credit, #boot .boot-heartline { display: none; }
  #boot .boot-title, #boot:not([data-state=idle]) .boot-title { font-size: clamp(28px, 4.7vw, 48px); }
  #boot .boot-tagline { font-size: 13px; }
  #boot .boot-arrival-console h2 { font-size: 21px; }
  #boot .boot-arrival-console > p:first-child, #boot .boot-arrival-console > p:last-child { font-size: 7px; }
  #boot .boot-cast { padding: 0; }
  #boot .boot-cast strong { font-size: 30px; }
  #boot .boot-cast > p { display: none; }
}

/* Fit the entire film frame instead of enlarging it beyond the device.
   Portrait tablets use the same portrait film as phones. */
#boot { box-sizing: border-box; width: 100%; height: 100svh; height: 100dvh; }
#boot .boot-video { object-fit: contain; object-position: center center; transform: none; }
#boot .boot-poster { object-fit: contain; object-position: center top; transform: none; max-width: 100%; }
#boot .boot-title { max-width: 100%; white-space: normal; overflow-wrap: normal; }
@media (max-aspect-ratio: 1/1) {
  #boot .boot-video { inset: 0; width: 100%; height: 100%; object-fit: contain; }
  #boot .boot-poster { inset: 3% 0 auto auto; width: 100%; height: 74%; }
  #boot .boot-body { display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 24px; }
  #boot .boot-cast { order: -1; align-self: flex-start; width: 50%; padding: 0; }
  #boot .boot-main { width: 100%; max-width: 620px; }
  #boot .boot-shade { background: linear-gradient(0deg,#080e1af5 0%,#101b29df 36%,#13233555 62%,#080c1733 100%); }
}
@media (max-width: 360px) {
  #boot { padding-inline: max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right)); }
  #boot .boot-title, #boot:not([data-state=idle]) .boot-title { font-size: clamp(25px,9.8vw,35px); }
  #boot .boot-actions { gap: 8px 16px; }
}
/* A contained film can leave letterboxing: never show a second portrait behind it. */
#boot[data-state=idle] .boot-video { visibility: hidden; }
#boot:not([data-state=idle]):not([data-fallback=true]):not([data-reduced=true]) .boot-poster { visibility: hidden; }

/* Matte pair opening: artwork stays in flow and never crops either face. */
#boot { background: #101725; color: #ead2d7; }
#boot::after { border-color: #d9adb728; pointer-events: none; }
#boot .boot-facility, #boot .boot-poster, #boot .boot-video,
#boot .boot-shade, #boot .boot-grain, #boot .boot-bulkhead,
#boot .boot-scanline, #boot .boot-camera, #boot .boot-arrival-console,
#boot .boot-cast, #boot .boot-cast-preview, #boot .boot-heartline { display: none !important; }
#boot .boot-body { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: clamp(24px,6vw,100px); align-items: center; width: min(1160px,100%); margin: auto; }
#boot .boot-pair { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 0; min-width: 0; }
#boot .boot-pair img { display: block; width: 100%; max-width: min(520px,62vh); height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 22px; border: 1px solid #d9adb738; box-shadow: 0 24px 75px #0005; }
#boot .boot-pair figcaption { color: #c8acb9; font: italic 14px/1.5 Georgia,serif; text-align: center; }
#boot .boot-main { display: flex; flex-direction: column; gap: 24px; width: 100%; max-width: 500px; padding: 0; }
#boot .boot-content { text-align: left; gap: 18px; }
#boot .boot-rose { display: block; width: 64px; height: 64px; object-fit: contain; }
#boot .boot-title, #boot:not([data-state=idle]) .boot-title { font-size: clamp(36px,5.2vw,76px); white-space: normal; line-height: 1.08; }
#boot .boot-title span { display: block; }
#boot .boot-credit { color: #bba4b5; }
#boot .boot-tagline { color: #dfc2cc; font: italic clamp(16px,1.7vw,22px)/1.6 Georgia,serif; }
#boot .boot-message { color: #bbaec4; font-size: 11px; letter-spacing: .02em; }
#boot .boot-progress { max-width: none; }
#boot .boot-progress-bar { height: 3px; border-radius: 10px; background: #e3b3c022; }
#boot .boot-enter { background: #dcb5c0; color: #172033; border: 1px solid #dcb5c0; border-radius: 8px; }
#boot .boot-quiet { color: #dfc2cc; }
#boot[data-state=playing] .boot-pair { animation: pair-arrival 2s ease-out both; }
@keyframes pair-arrival { from { opacity: .65; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
@media (max-aspect-ratio: 1/1) {
 #boot { row-gap: 18px; }
 #boot .boot-body { display: flex; flex-direction: column; gap: clamp(16px,3vh,32px); align-items: center; }
 #boot .boot-pair { width: 100%; }
 #boot .boot-pair img { width: min(100%,42svh,480px); max-width: 100%; }
 #boot .boot-pair figcaption { display: none; }
 #boot .boot-main { max-width: 500px; gap: 18px; }
 #boot .boot-content { align-items: center; text-align: center; gap: 12px; }
 #boot .boot-rose { width: 44px; height: 44px; }
 #boot .boot-credit { display: none; }
 #boot .boot-title, #boot:not([data-state=idle]) .boot-title { font-size: clamp(30px,7vw,54px); }
 #boot .boot-title span { display: inline; }
 #boot .boot-tagline { font-size: 16px; }
 #boot .boot-actions { justify-content: center; gap: 12px 20px; }
 #boot .boot-footer { justify-content: center; }
}
@media (max-height: 520px) and (min-aspect-ratio: 1/1) {
 #boot .boot-body { grid-template-columns: minmax(0,.8fr) minmax(0,1fr); gap: 30px; }
 #boot .boot-pair img { max-width: 57svh; }
 #boot .boot-pair figcaption, #boot .boot-credit, #boot .boot-rose { display:none; }
 #boot .boot-main { display: flex; gap: 14px; }
 #boot .boot-content { gap: 10px; }
 #boot .boot-title, #boot:not([data-state=idle]) .boot-title { font-size: 32px; }
 #boot .boot-title span { display: inline; }
 #boot .boot-tagline { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { #boot .boot-pair { animation: none !important; } }
