/* Motion for the two product landings, /daw and /notation (static/js/landing-motion.js). One idea per
   section, each played once; every hidden starting state hangs off a class the script adds, so without the
   script (or with reduced motion, or a page opened at an anchor) the page is exactly as drawn.
   Values: the site's spring (584ms), the logo's write (420ms), the staff lines' draw (.87,0,.13,1), and per
   part the reference it was measured from (Apple, Linear). */

@media (prefers-reduced-motion: no-preference) {

  /* Rows and cards rise in: 12px, 80ms apart (a quieter take on Apple's 30px / 130ms). */
  .lm-rise:not(.lm-up) { opacity: 0; transform: translateY(12px); }
  .lm-rise.lm-up { transition: opacity var(--spring-d) var(--spring) var(--lm-d, 0ms), transform var(--spring-d) var(--spring) var(--lm-d, 0ms); }

  /* One italic phrase per page writes itself, word by word, like the logo. */
  .lm-ink .lm-w { display: inline-block; clip-path: inset(-.3em 100% -.4em 0); transition: clip-path 420ms var(--spring) calc(var(--i, 0) * 90ms + 140ms); }
  .lm-ink.lm-in .lm-w { clip-path: inset(-.3em -.35em -.4em -.25em); }

  /* Rehearsal letters: the box is drawn like a pencil mark, then the letter. */
  .lm-lt { position: relative; border-color: transparent !important; color: transparent !important; transition: color 260ms linear calc(var(--i, 0) * 90ms + 420ms); }
  .lm-lt.lm-in { color: var(--lm-c) !important; }
  .lm-box { position: absolute; inset: -1.25px; width: calc(100% + 2.5px); height: calc(100% + 2.5px); overflow: visible; pointer-events: none; }
  .lm-box rect { fill: none; stroke: var(--lm-c); stroke-width: 1.25px; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 560ms cubic-bezier(.87, 0, .13, 1) calc(var(--i, 0) * 90ms); }
  .lm-lt.lm-in .lm-box rect { stroke-dashoffset: 0; }

  /* The bands open to the screen's edges with the scroll (clip-path set by the script). */
  .lm-bleed { will-change: clip-path; }

  /* The closing title is sung: word by word, the word being sung in the accent, as in the score. */
  .lm-sung .lm-s { opacity: .24; transition: opacity 140ms linear, color 260ms linear; }
  .lm-sung .lm-s.lit { opacity: 1; }
  .lm-sung .lm-s.now { color: var(--a300); }

  /* /daw, the blue band: the playhead follows the scroll instead of passing once. */
  .lp .lm-lane .lane .sweep { animation: none !important; opacity: 1; }
  .lp .lm-lane .lane-notes .n { transition: opacity 200ms linear, background-color 200ms linear; }
  .lp .lm-lane .lane-notes .n.lm-ahead { opacity: .35; }
  .lp .lm-lane .lane-notes .s { transition: opacity 220ms linear, transform var(--spring-d) var(--spring); }
  .lp .lm-lane .lane-notes .s.lm-ahead { opacity: 0; transform: translateY(-31px); }
  .lp .lm-lane .lane-notes svg { transition: clip-path 80ms linear; }
  .lp .lm-lane .steps3 .letter { transition: background-color 240ms linear, color 240ms linear; }
  .lp .lm-lane .steps3 .letter.lm-hit { background: var(--on-accent, #0b1120); color: var(--b400); }

  /* /daw, Sticky Lyrics: the notes are played in at Silver Apples' own lengths, each word lands on its note. */
  .lp .lm-drop .syl i { transform-origin: 0 50%; }
  .lp .lm-drop:not(.lm-in) .syl i { transform: scaleX(0); }
  .lp .lm-drop:not(.lm-in) .syl span { opacity: 0; transform: translateY(-.5em); }
  .lp .lm-drop.lm-in .syl i { transition: transform var(--lm-dt) linear var(--lm-t0); }
  .lp .lm-drop.lm-in .syl span { transition: opacity 200ms linear calc(var(--lm-t0) + 80ms), transform var(--spring-d) var(--spring) calc(var(--lm-t0) + 80ms); }

  /* /daw, "Try it in your browser": iPhone 18 Pro's settle, 80px -> 0 and 1.2 -> 1 inside the frame over 1.5s. */
  .lp .see-pic.lm-see img { transform-origin: 50% 50%; }
  .lp .see-pic.lm-see:not(.lm-in) { opacity: 0; transform: translateY(80px); }
  .lp .see-pic.lm-see:not(.lm-in) img { transform: scale(1.2); }
  .lp .see-pic.lm-see.lm-in { transition: opacity .9s var(--spring), transform 1.5s var(--spring); }
  .lp .see-pic.lm-see.lm-in img { transition: transform 1.5s var(--spring); }

  /* /notation, "Three pieces": each waveform grows from its centre line (Linear: .42s, scale .4 -> 1, 0-330ms apart). */
  .cx .v-row.lm-wave .v-wf i { transform-origin: 50% 50%; }
  .cx .v-row.lm-wave:not(.lm-in) .v-wf i { opacity: 0; transform: scaleY(.4); }
  .cx .v-row.lm-wave.lm-in .v-wf i { transition: opacity .42s cubic-bezier(.25, .46, .45, .94), transform .42s cubic-bezier(.25, .46, .45, .94); transition-delay: calc(var(--kd, 0ms) + var(--r, 0) * 130ms); }

  /* The bar changes ground (Vision Pro: .24s cubic-bezier(.28,.11,.32,1)). */
  :is(html.lm-hdr-paper, html.lm-hdr-band) :is(.cx-hdr, .c4d-hdr) .cap,
  :is(html.lm-hdr-paper, html.lm-hdr-band) :is(.cx-hdr, .c4d-hdr) .cap :is(a, button, span) { transition: background-color .24s cubic-bezier(.28, .11, .32, 1), box-shadow .24s cubic-bezier(.28, .11, .32, 1), color .24s cubic-bezier(.28, .11, .32, 1); }
}

/* Over a paper band the bar is paper with the logo in ink; over the accent band it takes the accent with navy
   text. States rather than motion, so they hold with reduced motion too. /notation's paper is notation.js's
   (html.nx-hdr-paper); these cover /daw's paper and both pages' bands. */
html.lm-hdr-paper :is(.cx-hdr, .c4d-hdr) .cap { background-color: rgb(241 236 226 / .86); box-shadow: inset 0 0 0 1px rgb(23 25 30 / .09), 0 8px 24px -16px rgb(23 25 30 / .28); color: #17191e; }
html.lm-hdr-band :is(.cx-hdr, .c4d-hdr) .cap { background-color: color-mix(in srgb, var(--a400) 86%, transparent); box-shadow: inset 0 0 0 1px rgb(11 17 32 / .12), 0 8px 24px -16px rgb(11 17 32 / .35); color: #0b1120; }
:is(html.lm-hdr-paper, html.lm-hdr-band) :is(.cx-hdr, .c4d-hdr) .cap :is(a, button):not(.home, .try, .hdr-go, .hdr-buy) { color: rgb(23 25 30 / .66); }
:is(html.lm-hdr-paper, html.lm-hdr-band) :is(.cx-hdr, .c4d-hdr) .cap :is(a[aria-current], a:hover, button:hover) { color: #17191e; }
:is(html.lm-hdr-paper, html.lm-hdr-band) :is(.cx-hdr, .c4d-hdr) .hdr-buy .now { color: #17191e; }
:is(html.lm-hdr-paper, html.lm-hdr-band) :is(.cx-hdr, .c4d-hdr) :is(.try, .hdr-buy .go, .hdr-go) { background: #17191e; color: #f1ece2; }
:is(html.lm-hdr-paper, html.lm-hdr-band) :is(.cx-hdr, .c4d-hdr) .burger i::before,
:is(html.lm-hdr-paper, html.lm-hdr-band) :is(.cx-hdr, .c4d-hdr) .burger i::after { background: rgb(23 25 30 / .85); }
:is(html.lm-hdr-paper, html.lm-hdr-band) :is(.cx-hdr, .c4d-hdr) .home img:not(.ink) { display: none; }
:is(html.lm-hdr-paper, html.lm-hdr-band) :is(.cx-hdr, .c4d-hdr) .home img.ink { display: block; }
