/* The home page's next hero, a draft (templates/welcome-hero.html, the
   Welcome Hero block on /design). It stands on static/welcome.css: the
   page's width, the headline, the field and the window are that file's.
   Here is only what the new hero changes: the words in the middle over
   a wide window, and the window holding the app's own stage, which
   plays by itself. */

/* The room over the headline is the page's own (.wl in
   static/welcome.css), as on the home page today: the words do not
   stand right under the bar. */
.wh { padding-bottom: 6rem; }

/* The words are short and the window is the picture: the headline on
   one line where the screen has the width, the line under it on two,
   and the window's top still in the first screen. */
.wh-hero { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; }
.wh-copy { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; width: 100%; max-width: 72rem; text-align: center; }
.wh .wl-title { font-size: clamp(2.5rem, 1.5rem + 2.8vw, 3.75rem); }
.wh-lede { max-width: 44rem; text-wrap: balance; }

/* The field is the page's own (static/welcome.css), in the middle here
   with its line under it. */
.wh-copy .wl-field { width: 100%; margin-top: 2.25rem; }
.wh-copy .wl-hero-fine { justify-content: center; }

/* The film's steps, over the window: each a button that plays it from
   there, with a play mark after its name that the step playing does
   not need. A step's bar fills while it plays (static/welcome-hero.js
   gives the time, --wh-ms), stands full once it has played, and is
   empty while the window loads the step just pressed. Held still, the
   step shown has its bar full. Pointed at, a step's bar and its mark
   darken. */
.wh-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; width: 100%; margin: clamp(3.5rem, 2.5rem + 3vw, 5rem) 0 0; padding: 0; list-style: none; }
.wh-step { display: grid; align-content: start; gap: 0.625rem; min-height: 2.75rem; padding-bottom: 0.875rem; font-size: 0.875rem; font-weight: 500; line-height: 1.3; text-align: left; text-decoration: none; color: var(--muted-foreground); transition: color 150ms ease; }
.wh-step-track { display: block; height: 3px; overflow: hidden; border-radius: 999px; background: var(--solid-border); transition: background-color 150ms ease; }
.wh-step-track i { display: block; height: 100%; border-radius: inherit; background: var(--marketing-foreground); transform: scaleX(0); transform-origin: left; }
.wh-step-say { display: flex; align-items: baseline; gap: 0.5rem; }
.wh-step-play { flex: none; align-self: center; margin-left: 0.125rem; opacity: 0.55; transition: opacity 150ms ease; }
.wh-step[data-wh-on] .wh-step-play { visibility: hidden; }
.wh-step-n { font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.75rem; font-weight: 400; color: var(--muted-foreground); }
.wh-step[data-wh-on] { color: var(--marketing-foreground); }
.wh-step[data-wh-done] .wh-step-track i,
.wh-step[data-wh-on]:not([data-wh-wait]) .wh-step-track i { transform: scaleX(1); }
.wh-step:focus-visible { outline: 2px solid var(--marketing-foreground); outline-offset: 4px; border-radius: 0.25rem; }
@media (hover: hover) and (pointer: fine) {
  .wh-step:hover { color: var(--marketing-foreground); }
  .wh-step:hover .wh-step-play { opacity: 1; }
  .wh-step:not([data-wh-on]):hover .wh-step-track { background: color-mix(in oklab, var(--marketing-foreground) 32%, var(--solid-border)); }
}
@media (prefers-reduced-motion: no-preference) {
  .wh-step[data-wh-on][style*="--wh-ms"] .wh-step-track i { animation: wh-fill var(--wh-ms) linear both; }
}
@keyframes wh-fill {
  from { transform: scaleX(0); }
}
@media (max-width: 40rem) {
  .wh-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 0.5rem; }
  .wh-step { font-size: 0.8125rem; }
  .wh-step-say { flex-wrap: wrap; gap: 0.125rem 0.375rem; }
  .wh-step-n { flex-basis: 100%; }
}

/* The window: the app's own screen, nearly as tall as the visitor's,
   so the fan, the reports beside it and the table's first rows all
   show. The stage's own frame goes, the window is the frame. */
.wh-window { width: 100%; margin-top: 0.75rem; }
/* The window's screen is a frame with the film as its own page
   (welcome-hero-scene). */
/* Nothing in the film answers a visitor's press, so the frame takes no
   touch, click or wheel at all: they reach the page, and a finger on
   the window scrolls the page as anywhere else. */
