/* Notes, screen 1, the top. Drawn at 1440 x 772 under the nav: the copy on the logo's line
   88 down, the scene on one ground 640 down that runs the window's width. The scene is a
   stage measured in --k (--u on desktop): the three and the table, your computer's ink
   dome, the note in a clip whose foot is the dome's top (590), and the four said turns. */
.nt-top { height: calc(772 * var(--u)); }
.nh-frame { position: relative; width: calc(1440 * var(--u)); height: 100%; margin: 0 auto; }
.nh-view { position: absolute; inset: 0; }
.nh-ground { position: absolute; top: calc(640 * var(--k) - 1.5px); left: calc((1440 * var(--u) - 100vw) / 2); width: 100vw; height: 3px; background: var(--ink); }
.nh-stage { position: absolute; left: 0; top: 0; width: calc(1440 * var(--k)); height: calc(772 * var(--k)); }
.nh-art { position: absolute; left: 0; top: 0; width: 100%; height: auto; overflow: visible; }

.nh-clip { position: absolute; left: calc(1074 * var(--k)); top: 0; width: calc(300 * var(--k)); height: calc(590 * var(--k)); overflow: hidden; pointer-events: none; }
.nh-note { position: absolute; left: calc(10 * var(--k)); bottom: 0; width: calc(280 * var(--k)); display: grid; gap: calc(10 * var(--k)); padding: calc(16 * var(--k)) calc(18 * var(--k)) calc(18 * var(--k)); border-radius: calc(16 * var(--k)) calc(16 * var(--k)) 0 0; background: var(--cream); box-shadow: inset 0 0 0 max(2px, calc(2.5 * var(--k))) var(--ink); }
.nh-note-t { margin-bottom: calc(2 * var(--k)); font-size: calc(15 * var(--k)); line-height: 1.3; font-weight: 800; color: var(--ink); }
.nh-row { display: flex; align-items: center; gap: calc(8 * var(--k)); font-size: calc(14 * var(--k)); line-height: 1.25; font-weight: 700; color: var(--ink); white-space: nowrap; }
.nh-row .nt-face { width: calc(20 * var(--k)); height: calc(20 * var(--k)); }
.nh-tick { width: calc(14 * var(--k)); height: calc(14 * var(--k)); }
.nh-tick path { stroke-dasharray: 1 1; }

/* A turn said over the speaker's head (its centre 162 x 1.2 + 44 over the ground), unseen but as it plays. */
.nh-say { position: absolute; left: calc(var(--x) * var(--k)); top: calc(401.6 * var(--k)); padding: calc(9 * var(--k)) calc(16 * var(--k)); border-radius: calc(18 * var(--k)); background: var(--cream); box-shadow: inset 0 0 0 max(1.5px, calc(2 * var(--k))) var(--ink); font-size: calc(17 * var(--k)); line-height: 1.2; font-weight: 700; color: var(--ink); white-space: nowrap; transform-origin: 0 0; transform: translate(-50%, -50%); opacity: 0; pointer-events: none; }

.nh-copy { position: absolute; left: calc(80 * var(--u)); top: calc(88 * var(--u)); z-index: 1; }
.nh-h { font-size: calc(120 * var(--u)); line-height: 0.95; font-weight: 800; letter-spacing: -0.045em; white-space: nowrap; }
.nh-h .line { display: block; }
.nh-h .lift { display: inline-block; }
.nh-mid { max-width: calc(540 * var(--u)); margin-top: calc(36 * var(--u)); font-size: max(20px, calc(30 * var(--u))); line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.nt-top .mk-soon { margin-top: calc(32 * var(--u)); }

@media (max-width: 1023.98px) {
  /* The phone: the copy, then the scene under it, cropped to the three, the computer and the note (630 to 1380 across, 365 to 650 down). */
  .nt-top { height: auto; }
  .nh-frame { width: auto; display: flex; flex-direction: column; }
  .nh-copy { position: static; order: 1; padding: 40px var(--m) 0; }
  .nh-h { font-size: calc(64 * min(1.25px, 100vw / 390)); }
  .nh-mid { max-width: 16em; margin-top: 18px; font-size: 20px; }
  .nt-top .mk-soon { margin-top: 24px; }
  .nh-view { --k: calc(100vw / 750); position: relative; order: 2; height: calc(285 * var(--k)); margin-top: 24px; overflow: hidden; }
  .nh-ground { top: calc(275 * var(--k) - 1.25px); left: 0; height: 2.5px; }
  .nh-stage { left: calc(-630 * var(--k)); top: calc(-365 * var(--k)); }
  .nh-say { font-size: calc(24 * var(--k)); padding: calc(11 * var(--k)) calc(18 * var(--k)); }
}

/* ---------------------------------------------------------------- motion
   The copy rises in as the page opens. The scene repeats while it is in view
   (js/pages/notes/scenes.js): .is-live holds the waiting frame (the note down in the
   computer, its ticks undrawn), .is-playing runs it, .is-clearing fades the note out. Each
   turn: 0.16 s up, 0.3 s held, 0.36 s gliding over and into the computer (quickening), a
   turn every 0.44 s from 0.3 s; the note comes up from 2.45 s over 0.6 s; the ticks draw
   at 3.1 and 3.2 s. */
.motion .nt-top .lift { animation: nh-rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d) both; }
@keyframes nh-rise { from { opacity: 0; translate: 0 18px; } }

.motion .nt-top.is-live:not(.is-playing) .nh-note { translate: 0 calc(230 * var(--k)); }
.motion .nt-top.is-live:not(.is-playing) .nh-tick path { stroke-dashoffset: 1; }
.motion .nt-top.is-playing .nh-say { animation: nh-say 0.82s linear calc(300ms + var(--i) * 440ms) both; }
.motion .nt-top.is-playing .nh-note { animation: nh-note 0.6s cubic-bezier(0.33, 1, 0.68, 1) 2.45s both; }
.motion .nt-top.is-playing .nh-tick path { animation: nh-tick 0.16s linear 3.1s both; }
.motion .nt-top.is-playing .nh-tick-3 path { animation-delay: 3.2s; }
.motion .nt-top.is-clearing .nh-note { opacity: 0; transition: opacity 0.3s ease; }
@keyframes nh-note { from { translate: 0 calc(230 * var(--k)); } }
@keyframes nh-tick { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
/* Along the curve from over the speaker (x, 401.6) by (1180, 300) to the computer's crown
   (1224, 588), sampled at even steps of its quickening time. */
@keyframes nh-say {
  0% { opacity: 0; scale: 0.6; translate: 0 0; }
  6.5% { opacity: 0.33; scale: 0.84; }
  19.51% { opacity: 1; scale: 1; translate: 0 0; }
  56.1% { opacity: 1; scale: 1; translate: 0 0; animation-timing-function: linear; }
  64.88% { scale: 0.97; translate: calc((-0.0784 * var(--x) + 92.58) * var(--k)) calc(-7.51 * var(--k)); }
  73.66% { scale: 0.88; translate: calc((-0.2944 * var(--x) + 348.51) * var(--k)) calc(-22.54 * var(--k)); }
  82.44% { scale: 0.73; translate: calc((-0.5904 * var(--x) + 702.37) * var(--k)) calc(-22.67 * var(--k)); }
  91.22% { opacity: 1; scale: 0.52; translate: calc((-0.8704 * var(--x) + 1045.09) * var(--k)) calc(29.53 * var(--k)); }
  92.8% { opacity: 1; }
  100% { opacity: 0; scale: 0.25; translate: calc((1224 - var(--x)) * var(--k)) calc(186.4 * var(--k)); }
}
