/* Home: the split doorway. Order: layout, type, colour, motion. Desk first. */

/* ================= LAYOUT ================= */

/* Opening words, kept short so the whole frame and the blue band fit the first window. */
.doorstep { padding-block: 0.75rem 1rem; }
.doorstep .first-line { max-width: none; }

/* The set piece: .frontdoor holds one 16:9 frame, cut in two at the seam. The frame takes
   the room left under the words, so the blue band closes the first window. It stands on the
   straw ground with the two halves meeting at the seam: no bark field, no letterbox bars,
   no strip under it. One 16:9 frame, shot whole, no crop. */
.doorway.frontdoor {
  --tda-frame-h: clamp(13rem, calc(100svh - var(--tda-lintel) - 15rem), 44rem);
  padding-top: var(--tda-beat);
}
.frontdoor .jamb {
  width: min(100%, calc(var(--tda-frame-h) * 8 / 9));
  height: var(--tda-frame-h);
}
.frontdoor > .hall > .jamb { margin-left: auto; }

/* .sill: the studio half of the blue band, the same height as the hall half. */
.sill { display: block; }

/* A chapter: .act is one row across the seam. The hall pane holds the .plate (one 16:9 tile,
   pinned under the header while its words pass); the studio pane holds the words. */
.act { align-items: stretch; }
.act > .hall, .act > .studio { padding: 0 var(--tda-edge) clamp(2.5rem, 9vh, 6.5rem); }
.frontdoor + .act > .hall, .frontdoor + .act > .studio { padding-top: clamp(2.5rem, 9vh, 6.5rem); }
.act > .hall-held { top: calc(var(--tda-lintel) + var(--tda-beat)); }

/* The plate runs the full height of its chapter - the taller of picture and words - so every
   picture bottoms out on its own last line and the space between chapters is one fixed
   measure instead of whatever length the text happened to be. */
.act > .plate { display: flex; align-self: stretch; }
.plate .mirror { flex: 1 1 auto; aspect-ratio: auto; }

.act > .studio > * + * { margin-top: var(--tda-beat); }
.glimpse { max-width: 32rem; }

/* The hand-off that closes the last chapter: two full-width tiles. */
.act > .studio > .farewell { display: grid; gap: 0.75rem; margin-top: calc(var(--tda-beat) * 2); }
.farewell .bow-way { min-height: 5.5rem; }

/* Phones: one stack. The two halves stay side by side as one whole picture; nothing pins. */
@media (max-width: 48rem) {
  .doorway.frontdoor { grid-template-columns: 1fr 1fr; padding-top: 0; }
  .frontdoor > .hall, .frontdoor > .studio { display: contents; }
  .frontdoor .jamb { width: 100%; height: auto; aspect-ratio: 8 / 9; }
  .frontdoor > .hall > .jamb { grid-column: 1; grid-row: 1; }
  .frontdoor > .studio > .jamb { grid-column: 2; grid-row: 1; }
  .frontdoor .trial-band { grid-column: 1 / -1; grid-row: 2; }
  .frontdoor .sill { display: none; }
  .act { align-items: start; }
  .act > .plate { display: block; }
  .plate .mirror { aspect-ratio: 16 / 9; }
  .act > .hall { padding-bottom: var(--tda-beat); }
  .frontdoor + .act > .studio { padding-top: 0; }
  .farewell .bow-way { min-height: 4.5rem; }
}

/* ================= TYPE ================= */

.frontdoor .trial-band { font-size: clamp(1.0625rem, 1.9vw, 1.75rem); }

/* The one Fredoka line that leads a chapter; everything under it is the body mono. */
.glimpse {
  font-family: var(--tda-voice);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.4vw, 2.125rem);
  line-height: 1.22;
}

/* ================= COLOUR ================= */

.farewell .offer-way { background: var(--tda-blue); color: var(--tda-straw); border-color: var(--tda-blue); }
.farewell .offer-way:hover { background: var(--tda-bark); color: var(--tda-straw); border-color: var(--tda-bark); }

/* ================= MOTION ================= */

/* The first screen is complete at rest: the two halves of the blue band are painted, not
   wiped in, so the trade, the sentence, the picture and the band are all there on arrival. */
