/*
  Download page (/download): page-specific styles only. Loaded after styles.css and motion.css on this page only
  (scripts/build.mjs › SUBPAGES). Shared subpage building blocks (page-hero variants, .card, .chip,
  .badge, .pill-status, .callout, .window, .icon-tile, .sample-portrait …) live in styles.css; reuse them.
  Rules: the two literal breakpoints (max-width: 960px / 640px); every hidden start state scoped to
  html.motion (".motion .x") plus a JS-only state attribute; animate transform/opacity only.
  Markup: scripts/pages/download.mjs. Behaviour: dist/pages/download.js (steps sweep).
  Platform cards: dist/platforms.css / dist/platforms.js (shared with the homepage).
*/

.dl-steps .visual-heading > p { text-wrap: pretty; }

/* Hero visual: real app capture in a window frame, data chips and the capture note below.
   The capture has its own 40px title bar; it is cropped off (object-position bottom) so the
   frame's bar is the only one. aspect-ratio reserves the size before the image loads. */
.dl-hero-figure { margin: 0; }
.dl-window img { width: 100%; aspect-ratio: 1280 / 760; object-fit: cover; object-position: 50% 100%; }
.dl-hero-figure figcaption { display: grid; gap: var(--space-3); margin-top: var(--space-4); }

/* Platforms: the download cards right under the hero (shared component: dist/platforms.css). */
.dl-platforms { padding-top: 0; }

/* First clip: a timeline track with one dot per step above three cards. */
.steps { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); margin: 0; padding: 0; list-style: none; }
/* The connector runs through the dots (dot centre = 20px number line + 8px gap + 4px). */
.steps::before { content: ''; position: absolute; top: 32px; left: 0; right: 0; height: 1px; background: var(--line-strong); transform-origin: 0 50%; }
.step { display: flex; flex-direction: column; min-width: 0; }
.step-marker { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: var(--space-2); margin-bottom: 20px; font-size: var(--fs-meta); line-height: 20px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.step-dot { position: relative; z-index: 1; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px var(--bg); }
.step-card { flex: 1; display: flex; flex-direction: column; }
.step-stage { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; height: 224px; }
.step-copy { margin-top: var(--space-5); }
.step-copy p { margin-top: var(--space-2); font-size: var(--fs-ui); line-height: 1.6; }
.dl-steps-note { margin-top: var(--space-4); }
.dl-assistant { margin-top: var(--space-5); }
.dl-assistant .dl-links { display: flex; flex-wrap: wrap; column-gap: var(--space-6); margin-top: var(--space-1); }
.dl-assistant .text-link { color: var(--ink); }

/* Wide: titles and texts of the three step cards start on the same lines (subgrid through the
   list item and the card: marker / stage / title / text). */
@supports (grid-template-rows: subgrid) {
  @media not all and (max-width: 960px) {
    .steps { row-gap: 0; }
    .step { display: grid; grid-row: span 4; grid-template-rows: subgrid; }
    .step-card { display: grid; grid-row: 2 / span 3; grid-template-rows: subgrid; }
    .step-copy { display: contents; }
    .step-copy h3 { margin-top: var(--space-5); }
    .step-copy p { align-self: start; }
  }
}

/* App fragments (aria-hidden, static): the homepage demo language in miniature. */
.frag { display: flex; flex-direction: column; width: min(100% - 24px, 248px); font-size: var(--fs-meta); line-height: 1.35; color: var(--ink-2); }
.frag-install { align-items: center; gap: var(--space-3); }
.frag-install img { width: 32px; height: 32px; }
.frag-wordmark { margin-top: -4px; font-size: var(--fs-body); font-weight: 550; letter-spacing: -.04em; color: var(--ink); }
.frag-progress { position: relative; width: 132px; height: 4px; margin-block: var(--space-1) var(--space-2); border-radius: 2px; background: var(--line); overflow: hidden; }
.frag-progress span { position: absolute; inset: 0; border-radius: inherit; background: var(--ink); }
.frag-button { display: inline-flex; align-items: center; min-height: 30px; padding: 0 18px; border-radius: var(--radius-pill); background: var(--fill); color: var(--on-fill); font-weight: 500; }
.frag-speech { gap: 10px; }
.frag-title { font-weight: 500; color: var(--ink); }
.frag-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface-tint); }
.frag-seg > span { display: flex; align-items: center; justify-content: center; min-height: 26px; border: 1px solid transparent; border-radius: var(--radius-pill); font-size: var(--fs-badge); }
.frag-seg > .is-on { border-color: var(--line-strong); background: var(--surface-pressed); color: var(--ink); }
.frag-rows { display: grid; gap: 6px; }
.frag-row { display: flex; align-items: center; gap: var(--space-2); min-height: 32px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-variant-numeric: tabular-nums; }
.frag-row.is-on { border-color: var(--line-strong); background: var(--surface-pressed); color: var(--ink); }
.frag-radio { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--line-strong); }
.frag-row.is-on .frag-radio { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 3px #262626; }
.frag-row-label { flex: 1; min-width: 0; white-space: nowrap; }
.frag-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); font-size: var(--fs-badge); color: var(--ink); white-space: nowrap; }
.frag-cost { font-size: var(--fs-badge); color: var(--muted); }
.frag-review { gap: 6px; }
.frag-clip { display: grid; grid-template-columns: 23px minmax(0, 1fr); align-items: center; column-gap: 10px; padding: 5px 8px 5px 5px; border: 1px solid transparent; border-radius: var(--radius-sm); }
.frag-clip.is-on { border-color: var(--line-strong); background: var(--surface-pressed); }
.frag-clip .sample-portrait { width: 23px; border-radius: 3px; }
.frag-clip-text { display: grid; gap: 3px; min-width: 0; }
.frag-clip-title { overflow: hidden; color: var(--ink); white-space: nowrap; text-overflow: ellipsis; }
.frag-clip-meta { display: flex; align-items: center; gap: var(--space-2); }
.frag-clip-time { font-size: var(--fs-badge); color: var(--muted); font-variant-numeric: tabular-nums; }
.frag-state { padding: 0 7px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); font-size: var(--fs-badge); line-height: 16px; white-space: nowrap; }
.frag-state.is-on { border-color: transparent; background: var(--fill); color: var(--on-fill); }

