/* Screen 5, time back. */
.blue-body { position: relative; background: var(--breakout); margin-top: -1px; padding: calc(24 * var(--u)) 0 calc(88 * var(--u)); color: var(--cream); }
/* Centred: the headline, then the year standing on its ground with the days back (BACK) inside its
   arch, then the one assumptions line under the ground. */
.tb-grid { display: flex; flex-direction: column; align-items: center; text-align: center; }
/* The headline is set so its full stop, 0.25 em, is the hero's full stop (30 at 1440):
   the travelling dot lands there at full size and rests as it (js/thread.js, "tb-stop").
   "brilliant" is in the dot's orange, the one word on the page that is. */
.tb-h { font-size: calc(120 * var(--u)); line-height: 0.95; letter-spacing: -0.045em; font-weight: 800; color: var(--cream); text-wrap: balance; }
.tb-word { color: var(--orange); }
/* The full stop's box never moves (the travelling dot lands on it); ::after draws the
   dot, so it can wait for the year and land. With the travelling dot on, that dot is it. */
.timeback .stop { width: 0.25em; height: 0.25em; margin-left: 0.1em; background: none; }
.timeback .stop::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--orange); }
.thread-on .timeback .stop::after { visibility: hidden; }
.tb-year { position: relative; margin-top: calc(48 * var(--u)); }
.year { display: block; }
.year-phone { display: none; }
/* The days you get back are the dot's orange and stay at the size they swell to as they
   light (Aida, 24 Nov: bigger and orange, so the days back stand apart from the rest of the year).
   1.7 times a day on the desktop leaves 4 px between neighbours on the next ring; the
   phone's rings are closer, so 1.5 there. */
.timeback { --back: 1.7; }
.yd { fill: var(--sky); }
.yd.back { fill: var(--orange); scale: var(--back); }
/* The number and its unit stand on the arch's ground, inside the inner ring (r 372).
   Both scale with the arch, so the number clears the ring at every width. It is cream:
   the lit days carry the orange. */
.tb-number { position: absolute; left: 0; right: 0; bottom: calc(30 * var(--u)); display: flex; flex-direction: column; align-items: center; gap: calc(20 * var(--u)); }
.num { font-size: calc(288 * var(--u)); line-height: 0.78; letter-spacing: -0.04em; font-weight: 800; color: var(--cream); }
.unit { font-size: max(20px, calc(28 * var(--u))); line-height: 1.18; font-weight: 700; letter-spacing: -0.015em; color: var(--cream); }
.tb-fine { margin-top: 18px; text-wrap: balance; }

@media (max-width: 1023.98px) {
  .timeback { --back: 1.5; }
  .blue-body { padding: 20px 0 36px; }
  /* Two balanced lines; the full stop keeps to its word. */
  .tb-h { max-width: 7em; font-size: 48px; line-height: 1; }
  /* The phone's inner ring (r 140) holds the number alone; its unit stands under the ground. */
  .tb-year { display: grid; justify-items: center; margin-top: 26px; width: 100%; max-width: 350px; }
  .year { display: none; }
  .year-phone { grid-area: 1 / 1; display: block; width: 100%; height: auto; overflow: visible; }
  .tb-number { display: contents; }
  .num { grid-area: 1 / 1; align-self: end; margin-bottom: 12px; font-size: 112px; }
  .unit { margin-top: 14px; font-size: 18px; }
  .tb-fine { margin-top: 10px; }
}

/* ---------------------------------------------------------------- motion: the year, on repeat
   js/timeBack.js sets .is-live when motion is on (until then the section is the finished
   frame), and .is-playing as half the year has come into view: from then on one clock, set in
   src/sections/timeBack.mjs. The weeks appear along the half rings, January to December,
   each day fading and growing in over --fade from its --d; the days back light one after
   another from their --l (Sky to orange at once, each swelling past its lit size and settling on it
   over 0.32 s); the full
   stop lands at --land (the last day's light) and is done 0.42 s later. The number never
   counts and never moves. With the travelling dot on, the dot is the full stop: it rests
   there already and swells as it lands (js/thread.js). While the year is in view it plays
   again (js/loop.js, the canvas's 4.8 s): the finished frame holds, the days fade out
   (.is-clearing; the ground, the number and the full stop stay), and the weeks appear again from
   their waiting frame. From the second run on (.is-again) the full stop, landed once, stays
   at full size and swells where it stands as it lands again. */
.yd { transform-box: fill-box; transform-origin: center; }
.timeback.is-live .yd { opacity: 0; scale: 0.4; }
.timeback.is-live.is-playing .yd { opacity: 1; scale: 1; transition: opacity var(--fade) linear var(--d), scale var(--fade) linear var(--d); }
.timeback.is-live .yd.back { fill: var(--sky); }
.timeback.is-live.is-playing .yd.back { animation: tb-light 0.32s linear var(--l) forwards; }
@keyframes tb-light { 0% { fill: var(--orange); scale: 1; } 50% { fill: var(--orange); scale: calc(var(--back) * 1.24); } 100% { fill: var(--orange); scale: var(--back); } }
.timeback.is-live .stop::after { scale: 0; }
.timeback.is-live.is-playing .stop::after { animation: tb-land 0.42s linear var(--land) forwards; }
@keyframes tb-land { 0% { scale: 0; } 59.52% { scale: 1.16; } 100% { scale: 1; } }
.timeback.is-live.is-again .stop::after { scale: 1; }
.timeback.is-live.is-again.is-playing .stop::after { animation: tb-reland 0.42s ease-out var(--land); }
@keyframes tb-reland { 40% { scale: 1.16; } }
.timeback.is-clearing .yd, .timeback.is-live.is-playing.is-clearing .yd { opacity: 0; transition: opacity 0.3s ease; }
