/* The date and viewing controls have their own opaque navigation band. */
.bar>.stamp,.bar>.film-announcement,.reading .bar>.stamp.in-chronology {display:none}
html.enhanced body:not(.reading) .bar:has(>.stamp.in-chronology) {
  display:grid;grid-template-columns:1fr auto 1fr;column-gap:12px;
  padding:0 max(14px,env(safe-area-inset-left)) 0 max(15px,env(safe-area-inset-left));
  color:#fff4d9;background:#193744;border-bottom:2px solid #ca7950;text-shadow:none;
}
body:not(.reading) .bar:has(>.stamp.in-chronology) nav {justify-self:end}
body:not(.reading) .bar:has(>.stamp.in-chronology) .span-years{display:none}
body:not(.reading) .bar>.stamp.in-chronology {
  position:static;display:flex;justify-self:start;align-items:center;width:auto;max-width:100%;
  inset:auto;padding:0;gap:0;margin:0;color:#ffedcf;background:none;border:0;box-shadow:none;
  text-align:left;letter-spacing:normal;text-transform:none;
}
.bar .stamp #stampPart,.bar .stamp>i {display:none}
.bar .stamp #date {display:flex;align-items:flex-start;flex-direction:column;gap:2px;line-height:1}
.calendar-heading {display:block;font:700 clamp(1.55rem,2.6vw,2.45rem)/.98 var(--sans);letter-spacing:-.035em;white-space:nowrap}
.calendar-prefix {font:normal .53em/1 var(--mono);letter-spacing:0}
.calendar-context,.calendar-description {font:normal clamp(.68rem,1vw,.85rem)/1.1 var(--mono);letter-spacing:.03em}
.calendar-context {color:#efc9a1}
.calendar-description {font-size:clamp(.9rem,1.4vw,1.4rem)}
body:not(.reading):has(#stage[data-beat="62"]) {--bar:94px}
body:not(.reading) .bar:has(>.film-announcement:not(:empty)) {grid-template-rows:1fr auto;row-gap:0}
body:not(.reading) .bar .film-announcement:not(:empty) {grid-column:1/-1;display:flex;align-items:center;gap:.65em;justify-self:start;max-width:100%;padding:3px 0 7px;line-height:1.13;color:#fff3d8}
.announcement-title {font:700 clamp(.76rem,1.35vw,1.05rem)/1.14 var(--sans)}
.announcement-source {font:normal clamp(.62rem,.9vw,.77rem)/1.1 var(--mono);color:#efd6b8;border-left:1px solid #a98e72;padding-left:.65em}
.flag-pin {position:relative;flex:none;width:24px;aspect-ratio:1.9;background:repeating-linear-gradient(to bottom,#ad4e40 0 7.6923%,#fff1d8 7.6923% 15.3846%);outline:1px solid #f2dbaf99;box-shadow:0 1px 2px #1115}
.flag-pin::before{content:'';position:absolute;inset:0 auto auto 0;width:43%;height:54%;background:radial-gradient(circle,#ffedce .5px,transparent .7px) 0 0/3px 3px,#2b485a}

#stage .caption .department {
  display:inline-block;vertical-align:middle;background:#eab98c;border:1px solid #a86447;
  border-radius:2px;color:#202e36;padding:.23em .65em .24em;margin-right:.7em;
  font:800 clamp(.78rem,1.13vw,1.02rem)/1.2 var(--sans);letter-spacing:.13em;
  text-align:center;text-shadow:none;
}
#stage .department[data-desk="service"] {color:#e8f6e9;background:#225352;border-color:#85b2a4}
#stage .department:is([data-desk="ownership"],[data-desk="gabby"]) {color:#29414a;background:#f1e8cb;border-color:#bdb197}
#stage .department-change {animation:rail-dept .72s cubic-bezier(.2,.72,.25,1) both}
@keyframes rail-dept{from{opacity:.1;transform:translateY(-.65em)}to{opacity:1;transform:none}}

/* Let the candle occupy the lower right of its photographic plate. */
#stage[data-chapter-prop="candle"] .cp-candle {
  top:auto;right:var(--edge);bottom:64px;width:90px;height:136px;
}
#stage[data-chapter-prop="candle"] .cp-flame{height:clamp(22px,2vw,34px)}
#stage[data-kind="chapter"]:is([data-beat="18"],[data-beat="57"]) .caption {
  inset:calc(var(--bar) + clamp(0px,1.25svh,18px)) 7% auto;
  padding:0;text-align:center;text-shadow:none;
}
#stage:is([data-beat="18"],[data-beat="57"]) .caption .kicker{margin:0 0 .4em}
#stage[data-kind="chapter"]:is([data-beat="18"],[data-beat="57"]) .line {
  width:100%;max-width:100%;font-size:clamp(2.1rem,min(5.3vw,7.6svh),5.8rem);letter-spacing:-.055em;line-height:.98;
}
#stage:is([data-beat="18"],[data-beat="57"]) #chapter-sub {
  margin:.38em auto 0;max-width:39ch;font-size:clamp(.93rem,min(1.7vw,2.5svh),1.45rem);
}
#stage[data-kind="chapter"]:is([data-beat="18"],[data-beat="57"]) .line-mask {max-width:100%;width:100%}
#stage[data-beat="18"] .caption {color:#2e2a26}
#stage[data-beat="57"] .caption {color:#f8f0d9;text-shadow:0 1px 5px #142632,0 1px 11px #142632}
#stage[data-beat="57"] .caption .line {text-shadow:inherit}
#stage[data-beat="57"] .symmetry-label{margin-top:.25em}
.approval-sentence {display:block;margin-top:.27em;animation:signature-entry 1.05s .72s cubic-bezier(.17,.65,.2,1) backwards}
@keyframes signature-entry{from{transform:translateX(11%);opacity:0}to{transform:translateX(0);opacity:1}}

/* Place the closing verdict in a separate line at the foot of each spread. */
#stage:is([data-beat="44"],[data-beat="62"])>#chapter-sub {
  position:absolute;z-index:4;inset:auto auto 73px var(--edge);margin:0;max-width:calc(45% - var(--edge) * 2);
  display:flex;align-items:center;gap:.55em;padding:.5em .72em;color:#143848;background:#f7e7bb;
  border:1px solid #b28e60;border-radius:2px;box-shadow:0 2px 0 #604e3940;
  font:750 clamp(1rem,1.6vw,1.9rem)/1.12 var(--sans);letter-spacing:-.012em;text-align:left;text-wrap:balance;
  animation:verdict-entry 1.15s .85s cubic-bezier(.2,.72,.2,1) backwards;
}
#stage[data-beat="44"]>#chapter-sub {letter-spacing:.02em;color:#18463c;background:#ecf3dc;border-color:#83a58d}
.validation-check {
  border-radius:2px;background:#246449;color:#fff7dd;min-width:1.35em;height:1.35em;
  display:inline-grid;place-items:center;font:700 1em/1 Arial,sans-serif;
}
#stage[data-beat="44"] .gp-validation {visibility:hidden}
#stage:is([data-beat="19"],[data-beat="44"],[data-beat="62"]) .set #story-prop {inset:var(--bar) 0 58px}
#stage:is([data-beat="19"],[data-beat="44"],[data-beat="62"]) #story-prop .gp-object {top:50%;max-width:85%}
#stage:is([data-beat="19"],[data-beat="44"],[data-beat="62"]) .caption {top:clamp(90px,22%,230px)}
#stage:is([data-beat="19"],[data-beat="62"]) .line {font-size:clamp(1.7rem,min(3vw,5.25svh),4.05rem);line-height:1.075}
@keyframes verdict-entry{from{transform:translateX(-16%);opacity:0}to{transform:none;opacity:1}}
@media(max-width:780px) {
  html.enhanced body:not(.reading) .bar:has(>.stamp.in-chronology) {padding-inline:max(12px,env(safe-area-inset-left));grid-template-columns:minmax(0,1fr) auto auto;gap:0 7px}
  body:not(.reading) .bar:has(>.stamp.in-chronology) .brand {font-size:0;gap:0}
  body:not(.reading) .bar:has(>.stamp.in-chronology) .brand .key-mark {width:21px}
  .calendar-heading{font-size:clamp(1.34rem,6.3vw,1.9rem)}
  .long-date .calendar-heading{font-size:clamp(1.03rem,4.55vw,1.48rem)}
  .calendar-context{font-size:clamp(.62rem,2.6vw,.77rem)}
  .flag-pin{width:19px}
  .announcement-title {font-size:clamp(.7rem,3vw,.94rem)}
  .announcement-source {font-size:clamp(.58rem,2.25vw,.68rem)}
  body:not(.reading) .bar .film-announcement:not(:empty) {padding-bottom:6px;gap:.38em}
}
@media(max-width:780px) and (orientation:portrait) {
  #stage[data-chapter-prop="candle"]:not([data-beat="18"]) .cp-candle{bottom:calc(41% + 5px);right:6px}
  #stage:is([data-beat="19"],[data-beat="44"],[data-beat="62"]) {
    display:grid;grid-template-areas:none;grid-template-columns:minmax(0,1fr);
    grid-template-rows:var(--bar) minmax(0,1fr) auto auto 64px;
  }
  #stage:is([data-beat="19"],[data-beat="44"],[data-beat="62"]) .set {
    position:relative;inset:auto;grid-area:2/1;min-height:0;margin:0;
  }
  #stage:is([data-beat="19"],[data-beat="44"],[data-beat="62"]) .set #story-prop {position:absolute;inset:4px 0;overflow:hidden}
  #stage:is([data-beat="19"],[data-beat="44"],[data-beat="62"]) .caption {
    position:relative;grid-area:3/1;inset:auto;width:auto;padding:12px var(--edge) 8px;
  }
  #stage:is([data-beat="19"],[data-beat="44"],[data-beat="62"]) .line {font-size:clamp(1.2rem,min(6vw,3.6svh),2.5rem);line-height:1.055}
  #stage:is([data-beat="44"],[data-beat="62"])>#chapter-sub {
    position:relative;grid-area:4/1;justify-self:start;inset:auto;max-width:calc(100% - var(--edge) * 2);
    margin:0 var(--edge) 8px;font-size:clamp(1rem,4.5vw,1.35rem);
  }
  #stage:is([data-beat="19"],[data-beat="44"],[data-beat="62"]) .transport {
    grid-area:5/1;position:relative;inset:auto;height:100%;min-width:0;align-self:stretch;
    padding-top:14px;
  }
  #stage:is([data-beat="19"],[data-beat="44"],[data-beat="62"]) .transport .film-title {
    inset:3px auto auto var(--edge);padding:0;
  }
  #stage:is([data-beat="19"],[data-beat="44"])[data-chapter-prop="candle"] .chapter-props {
    position:relative;inset:auto;grid-area:2/1;min-height:0;
  }
  #stage:is([data-beat="19"],[data-beat="44"])[data-chapter-prop="candle"] .cp-candle {bottom:4px}
  #stage[data-kind="chapter"]:is([data-beat="18"],[data-beat="57"]) .caption {inset:max(calc(var(--bar) + 26px),19svh) 5% auto}
  #stage[data-kind="chapter"]:is([data-beat="18"],[data-beat="57"]) .line {font-size:clamp(2.35rem,11.2vw,4.75rem)}
  #stage:is([data-beat="18"],[data-beat="57"]) #chapter-sub {font-size:clamp(.9rem,4.1vw,1.22rem);max-width:29ch}
}
@media(max-height:540px) and (orientation:landscape) {
  body:not(.reading):has(#stage[data-beat="62"]) {--bar:65px}
  #stage:is([data-beat="19"],[data-beat="44"],[data-beat="62"]) .caption {top:calc(var(--bar) + 8px)}
  #stage:is([data-beat="19"],[data-beat="44"],[data-beat="62"]) .caption .kicker {margin:0 0 5px}
  #stage:is([data-beat="44"],[data-beat="62"])>#chapter-sub {bottom:43px;font-size:.98rem}
  #stage[data-chapter-prop="candle"] .cp-candle {width:64px;height:94px;bottom:42px}
}
@media(prefers-reduced-motion:reduce) {
  #stage .department-change,.approval-sentence,#stage:is([data-beat="44"],[data-beat="62"])>#chapter-sub {animation:none}
}
#read .read-beat small[data-department] {
  display:inline-block;font:750 .72rem/1.1 var(--sans);letter-spacing:.08em;
  padding:.23em .49em;border:1px solid #ae7757;border-radius:2px;margin-inline:.26em .36em;
  background:#edc39e;color:#242f32;vertical-align:baseline;
}
#read .read-beat small[data-department="service"] {color:#153f3c;background:#d9e9df;border-color:#7caa99}

