/* Screen 1, the hero: the design export's drawing, as static HTML and SVG. The frame is
   the design's 1440 x 820 less the nav's 88 on top, and --u is one design px of it, so the
   headline, the drawing and the copy scale together. The phone frame is drawn at 390. */
/* Clipped at the window's sides only (section): the speaker runs on below the hero. */
.hero { container: hero / inline-size; }
.hero-frame { --u: min(1px, calc(100cqw / 1440)); position: relative; width: calc(1440 * var(--u)); height: calc(732 * var(--u)); margin: 0 auto; }
/* Each drawing takes its height from its viewBox, which starts under the nav. */
.hero-art { position: absolute; left: 0; top: 0; width: 100%; height: auto; overflow: visible; pointer-events: none; z-index: 1; }
.art-phone { display: none; }
/* The final frame has no line from the dot: it shows only while the note is written. */
.hero .out { opacity: 0; }

.hero-h1 { position: absolute; left: calc(80 * var(--u)); top: calc(8 * var(--u)); z-index: 2; font-size: calc(150 * var(--u)); line-height: 0.95; font-weight: 800; letter-spacing: -0.045em; white-space: nowrap; }
.hero-h1 .line { display: block; }
.hero-h1 .line > .lift { display: inline-block; }
/* The full stop's box never moves (the travelling voice starts from it); ::after draws
   the dot, so the dot can rise with its word and swell as the tangle goes in. */
.hero .stop { margin-left: 0.08em; background: none; }
.hero .stop::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--orange); }

/* The copy keeps the design's sizes from 1200 up; narrower, the small parts stop shrinking at a readable size. */
.hero-copy { position: absolute; left: calc(700 * var(--u)); top: calc(382 * var(--u)); width: calc(580 * var(--u)); z-index: 2; }
.hero-sub { font-size: max(20px, calc(36 * var(--u))); line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.hero-what { margin-top: calc(16 * var(--u)); font-size: max(15px, calc(23 * var(--u))); line-height: 1.5; color: var(--body); text-wrap: pretty; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: calc(14 * var(--u)) calc(24 * var(--u)); margin-top: calc(28 * var(--u)); }
.hero-cta .btn { height: max(44px, calc(58 * var(--u))); padding: 0 max(22px, calc(32 * var(--u))); font-size: max(15px, calc(18 * var(--u))); }
/* Murmur is not out yet, so the row holds the coming-soon status alone (src/download.mjs).
   It is a status, not a button waiting to work: a round chip, a step smaller than a
   button and at its own width, with a small ring before the words that says "not yet". */
.hero-cta .btn-soon { gap: max(9px, calc(11 * var(--u))); height: max(40px, calc(50 * var(--u))); padding: 0 max(18px, calc(24 * var(--u))) 0 max(15px, calc(20 * var(--u))); border-radius: 999px; font-size: max(15px, calc(17 * var(--u))); }
.hero-cta .btn-soon::before { content: ""; flex: none; width: max(8px, calc(9 * var(--u))); aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 2px currentColor; }

/* Narrower than the desktop layout, the screens after the hero stack from the left edge:
   the hero grows to hold the speaker's whole body and their ground (the feet at 977). */
@media (max-width: 1023.98px) {
  .hero-frame { height: calc(892 * var(--u)); }
}

/* The phone, from the design's own break (the hero 720 wide or less): the same drawing at
   390, up to 1.25x, with the speaker back at the stage's bottom left. */
@container hero (max-width: 720px) {
  .hero-frame { --u: min(1.25px, calc(100cqw / 390)); width: calc(390 * var(--u)); height: calc(766 * var(--u)); }
  .art-desk { display: none; }
  .art-phone { display: block; }
  .hero-h1 { left: calc(20 * var(--u)); top: calc(28 * var(--u)); font-size: calc(64 * var(--u)); }
  .hero-copy { left: calc(20 * var(--u)); top: calc(511 * var(--u)); width: calc(350 * var(--u)); }
  .hero-sub { font-size: calc(24 * var(--u)); }
  .hero-what { font-size: calc(17 * var(--u)); }
  .hero-cta { gap: calc(12 * var(--u)); }
}

/* ---------------------------------------------------------------- motion
   The design's loop, --hero-loop long (3.4 s; Aida, 22 Nov, the canvas heroSpec): the
   tangle is said into the full stop in 1.1 s, speeding up as it goes; the stop swells (1.1
   to 1.45 s); a line leaves it and the note writes itself, title and four lines 0.1 s apart,
   then three ticks (1.25 to 2.07 s), while the tangle goes into the dot (1.3 to 2.0 s); a
   second small swell (2.15 s); the note holds to 3.0 s and clears by 3.2 s. It loops for as
   long as the hero is in view (Aida, 23 Nov: "just loop it"); on desktop with the travelling
   voice on, only while the voice is home on the stop (.dot-home). js/hero.js switches it,
   always on a loop's boundary, where the drawing is empty:
   .is-resting  one more run, to rest at 75% of it: the whole note written, the tangle drawn in;
   .is-still    no loop: that finished frame, nothing running (out of view);
   .is-clearing the tangle, the note and its line fade out, before a fresh run from rest.
   The words' entrance (hero-rise) plays once per load: the stop keeps it first in every
   state, so it is never run again. */
.hero { --hero-loop: 3.4s; }
.motion .hero .lift { animation: hero-rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d) both; }
.motion .hero .stop::after { animation: hero-rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both, hero-stop var(--hero-loop) ease-in-out infinite; }
.motion .hero .tangle { stroke-dasharray: 1 1; animation: hero-tangle var(--hero-loop) linear infinite; }
.motion .hero .ink { stroke-dasharray: 1; }
.motion .hero .out, .motion .hero .note > * { animation-duration: var(--hero-loop); animation-timing-function: linear; animation-iteration-count: infinite; animation-fill-mode: forwards; }
.motion .hero .out { animation-name: hero-out; }
.motion .hero .title { animation-name: hero-title; }
.motion .hero .l0 { animation-name: hero-l0; }
.motion .hero .l1 { animation-name: hero-l1; }
.motion .hero .l2 { animation-name: hero-l2; }
.motion .hero .l3 { animation-name: hero-l3; }
.motion .hero .l4 { animation-name: hero-l4; }
.motion .hero .r2 { animation-name: hero-r2; }
.motion .hero .r3 { animation-name: hero-r3; }
.motion .hero .r4 { animation-name: hero-r4; }
.motion .hero .t2 { animation-name: hero-t2; }
.motion .hero .t3 { animation-name: hero-t3; }
.motion .hero .t4 { animation-name: hero-t4; }