.wh-scene { display: block; width: 100%; height: clamp(34rem, 82vh, 48rem); border: 0; pointer-events: none; }
/* On a phone the window is narrower than any phone's screen, and the
   app at that width looked bigger than the app on a phone. So the app
   gets a phone's width (a quarter more than the window has) and is
   shown at four fifths of its size: the window looks at a whole phone
   screen. The frame's box is still its full size, so the room it
   leaves under itself is taken back. */
@media (max-width: 40rem) {
  .wh-scene {
    --wh-zoom: 0.8;
    --wh-tall: clamp(30rem, 76svh, 42rem);
    width: calc(100% / var(--wh-zoom));
    height: calc(var(--wh-tall) / var(--wh-zoom));
    margin-bottom: calc(var(--wh-tall) * (1 - 1 / var(--wh-zoom)));
    transform: scale(var(--wh-zoom));
    transform-origin: 0 0;
  }
}

/* In the scene's page: the Story door's stage, filling the frame. The
   Home block's stage in it loses its own frame and height. */
.wh-scene-page { margin: 0; overflow: hidden; background: var(--app-page-fallback); }
.wh-screen { position: relative; height: 100vh; overflow: clip; }
.wh-screen .sdoor { height: 100vh; border-radius: 0; }
.wh-screen [data-sheet-frame] { min-height: 0; height: 100vh; border: 0; border-radius: 0; }
.wh-screen .mstory-block { scrollbar-width: none; }
/* The page is looked at: nothing in it says it could be pressed. */
.wh-screen, .wh-screen * { cursor: default !important; }
/* The stage's own room over the fan's bar goes: the window's bar is
   over it already, and the card is what should be seen first. */
.wh-screen [data-sheet-frame] > .z-10 { padding-top: 0; }
/* A year's sheet in the window: the figure, the limits and the
   download; the small print under them is the app's to say. */
.wh-screen .rsheet-note, .wh-screen .rsheet-inspect { display: none; }

.wh-screen > dialog.overlay-sheet { z-index: 80; }
/* The review's drawer as the film closes it: it fades and sinks a
   little, quickly. */
.wh-screen > dialog#rdrawer { transition: opacity 0.2s ease-out, translate 0.2s ease-out; }
.wh-screen > dialog#rdrawer[data-wh-going] { opacity: 0; translate: 0 1.5rem; }
/* A drawer that opens has the app's page step back behind it, smaller
   and dimmed (static/overlay-sheet.js). There the drawer stands over
   the page, in the browser's top layer; in the window it is part of
   the page (the scene's head says why), and would step back with it.
   So the window's page stays as it is, and the drawer's own scrim is
   what dims it. */
.wh-scene-page { transform: none !important; filter: none !important; }

/* The film's pointer (static/welcome-hero.js): it goes to what is
   pressed next and dips as it presses, with a ring where it pressed. */
.wh-hand { position: absolute; top: 0; left: 0; z-index: 90; width: 22px; height: 22px; margin: -3px 0 0 -4px; opacity: 0; pointer-events: none; filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.28)); transition: translate 0.52s cubic-bezier(0.3, 0.7, 0.2, 1), opacity 0.2s ease-out; }
.wh-hand[data-on] { opacity: 1; }
.wh-hand svg { display: block; transition: scale 0.12s ease-out; transform-origin: 4px 3px; }
.wh-hand[data-press] svg { scale: 0.86; }
.wh-hand::after { content: ""; position: absolute; top: -9px; left: -8px; width: 24px; height: 24px; border: 2px solid var(--marketing-foreground); border-radius: 999px; opacity: 0; scale: 0.4; }
.wh-hand[data-ring]::after { animation: wh-press 0.42s ease-out; }
@keyframes wh-press {
  from { opacity: 0.55; scale: 0.4; }
  to { opacity: 0; scale: 1.5; }
}

/* A step pressed, and the film's last step, load the page anew: the
   old one fades, the new one comes in with a short fade. At the film's
   end the table and the reports arrive a beat after the fan. The
   reports only fade: they are placed from the fan's section, and
   anything that moved their box would place them from the box instead. */
@media (prefers-reduced-motion: no-preference) {
  .wh-screen[data-wh-play] { animation: wh-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .wh-screen[data-wh-leaving] { opacity: 0; transition: opacity 0.2s ease-out; animation: none; }
  .wh-screen[data-wh-play][data-wh-step="home"] #source-content { animation: wh-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.2s backwards; }
  .wh-screen[data-wh-play][data-wh-step="home"] #report-papers { animation: wh-in 0.5s ease-out 0.45s backwards; }
}
@keyframes wh-in {
  from { opacity: 0; }
}
@keyframes wh-rise {
  from { opacity: 0; translate: 0 1rem; }
}
.wh-cap { text-align: center; }
