/* The stage: everything that belongs to the room, moved as one by the camera. A transformed parent holds its
   fixed children, so at rest and in flight they keep the same layout. */
#stage { position: fixed; inset: 0; z-index: 7; transform-origin: 0 0; }
/* In flight the frame drives each layer's opacity, so nothing may trail behind it. */
body.page-on :is(.wedge, #ring, .enter) { transition: none; }
body.page-on :is(.wedge, .enter) { pointer-events: none; }

/* A landing page: placeholder words in the clearing the sky leaves at the centre. */
.page { position: fixed; inset: 0; z-index: 8; overflow: auto; pointer-events: none; font-family: 'JetBrains Mono', monospace; color: #141414; }
body.page-on .page { pointer-events: auto; }
.page-inner { min-height: 100%; display: grid; place-items: center; padding: 10vh 24px 14vh; text-align: center; }
.page .kicker, .page h2, .page p, .page .about-back { opacity: 0; transition: opacity 180ms ease-out, transform 180ms ease-out; }
.page .kicker, .page h2, .page p { transform: translateY(8px); }
.page.page-in .kicker, .page.page-in h2, .page.page-in p, .page.page-in .about-back { opacity: 1; transform: none; transition: opacity 520ms cubic-bezier(.23, 1, .32, 1), transform 520ms cubic-bezier(.23, 1, .32, 1); }
.page.page-in h2 { transition-delay: 60ms; }
.page.page-in p { transition-delay: 120ms; }
.page .kicker { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; margin: 0 0 1.4em; }
.page h2 { font: 700 clamp(30px, 6vmin, 64px)/1.05 'JetBrains Mono', monospace; margin: 0 0 0.5em; letter-spacing: 0.02em; }
.page p { font-size: clamp(14px, 1.7vmin, 17px); line-height: 1.6; max-width: 28em; margin: 0 auto 1em; }
.page a:not(.about-back) { color: inherit; text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 0.08em; }
@media (prefers-reduced-motion: reduce) { .page .kicker, .page h2, .page p { transform: none; } }

/* Readings: its words and a link, until the calendar is switched on. Then the page gives the section the class
   calendar-on, the calendar fills the page and scrolls itself, and the sky behind it stays still. */
#page-readings.calendar-on { overflow: hidden; }
.page-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity 180ms ease-out; }
.page.page-in .page-frame { opacity: 1; transition: opacity 520ms cubic-bezier(.23, 1, .32, 1); }
/* Over the calendar the way back sits on a disc of paper, so it reads on whatever is under it. */
#page-readings.calendar-on .about-back { background: rgba(244, 241, 234, .84); }
/* The frame begins just below the way back, which stands in a strip of sky with the landing's heading beside it:
   on a narrow screen the calendar's panel reaches the left edge, and a long step scrolled under the way back
   would put the calendar's own back arrow in the same spot. The strip is the way back's own top (about.css),
   its 44px, and 8px of air. The frame's top edge fades over 12px, so what is scrolled goes into the strip
   softly; the calendar keeps more than that above its panel, so nothing at rest is faded. */
#page-readings.calendar-on .page-frame {
  --strip: calc(clamp(10px, 2.5vh, 24px) + 44px + 8px);
  top: var(--strip); height: calc(100% - var(--strip));
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12px);
  mask-image: linear-gradient(to bottom, transparent, #000 12px);
}
/* The heading, centred on the way back's line, on a feathered clearing of paper like the hub's name. */
.readings-head { position: absolute; left: 0; right: 0; top: clamp(10px, 2.5vh, 24px); height: 44px; display: grid; place-items: center; pointer-events: none; }
.page .readings-head h2 { position: relative; margin: 0; font-size: clamp(20px, 3.2vmin, 28px); }
.readings-head h2::before { content: ''; position: absolute; inset: -60% -30%; z-index: -1; background: radial-gradient(closest-side, rgba(244, 241, 234, .92) 55%, rgba(244, 241, 234, 0) 100%); }
/* The words and the heading are swapped by the hidden attribute, which their own display would otherwise outrank. */
.readings-head[hidden], #page-readings .page-inner[hidden] { display: none; }
/* A heading focused for the visitor on arrival is not a control, so it takes no ring. */
.page h2[tabindex="-1"]:focus { outline: none; }