/* Resting, still and clearing (js/hero.js). */
.motion .hero.is-resting .stop::after { animation: hero-rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both, hero-stop var(--hero-loop) ease-in-out 0.75 forwards; }
.motion .hero.is-resting .tangle { animation: hero-tangle-rest var(--hero-loop) linear 0.75 forwards; }
.motion .hero.is-resting .out, .motion .hero.is-resting .note > * { animation-iteration-count: 0.75; }
.motion .hero.is-still .stop::after { animation: hero-rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both; }
.motion .hero.is-still .tangle, .motion .hero.is-still .out, .motion .hero.is-still .note > * { animation: none; }
.motion .hero.is-clearing .tangle, .motion .hero.is-clearing .note, .motion .hero.is-clearing .out { opacity: 0; transition: opacity 0.3s ease; }

@keyframes hero-rise { from { opacity: 0; translate: 0 18px; } }
@keyframes hero-stop { 0%, 32.35% { scale: 1; } 36.76% { scale: 1.3; } 42.65%, 60.88% { scale: 1; } 63.24% { scale: 1.12; } 67.65%, 100% { scale: 1; } }
@keyframes hero-tangle { 0% { stroke-dashoffset: 1; animation-timing-function: cubic-bezier(0.4, 0.1, 0.75, 0.9); } 32.35% { stroke-dashoffset: 0; } 38.24% { stroke-dashoffset: 0; animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1); } 58.82%, 100% { stroke-dashoffset: -1; } }
@keyframes hero-tangle-rest { 0% { stroke-dashoffset: 1; animation-timing-function: cubic-bezier(0.4, 0.1, 0.75, 0.9); } 32.35%, 100% { stroke-dashoffset: 0; } }
@keyframes hero-out { 0%, 35.29% { stroke-dashoffset: 1; opacity: 1; animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1); } 39.71%, 70.59% { stroke-dashoffset: 0; opacity: 1; } 75%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes hero-title { 0%, 36.76% { stroke-dashoffset: 1; opacity: 1; animation-timing-function: cubic-bezier(0.3, 0.5, 0.3, 1); } 44.12% { stroke-dashoffset: 0; } 88.24% { stroke-dashoffset: 0; opacity: 1; } 94.12% { stroke-dashoffset: 0; opacity: 0; } 100% { stroke-dashoffset: 1; opacity: 0; } }
@keyframes hero-l0 { 0%, 36.76% { stroke-dashoffset: 1; opacity: 1; animation-timing-function: cubic-bezier(0.3, 0.5, 0.3, 1); } 44.12% { stroke-dashoffset: 0; } 88.24% { stroke-dashoffset: 0; opacity: 1; } 94.12% { stroke-dashoffset: 0; opacity: 0; } 100% { stroke-dashoffset: 1; opacity: 0; } }
@keyframes hero-l1 { 0%, 39.71% { stroke-dashoffset: 1; opacity: 1; animation-timing-function: cubic-bezier(0.3, 0.5, 0.3, 1); } 47.06% { stroke-dashoffset: 0; } 88.24% { stroke-dashoffset: 0; opacity: 1; } 94.12% { stroke-dashoffset: 0; opacity: 0; } 100% { stroke-dashoffset: 1; opacity: 0; } }
@keyframes hero-l2 { 0%, 42.65% { stroke-dashoffset: 1; opacity: 1; animation-timing-function: cubic-bezier(0.3, 0.5, 0.3, 1); } 50% { stroke-dashoffset: 0; } 88.24% { stroke-dashoffset: 0; opacity: 1; } 94.12% { stroke-dashoffset: 0; opacity: 0; } 100% { stroke-dashoffset: 1; opacity: 0; } }
@keyframes hero-l3 { 0%, 45.59% { stroke-dashoffset: 1; opacity: 1; animation-timing-function: cubic-bezier(0.3, 0.5, 0.3, 1); } 52.94% { stroke-dashoffset: 0; } 88.24% { stroke-dashoffset: 0; opacity: 1; } 94.12% { stroke-dashoffset: 0; opacity: 0; } 100% { stroke-dashoffset: 1; opacity: 0; } }
@keyframes hero-l4 { 0%, 48.53% { stroke-dashoffset: 1; opacity: 1; animation-timing-function: cubic-bezier(0.3, 0.5, 0.3, 1); } 55.88% { stroke-dashoffset: 0; } 88.24% { stroke-dashoffset: 0; opacity: 1; } 94.12% { stroke-dashoffset: 0; opacity: 0; } 100% { stroke-dashoffset: 1; opacity: 0; } }
@keyframes hero-r2 { 0%, 42.35% { opacity: 0; } 43.24%, 88.24% { opacity: 1; } 94.12%, 100% { opacity: 0; } }
@keyframes hero-r3 { 0%, 45.29% { opacity: 0; } 46.18%, 88.24% { opacity: 1; } 94.12%, 100% { opacity: 0; } }
@keyframes hero-r4 { 0%, 48.24% { opacity: 0; } 49.12%, 88.24% { opacity: 1; } 94.12%, 100% { opacity: 0; } }
@keyframes hero-t2 { 0%, 51.47% { stroke-dashoffset: 1; opacity: 1; } 55% { stroke-dashoffset: 0; } 88.24% { stroke-dashoffset: 0; opacity: 1; } 94.12% { stroke-dashoffset: 0; opacity: 0; } 100% { stroke-dashoffset: 1; opacity: 0; } }
@keyframes hero-t3 { 0%, 54.41% { stroke-dashoffset: 1; opacity: 1; } 57.94% { stroke-dashoffset: 0; } 88.24% { stroke-dashoffset: 0; opacity: 1; } 94.12% { stroke-dashoffset: 0; opacity: 0; } 100% { stroke-dashoffset: 1; opacity: 0; } }
@keyframes hero-t4 { 0%, 57.35% { stroke-dashoffset: 1; opacity: 1; } 60.88% { stroke-dashoffset: 0; } 88.24% { stroke-dashoffset: 0; opacity: 1; } 94.12% { stroke-dashoffset: 0; opacity: 0; } 100% { stroke-dashoffset: 1; opacity: 0; } }

/* Desktop with the travelling voice on (sections/thread.css), the voice is the dot and this
   stop steps aside, except while the visitor is at the top with the voice home on it
   (.dot-home, js/hero.js): there the stop rises and swells as drawn, and the voice waits
   hidden under it. */
.thread-on .hero:not(.dot-home) .stop::after { visibility: hidden; transition: visibility 0s linear 0.15s; }
.thread-on:has(.hero.dot-home) .thread .voice { opacity: 0; }
/* The hand-over as the visitor first scrolls (.is-handing, a frame or two): the stop steps
   aside and the voice shows at once, in the same frame and the same place, so the dot leaves
   as one dot. Back home the voice fades out over the stop, which shows at once under it. */
.thread-on .hero.is-handing .stop::after { transition: none; }
.thread-on:has(.hero.is-handing) .thread .voice { transition: none; }