/* What you need: one card, a two-column definition list. */
.dl-needs .section-title { margin-bottom: var(--space-5); }
.needs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6) var(--space-7); margin: 0; }
.needs dt { display: flex; align-items: center; gap: 10px; font-size: var(--fs-ui); line-height: var(--lh-ui); font-weight: 600; color: var(--ink); }
.needs dt .icon { color: var(--ink-2); }
.needs dd { margin: var(--space-1) 0 0 30px; max-width: 52ch; font-size: var(--fs-ui); line-height: 1.6; color: var(--ink-2); }

/* Signature motion (download.js, once, first view only, started below the fold, wide layout):
   the connector sweeps from the first dot to the end, then the step-2 "Bereit" chip fades in.
   The start state exists only under html.motion with the JS-set data-sweep; without JS, with
   reduced motion, in print and after leaving the view everything is in its final state. */
.motion .steps[data-sweep=ready]::before { transform: scaleX(0); }
.motion .steps[data-sweep=ready] [data-sweep-chip] { opacity: 0; }
.motion .steps[data-sweep=play]::before { transition: transform var(--dur-sweep) var(--ease-out-soft) 300ms; }
.motion .steps[data-sweep=play] [data-sweep-chip] { transition: opacity var(--dur-fade) var(--ease-standard) 520ms; }
@media print {
  .motion .steps[data-sweep]::before { transform: none !important; }
  .motion .steps[data-sweep] [data-sweep-chip] { opacity: 1 !important; }
}

@media (max-width: 960px) {
  /* Steps: one column, fragment left and text right; the horizontal connector goes. */
  .steps { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .steps::before { display: none; }
  .step-marker { flex-direction: row; align-items: center; margin-bottom: var(--space-3); }
  .step-dot { box-shadow: none; }
  .step-card { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; column-gap: var(--space-6); }
  .step-stage { height: 208px; }
  .step-copy { margin-top: 0; }
}
@media (max-width: 640px) {
  .dl-window .window-bar { height: 24px; }
  .step-card { display: flex; align-items: stretch; }
  .step-stage { height: 200px; }
  .step-copy { margin-top: 20px; }
  .needs { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  .dl-assistant .dl-links { flex-direction: column; }
}
