/* /welcome only. Loaded after app.css, which carries the tokens, the buttons
   and the older .wel-* rules this page no longer uses for its hero.
   The hero is a phone that plays five real screens from the example record;
   the shaded band behind it is the lab's range as the charts draw it. */

.wh { display: grid; gap: 18px; min-width: 0; }
.wh-copy { min-width: 0; }
.wh h1 { font: 500 clamp(30px, 8.8vw, 60px)/1.04 var(--serif); letter-spacing: -.025em; margin: 6px 0 12px; text-wrap: balance; display: block; min-height: 0; padding-right: 0; }
.wh-sub { font-size: 17px; line-height: 1.45; color: var(--body); margin: 0 0 18px; max-width: 34ch; text-wrap: pretty; }
.wh-cta { flex-wrap: nowrap; }
.wh-cta .btn { flex: 1 1 auto; padding: 0 16px; }
.wh-cta .btn[hidden] { display: none; }
.wh-tour { margin: 10px 0 0; font-size: 14px; }
.wh-tour a { color: var(--body); }
.wh .msg:empty { display: none; }

/* The stage: the band, the phone, the caption, the pause. */
.wh-stage { position: relative; display: grid; justify-items: center; gap: 12px; padding: 18px 0 4px; min-width: 0; }
.wh-stage::before { content: ""; position: absolute; left: -16px; right: -16px; top: 32%; height: 26%;
  background: color-mix(in srgb, var(--act) 7%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  border-top: 1px dashed color-mix(in srgb, var(--act) 45%, transparent);
  border-bottom: 1px dashed color-mix(in srgb, var(--act) 45%, transparent); pointer-events: none; }
.wh-phone { position: relative; box-sizing: content-box; width: calc(min(66vw, 268px) - 20px); aspect-ratio: 390 / 844; padding: 9px; border-radius: 42px;
  background: #0B0D0C; border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 30px 60px -20px rgba(0,0,0,.45), 0 12px 24px -12px rgba(0,0,0,.35); }
.wh-phone img { position: absolute; inset: 9px; width: calc(100% - 18px); height: calc(100% - 18px); border-radius: 33px; object-fit: cover; opacity: 0; background: #111412; }
.wh-phone img.on { opacity: 1; }
.wh-cap { margin: 0 0 -4px; font: 600 18px/1.25 var(--serif); color: var(--bone); text-align: center; min-height: 2.5em; max-width: 24ch; display: grid; align-items: end; text-wrap: balance; }
.wh-cap, .wh-seg { order: -1; }
.wh-pause { all: unset; position: absolute; top: 60px; right: max(0px, calc(50% - 134px - 58px)); font: 500 12px var(--mono); color: var(--grey); padding: 10px 8px; min-height: 24px; cursor: pointer; }
.wh-pause:hover { color: var(--bone); }
.wh-pause:focus-visible { outline: 2px solid var(--act); outline-offset: 2px; border-radius: 6px; }

/* The index: what each screen shows. A phone sees it as five segments;
   a wide screen reads it as a list beside the phone. */
.wh-index { list-style: none; margin: 0; padding: 0; display: none; }
.wh-index button { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; position: relative; color: var(--grey);
  font: 500 16px/1.3 var(--head); padding: 12px 0 14px 18px; }
.wh-index button::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 12px; width: 2px; background: var(--line-2); border-radius: 2px; }
.wh-index button::after { content: ""; position: absolute; left: 0; top: 10px; width: 2px; height: 0; background: var(--act); border-radius: 2px; }
.wh-index button[aria-pressed="true"] { color: var(--bone); font-weight: 600; }
.wh-index button[aria-pressed="true"]::after { height: calc(100% - 22px); }
.wh-index button:hover { color: var(--bone); }
.wh-index button:focus-visible { outline: 2px solid var(--act); outline-offset: 2px; border-radius: 6px; }

/* Segments on a phone: built by welcome.js, so without script nothing shows. */
.wh-seg { display: flex; gap: 6px; width: min(66vw, 268px); }
.wh-seg button { all: unset; box-sizing: border-box; flex: 1; height: 24px; cursor: pointer; position: relative; }
.wh-seg button::before, .wh-seg button::after { content: ""; position: absolute; left: 0; top: 10px; height: 4px; border-radius: 4px; }
.wh-seg button::before { right: 0; background: var(--line-2); }
.wh-seg button::after { width: 0; background: var(--act); }
.wh-seg button.done::after, .wh-seg button[aria-pressed="true"]::after { width: 100%; }
.wh-seg button:focus-visible { outline: 2px solid var(--act); outline-offset: 2px; border-radius: 6px; }

/* Motion: a crossfade and a fill that times each screen. Only when asked for. */
@media (prefers-reduced-motion: no-preference) {
  .wh-phone img { transition: opacity .6s ease; }
  .wh.playing .wh-seg button[aria-pressed="true"]::after,
  .wh.playing .wh-index button[aria-pressed="true"]::after { animation: wh-fill 3.4s linear both; }
  .wh.playing .wh-index button[aria-pressed="true"]::after { animation-name: wh-fill-v; }
  .wh.paused .wh-seg button::after, .wh.paused .wh-index button::after { animation-play-state: paused; }
  .wh-index button { transition: color .3s ease; }
}
@keyframes wh-fill { from { width: 0; } to { width: 100%; } }
@keyframes wh-fill-v { from { height: 0; } to { height: calc(100% - 22px); } }

/* Three plain tiles under the hero. */
.wh-tiles { display: grid; gap: 10px; }
.wh-tile { display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; align-items: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--coal); }
.wh-tile .ico { grid-row: span 2; width: 40px; height: 40px; padding: 8px; box-sizing: border-box; border-radius: 0; padding: 4px; color: var(--act); background: transparent; }
.wh-tile h2 { font: 600 17px var(--serif); margin: 0 0 3px; }
.wh-tile p { margin: 0; color: var(--body); line-height: 1.45; }
.wh-note p { max-width: 62ch; line-height: 1.55; margin: 0 0 8px; }

@media (max-height: 700px) and (max-width: 859px) {
  .wh h1 { font-size: clamp(28px, 8vw, 40px); margin-bottom: 8px; }
  .wh-sub { font-size: 16px; margin-bottom: 14px; }
}

@media (min-width: 860px) {
  .wh { grid-template-columns: 1fr minmax(300px, 400px); gap: 40px; align-items: center; }
  .wh-index { display: block; margin-top: 30px; max-width: 380px; }
  .wh-seg, .wh-cap { display: none; }
  .wh-cta { flex-wrap: wrap; }
  .wh-cta .btn { flex: 0 0 auto; padding: 0 22px; }
  .wh-phone { width: calc(min(300px, (100svh - 140px) * 390 / 844) - 20px); }
  .wh-stage { padding: 0 0 40px; }
  .wh-stage::before { left: -60px; right: -60px; }
  .wh-pause { top: auto; bottom: 0; right: auto; left: 50%; transform: translateX(-50%); }
  .wh-tiles { grid-template-columns: repeat(3, 1fr); }
}