/* These two title cards are printed on the wall between the lamp and the
   scenery. Project each room's measured landmarks through its cover crop.
   The separate car cutout is bottom-aligned and uses object-fit:contain. */
#stage[data-kind="chapter"]:is([data-beat="18"],[data-beat="57"]) {
  --room-height:max(100svh,66.6667vw);
  --room-top:calc((100svh - var(--room-height)) * .52);
  --lamp-edge:calc(var(--room-top) + var(--room-height) * var(--lamp-position));
  --roof-edge:calc(88svh - min(42svh,62vw * var(--car-ratio)));
  --wall-start:max(var(--bar),var(--lamp-edge));
  --wall-end:var(--roof-edge);
}
#stage[data-kind="chapter"][data-beat="18"] {
  --lamp-position:.201;
  --stripe-position:.491;
  --car-ratio:.343;
  --wall-end:min(var(--roof-edge),calc(var(--room-top) + var(--room-height) * var(--stripe-position)));
}
#stage[data-kind="chapter"][data-beat="57"] {
  --lamp-position:.152;
  --car-ratio:.362;
}
#stage[data-kind="chapter"][data-beat="57"] .caption {
  color:#001624;
  text-shadow:none;
}
#stage[data-kind="chapter"]:is([data-beat="18"],[data-beat="57"]) .caption {
  grid-area:auto;
  inset:var(--wall-start) 5% calc(100svh - var(--wall-end));
  justify-self:stretch;
  align-self:stretch;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:0;
  margin:0;
  padding:0;
  width:auto;
  max-width:none;
}
#stage[data-kind="chapter"]:is([data-beat="18"],[data-beat="57"]) .caption .line-mask {margin:0 auto}
@media(max-width:780px) and (orientation:portrait) {
  #stage[data-kind="chapter"]:is([data-beat="18"],[data-beat="57"]) {
    --room-height:max(100svh,150vw);
    --room-top:calc((100svh - var(--room-height)) * .5);
    --roof-edge:calc(79.5svh - min(34svh,78vw * var(--car-ratio)));
  }
  #stage[data-kind="chapter"][data-beat="18"] {--lamp-position:.155;--stripe-position:.519}
  #stage[data-kind="chapter"][data-beat="57"] {--lamp-position:.127}
}
@media(max-height:540px) and (orientation:landscape) {
  #stage[data-kind="chapter"]:is([data-beat="18"],[data-beat="57"]) .line {
    font-size:clamp(1.25rem,6.4svh,2.5rem);
  }
  #stage:is([data-beat="18"],[data-beat="57"]) #chapter-sub {
    max-width:60ch;margin-top:.2em;font-size:clamp(.8rem,2.9svh,1rem);
  }
}
@media(prefers-reduced-motion:reduce) {
  #stage[data-kind="chapter"][data-beat="57"] {--wall-end:min(var(--roof-edge),49svh)}
}
@media(prefers-reduced-motion:no-preference) {
  /* The moving AI fixture fills the stage. Finish its dissolve before
     exposing the title on the wall, without shifting the title itself. */
  #stage[data-kind="chapter"][data-beat="57"] .caption {
    filter:opacity(1);
    transition:filter .24s ease-out;
  }
  #stage[data-kind="chapter"][data-beat="57"]:has(> .fl-fixture:not([hidden]):not(.fl-static)) .caption {
    filter:opacity(0);
  }
}
