/* The page atmosphere for the app pages (sign-in, onboarding, waitlist, terms, dashboard), linked right after app.css.
   Not linked by the landing, whose own washes and dot grid live in landing.css.
   html            the ground: #080a09 plus a static 64 px grain (grain.png) so the dark gradients do not band
   html::before    fixed light: two sage washes at the top, a faint third at the bottom left
   body::before    the landing hero's 18 px dot grid, a touch stronger so it shows at 1x, strongest at the top
   body::after     the wave: the same dots, brighter, in a band that steps one dot per 100 ms frame through the grid;
                   on /app only through the header band
   .tape           the market floor (market.svg) at the bottom of signed-out and onboarding pages; static on /terms,
                   never on /app. A background texture only: it sits under the card and away from any figure.
   button.still    the corner control that stops every animation for this viewer (motion.js, WCAG 2.2.2)
   One frame grid: every loop is stepped at 100 ms and starts at page load. State pauses a loop (animation-play-state
   plus visibility), it never removes it. Transform and opacity only. All of it is off under prefers-reduced-motion
   and under html.still. html[data-state] (set by dashboard.js) recolours the state edges and stops the wave: sage
   only while copying is live, neutral while loading, starting or reconnecting, amber paused, coral broken. */
:root{--th:min(270px,30vh);--tw:calc(var(--th) * 6);--state:var(--sage);--state-lit:var(--lit)}
@media (max-width:620px){:root{--th:min(210px,28vh)}}
/* wide monitors: a taller chart floor, so the card does not float over an empty field (silhouette test) */
@media (min-width:1800px){:root{--th:min(380px,30vh)}}
html:is(:not([data-state]),[data-state=idle]){--state:var(--muted);--state-lit:linear-gradient(90deg,#ffffff00 0%,#ffffff3d 20%,#ffffff1a 60%,#ffffff00 100%)}
html[data-state=paused]{--state:var(--amber);--state-lit:var(--lit-amber)}
html[data-state=bad]{--state:var(--red);--state-lit:var(--lit-red)}
html{background:url("/grain.png?v=6e689b64") 0 0/64px 64px,var(--bg)}
body{background:none} /* a body background paints over the z<0 layers */
html::before,body::before,body::after{content:"";position:fixed;top:0;left:0;pointer-events:none}
/* light: two sage washes at the top, a faint third bottom left */
html::before{right:0;height:100vh;z-index:-3;background:radial-gradient(900px 520px at 6% -8%,#1e2c1f8c,#1e2c1f00 72%),radial-gradient(820px 460px at 92% -10%,#3a48363d,#3a483600 70%),radial-gradient(760px 520px at 0% 108%,#18231840,#18231800 70%)}
/* the landing hero's dot grid, a touch stronger (visible at 1x), fixed, strongest at the top */
body::before{right:0;height:100vh;z-index:-2;background:radial-gradient(#8197763d .75px,#81977600 1.05px) 0 0/18px 18px;-webkit-mask-image:radial-gradient(140% 92% at 50% 0%,#000 0%,#000a 42%,#0000 100%);mask-image:radial-gradient(140% 92% at 50% 0%,#000 0%,#000a 42%,#0000 100%)}
/* the wave: the same dots, brighter, in a 756 px band (42 dots) moving one dot (18 px) per 100 ms frame, so its dots always sit on the grid's: light passes through the grid, nothing slides */
body::after{width:756px;height:100vh;z-index:-1;transform:translate3d(-756px,0,0);background:radial-gradient(#c3dba6d9 .85px,#c3dba600 1.15px) 0 0/18px 18px,linear-gradient(90deg,#a8c38a00,#a8c38a0c 50%,#a8c38a00);-webkit-mask-image:linear-gradient(90deg,#0000,#000 50%,#0000),linear-gradient(to bottom,#000 0%,#0009 40%,#0000 78%);-webkit-mask-composite:source-in;mask-image:linear-gradient(90deg,#0000,#000 50%,#0000),linear-gradient(to bottom,#000 0%,#0009 40%,#0000 78%);mask-composite:intersect}
/* on /app the wave crosses the header band only (logo and account), never the title, the status word or a number;
   once the page scrolls (html.scrolled, dashboard.js) content would move up under the band, so it stops */
body[data-page=app]::after{height:84px;-webkit-mask-image:linear-gradient(90deg,#0000,#000 50%,#0000),linear-gradient(to bottom,#000 0,#000 56px,#0000 84px);mask-image:linear-gradient(90deg,#0000,#000 50%,#0000),linear-gradient(to bottom,#000 0,#000 56px,#0000 84px)}
html:is([data-state=paused],[data-state=bad],.scrolled) body::after{animation-play-state:paused!important;visibility:hidden}
html[data-state=bad] body::before{opacity:.5}
@media (min-width:1800px){
  html::before{background:radial-gradient(56vw 34vw at 6% -8%,#1e2c1f8c,#1e2c1f00 72%),radial-gradient(52vw 30vw at 92% -10%,#3a48363d,#3a483600 70%),radial-gradient(48vw 34vw at 0% 108%,#18231840,#18231800 70%)}}
@media (max-width:620px){
  html::before{background:radial-gradient(520px 380px at 0% -6%,#1e2c1f99,#1e2c1f00 72%),radial-gradient(420px 300px at 100% -6%,#3a483640,#3a483600 70%)}
  body::before{-webkit-mask-image:radial-gradient(160% 64% at 50% 0%,#000 0%,#000a 42%,#0000 100%);mask-image:radial-gradient(160% 64% at 50% 0%,#000 0%,#000a 42%,#0000 100%)}
  body::after{width:378px;transform:translate3d(-378px,0,0)}
  body[data-page=app]::after{height:72px;-webkit-mask-image:linear-gradient(90deg,#0000,#000 50%,#0000),linear-gradient(to bottom,#000 0,#000 48px,#0000 72px);mask-image:linear-gradient(90deg,#0000,#000 50%,#0000),linear-gradient(to bottom,#000 0,#000 48px,#0000 72px)}}
/* the market floor: a real element clips the wide tile (no horizontal scroll); anchored to the page bottom, never fixed */
body[data-page=signin],body[data-page=onboard],body[data-page=waitlist],body[data-page=terms]{position:relative}
.tape{position:absolute;left:0;right:0;bottom:0;z-index:-1;height:var(--th);overflow:hidden;pointer-events:none;-webkit-mask-image:linear-gradient(to top,#000 0,#000 38%,#0009 66%,#0000 94%);mask-image:linear-gradient(to top,#000 0,#000 38%,#0009 66%,#0000 94%)}
.tape::before{content:"";position:absolute;top:0;bottom:0;left:0;width:calc(100% + var(--tw));opacity:.6;background:url("/market.svg?v=6e689b64") 0 100%/var(--tw) var(--th) repeat-x}
.page{padding-bottom:calc(var(--th) * .6)}
.doc{padding-bottom:calc(var(--th) + 24px)}
/* the one motion control on signed-out pages (WCAG 2.2.2): 44 px target, 28 px ring, two bars; a play triangle when still.
   Written as button.still: <html> carries the class "still" too (motion.js), and a bare .still would style the page root.
   Clear of the home indicator and the notch (viewport-fit=cover); round, so the focus ring follows the ring */
button.still{position:absolute;right:calc(16px + env(safe-area-inset-right));bottom:calc(14px + env(safe-area-inset-bottom));z-index:1;width:44px;height:44px;display:grid;place-items:center;border:0;border-radius:50%;background:none;cursor:pointer;color:var(--muted)}
button.still::before{content:"";width:28px;height:28px;border:1px solid var(--line-2);border-radius:50%;background:#080a09cc}
button.still::after{content:"";position:absolute;width:8px;height:10px;border-inline:2px solid currentColor}
html.still button.still::after{width:0;height:0;border-style:solid;border-width:5px 0 5px 9px;border-color:#0000 #0000 #0000 currentColor;margin-left:3px}
button.still:hover{color:var(--ink)}
@media (max-height:560px){.wm2{display:none}}
@media (prefers-reduced-motion:no-preference){
  body::after{animation:pc-wave 20s infinite}
  .tape::before{animation:pc-tape 200s steps(2000) infinite}
  body[data-page=terms]::after,body[data-page=terms] .tape::before{animation:none}
  /* the dashboard: only its numbers and new copy events move (ui order 53), so the header band's wave holds still */
  body[data-page=app]::after{animation:none}
  /* the Journal (brief 65b) is a numbers page too: the same */
  body[data-page=journal]::after{animation:none}}
@media (prefers-reduced-motion:no-preference) and (max-width:620px){body::after{animation:pc-wave-m 10s infinite}}
@media (prefers-reduced-motion:no-preference) and (min-width:2161px){body::after{animation:pc-wave-xl 30s infinite}}
html.still *,html.still *::before,html.still *::after{animation:none!important}
/* Each pass ends with the whole band past the right edge, so it never parks on screen, and moves a whole number of
   dots (18 px) in 100 ms frames. desktop (621 to 2160 px): 2916 px = 162 dots in 16.2 s, then 3.8 s still.
   wide (2161 to 3888 px): 4644 px = 258 dots in 25.8 s, then 4.2 s still. phone (up to 620 px): 1044 px = 58 dots
   in 5.8 s, every 10 s */
@keyframes pc-wave{0%{transform:translate3d(-756px,0,0);animation-timing-function:steps(162)}81%,100%{transform:translate3d(2160px,0,0)}}
@keyframes pc-wave-xl{0%{transform:translate3d(-756px,0,0);animation-timing-function:steps(258)}86%,100%{transform:translate3d(3888px,0,0)}}
@keyframes pc-wave-m{0%{transform:translate3d(-378px,0,0);animation-timing-function:steps(58)}58%,100%{transform:translate3d(666px,0,0)}}
@keyframes pc-tape{to{transform:translate3d(calc(-1 * var(--tw)),0,0)}}
