/* ==========================================================================
   Al Fajer Private School (AFS): the home page
   --------------------------------------------------------------------------
   Loaded by index.html only, after styles.css (tokens, buttons, header).

   The page tells one day. Al Fajer means "the dawn":
     first screen   night (a question children ask), dawn, day (the motto)
     as you scroll  the page's sky brightens from dawn gold to full day
     the end        dusk, running into the navy footer

   Motion rules (README, "Motion"): only transform and opacity move, plus
   small gold strokes that draw. Everything here is switched off by
   prefers-reduced-motion and by <html class="motion-off"> (the "Pause
   motion" button); the heavier effects are skipped on <html class="lite">
   (very low-end phones, Data Saver).

   Arabic-ready: logical properties throughout; drawings that point carry
   .icon-dir or are mirrored under [dir="rtl"].
   ========================================================================== */

/* 1. THE PAGE'S SKY (animation 8) ==========================================
   Without scroll timelines it is one long still gradient behind the page.
   With them it is fixed, and its dawn and dusk layers fade by scroll. */
.sky { position: absolute; inset: 0; z-index: var(--z-sky); pointer-events: none; overflow: hidden; }
.sky__dawn, .sky__dusk { position: absolute; inset-inline: 0; }
.sky__dawn { top: 0; height: min(2600px, 34%); background: linear-gradient(180deg, #f4e2ba 0%, #f9efd7 38%, rgba(255, 253, 246, 0) 100%); }
.sky__dusk { bottom: 0; height: min(1600px, 20%); background: linear-gradient(180deg, rgba(223, 229, 246, 0) 0%, #dfe5f6 55%, #c7d1ec 100%); }
.sky::after { content: ""; position: absolute; inset: 0; background: url("/assets/img/grain.png"); }
main { position: relative; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    html:not(.motion-off):not(.lite) .sky { position: fixed; }
    html:not(.motion-off):not(.lite) .sky__dawn { height: 100%; background: linear-gradient(180deg, #f4e2ba 0%, #f9efd7 55%, #fffaf0 100%); animation: sky-fade-out linear both; animation-timeline: scroll(root); animation-range: 4% 42%; }
    html:not(.motion-off):not(.lite) .sky__dusk { height: 100%; background: linear-gradient(180deg, #e6ebf8 0%, #d3dbf1 60%, #bfcbea 100%); opacity: 0; animation: sky-fade-in linear both; animation-timeline: scroll(root); animation-range: 74% 97%; }
  }
}
@keyframes sky-fade-out { to { opacity: 0; } }
@keyframes sky-fade-in { to { opacity: 1; } }

/* 2. FIRST SCREEN: NIGHT, DAWN, DAY ========================================
   The natural state of every rule here is DAY. The opening is a set of
   animations that START in night values and END at the natural ones, with
   fill-mode backwards only, so nothing lingers once they finish. They do
   not run when the opening was already seen this visit (<html
   class="seen-dawn">, set before paint by assets/js/first.js), when the
   visitor skips it (.is-skipped), or when motion is off. */
.dawn { position: relative; margin-top: calc(-1 * (var(--header-h) + 1px)); background: var(--navy-deep); color: #fff; --u: clamp(1.15px, 0.172svh, 1.45px); --grow: 2.4; }
.dawn__pin { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: max(600px, calc(100svh - 103px)); padding-top: var(--header-h); }
.dawn__sky { pointer-events: none; position: absolute; inset: 0; background: linear-gradient(180deg, var(--night) 0%, var(--navy-deep) 55%, var(--navy) 100%); }
.dawn__daysky { position: absolute; inset: 0; background: linear-gradient(180deg, var(--navy-deep) 0%, var(--navy) 46%, #14318c 78%, #1d3c9c 100%); transition: opacity 0.6s var(--ease); }
.dawn__glow { position: absolute; left: -25%; width: 150%; bottom: -42%; height: 86%; background: radial-gradient(closest-side, rgba(255, 240, 200, 1) 0%, rgba(244, 216, 150, 0.96) 26%, rgba(214, 174, 92, 0.78) 48%, rgba(198, 158, 79, 0.34) 72%, transparent 100%); transition: opacity 0.6s var(--ease); }
.dawn .dawn__sky .stars { opacity: 0.55; transition: opacity 0.6s var(--ease); }

/* stars that can join into a shape */
.constel { position: absolute; top: calc(var(--header-h) + 0.4rem); inset-inline-end: 3.6rem; width: 120px; height: auto; overflow: visible; opacity: 0.8; }
.constel__dots { fill: var(--gold-300); }
.constel__shape { fill: none; stroke: var(--gold-300); stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.constel__shape.is-joined { animation: constel-join 2s var(--ease) both; }
@keyframes constel-join { 0% { stroke-dashoffset: 1; opacity: 0.7; } 30%, 70% { stroke-dashoffset: 0; opacity: 0.7; } 100% { stroke-dashoffset: 0; opacity: 0; } }

.dawn__grid { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; }
.dawn__copy { position: relative; padding-top: 1.25rem; }

/* NIGHT */
/* Night and day swap by a wipe, never a fade: one leaves (0.25 s), then the
   other arrives (0.35 s), so the two are never on top of each other and
   text is always at full strength. */
.dawn__night { position: absolute; inset: 1.25rem 0 0 0; display: flex; flex-direction: column; visibility: hidden; clip-path: inset(-12px -12px 100% -12px); transform: translateY(-8px); pointer-events: none; transition: clip-path 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s linear 0.25s; }
.dawn__lead { flex: none; font: 700 1rem/1.4 var(--font-ui); color: var(--gold-300); margin: 0 0 0.6rem; }
@media (max-width: 599px) { .dawn__lead { max-width: 13.5em; } .constel { width: 84px; inset-inline-end: 3.5rem; } } /* phones: the line wraps before the stars' shape, so the two never cross */
.dawn__q { font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: clamp(2.6rem, 12vw, 3.3rem); line-height: 1.06; letter-spacing: -0.01em; max-width: 9.6em; margin: 0; color: #fff; flex: none; }
/* The stage takes all the room left under the question (the night layer is as
   tall as the words' column) and each scene, drawn 2 to 1, is fitted into it
   from the start of the line. One scene per question, each in a wrapper. */
.scene-stage { position: relative; flex: 1 1 auto; min-height: 0; margin-top: 1rem; width: 100%; max-width: 380px; max-height: 190px; }
.qscene { position: absolute; inset: 0; display: none; }
.scene { display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--gold-300); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
/* which question and scene show: <html data-q="n"> (first.js before paint, main.js after) */
.dawn__q > span { display: none; }
html:not([data-q]) .dawn__q > span:nth-child(1), html[data-q="0"] .dawn__q > span:nth-child(1), html[data-q="1"] .dawn__q > span:nth-child(2), html[data-q="2"] .dawn__q > span:nth-child(3), html[data-q="3"] .dawn__q > span:nth-child(4), html[data-q="4"] .dawn__q > span:nth-child(5), html[data-q="5"] .dawn__q > span:nth-child(6), html[data-q="6"] .dawn__q > span:nth-child(7), html[data-q="7"] .dawn__q > span:nth-child(8) { display: inline; }
html:not([data-q]) .qscene:nth-child(1), html[data-q="0"] .qscene:nth-child(1), html[data-q="1"] .qscene:nth-child(2), html[data-q="2"] .qscene:nth-child(3), html[data-q="3"] .qscene:nth-child(4), html[data-q="4"] .qscene:nth-child(5), html[data-q="5"] .qscene:nth-child(6), html[data-q="6"] .qscene:nth-child(7), html[data-q="7"] .qscene:nth-child(8) { display: block; }
[dir="rtl"] .scene-stage { transform: scaleX(-1); }

/* DAY */
.dawn__day { clip-path: inset(-12px -12px -12px -12px); transition: clip-path 0.35s var(--ease) 0.25s, transform 0.35s var(--ease) 0.25s; }
.dawn__qline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.75rem; margin: 0 0 0.6rem; color: var(--gold-300); }
.dawn__qline em { font: italic 500 1.0625rem/1.3 var(--font-display); }
@media (max-width: 1199px) { .dawn__qline em { flex: 1 0 100%; } } /* the button always on its own row: the same height for every question */

/* The hint on the "Next question" button (animation 3): a tiny gold drawing
   of what the next question is about. While the first screen waits, the
   drawing slowly draws itself, and it is also the clock: when it is complete
   the next question arrives by itself. main.js shows one drawing at a time.
   Held (the drawing stops and waits) while the pointer rests on the question
   line or the buttons, while the keyboard is inside the first screen, while
   the tab is hidden and while the first screen is out of sight. Off for
   "less motion" and after "Pause motion": then the hint is a still drawing
   and the question changes only when the button is pressed. */
.dawn__hint { display: none; flex: none; width: 24px; height: 24px; }
.dawn__another.has-hint .dawn__hint { display: block; }
.dawn__hint .doodle { display: none; stroke: var(--gold-300); stroke-width: 4.4; }
.dawn__hint .doodle.is-next { display: block; }
@keyframes q-clock { from { visibility: visible; } to { visibility: visible; } }
@keyframes hint-1 { from { stroke-dashoffset: 1; } 55%, to { stroke-dashoffset: 0; } }
@keyframes hint-2 { from, 45% { stroke-dashoffset: 1; } 85%, to { stroke-dashoffset: 0; } }
@keyframes hint-3 { from, 80% { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes hint-fade { from { opacity: 0.2; } to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  html:not(.motion-off) .dawn.is-waiting .dawn__hint { animation: q-clock var(--q-wait, 9s) linear both; }
  html:not(.motion-off):not(.lite) .dawn.is-waiting .dawn__hint .is-next path { animation: hint-1 var(--q-wait, 9s) steps(80) both; }
  html:not(.motion-off):not(.lite) .dawn.is-waiting .dawn__hint .is-next path.d2 { animation-name: hint-2; }
  html:not(.motion-off):not(.lite) .dawn.is-waiting .dawn__hint .is-next path.d3 { animation-name: hint-3; }
  html.lite:not(.motion-off) .dawn.is-waiting .dawn__hint .is-next { animation: hint-fade var(--q-wait, 9s) steps(12) both; }
  html.tab-hidden .dawn__hint, html.tab-hidden .dawn__hint *, .dawn.is-away .dawn__hint, .dawn.is-away .dawn__hint * { animation-play-state: paused !important; }
  .dawn__copy:has(:focus-visible) .dawn__hint, .dawn__copy:has(:focus-visible) .dawn__hint * { animation-play-state: paused !important; }
  @media (hover: hover) {
    .dawn__qline:hover .dawn__hint, .dawn__qline:hover .dawn__hint *, .dawn__copy:has(.qhero__ctas:hover) .dawn__hint, .dawn__copy:has(.qhero__ctas:hover) .dawn__hint * { animation-play-state: paused !important; }
  }
}
.dawn__another { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 1rem; background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, 0.45); border-radius: var(--r-pill); font: 800 var(--fs-xs)/1 var(--font-ui); cursor: pointer; white-space: nowrap; }
.dawn__another:hover { border-color: var(--gold-400); color: var(--gold-300); }
.dawn h1 { color: #fff; font-weight: 500; font-size: clamp(2.15rem, 10vw, 2.75rem); line-height: 1.05; letter-spacing: -0.015em; margin: 0; max-width: 9.4em; }
/* Book to birds (animation 5), under the motto: a fine line ends in an open
   book, and three birds lift off its pages. As written here it is the
   finished picture; the opening only plays towards it. */
.booktobirds { display: block; width: 236px; max-width: 78%; height: auto; margin-top: 0.35rem; overflow: visible; }
.bb-line, .bb-book path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.bb-line { stroke-width: 1.2; }
.bb-pages { stroke: var(--gold-300); stroke-width: 1.5; }
.bb-fine { stroke: var(--gold-500); stroke-width: 0.9; }
.bb-bird path { fill: var(--gold-300); }
.bb-bird, .bb-fly, .bb-bird path, .bb-book { transform-box: fill-box; transform-origin: 50% 50%; }
.bb-bird path { transform-origin: 50% 80%; }
/* how far each bird flies from the page, and when it leaves: the one that
   flies furthest leaves first, so they follow one another and never cross */
.bb-bird--1 { --bb-t: 4.34s; --bb-x: -33px; --bb-y: 10px; }
.bb-bird--2 { --bb-t: 4.22s; --bb-x: -70px; --bb-y: 16.5px; }
.bb-bird--3 { --bb-t: 4.1s; --bb-x: -104px; --bb-y: 20px; }
/* right to left: the line and the birds follow the reading direction; the book is not mirrored */
[dir="rtl"] .booktobirds, [dir="rtl"] .bb-book { transform: scaleX(-1); }
.qhero__support { font-size: 1rem; line-height: 1.5; color: rgba(255, 255, 255, 0.92); margin: 0.5rem 0 0; max-width: 23em; }
.qhero__ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.25rem; margin-top: 1rem; }
.dawn__link { display: none; align-items: center; min-height: 44px; font: 700 var(--fs-sm)/1.2 var(--font-ui); color: #fff; text-decoration: none; border-bottom: 1.5px solid var(--gold-500); }
.dawn__link:hover { color: var(--gold-300); }
@media (min-width: 600px) { .dawn__link { display: inline-flex; } }

/* one button per question: for keyboard and screen readers, seen on focus */
.qhero__dots { display: flex; gap: 0.35rem; height: 0; overflow: visible; }
.qhero__dot { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; opacity: 0; cursor: pointer; }
.qhero__dot::before { content: ""; display: block; width: 8px; height: 8px; margin: auto; border-radius: 50%; background: rgba(255, 255, 255, 0.6); }
.qhero__dot[aria-current="true"]::before { background: var(--gold-400); }
.qhero__dot:focus-visible { opacity: 1; width: 44px; height: 44px; }

/* The three arch photos. --u is one unit of the arcade (see the horizon). */
.dawn__arches { position: relative; z-index: 3; margin-top: auto; padding-top: 1.1rem; align-self: center; display: flex; align-items: flex-end; justify-content: center; gap: calc(8 * var(--u)); box-sizing: content-box; height: calc(180 * var(--u)); }
.arch { position: relative; flex: none; margin: 0; padding: 4px; border: 1.5px solid rgba(198, 158, 79, 0.9); border-radius: 999px 999px 10px 10px; }
.arch img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 999px 999px 6px 6px; }
.arch--a { width: calc(80 * var(--u)); height: calc(124 * var(--u)); }
.arch--b { width: calc(100 * var(--u)); height: calc(180 * var(--u)); z-index: 2; transform-origin: 50% 100%; }
.arch--c { width: calc(80 * var(--u)); height: calc(140 * var(--u)); }
.arch__veil { position: absolute; inset: 4px; border-radius: 999px 999px 6px 6px; background: #041138; opacity: 0; transition: opacity 0.6s var(--ease); }
.arch--b img { object-position: 50% 40%; }

/* The Bahrain horizon: 1 unit of its drawing = 1 --u, so it lines up with the arches. */
.horizon { pointer-events: none; position: absolute; bottom: 0; left: 50%; width: calc(1200 * var(--u)); height: calc(180 * var(--u)); max-width: none; transform: translateX(-50%); z-index: 0; overflow: visible; fill: none; stroke: var(--gold-400); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: opacity 0.4s var(--ease); }
.horizon__line { vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 0; }
/* Two more layers share its place, its mask and its fades: a far row in a
   soft haze behind it, and the town's windows in front. */
.horizon--far { stroke-width: 1; }
.horizon__far { vector-effect: non-scaling-stroke; opacity: 0.5; }
.horizon__haze { stroke: none; }
.horizon--lights { fill: var(--gold-300); stroke: none; opacity: 0; transition: opacity 0.5s var(--ease); }
/* Seasons (animation 4d): on the school calendar's own dates the skyline
   carries a small touch: lanterns and a crescent through Ramadan, pennants
   for Eid and for Bahrain National Day. main.js names the season on
   <html data-season> from the calendar; with no answer from the calendar
   nothing is shown. All three are drawings: nothing moves. The string hangs
   from a slim mast on the dome to the top of the tower's finial, high enough
   for the lanterns and pennants to be seen from across a room on a phone
   (16 Nov 2026: about twice as noticeable as first drawn). */
/* its box reaches 40 units above the roofs (the crescents stand there): on a
   laptop the skyline's mask cuts whatever leaves the box */
.horizon--season { height: calc(220 * var(--u)); stroke-width: 0.9; }
.season { display: none; }
html[data-season="ramadan"] .season--ramadan, html[data-season="eid"] .season--eid, html[data-season="national"] .season--national { display: inline; }
.season__glass { fill: #fbeec6; stroke: var(--gold-500); stroke-width: 0.9; }
.season__gold { fill: var(--gold-300); stroke: none; }
.season__red { fill: #e0263c; stroke: none; }
.season__white { fill: #fff; stroke: none; }

/* Facts along the foot */
.qhero__facts { position: relative; z-index: 4; background: rgba(3, 13, 46, 0.72); border-top: 1px solid rgba(198, 158, 79, 0.75); }
.qhero__facts-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem 1rem; padding-block: 0.8rem; font: 800 var(--fs-xs)/1.35 var(--font-ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-300); }
:lang(ar) .qhero__facts-row { letter-spacing: 0; text-transform: none; }

.dawn__pause { position: absolute; z-index: 5; inset-inline-end: 0.6rem; top: calc(var(--header-h) + 0.6rem); background: rgba(3, 13, 46, 0.35); border-color: rgba(255, 255, 255, 0.3); }

@media (min-width: 900px) {
  .dawn { --u: clamp(1.7px, 0.262vh, 2.2px); --grow: 1.7; }
  .dawn__pin { min-height: clamp(600px, calc(100vh - 96px), 860px); }
  .dawn .container { max-width: 1320px; }
  .dawn__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: clamp(1.5rem, 4vw, 4rem); align-items: end; }
  .dawn__copy { align-self: stretch; padding-top: clamp(1.75rem, 6vh, 4rem); } /* as tall as the photos beside it, so the night's scene has that room */
  .dawn__night { inset-block-start: clamp(1.75rem, 6vh, 4rem); }
  .dawn__lead { font-size: 1.1875rem; margin-bottom: 1rem; }
  .dawn__q { font-size: clamp(3.6rem, 5.6vw, 5.25rem); }
  .scene-stage { margin-block: 1.5rem 1.25rem; max-width: 560px; max-height: 280px; } /* inside the words' column, so it stays clear of the photos */
  .dawn__qline { margin-bottom: 1.1rem; }
  .dawn__qline em { font-size: 1.125rem; white-space: nowrap; }
  .dawn h1 { font-size: clamp(3rem, 4.6vw, 4.5rem); }
  .booktobirds { width: clamp(280px, 23vw, 340px); margin-top: 0.7rem; }
  .qhero__support { font-size: 1.1875rem; margin-top: 0.95rem; }
  .qhero__ctas { margin-top: 1.6rem; }
  .dawn__arches { align-self: end; padding-top: 0; margin-inline-end: 1rem; }
  .constel { width: 190px; top: calc(var(--header-h) + 1rem); inset-inline-end: 5.5rem; }
  /* the skyline stays clear of the words: it fades out towards the text column */
  .horizon { -webkit-mask-image: linear-gradient(90deg, transparent 0, transparent 30%, #000 37%); mask-image: linear-gradient(90deg, transparent 0, transparent 30%, #000 37%); }
  [dir="rtl"] .horizon { -webkit-mask-image: linear-gradient(270deg, transparent 0, transparent 30%, #000 37%); mask-image: linear-gradient(270deg, transparent 0, transparent 30%, #000 37%); }
  .dawn__glow { left: auto; inset-inline-end: -14%; width: 78%; bottom: -60%; height: 122%; }
  .qhero__facts-row { grid-template-columns: repeat(4, auto); justify-content: space-between; padding-block: 1.1rem; }
}

@media (min-width: 1200px) { .dawn__qline em { font-size: 1.3125rem; } }

/* --- The opening (animations 1, 4, 5): about 4.2 s ------------------------ */
@media (prefers-reduced-motion: no-preference) {
  html:not(.seen-dawn):not(.motion-off) .dawn:not(.is-skipped) .dawn__night { animation: open-night 4.2s linear backwards; }
  html:not(.seen-dawn):not(.motion-off) .dawn:not(.is-skipped) .dawn__day { animation: open-day 4.2s var(--ease) backwards; }
  html:not(.seen-dawn):not(.motion-off) .dawn:not(.is-skipped) .dawn__daysky { animation: open-fade-in 4.2s linear backwards; }
  html:not(.seen-dawn):not(.motion-off) .dawn:not(.is-skipped) .dawn__glow { animation: open-glow 4.2s linear backwards; }
  html:not(.seen-dawn):not(.motion-off) .dawn:not(.is-skipped) .arch__veil { animation: open-veil 4.2s linear backwards; }
  html:not(.seen-dawn):not(.motion-off) .dawn:not(.is-skipped) .dawn__sky .stars { animation: open-stars 4.2s linear backwards; }
  html:not(.seen-dawn):not(.motion-off):not(.lite) .dawn:not(.is-skipped) .horizon__line { animation: open-draw 4.2s linear backwards; }
  /* book to birds: the line, then the book, then the three birds, 1.5 s in all */
  html:not(.seen-dawn):not(.motion-off):not(.lite) .dawn:not(.is-skipped) .bb-line { animation: bb-draw 0.45s cubic-bezier(0.45, 0, 0.3, 1) 3.45s backwards; }
  html:not(.seen-dawn):not(.motion-off):not(.lite) .dawn:not(.is-skipped) .bb-pages { animation: bb-draw 0.35s cubic-bezier(0.3, 0, 0.3, 1) 3.75s backwards; }
  html:not(.seen-dawn):not(.motion-off):not(.lite) .dawn:not(.is-skipped) .bb-spine { animation-duration: 0.15s; animation-delay: 4s; }
  html:not(.seen-dawn):not(.motion-off):not(.lite) .dawn:not(.is-skipped) .bb-fine { animation: bb-fine 0.25s ease-out 4s backwards; }
  html:not(.seen-dawn):not(.motion-off):not(.lite) .dawn:not(.is-skipped) .bb-bird { animation: bb-out 0.62s cubic-bezier(0.3, 0.4, 0.4, 1) var(--bb-t) backwards; }
  html:not(.seen-dawn):not(.motion-off):not(.lite) .dawn:not(.is-skipped) .bb-fly { animation: bb-up 0.62s cubic-bezier(0.05, 0.8, 0.3, 1.12) var(--bb-t) backwards; }
  html:not(.seen-dawn):not(.motion-off):not(.lite) .dawn:not(.is-skipped) .bb-bird path { animation: bb-flap 0.31s ease-in-out var(--bb-t) 2 backwards; }
  html.lite:not(.seen-dawn):not(.motion-off) .dawn:not(.is-skipped) .booktobirds { animation: bb-fade 0.5s ease-out 3.5s backwards; }
  html:not(.seen-dawn):not(.motion-off):not(.lite) .dawn:not(.is-skipped) :is(.horizon--far, .horizon--season) { animation: open-fade-in 4.2s linear backwards; }
  html:not(.motion-off) .season { animation: fade-in 0.8s var(--ease) backwards; } /* a season arrives softly when the calendar has answered */
  html.lite:not(.seen-dawn):not(.motion-off) .dawn:not(.is-skipped) .horizon:not(.horizon--lights) { animation: open-fade-in 4.2s linear backwards; }
}
/* The words are wiped, never faded: text is at full strength or not there at
   all, so it is readable (and passes a contrast check) at every moment. */
@keyframes open-night { 0%, 50% { opacity: 1; visibility: visible; transform: none; clip-path: inset(-12px -12px -12px -12px); } 63.9% { opacity: 1; visibility: visible; transform: translateY(-12px); clip-path: inset(-12px -12px 100% -12px); } 64%, 100% { opacity: 0; visibility: hidden; transform: translateY(-10px); clip-path: inset(-12px -12px 100% -12px); } }
@keyframes open-day { 0%, 65.9% { visibility: hidden; transform: translateY(14px); clip-path: inset(-12px -12px 100% -12px); } 66% { visibility: visible; transform: translateY(14px); clip-path: inset(-12px -12px 100% -12px); } 84%, 100% { visibility: visible; transform: none; clip-path: inset(-12px -12px -12px -12px); } }
@keyframes open-fade-in { 0%, 47% { opacity: 0; } 76%, 100% { opacity: 1; } }
@keyframes open-glow { 0%, 47% { opacity: 0; transform: translateY(38%); } 78%, 100% { opacity: 1; transform: none; } }
@keyframes open-veil { 0%, 47% { opacity: 0.9; } 76%, 100% { opacity: 0; } }
@keyframes open-stars { 0%, 47% { opacity: 1; } 76%, 100% { opacity: 0.55; } }
@keyframes open-draw { 0%, 48% { stroke-dashoffset: 1; } 78%, 100% { stroke-dashoffset: 0; } }
@keyframes bb-draw { from { stroke-dashoffset: 1; } }
@keyframes bb-fine { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0.75; } } /* four short lines in one path: each is a quarter of its length */
@keyframes bb-out { from { transform: translateX(var(--bb-x)); } }
@keyframes bb-up { from { opacity: 0; transform: translateY(var(--bb-y)) scale(0.3); } 30% { opacity: 1; } }
@keyframes bb-flap { 50% { transform: scaleY(0.5); } }
@keyframes bb-fade { from { opacity: 0; } }

/* --- "Another question" (animation 3): night returns for a moment --------- */
.dawn.is-asking .dawn__night { visibility: visible; clip-path: inset(-12px -12px -12px -12px); transform: none; transition: clip-path 0.35s var(--ease) 0.25s, transform 0.35s var(--ease) 0.25s, visibility 0s linear 0.25s; }
/* the day's words are clipped away, not hidden: the keyboard stays where it was, and nothing unseen can be tapped */
.dawn.is-asking .dawn__day { clip-path: inset(-12px -12px 100% -12px); transform: translateY(-6px); transition: clip-path 0.25s var(--ease), transform 0.25s var(--ease); }
.dawn.is-asking .dawn__daysky { opacity: 0.15; }
.dawn.is-asking .dawn__glow { opacity: 0.2; }
.dawn.is-asking .arch__veil { opacity: 0.74; }
.dawn.is-asking .dawn__sky .stars { opacity: 1; }
.dawn.is-asking .horizon { opacity: 0.25; }
.dawn.is-asking .horizon--lights { opacity: 1; } /* the town's windows light up for the night story */
html[data-season="ramadan"] .dawn.is-asking .horizon--season { opacity: 1; } /* and Ramadan's lanterns and crescent stay bright */

/* --- The scenes (animation 2) ------------------------------------------------
   As written, a scene is its finished picture. It plays by itself, with no
   script, whenever its question is the one on show and the night is up: in
   the opening, and in each night moment (.is-asking). ---------------------- */
/* The look every scene shares (sc-fill, sc-ink, sc-draw, sc-pop ... and the
   keyframes sc-draw, sc-on, sc-pop) is in styles.css, "Line art": the banner
   pictures of the inner pages use it too. */
.dawn.is-asking { --scene-wait: 0.4s; } /* in a night moment a scene waits for the night to wipe in */
/* scene:moon */
/* the moon: the road and the town draw, the car drives over the hills with the moon right above it; then stars, a cloud, the headlamp */
@media (prefers-reduced-motion: no-preference) {
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .moon-road { animation: sc-draw 0.9s var(--ease) var(--scene-wait, 0s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .moon-town { animation: sc-draw 1s var(--ease) calc(var(--scene-wait, 0s) + 0.2s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .moon-palm { animation: sc-draw 1s var(--ease) calc(var(--scene-wait, 0s) + 0.35s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .moon-win { animation: sc-on 0.3s linear calc(var(--scene-wait, 0s) + 1.15s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .moon-win2 { animation-delay: calc(var(--scene-wait, 0s) + 1.4s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .moon-car { animation: moon-car 3.2s linear calc(var(--scene-wait, 0s) + 0.1s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .moon-moon { animation: moon-moon 3.2s linear calc(var(--scene-wait, 0s) + 0.1s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .moon-beam { animation: sc-on 0.4s linear calc(var(--scene-wait, 0s) + 2s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .moon-star { animation: sc-pop 0.5s var(--ease) calc(var(--scene-wait, 0s) + 1.9s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .moon-s2 { animation-delay: calc(var(--scene-wait, 0s) + 2.1s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .moon-s3 { animation-delay: calc(var(--scene-wait, 0s) + 2.3s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .moon-s4 { animation-delay: calc(var(--scene-wait, 0s) + 2.5s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .moon-cloud { animation: moon-cloud 1.6s cubic-bezier(0.2, 0.6, 0.3, 1) calc(var(--scene-wait, 0s) + 1.7s) backwards; }
}
@keyframes moon-car { 0% { transform: translate(-490px, 17.7px) rotate(1.9deg); } 10.9% { transform: translate(-410px, 6.9px) rotate(8deg); } 21.8% { transform: translate(-330px, 5.8px) rotate(15.6deg); } 32.7% { transform: translate(-250px, 15.5px) rotate(21.9deg); } 43.6% { transform: translate(-170px, 24.5px) rotate(15.2deg); } 54.5% { transform: translate(-90px, 21.1px) rotate(4.4deg); animation-timing-function: cubic-bezier(0.2, 0.5, 0.6, 1); } 72% { transform: translate(-40px, 10.7px) rotate(-2.8deg); animation-timing-function: ease-out; } 100% { transform: translate(0, 0) rotate(0deg); } }
@keyframes moon-moon { 0% { transform: translate(-490px, 16px); } 10.9% { transform: translate(-410px, 10px); } 21.8% { transform: translate(-330px, 5px); } 32.7% { transform: translate(-250px, 1px); } 43.6% { transform: translate(-170px, -2px); } 54.5% { transform: translate(-90px, -3px); animation-timing-function: cubic-bezier(0.2, 0.5, 0.6, 1); } 72% { transform: translate(-40px, -2px); animation-timing-function: ease-out; } 100% { transform: translate(0, 0); } }
@keyframes moon-cloud { from { opacity: 0; transform: translateX(-70px); } }
/* /scene:moon */

/* scene:fish */
/* the fish: light falls from the surface, the big fish swims in, a shoal passes, the grass sways; then bubbles rise and the oyster shows its pearl */
.scene g.fish-grass { transform-origin: 50% 100%; }
.scene g.fish-lid { transform-origin: 0% 100%; }
.scene g.fish-tail { transform-origin: 100% 50%; }
@media (prefers-reduced-motion: no-preference) {
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .fish-top { animation: sc-draw 1s var(--ease) var(--scene-wait, 0s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .fish-ray { animation: sc-on 0.9s linear calc(var(--scene-wait, 0s) + 0.1s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .fish-ray2 { animation-delay: calc(var(--scene-wait, 0s) + 0.35s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .fish-ray3 { animation-delay: calc(var(--scene-wait, 0s) + 0.6s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .fish-bed { animation: sc-draw 1s var(--ease) calc(var(--scene-wait, 0s) + 0.1s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .fish-blade { animation: sc-draw 0.9s var(--ease) calc(var(--scene-wait, 0s) + 0.4s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .fish-grass { animation: fish-sway 2.4s ease-in-out calc(var(--scene-wait, 0s) + 0.9s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .fish-grass2 { animation-delay: calc(var(--scene-wait, 0s) + 1s); animation-direction: reverse; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .fish-big { animation: fish-big 1.8s linear calc(var(--scene-wait, 0s) + 0.1s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .fish-tail { animation: fish-tail 0.36s ease-in-out calc(var(--scene-wait, 0s) + 0.1s) 5 backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .fish-shoal { animation: fish-shoal 3.1s cubic-bezier(0.2, 0.6, 0.3, 1) calc(var(--scene-wait, 0s) + 0.2s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .fish-bub { animation: fish-bub 0.9s var(--ease) calc(var(--scene-wait, 0s) + 1.9s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .fish-b2 { animation-delay: calc(var(--scene-wait, 0s) + 2.05s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .fish-b3 { animation-delay: calc(var(--scene-wait, 0s) + 2.2s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .fish-b4 { animation-delay: calc(var(--scene-wait, 0s) + 2.35s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .fish-lid { animation: fish-lid 0.7s var(--ease) calc(var(--scene-wait, 0s) + 2s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .fish-pearl { animation: sc-pop 0.5s var(--ease) calc(var(--scene-wait, 0s) + 2.45s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .fish-spark { animation: sc-pop 0.4s var(--ease) calc(var(--scene-wait, 0s) + 2.85s) backwards; }
}
@keyframes fish-big { 0% { transform: translate(-474.0px, -36.0px) rotate(-20.6deg); } 14.3% { transform: translate(-347.5px, -25.1px) rotate(1.9deg); } 28.6% { transform: translate(-246.0px, 20.7px) rotate(-1.0deg); } 42.9% { transform: translate(-156.3px, 24.0px) rotate(-15.7deg); } 57.1% { transform: translate(-88.4px, 3.6px) rotate(-17.3deg); } 71.4% { transform: translate(-39.4px, -8.5px) rotate(-9.6deg); } 85.7% { transform: translate(-9.6px, -3.3px) rotate(-1.1deg); } 100% { transform: translate(0.0px, 0.0px) rotate(0.0deg); } }
@keyframes fish-tail { 50% { transform: rotate(14deg); } }
@keyframes fish-sway { 30% { transform: rotate(5deg); } 68% { transform: rotate(-4deg); } }
@keyframes fish-shoal { from { transform: translate(190px, -14px); } }
@keyframes fish-bub { from { opacity: 0; transform: translateY(46px) scale(0.5); } }
@keyframes fish-lid { from { transform: rotate(38deg); } }
/* /scene:fish */

/* scene:sky */
/* the sky: a paper plane climbs past the clouds and loops once, a kite sways on its string; then the plane flies on past the stars */
.scene g.sky-kite { transform-origin: 100% 100%; }
@media (prefers-reduced-motion: no-preference) {
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sky-ca { animation: sky-drift 3.3s linear var(--scene-wait, 0s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sky-cb { animation: sky-drift 3.3s linear var(--scene-wait, 0s) reverse backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sky-ground { animation: sc-draw 0.9s var(--ease) calc(var(--scene-wait, 0s) + 0.1s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sky-string { animation: sc-draw 0.6s var(--ease) calc(var(--scene-wait, 0s) + 0.5s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sky-kbody { animation: sc-pop 0.5s var(--ease) calc(var(--scene-wait, 0s) + 0.9s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sky-tail { animation: sc-draw 0.6s var(--ease) calc(var(--scene-wait, 0s) + 1.2s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sky-kite { animation: sky-sway 2.2s ease-in-out calc(var(--scene-wait, 0s) + 1.1s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sky-plane { animation: sky-plane 3.2s linear calc(var(--scene-wait, 0s) + 0.1s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sky-trail { animation: sky-trail 3.2s linear calc(var(--scene-wait, 0s) + 0.1s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sky-star { animation: sc-pop 0.5s var(--ease) calc(var(--scene-wait, 0s) + 1.9s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sky-s2 { animation-delay: calc(var(--scene-wait, 0s) + 2.2s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sky-s3 { animation-delay: calc(var(--scene-wait, 0s) + 2.5s); }
}
@keyframes sky-plane { 0% { transform: translate(-660.0px, 278.0px) rotate(373.3deg); } 4.8% { transform: translate(-589.3px, 265.6px) rotate(356.7deg); } 9.7% { transform: translate(-522.0px, 239.9px) rotate(350.3deg); } 14.5% { transform: translate(-456.3px, 210.2px) rotate(349.7deg); } 19.3% { transform: translate(-389.7px, 182.7px) rotate(354.2deg); } 24.2% { transform: translate(-320.0px, 165.2px) rotate(367.6deg); } 29% { transform: translate(-259.2px, 136.6px) rotate(306.0deg); } 33.8% { transform: translate(-286.1px, 78.2px) rotate(212.2deg); } 38.7% { transform: translate(-342.6px, 109.0px) rotate(118.3deg); } 43.5% { transform: translate(-308.1px, 163.2px) rotate(24.4deg); } 48.3% { transform: translate(-238.5px, 148.5px) rotate(-10.8deg); } 53.2% { transform: translate(-177.0px, 111.2px) rotate(-22.2deg); } 58% { transform: translate(-121.0px, 65.8px) rotate(-27.4deg); } 62.7% { transform: translate(-98.9px, 46.2px) rotate(-26.8deg); } 67.3% { transform: translate(-78.6px, 29.9px) rotate(-22.8deg); } 72% { transform: translate(-59.8px, 17.4px) rotate(-15.4deg); } 76.7% { transform: translate(-42.4px, 9.6px) rotate(-4.5deg); } 81.3% { transform: translate(-27.2px, 5.7px) rotate(2.3deg); } 86% { transform: translate(-15.3px, 3.4px) rotate(2.8deg); } 90.7% { transform: translate(-6.8px, 1.6px) rotate(1.4deg); } 95.3% { transform: translate(-1.7px, 0.4px) rotate(0.2deg); } 100% { transform: translate(0.0px, 0.0px) rotate(0.0deg); } }
@keyframes sky-trail { 0% { stroke-dashoffset: 1; } 58% { stroke-dashoffset: 0.14; animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94); } 100% { stroke-dashoffset: 0; } }
@keyframes sky-drift { from { transform: translateX(-26px); } }
@keyframes sky-sway { 35% { transform: rotate(-5deg); } 70% { transform: rotate(3deg); } }
/* /scene:sky */

/* scene:rainbow */
/* the rainbow: rain on one side, the sun behind a cloud on the other, and the rainbow draws from cloud to cloud; then small steps climb it and stop at the top */
@media (prefers-reduced-motion: no-preference) {
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .rainbow-sun { animation: rainbow-sun 1.2s var(--ease) calc(var(--scene-wait, 0s) + 0.1s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .rainbow-rain { animation: rainbow-rain 0.5s ease-out calc(var(--scene-wait, 0s) + 0.3s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .rainbow-r2 { animation-delay: calc(var(--scene-wait, 0s) + 0.55s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .rainbow-arc { animation: sc-draw 1.1s cubic-bezier(0.45, 0, 0.3, 1) calc(var(--scene-wait, 0s) + 0.3s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .rainbow-a2 { animation-delay: calc(var(--scene-wait, 0s) + 0.42s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .rainbow-a3 { animation-delay: calc(var(--scene-wait, 0s) + 0.54s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .rainbow-a4 { animation-delay: calc(var(--scene-wait, 0s) + 0.66s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .rainbow-band { animation: sc-on 0.6s linear calc(var(--scene-wait, 0s) + 1.3s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .rainbow-step { animation: sc-pop 0.35s var(--ease) calc(var(--scene-wait, 0s) + 1.9s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .rainbow-t2 { animation-delay: calc(var(--scene-wait, 0s) + 2.05s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .rainbow-t3 { animation-delay: calc(var(--scene-wait, 0s) + 2.2s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .rainbow-t4 { animation-delay: calc(var(--scene-wait, 0s) + 2.35s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .rainbow-t5 { animation-delay: calc(var(--scene-wait, 0s) + 2.5s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .rainbow-t6 { animation-delay: calc(var(--scene-wait, 0s) + 2.65s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .rainbow-t7 { animation-delay: calc(var(--scene-wait, 0s) + 2.8s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .rainbow-star { animation: sc-pop 0.4s var(--ease) calc(var(--scene-wait, 0s) + 2.95s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .rainbow-st2 { animation-delay: calc(var(--scene-wait, 0s) + 3s); }
}
@keyframes rainbow-sun { from { opacity: 0; transform: translateY(26px); } }
@keyframes rainbow-rain { from { opacity: 0; transform: translate(5px, -13px); } }
/* /scene:rainbow */

/* scene:sun */
/* the sun: it sinks to the horizon and its path shimmers on the water; then birds cross and the moon and the first stars take its place */
@media (prefers-reduced-motion: no-preference) {
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sun-horizon { animation: sc-draw 0.8s var(--ease) var(--scene-wait, 0s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sun-land { animation: sc-draw 0.9s var(--ease) calc(var(--scene-wait, 0s) + 0.2s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sun-wave { animation: sc-draw 0.8s var(--ease) calc(var(--scene-wait, 0s) + 0.5s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sun-sun { animation: sun-set 1.7s cubic-bezier(0.4, 0, 0.3, 1) calc(var(--scene-wait, 0s) + 0.1s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sun-shim { animation: sc-on 0.3s linear calc(var(--scene-wait, 0s) + 1.2s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sun-h2 { animation-delay: calc(var(--scene-wait, 0s) + 1.35s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sun-h3 { animation-delay: calc(var(--scene-wait, 0s) + 1.5s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sun-h4 { animation-delay: calc(var(--scene-wait, 0s) + 1.65s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sun-h5 { animation-delay: calc(var(--scene-wait, 0s) + 1.8s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sun-birds { animation: sun-birds 1.5s cubic-bezier(0.2, 0.5, 0.3, 1) calc(var(--scene-wait, 0s) + 1.8s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sun-bird { animation: sun-flap 0.3s ease-in-out calc(var(--scene-wait, 0s) + 1.8s) 5 backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sun-moon { animation: sun-moon 0.9s var(--ease) calc(var(--scene-wait, 0s) + 2s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sun-star { animation: sc-pop 0.5s var(--ease) calc(var(--scene-wait, 0s) + 2.3s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sun-s2 { animation-delay: calc(var(--scene-wait, 0s) + 2.55s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sun-s3 { animation-delay: calc(var(--scene-wait, 0s) + 2.8s); }
}
@keyframes sun-set { from { transform: translateY(-118px); } }
@keyframes sun-birds { from { opacity: 0; transform: translate(330px, -30px); } 20% { opacity: 1; } }
@keyframes sun-flap { 50% { transform: scaleY(0.45); } }
@keyframes sun-moon { from { opacity: 0; transform: translateY(26px); } }
/* /scene:sun */

/* scene:sea */
/* the sea: a dhow under sail rides three layers of waves under the moon; then gulls circle, the wave tops sparkle like salt and a fish jumps */
@media (prefers-reduced-motion: no-preference) {
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sea-w1 { animation: sc-draw 1s var(--ease) var(--scene-wait, 0s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sea-w2 { animation: sc-draw 1s var(--ease) calc(var(--scene-wait, 0s) + 0.15s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sea-w3 { animation: sc-draw 1s var(--ease) calc(var(--scene-wait, 0s) + 0.3s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sea-dhow { animation: sea-dhow 2.6s linear calc(var(--scene-wait, 0s) + 0.1s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sea-gull { animation: sea-gull 1.4s cubic-bezier(0.3, 0.4, 0.4, 1) calc(var(--scene-wait, 0s) + 1.8s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sea-g2 { animation-name: sea-gull2; animation-delay: calc(var(--scene-wait, 0s) + 1.95s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sea-wing { animation: sea-flap 0.3s ease-in-out calc(var(--scene-wait, 0s) + 1.8s) 5 backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sea-salt { animation: sc-pop 0.4s var(--ease) calc(var(--scene-wait, 0s) + 2s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sea-t2 { animation-delay: calc(var(--scene-wait, 0s) + 2.25s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sea-t3 { animation-delay: calc(var(--scene-wait, 0s) + 2.5s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sea-splash { animation: sc-pop 0.3s var(--ease) calc(var(--scene-wait, 0s) + 2.7s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .sea-jump { animation: sea-jump 0.55s cubic-bezier(0.2, 0.6, 0.4, 1) calc(var(--scene-wait, 0s) + 2.7s) backwards; }
}
@keyframes sea-dhow { 0% { transform: translate(-320px, 3px) rotate(-4deg); } 20% { transform: translate(-236px, -4px) rotate(3deg); } 40% { transform: translate(-152px, 3px) rotate(-3deg); } 60% { transform: translate(-76px, -3px) rotate(2.5deg); animation-timing-function: ease-out; } 100% { transform: translate(0, 0) rotate(0deg); } }
@keyframes sea-gull { 0% { opacity: 0; transform: translate(72.0px, 42.0px) rotate(99.1deg); } 12.5% { opacity: 1; transform: translate(83.4px, -7.0px) rotate(78.8deg); } 25% { transform: translate(46.9px, -33.5px) rotate(63.9deg); } 37.5% { transform: translate(7.9px, -34.4px) rotate(56.6deg); } 50% { transform: translate(-21.9px, -22.7px) rotate(49.0deg); } 62.5% { transform: translate(-30.4px, -2.0px) rotate(21.3deg); } 75% { transform: translate(-13.9px, 3.1px) rotate(4.4deg); } 87.5% { transform: translate(-3.4px, 1.1px) rotate(0.7deg); } 100% { transform: translate(0.0px, 0.0px) rotate(0.0deg); } }
@keyframes sea-gull2 { 0% { opacity: 0; transform: translate(-88.0px, 54.0px) rotate(-100.4deg); } 12.5% { opacity: 1; transform: translate(-101.6px, 10.6px) rotate(-81.6deg); } 25% { transform: translate(-72.8px, -17.7px) rotate(-66.7deg); } 37.5% { transform: translate(-38.3px, -22.7px) rotate(-58.8deg); } 50% { transform: translate(-10.2px, -16.6px) rotate(-54.4deg); } 62.5% { transform: translate(9.9px, -6.9px) rotate(-49.5deg); } 75% { transform: translate(12.4px, 3.1px) rotate(-5.5deg); } 87.5% { transform: translate(3.0px, 1.1px) rotate(-0.6deg); } 100% { transform: translate(0.0px, 0.0px) rotate(0.0deg); } }
@keyframes sea-flap { 50% { transform: scaleY(0.45); } }
@keyframes sea-jump { 0% { opacity: 0; transform: translate(-46.0px, 76.0px) rotate(-58.3deg); } 20% { opacity: 1; transform: translate(-37.9px, 43.6px) rotate(-46.3deg); } 40% { transform: translate(-25.7px, 20.7px) rotate(-30.5deg); } 60% { transform: translate(-12.8px, 7.4px) rotate(-14.5deg); } 80% { transform: translate(-3.4px, 1.5px) rotate(-3.4deg); } 100% { transform: translate(0.0px, 0.0px) rotate(0.0deg); } }
/* /scene:sea */

/* scene:stars */
/* the stars: they come out a few at a time over a hill with a telescope; then lines join some into shapes, a few twinkle and a shooting star crosses */
@media (prefers-reduced-motion: no-preference) {
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .stars-hill { animation: sc-draw 0.9s var(--ease) var(--scene-wait, 0s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .stars-scope { animation: sc-draw 0.6s var(--ease) calc(var(--scene-wait, 0s) + 0.3s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .stars-tube { animation: sc-pop 0.5s var(--ease) calc(var(--scene-wait, 0s) + 0.6s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .stars-star { animation: sc-pop 0.5s var(--ease) calc(var(--scene-wait, 0s) + 0.2s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .stars-g2 { animation-delay: calc(var(--scene-wait, 0s) + 0.6s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .stars-g3 { animation-delay: calc(var(--scene-wait, 0s) + 1s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .stars-g4 { animation-delay: calc(var(--scene-wait, 0s) + 1.4s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .stars-join { animation: sc-draw 1s cubic-bezier(0.45, 0, 0.3, 1) calc(var(--scene-wait, 0s) + 1.9s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .stars-j2 { animation-duration: 0.7s; animation-delay: calc(var(--scene-wait, 0s) + 2.3s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .stars-tw { animation: sc-pop 0.5s var(--ease) calc(var(--scene-wait, 0s) + 0.2s) backwards, stars-tw 0.5s ease-in-out calc(var(--scene-wait, 0s) + 2.2s) 2; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .stars-tw.stars-g2 { animation-delay: calc(var(--scene-wait, 0s) + 0.6s), calc(var(--scene-wait, 0s) + 2.35s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .stars-tw.stars-g4 { animation-delay: calc(var(--scene-wait, 0s) + 1.4s), calc(var(--scene-wait, 0s) + 2.1s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .stars-shoot { animation: stars-shoot 0.7s cubic-bezier(0.2, 0.6, 0.3, 1) calc(var(--scene-wait, 0s) + 2.6s) backwards; }
}
@keyframes stars-tw { 50% { transform: scale(1.5); } }
@keyframes stars-shoot { from { opacity: 0; transform: translate(170px, -80px); } 25% { opacity: 1; } }
/* /scene:stars */

/* scene:birds */
/* the birds: a flock in a V flies over the little town along a dotted way; then it reaches the tree and the last bird catches up */
@media (prefers-reduced-motion: no-preference) {
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-hill { animation: sc-draw 0.9s var(--ease) var(--scene-wait, 0s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-town { animation: sc-draw 1s var(--ease) calc(var(--scene-wait, 0s) + 0.15s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-palm { animation: sc-draw 0.9s var(--ease) calc(var(--scene-wait, 0s) + 0.3s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-tree { animation: sc-draw 0.7s var(--ease) calc(var(--scene-wait, 0s) + 0.4s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-crown { animation: sc-on 0.5s linear calc(var(--scene-wait, 0s) + 0.8s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-win { animation: sc-on 0.3s linear calc(var(--scene-wait, 0s) + 1.1s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-w2 { animation-delay: calc(var(--scene-wait, 0s) + 1.3s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-w3 { animation-delay: calc(var(--scene-wait, 0s) + 1.5s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-dot { animation: sc-pop 0.3s var(--ease) calc(var(--scene-wait, 0s) + 0.1s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-d2 { animation-delay: calc(var(--scene-wait, 0s) + 0.22s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-d3 { animation-delay: calc(var(--scene-wait, 0s) + 0.34s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-d4 { animation-delay: calc(var(--scene-wait, 0s) + 0.46s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-d5 { animation-delay: calc(var(--scene-wait, 0s) + 0.58s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-d6 { animation-delay: calc(var(--scene-wait, 0s) + 0.7s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-d7 { animation-delay: calc(var(--scene-wait, 0s) + 0.82s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-d8 { animation-delay: calc(var(--scene-wait, 0s) + 0.94s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-d9 { animation-delay: calc(var(--scene-wait, 0s) + 1.06s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-flock { animation: birds-flock 3.1s linear calc(var(--scene-wait, 0s) + 0.1s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-wing { animation: birds-flap 0.34s ease-in-out calc(var(--scene-wait, 0s) + 0.1s) 9 backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-b2 { animation-delay: calc(var(--scene-wait, 0s) + 0.2s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-b3 { animation-delay: calc(var(--scene-wait, 0s) + 0.27s); animation-iteration-count: 8; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-star { animation: sc-pop 0.5s var(--ease) calc(var(--scene-wait, 0s) + 2.2s) backwards; }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-s2 { animation-delay: calc(var(--scene-wait, 0s) + 2.5s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-s3 { animation-delay: calc(var(--scene-wait, 0s) + 2.8s); }
  html:not(.motion-off):not(.lite) :is(.dawn.is-asking, html:not(.seen-dawn) .dawn:not(.is-skipped)) .birds-last { animation: birds-last 1.2s cubic-bezier(0.2, 0.5, 0.3, 1) calc(var(--scene-wait, 0s) + 2.05s) backwards; }
}
@keyframes birds-flock { 0% { transform: translate(-552.0px, 24.0px) rotate(-16.2deg); } 8% { transform: translate(-501.4px, -12.0px) rotate(-14.6deg); } 16% { transform: translate(-446.8px, -41.5px) rotate(-12.7deg); } 24% { transform: translate(-388.6px, -62.8px) rotate(-10.5deg); } 32% { transform: translate(-327.6px, -74.1px) rotate(-7.9deg); } 40% { transform: translate(-265.6px, -73.3px) rotate(-5.1deg); } 48% { transform: translate(-204.1px, -64.7px) rotate(-4.1deg); } 56% { transform: translate(-143.3px, -52.0px) rotate(-3.1deg); } 63.3% { transform: translate(-98.4px, -39.4px) rotate(-2.3deg); } 70.7% { transform: translate(-62.3px, -27.0px) rotate(-1.5deg); } 78% { transform: translate(-34.7px, -16.0px) rotate(-0.8deg); } 85.3% { transform: translate(-15.3px, -7.4px) rotate(-0.4deg); } 92.7% { transform: translate(-3.8px, -1.9px) rotate(-0.1deg); } 100% { transform: translate(0.0px, 0.0px) rotate(0.0deg); } }
@keyframes birds-last { 0% { opacity: 0; transform: translate(-472.0px, 48.0px) rotate(-17.7deg); } 14.3% { opacity: 1; transform: translate(-354.3px, -13.9px) rotate(-14.7deg); } 28.6% { transform: translate(-245.9px, -44.1px) rotate(-11.6deg); } 42.9% { transform: translate(-153.9px, -48.2px) rotate(-8.0deg); } 57.1% { transform: translate(-82.9px, -38.4px) rotate(-6.3deg); } 71.4% { transform: translate(-34.5px, -22.1px) rotate(-2.6deg); } 85.7% { transform: translate(-8.3px, -6.1px) rotate(-0.4deg); } 100% { transform: translate(0.0px, 0.0px) rotate(0.0deg); } }
@keyframes birds-flap { 50% { transform: scaleY(0.45); } }
/* /scene:birds */

/* --- Arch portal (animation 7): only where scroll timelines exist --------- */
.dawn__run { display: none; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) and (min-height: 560px) {
    html:not(.motion-off):not(.lite) .dawn { view-timeline: --dawn block; view-timeline-inset: 0px; } /* inset 0: without it the page's scroll-padding starts the portal before any scrolling */
    html:not(.motion-off):not(.lite) .dawn__run { display: block; height: 55svh; }
    html:not(.motion-off):not(.lite) .dawn__pin { position: sticky; top: calc(-1 * var(--pin-over, 0px)); } /* --pin-over (main.js): on a short phone the pin settles with its foot, the arches, in view */
    html:not(.motion-off):not(.lite) .arch--b { animation: portal-grow linear both; animation-timeline: --dawn; animation-range: contain 0% contain 100%; }
    html:not(.motion-off):not(.lite) .arch--a { animation: portal-leave-a linear both; animation-timeline: --dawn; animation-range: contain 0% contain 55%; }
    html:not(.motion-off):not(.lite) .arch--c { animation: portal-leave-c linear both; animation-timeline: --dawn; animation-range: contain 0% contain 55%; }
    html:not(.motion-off):not(.lite) .dawn__copy { animation: portal-copy linear both; animation-timeline: --dawn; animation-range: contain 0% contain 45%; }
    html:not(.motion-off):not(.lite) .horizon, html:not(.motion-off):not(.lite) .constel { animation: portal-fade linear both; animation-timeline: --dawn; animation-range: contain 0% contain 35%; }
    /* laptops: the arch grows beside the words, never over them, so the motto
       and the question stay; and the screen is held for a shorter stretch */
    @media (min-width: 900px) {
      html:not(.motion-off):not(.lite) .dawn__run { height: 34svh; }
      html:not(.motion-off):not(.lite) .dawn__copy { animation: none; }
    }
  }
}
@keyframes portal-grow { to { transform: scale(var(--grow)); } }
@keyframes portal-leave-a { to { transform: translateX(-70%); opacity: 0; } }
@keyframes portal-leave-c { to { transform: translateX(70%); opacity: 0; } }
@keyframes portal-copy { to { transform: translateY(-36px); opacity: 0; } }
@keyframes portal-fade { to { opacity: 0; } }
[dir="rtl"] .arch--a { animation-name: portal-leave-c; }
[dir="rtl"] .arch--c { animation-name: portal-leave-a; }

/* 3. SECTIONS BELOW =========================================================
   Their backgrounds are see-through, so the page's sky shows. */
.section-head--split { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; max-width: none; margin-bottom: var(--sp-6); }
.section-head--split h2 { margin-bottom: 0; }
.section-head__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* Welcome + facts */
.welcome { padding-top: clamp(3.5rem, 8vw, 6.5rem); }
.welcome__grid { display: grid; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (min-width: 900px) { .welcome__grid { grid-template-columns: 1.15fr 1fr; } }
.welcome .rule-dot { margin: 0.15rem 0 1.25rem; }
.welcome .lead { color: var(--ink-700); }
.facts { position: relative; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid rgba(198, 158, 79, 0.55); border-radius: var(--r-xl); background: rgba(255, 255, 255, 0.62); }
.facts__doodle { position: absolute; top: -22px; inset-inline-end: 22px; width: 46px; height: 46px; background: var(--cream); border-radius: 50%; padding: 6px; }
.facts__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.facts__item { padding: 1rem 0.9rem 1.1rem; }
.facts__item:nth-child(odd) { border-inline-end: 1px solid rgba(198, 158, 79, 0.45); padding-inline-start: 0.2rem; }
.facts__item:nth-child(-n+2) { border-bottom: 1px solid rgba(198, 158, 79, 0.45); }
.facts__num { font-family: var(--font-display); font-weight: 560; font-size: clamp(2.2rem, 5.4vw, 3.3rem); line-height: 1; letter-spacing: -0.02em; color: var(--navy-deep); font-variant-numeric: lining-nums tabular-nums; }
.facts__num--words { font-size: clamp(1.7rem, 4.2vw, 2.5rem); }
/* "About 350": a small word before the figure. On a narrow phone it sits
   just above the figure instead, so the figure keeps its place in the row. */
.facts__num { position: relative; }
.facts__about { position: absolute; inset-block-end: 100%; inset-inline-start: 0; font: 800 0.875rem/1.1 var(--font-ui); letter-spacing: 0; color: var(--gold-text); white-space: pre; }
.facts__num--about { white-space: nowrap; }
@media (min-width: 375px) { .facts__about { position: static; } }
@media (min-width: 600px) { .facts__about { font-size: 1rem; } }
.facts__item dd { margin: 0.5rem 0 0; font-size: var(--fs-sm); line-height: 1.4; color: var(--ink-500); }
.facts__note { display: flex; align-items: center; gap: 0.5rem; margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid rgba(198, 158, 79, 0.45); font: 800 var(--fs-sm)/1.35 var(--font-ui); color: var(--navy-deep); }
.facts__note svg { color: var(--gold-600); flex-shrink: 0; }
.facts__line { margin: 0.5rem 0 0; font-size: var(--fs-sm); color: var(--ink-500); }

/* The two posters (animation 14) */
.posters__row { display: flex; gap: clamp(1rem, 4vw, 3rem); justify-content: center; }
.poster { flex: 0 1 360px; }
.poster__frame { margin: 0; padding: 6px; background: #fff; border: 1px solid rgba(198, 158, 79, 0.7); border-radius: var(--r-md); box-shadow: var(--sh-lg); transform-origin: 50% 100%; }
.poster__frame img { display: block; width: 100%; height: auto; border-radius: 7px; }
.poster__words { padding: 1.25rem 0.25rem 0; text-align: center; }
.poster__words h3 { font-family: var(--font-display); font-weight: 560; font-size: clamp(1.5rem, 2.6vw, 1.9rem); letter-spacing: -0.01em; margin-bottom: 0.35rem; }
.poster__kicker { font: 800 var(--fs-xs)/1.3 var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-text); margin-bottom: 0.6rem; }
.poster__words p:last-child { color: var(--ink-500); max-width: 30ch; margin-inline: auto; }
.posters__motto { text-align: center; margin: clamp(1.75rem, 4vw, 2.75rem) 0 0; font: 800 var(--fs-xs)/1.3 var(--font-ui); letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-text); }
/* the posters' gold line with a dot: above the motto here, and under the welcome heading */
.rule-dot, .posters__motto::before { content: ""; display: block; width: 132px; height: 9px; background: radial-gradient(circle at 50% 50%, var(--gold-500) 0 3.5px, transparent 4px), linear-gradient(var(--gold-500), var(--gold-500)) 0 50% / 54px 1.5px no-repeat, linear-gradient(var(--gold-500), var(--gold-500)) 100% 50% / 54px 1.5px no-repeat; }
.posters__motto::before { margin: 0 auto 0.9rem; }
@media (prefers-reduced-motion: no-preference) {
  /* in the welcome section it draws once, from the start of the line, the first time it is seen */
  html.anim:not(.motion-off) .rule-dot:not(.is-in) { clip-path: inset(0 100% 0 0); }
  html.anim:not(.motion-off)[dir="rtl"] .rule-dot:not(.is-in) { clip-path: inset(0 0 0 100%); }
  html.anim:not(.motion-off) .rule-dot.is-in:not(.is-there) { animation: rule-wipe 0.7s var(--ease-out) 0.15s backwards; }
  html.anim:not(.motion-off)[dir="rtl"] .rule-dot.is-in:not(.is-there) { animation-name: rule-wipe-rtl; }
}
@keyframes rule-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes rule-wipe-rtl { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
:lang(ar) .poster__kicker, :lang(ar) .posters__motto { letter-spacing: 0; }
@media (max-width: 699px) {
  /* phones: swipe from one poster to the other */
  .posters__row { position: relative; justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(-1 * var(--sp-5)); padding: 0.5rem var(--sp-5) 1.5rem; scrollbar-width: none; }
  .posters__row::-webkit-scrollbar { display: none; }
  .poster { flex: 0 0 78vw; scroll-snap-align: center; }
}

/* Photos in an arch: styles.css (animation 11 draws the outline, then the photo blooms) */
.feature--arch { margin-bottom: clamp(3rem, 7vw, 5.5rem); }
.feature--arch:last-child { margin-bottom: 0; }
.feature--arch .feature__media { max-width: 420px; width: 100%; margin-inline: auto; }
.feature--arch h2 { font-size: var(--fs-xl); }
.duo .head-doodle { margin-top: -0.2rem; }

/* Life beyond walls: the one navy band, with a strip to swipe (animation 15) */
.life { overflow: hidden; background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%); }
.life .container { position: relative; z-index: 1; }
.life .section-head { color: #fff; }
.life h2 { color: #fff; }
.life .section-head p { color: rgba(255, 255, 255, 0.88); }
.life-strip { position: relative; z-index: 1; display: flex; gap: clamp(0.9rem, 2.4vw, 1.75rem); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--sp-5); padding: 0.5rem max(var(--sp-5), calc((100vw - var(--container)) / 2 + var(--sp-5))) 1.25rem; scrollbar-width: thin; scrollbar-color: rgba(198, 158, 79, 0.7) transparent; }
.life-card { flex: 0 0 min(64vw, 250px); scroll-snap-align: start; display: block; text-decoration: none; color: #fff; }
.life-card .arch--photo::before { border-color: rgba(214, 182, 114, 0.9); }
.life-card__label { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 0.4rem; font: 800 var(--fs-sm)/1.3 var(--font-ui); text-align: center; }
.life-card:hover .life-card__label { color: var(--gold-300); }
.life__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 1.5rem; }
@media (min-width: 1280px) { .life-strip { justify-content: center; padding-inline: var(--sp-5); } .life-card { flex-basis: 212px; } }

/* Fees at a glance: one ledger instead of four cards */
.ledger { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid rgba(198, 158, 79, 0.55); border-radius: var(--r-xl); background: rgba(255, 255, 255, 0.62); overflow: hidden; }
.ledger__item { padding: 1.1rem 1rem 1.2rem; border-inline-end: 1px solid rgba(198, 158, 79, 0.4); border-bottom: 1px solid rgba(198, 158, 79, 0.4); }
.ledger__item:nth-child(2n) { border-inline-end: 0; }
.ledger__item:nth-last-child(-n+2) { border-bottom: 0; }
.ledger__item h3 { font-family: var(--font-display); font-weight: 560; font-size: clamp(1.35rem, 2.3vw, 1.75rem); letter-spacing: -0.01em; margin: 0.65rem 0 0.3rem; font-variant-numeric: lining-nums; }
.ledger__per { font: 600 var(--fs-xs)/1 var(--font-ui); letter-spacing: 0; color: var(--ink-500); }
.ledger__item p { margin: 0; font-size: var(--fs-sm); line-height: 1.45; color: var(--ink-500); }
@media (min-width: 900px) {
  .ledger { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ledger__item { padding: 1.5rem 1.4rem 1.6rem; border-bottom: 0; }
  .ledger__item:nth-child(2n) { border-inline-end: 1px solid rgba(198, 158, 79, 0.4); }
  .ledger__item:last-child { border-inline-end: 0; }
}

/* Values: the logo's two colours, with the logo between them (animation 12) */
.values__row { display: grid; gap: 1.25rem; align-items: stretch; }
.value { padding: clamp(1.4rem, 3vw, 2.1rem); border-radius: var(--r-xl); }
.value h3 { font-family: var(--font-display); font-weight: 560; font-size: clamp(1.4rem, 2.4vw, 1.75rem); letter-spacing: -0.01em; }
.value p { margin: 0; }
.value--navy { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%); color: rgba(255, 255, 255, 0.92); }
.value--navy h3 { color: #fff; }
.value--gold { background: linear-gradient(160deg, var(--gold-400) 0%, var(--gold-500) 100%); color: var(--navy-deep); }
.value--gold h3 { color: var(--navy-deep); }
.values__more { margin-top: 2rem; }
.medal { position: relative; justify-self: center; align-self: center; width: 200px; perspective: 900px; order: -1; }
.medal__turn { position: relative; transform-style: preserve-3d; will-change: auto; }
.medal__logo { display: block; width: 100%; height: auto; }
/* one soft gold light: a sliding gradient, shown only through the logo's own outline */
.medal__light { position: absolute; inset: 0; pointer-events: none; overflow: hidden; visibility: hidden; }
/* the mask file (the logo itself) is asked for only once the medal is on screen and the light is about to cross it */
.medal.is-in .medal__light { visibility: visible; -webkit-mask: url("/assets/img/logo/afs-logo-480.webp") center / contain no-repeat; mask: url("/assets/img/logo/afs-logo-480.webp") center / contain no-repeat; }
html.motion-off .medal .medal__light, html.lite .medal .medal__light { visibility: hidden; -webkit-mask: none; mask: none; }
.medal__light::before { content: ""; position: absolute; top: -20%; bottom: -20%; left: 0; width: 42%; background: linear-gradient(100deg, transparent 0%, rgba(255, 244, 214, 0.75) 50%, transparent 100%); transform: translateX(-140%) skewX(-12deg); }
.medal__shadow { display: block; width: 62%; height: 14px; margin: 0.6rem auto 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(6, 23, 75, 0.28), transparent); }
@media (min-width: 900px) {
  .values__row { grid-template-columns: 1fr auto 1fr; gap: clamp(1.25rem, 3vw, 2.5rem); }
  .medal { width: 260px; order: 0; }
  .value { display: flex; flex-direction: column; justify-content: center; }
}

/* The posters slide up and straighten (animation 14), 0.7 s. The medal
   turns in with depth, then one soft gold light passes over it (12). */
@keyframes poster-a { from { opacity: 0; transform: translateY(46px) rotate(-3.5deg); } }
@keyframes poster-b { from { opacity: 0; transform: translateY(46px) rotate(3.5deg); } }
@keyframes medal-turn { 0% { opacity: 0; transform: rotateY(-82deg); } 70% { opacity: 1; transform: rotateY(9deg); } 100% { transform: none; } }
@keyframes medal-light { from { transform: translateX(-140%) skewX(-12deg); } to { transform: translateX(340%) skewX(-12deg); } }
.medal__turn { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.25s var(--ease-out); }
@media (prefers-reduced-motion: no-preference) {
  html.anim:not(.motion-off) .poster--a.reveal.is-in:not(.is-there) { animation: poster-a 0.7s var(--ease-settle) backwards; }
  html.anim:not(.motion-off) .poster--b.reveal.is-in:not(.is-there) { animation: poster-b 0.7s 0.1s var(--ease-settle) backwards; }
  html.anim:not(.motion-off):not(.lite) .medal:not(.is-in) .medal__turn { opacity: 0; transform: rotateY(-82deg); }
  html.anim:not(.motion-off):not(.lite) .medal:not(.is-in) .medal__shadow { opacity: 0; }
  html.anim:not(.motion-off):not(.lite) .medal.is-in:not(.is-there) .medal__turn { animation: medal-turn 1.1s var(--ease-out) backwards; }
  html.anim:not(.motion-off):not(.lite) .medal.is-in:not(.is-there) .medal__shadow { animation: fade-in 0.6s 0.5s var(--ease-out) backwards; }
  html.anim:not(.motion-off):not(.lite) .medal.is-in:not(.is-there) .medal__light::before { animation: medal-light 0.9s 1s var(--ease-out) both; }
  /* dusk (25): the first stars come out as the closing band arrives */
  html.anim:not(.motion-off) .cta-banner--dusk .stars i { transition: opacity 0.9s var(--ease-out); }
  html.anim:not(.motion-off) .cta-banner--dusk .stars:not(.is-on) i { opacity: 0; }
  html.anim:not(.motion-off) .cta-banner--dusk .stars i:nth-child(2n) { transition-delay: 0.3s; }
  html.anim:not(.motion-off) .cta-banner--dusk .stars i:nth-child(3n) { transition-delay: 0.6s; }
}

/* Principal */
.principal-sec .principal__portrait { max-width: 380px; width: 100%; margin-inline: auto; }
.principal-sec .principal__portrait img { border-radius: 0; box-shadow: none; aspect-ratio: auto; height: 100%; }
.principal__more { margin-top: 1.25rem; }

/* Closing: dusk */
.cta-banner--dusk .container { position: relative; z-index: 1; }
.cta-banner--dusk .head-doodle { margin-bottom: 0.6rem; }
.cta-banner__small { margin-top: 1rem; font-size: var(--fs-sm) !important; color: rgba(255, 255, 255, 0.82) !important; }
.cta-banner__small a { color: var(--gold-300); }

/* News on the home page: on phones the three posts sit in a strip to swipe */
@media (max-width: 699px) {
  /* position: relative keeps the cards' hidden screen-reader text inside the strip */
  .home-news .news-grid { position: relative; display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(-1 * var(--sp-5)); padding: 0.25rem var(--sp-5) 1.25rem; scrollbar-width: none; }
  .home-news .news-grid::-webkit-scrollbar { display: none; }
  .home-news .news-card { flex: 0 0 80vw; scroll-snap-align: center; }
}

/* 4. PHONES: A SHORTER PAGE ================================================
   Two long paragraphs that the About page carries in full are left out
   here, and the portraits are smaller. Nothing is removed from the site. */
@media (max-width: 699px) {
  .welcome .lead p + p { display: none; }
  .principal-sec .principal__text > p:nth-of-type(2) { display: none; }
  .principal-sec .principal__portrait { max-width: 250px; }
  .feature--arch .feature__media { max-width: 270px; }
  .medal { width: 168px; }
}
