/* 23-home.css — the home page (task 199, Pages/Index.cshtml), linked by it alone after the shared sheets.
   Second version (the owner, 30.11.2026: «дуже стримано … має бути точно як на Awwwards»): a dark trading floor first, in
   both themes (the stage tokens of 00-tokens.css), then the page in the reader's theme. Semantic tokens only.
   Motion: every animation sits in a prefers-reduced-motion: no-preference block; under reduce the page is the same page,
   still — the ring at its first angle, the tape a row to scroll, the counters their figures, the scroll story its end.
   home.js drives what CSS cannot (the orbit, the odometers, the pointer, the scroll story); the page is whole without it.
   Task 207 (the taste skill, `~/.claude/skills/taste-skill`, read as files): a section a screen, each on a ground of its own
   (surface pairs: the stage, --bg, --surface-1), one wrap of 1 280 px whose edges every block keeps, Geist for the headings
   and figures, no violet, no stock reveal on scroll, no tilt, a card lifts 2 px and its photo grows 1.03. */

/* Geist (wwwroot/lib/geist/SOURCE.md): one variable file, the weight axis kept. `optional`: preloaded by the page, it is
   there for the first paint or not at all — a late face would reflow the headline under the reader (CLS). */
@font-face {
  font-family: "Geist";
  src: url("../../lib/geist/geist-subset.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: optional;
}

.home {
  --home-max: 1280px;
  --home-gutter: clamp(20px, 5.5vw, 80px);
  --home-display: "Geist", var(--font-sans);
  --ease-power3: cubic-bezier(0.215, 0.61, 0.355, 1);
  width: 100%;
  display: grid;
  font-variant-numeric: tabular-nums;
  overflow-x: clip;
}

/* The one wrap: the same left and right line for every section's content, the header's included (1 280 px, the gutter
   80 px at 1 440, 20 on a phone). */
.home-wrap {
  width: min(var(--home-max), calc(100% - var(--home-gutter) * 2));
  margin-inline: auto;
  min-width: 0;
}

.home h1,
.home h2,
.home h3 {
  margin: 0;
  color: inherit;
  text-wrap: balance;
}

.home p,
.home dl,
.home dd,
.home figure {
  margin: 0;
}

.home ul,
.home ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.home .is-up { color: var(--up); }
.home .is-down { color: var(--down); }

/* The page breaks out of .app-body's padding: the stage runs edge to edge under the header. */
body.app-shell:has(.hx) > .app-body {
  width: 100%;
  padding-top: 0;
}

/* ── Lenis (task 200, wwwroot/lib/lenis): its own stylesheet's rules, and Bootstrap's `scroll-behavior: smooth` off for
   as long as Lenis is on — not only while it scrolls (its `.lenis-smooth`): with it, a focus, a `#` address or
   scrollIntoView started a native smooth scroll Lenis then fought, and a far focus ended 1 554 px below the window
   (stand200, Chromium 1 440). Lenis smooths a link's anchor itself (`anchors: true`). ── */
html.lenis,
html.lenis body {
  height: auto;
}

html.lenis {
  scroll-behavior: auto;
}

/* A focused control or an anchor is never left under the sticky header (WCAG 2.4.11; task 200's keyboard pass). */
html:has(.hx) {
  scroll-padding-top: calc(var(--app-header) + var(--space-4));
}

.lenis.lenis-stopped {
  overflow: clip;
}

.lenis [data-lenis-prevent] {
  overscroll-behavior: contain;
}

/* ── The stage: aurora, a dot grid of studs, the pointer's light ───────────────────────────────────────────────── */
.hx {
  --mx: 50%;
  --my: 40%;
  position: relative;
  isolation: isolate;
  --tape-h: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: clamp(24px, 4vw, 48px);
  /* The hero and the ticker under it are the first screen together (the taste skill: the hero alone on it). */
  min-height: calc(100svh - var(--app-header) - var(--tape-h));
  padding: clamp(28px, 5vw, 64px) max(var(--home-gutter), calc((100% - var(--home-max)) / 2)) clamp(28px, 4vw, 56px);
  background: var(--stage);
  color: var(--stage-text);
  overflow: hidden;
}

/* A guest's header is part of the stage (task 202, _HeaderGuest's data-stage): the stage starts at the window's top,
   under the header, the header's height added to its padding — its words stay where they were. An account's header is
   the app's, solid, and the stage starts under it. */
body:has(> .app-header[data-stage]) {
  --hx-under: var(--app-header);
}

@media (max-width: 900px) {
  body:has(> .app-header[data-stage]) {
    --hx-under: calc(52px + env(safe-area-inset-top, 0px));
  }
}

body:has(> .app-header[data-stage]) .hx {
  margin-top: calc(-1 * var(--hx-under));
  padding-top: calc(var(--hx-under) + clamp(28px, 5vw, 64px));
  min-height: calc(100svh - var(--tape-h));
}

@media (min-width: 1000px) {
  .hx {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: center;
  }

  .hx > .home-folio {
    grid-column: 1 / -1;
  }
}

.hx-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hx-aurora {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  /* Soft by its own gradient, no blur filter (an 80 px blur over three 60vmax layers was repainted while they drifted). */
  opacity: 0.32;
  will-change: transform;
}

.hx-aurora--1 { left: -18vmax; top: -24vmax; background: radial-gradient(closest-side, var(--glow-1), color-mix(in srgb, var(--glow-1) 35%, transparent) 45%, transparent); }
.hx-aurora--2 { right: -20vmax; top: -10vmax; background: radial-gradient(closest-side, var(--glow-2), color-mix(in srgb, var(--glow-2) 35%, transparent) 45%, transparent); opacity: 0.4; }
.hx-aurora--3 { left: 20%; bottom: -34vmax; background: radial-gradient(closest-side, var(--glow-3), color-mix(in srgb, var(--glow-3) 35%, transparent) 45%, transparent); opacity: 0.22; }

/* Studs: a dot every 24 px round the orbit, bright round the pointer — and none behind the words: the copy's column is
   masked out (the right half from 1 000 px, the ring's band on a phone), so no dot ever touches a glyph or a control. */
.hx-grid,
.hx-spot {
  --grid-mask: linear-gradient(90deg, transparent 0 52%, black 68%);
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--stage-border) 1.4px, transparent 1.6px);
  background-size: 24px 24px;
  mask-image: var(--grid-mask), radial-gradient(ellipse 70% 80% at 75% 50%, black, transparent 85%);
  mask-composite: intersect;
}

.hx-spot {
  background-image: radial-gradient(circle, var(--stage-muted) 1.6px, transparent 1.8px);
  mask-image: var(--grid-mask), radial-gradient(260px circle at var(--mx) var(--my), black, transparent 70%);
  opacity: 0.75;
}

/* On a phone the words run the whole width: the studs are the ring's own, behind it only (.hx-orbit::before). */
@media (max-width: 999px) {
  .hx-grid,
  .hx-spot {
    display: none;
  }

  .hx-orbit::before {
    content: "";
    position: absolute;
    inset: 0 -16px;
    background-image: radial-gradient(circle, var(--stage-border) 1.4px, transparent 1.6px);
    background-size: 22px 22px;
    mask-image: radial-gradient(ellipse 60% 55% at 50% 55%, black, transparent 80%);
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hx-aurora--1 { animation: hx-drift 18s ease-in-out infinite alternate; }
  .hx-aurora--2 { animation: hx-drift 22s ease-in-out -6s infinite alternate-reverse; }
  .hx-aurora--3 { animation: hx-drift 26s ease-in-out -12s infinite alternate; }
}

@keyframes hx-drift {
  to { transform: translate3d(8vmax, 6vmax, 0) scale(1.15); }
}

/* ── An account's collection, a glass strip on the stage ── */
.home-folio {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--stage-border);
  border-radius: 16px;
  background: var(--stage-surface);
}

.home-folio__title {
  font-size: var(--text-sm);
  font-weight: 700;
}

.home-folio__figs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
}

.home-folio__figs > div {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.home-folio__figs dt,
.home-folio__empty {
  font-size: var(--text-xs);
  color: var(--stage-muted);
}

.home-folio__figs dd {
  font-size: var(--text-md);
  font-weight: 700;
}

.home-folio__figs dd span {
  font-weight: 500;
}

.home-folio__figs .home-folio__value {
  font-size: var(--text-lg);
}

.home-folio__value span {
  margin-left: var(--space-1);
  font-size: var(--text-xs);
  color: var(--stage-muted);
}

.hx .is-up { color: var(--stage-up); }
.hx .is-down { color: var(--stage-down); }

/* ── The headline: huge, tight, letter by letter ── */
.hx-copy {
  display: grid;
  gap: clamp(18px, 2.4vw, 28px);
  min-width: 0;
  position: relative;
  z-index: 2;
}

.hx-title {
  font-family: var(--home-display);
  font-size: clamp(2.6rem, 1rem + 5.6vw, 5.25rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hx-title__show {
  display: block;
}

.hx-word {
  display: inline-block;
  white-space: nowrap;
}

.hx-char {
  display: inline-block;
}

/* The letters are drawn, not written (task 219): the heading's text is its visually hidden copy alone, so a search
   engine's snippet and a copied selection read the headline once. */
.hx-char::before {
  content: attr(data-ch);
}

.hx-word--accent {
  padding-bottom: 0.06em;
  background: var(--accent-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.hx-mark {
  font-size: 0.32em;
  vertical-align: 1.8em;
  letter-spacing: 0;
  font-weight: 600;
}

/* The research's letters.js: y, rotate and blur to rest, 0.9 s, 10 ms apart. Opacity starts above 0, so the title is
   painted on the first frame and stays the page's largest contentful paint. */
@media (prefers-reduced-motion: no-preference) {
  .hx-char {
    animation: hx-letter 900ms var(--ease-power3) both;
    animation-delay: calc(var(--c) * 10ms);
  }
}

@keyframes hx-letter {
  from {
    opacity: 0.02;
    transform: translateY(0.45em) rotate(6deg);
    filter: blur(10px);
  }
}

/* The hero's entrance (the taste skill: the headline, then what to do, the picture settling; ~1.1 s, once): the line, the
   search, the two ways in and the figures rise after the letters. From 0.02, not 0: painted on the first frame, so the
   line stays the page's largest paint (Lighthouse). */
@media (prefers-reduced-motion: no-preference) {
  .hx-lead,
  .home-search,
  .hx-actions,
  .hx-stats {
    animation: hx-rise 700ms var(--ease-power3) backwards;
  }

  .hx-lead { animation-delay: 220ms; }
  .home-search { animation-delay: 320ms; }
  .hx-actions { animation-delay: 400ms; }
  .hx-stats { animation-delay: 480ms; }

  /* The whole box settles, ring and floor together: an animated transform on the ring alone made it a stacking context
     of its own, and the floor's amber glow, later in the box, painted over the front cards. */
  .hx-orbit {
    animation: hx-settle 1100ms var(--ease-power3) backwards;
  }
}

@keyframes hx-rise {
  from {
    opacity: 0.02;
    transform: translateY(14px);
  }
}

@keyframes hx-settle {
  from {
    opacity: 0.02;
    transform: scale(0.94);
  }
}

.hx-lead {
  max-width: 52ch;
  font-size: clamp(1.0625rem, 0.95rem + 0.5vw, 1.3125rem);
  line-height: 1.5;
  color: var(--stage-muted);
  text-wrap: pretty;
}

/* ── Buttons on the stage: a fill that steps on hover, 1 px up, and presses 1 px down (the taste skill's motion layer;
   task 199's turning conic edge and the pull to the pointer went with task 207 — a shine and a glide it lists as never) ── */
.hx-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 52px;
  padding: 0 var(--space-6);
  border: 1px solid var(--stage-border);
  border-radius: 999px;
  background: var(--stage-surface);
  color: var(--stage-text);
  font-weight: 700;
  font-size: var(--text-lg);
  text-decoration: none;
  cursor: pointer;
  transition: translate 150ms var(--ease-out), background-color 150ms var(--ease), scale 90ms var(--ease-out);
}

.hx-btn:hover {
  color: var(--stage-text);
  background: var(--stage-border);
}

@media (hover: hover) and (pointer: fine) {
  .hx-btn:hover {
    translate: 0 -1px;
  }
}

.hx-btn:active {
  translate: 0 1px;
  scale: 0.985;
}

.hx-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* A secondary on the stage is a solid dark chip, not a hole the studs show through. */
.hx-btn--ghost {
  background: var(--stage);
}

.hx-btn--primary {
  border: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  overflow: hidden;
  isolation: isolate;
}

.hx-btn--primary:hover {
  background: var(--accent-hover);
  color: var(--accent-contrast);
}

.hx-btn--light {
  border-color: transparent;
  background: var(--stage-text);
  color: var(--stage);
}

.hx-btn--light:hover {
  background: var(--stage-muted);
  color: var(--stage);
}

.home-scrolly .hx-btn--primary,
.home .hx-btn--primary {
  color: var(--accent-contrast);
}


/* ── The search on the stage ── */
.home-search {
  position: relative;
  z-index: 3;
  max-width: 640px;
}

.home-search__form {
  display: flex;
  gap: var(--space-2);
  padding: 6px;
  border: 1px solid var(--stage-border);
  border-radius: 999px;
  background: var(--stage);
  transition: border-color var(--duration-1) var(--ease), box-shadow var(--duration-2) var(--ease-out);
}

.home-search__form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--stage-border), 0 18px 48px var(--stage);
}

.home-search__field {
  flex: 1;
  min-width: 0;
}

.home-search__field .ui-input {
  height: 52px;
  border: 0;
  background: transparent;
  color: var(--stage-text);
  font-size: max(16px, var(--text-lg));
  box-shadow: none;
}

.home-search__field .ui-input::placeholder {
  color: var(--stage-muted);
}

.home-search__field .ui-input:focus,
.home-search__field .ui-input:focus-visible {
  outline: none;
  box-shadow: none;
}

.home-search__field svg {
  width: 18px;
  height: 18px;
  stroke: var(--stage-muted);
}

.home-search__go {
  min-height: 52px;
}

.home-search__go-icon {
  display: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-search__panel {
  left: 0;
  right: auto;
  width: 100%;
  color: var(--text);
}

.hx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ── Odometer figures (home.js turns each digit into a column that rolls; the text is the figure without it) ── */
.hx-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) clamp(24px, 4vw, 48px);
  padding-top: var(--space-2);
}

.hx-stats > div {
  display: grid;
  gap: 2px;
}

.hx-stats dt {
  order: 2;
  font-size: var(--text-sm);
  color: var(--stage-muted);
}

.hx-stats__link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--stage-border);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

@media (prefers-reduced-motion: no-preference) {
  .hx-stats__link {
    transition: text-decoration-color 150ms var(--ease);
  }
}

.hx-stats__link:hover {
  color: inherit;
  text-decoration-color: var(--accent);
}

.hx-stats dd {
  font-family: var(--home-display);
  font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.odo {
  display: inline-flex;
  overflow: hidden;
  line-height: 1;
  vertical-align: bottom;
}

.odo__col {
  display: inline-block;
  height: 1em;
  overflow: hidden;
}

.odo__reel {
  display: flex;
  flex-direction: column;
}

.odo__reel > span {
  height: 1em;
  line-height: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .odo.is-rolling .odo__reel {
    transition: transform 650ms var(--ease-power3);
    transition-delay: calc(var(--k) * 50ms);
  }
}

/* ── The orbit: twelve sets round a ring, projected in 2D (task 200) ──
   The ring is drawn without CSS 3D: each item's place is computed from its angle on the circle (--a, the server's) plus
   the ring's turn (--turn, home.js, one write a frame on the ring), with CSS sin() / cos(): x = sin, depth = cos, the
   ring tilted by --tilt towards the viewer, a perspective factor --s = 1 / (1 − depth · 0.36): the front card 1.5 times,
   the back 0.75 (0.3 gave 1.4 and 0.78 — too little depth without the old filters). Only 2D translate, scale
   and opacity move — composited alike in every engine. Task 199's ring was `perspective` + `preserve-3d` with a blur,
   a brightness filter and a reflection on each item: WebKit drew it as a flat row that slid at half the scroll's speed
   (stand200, Playwright WebKit 26.5, 390 and 1 440 — the owner's flicker), and every turn repainted twelve filters. */
.hx-orbit {
  --r: clamp(150px, 18vw, 260px);
  --item: clamp(96px, 9vw, 136px);
  position: relative;
  height: calc(var(--r) * 0.9 + var(--item) * 1.6);
  z-index: 1;
  /* Layout only, never paint: the ring must not be cut by its own box (paint containment sliced the side cards at
     the column's edges, stand200 1 440). The stage (.hx) clips what passes its edge. */
  contain: layout;
}

.hx-orbit__ring {
  --turn: 0deg;
  --tilt: 22deg;
  position: absolute;
  inset: 0;
}

.hx-orbit__item {
  --ang: calc(var(--a) + var(--turn));
  --cz: cos(var(--ang));
  --s: calc(1 / (1 - var(--cz) * cos(var(--tilt)) * 0.36));
  position: absolute;
  left: 50%;
  top: var(--cy, 50%);
  width: var(--item);
  aspect-ratio: 4 / 3;
  margin: calc(var(--item) * -0.375) 0 0 calc(var(--item) * -0.5);
  display: block;
  padding: var(--photo-inset);
  border-radius: 14px;
  background: var(--photo-bg);
  box-shadow: 0 18px 40px var(--stage), 0 0 0 1px var(--stage-border);
  transform:
    translate(calc(sin(var(--ang)) * var(--r) * var(--s)), calc(var(--cz) * sin(var(--tilt)) * var(--r) * var(--s)))
    scale(calc(var(--s) * 0.92));
  opacity: calc(0.3 + (var(--cz) + 1) * 0.35);
  z-index: round(calc((var(--cz) + 1) * 50));
  transition: box-shadow var(--duration-2) var(--ease);
}

/* Depth without a filter: an amber pool under each card, strongest under the front one and gone behind. */
.hx-orbit__item::after {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  top: 100%;
  height: 30%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--glow-1) 55%, transparent), transparent);
  opacity: clamp(0, calc(var(--cz) * 1.4 - 0.4), 1);
  pointer-events: none;
}

.hx-orbit__pic {
  position: absolute;
  inset: var(--photo-inset);
  width: calc(100% - var(--photo-inset) * 2);
  height: calc(100% - var(--photo-inset) * 2);
}


.js-motion .hx-orbit__item {
  cursor: pointer;
}

.hx-orbit__item:hover {
  box-shadow: 0 0 0 2px var(--accent), 0 24px 60px var(--stage);
}

/* Its pause: a small glass chip in the box's top corner, above the ring's band, over no card. */
.hx-orbit .hx-orbit__toggle {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  z-index: 200;
}

.home-tape__toggle[hidden] {
  display: none;
}

/* The floor: a warm pool under the ring (--glow-2, orange since task 207 — violet before) and an amber glow under the front item. */
.hx-orbit__floor {
  position: absolute;
  left: 50%;
  top: calc(var(--cy, 50%) + var(--item) * 0.25);
  width: calc(var(--r) * 2.4);
  height: calc(var(--r) * 0.7);
  translate: -50% -20%;
  border-radius: 50%;
  /* A soft edge drawn in the gradient itself, not a blur filter (repainted on every frame it moved under). */
  background: radial-gradient(closest-side, var(--glow-2), transparent 100%);
  opacity: 0.32;
}

.hx-orbit__floor::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 46%;
  height: 60%;
  translate: -50% 10%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow-1), transparent);
  opacity: 0.9;
}

/* From 1 000 px the ring is sized from its own column, so no card ever passes the column's edge at any width: half the
   width holds the widest point of the ring (1.06 r, where cos = k) plus half a card there (0.52 item); the front card is
   1.38 items wide at the centre. The box's height follows its width (the ring is 0.53 W tall with the pointer's 28°
   tilt), its centre 36 % down — the back row is shallower than the front. */
@media (min-width: 1000px) {
  .hx-orbit {
    container-type: inline-size;
    height: auto;
    aspect-ratio: 5 / 3;
  }

  .hx-orbit__ring,
  .hx-orbit__floor {
    --item: min(136px, 23cqi);
    --r: calc((46cqi - var(--item) * 0.52) / 1.06);
    --cy: 36%;
  }
}

@media (max-width: 999px) {
  .hx-orbit {
    --r: min(31vw, 230px);
    --item: min(20vw, 110px);
    order: 2;
    touch-action: pan-y;
  }
}

/* ── The tape: the index's largest on one row, an exchange board at the first screen's foot (two rows until task 207;
   the movers have their own section now) ── */
.home-tape {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px;
  padding-block: var(--space-2);
  background: var(--stage);
  color: var(--stage-text);
  border-block: 1px solid var(--stage-border);
}

.home-tape__viewport {
  grid-column: 1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 64px, black calc(100% - 64px), transparent);
}

.home-tape__track {
  display: flex;
  width: max-content;
}

.home-tape__list {
  display: flex;
  flex: none;
}

.home-tape__item {
  flex: none;
}

.home-tape__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 60px;
  padding: var(--space-2) var(--space-6) var(--space-2) var(--space-4);
  border-right: 1px solid var(--stage-border);
  color: var(--stage-text);
  text-decoration: none;
  white-space: nowrap;
  font-size: var(--text-md);
  transition: background-color var(--duration-2) var(--ease), translate var(--duration-2) var(--ease-out);
}

.home-tape__link:hover {
  color: var(--stage-text);
  background: var(--stage-surface);
}

.home-tape__photo {
  width: 48px;
  height: 36px;
  object-fit: contain;
  border-radius: var(--radius-2);
  background: var(--photo-bg);
  padding: var(--photo-inset);
  transition: scale var(--duration-2) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .home-tape__link:hover .home-tape__photo {
    scale: 1.03;
  }
}

.home-tape__number {
  font-weight: 800;
}

.home-tape__name {
  max-width: 20ch;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--stage-muted);
}

.home-tape__price {
  font-weight: 700;
}

.home-tape__move {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  border-radius: var(--radius-1);
  padding: 2px 6px;
}

.home-tape .is-up { color: var(--stage-up); }
.home-tape .is-down { color: var(--stage-down); }

.home-tape__arrow {
  width: 10px;
  height: 10px;
  fill: currentColor;
  filter: drop-shadow(0 0 4px currentColor);
}

/* The tape's pause sits in a gutter of its own at the rows' end — beside the moving content, never on it. 40 px with a
   mouse; 01-base.css' touch floor makes it 44 on a phone. */
.home-tape__toggle {
  position: relative;
  z-index: 2;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  margin-inline: var(--space-2) var(--space-3);
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--stage-border);
  border-radius: 50%;
  background: var(--stage-surface);
  color: var(--stage-muted);
  cursor: pointer;
  transition: scale var(--duration-1) var(--ease-out);
}

.home-tape__toggle:active {
  scale: 0.96;
}

.home-tape__toggle svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.home-tape__toggle .home-tape__play,
.home-tape__toggle[aria-pressed="true"] .home-tape__pause {
  display: none;
}

.home-tape__toggle[aria-pressed="true"] .home-tape__play {
  display: block;
}

.home-tape__toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .home-tape__track {
    animation: home-tape 70s linear infinite;
  }

  .home-tape:hover .home-tape__track,
  .home-tape:focus-within .home-tape__track,
  .home-tape.is-paused .home-tape__track {
    animation-play-state: paused;
  }

  /* As the tape comes into view each move flashes its colour once (home.js adds .is-in). */
  .home-tape.is-in .home-tape__move {
    animation: home-flash 900ms var(--ease-out) both;
    animation-delay: calc(var(--k, 0) * 60ms);
  }
}

@keyframes home-tape {
  to { transform: translateX(-50%); }
}

@keyframes home-flash {
  0% { background: currentColor; color: var(--stage); }
  100% { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .home-tape__viewport {
    overflow-x: auto;
    mask-image: none;
  }

  .home-tape__list[aria-hidden="true"],
  .home-tape__toggle {
    display: none;
  }
}

/* ── Sections: one a screen, each on a ground of its own, its heading first and top-aligned (task 207, the taste skill's
   «one section per screen» and surface pairs; separated by the ground, never a rule). Nothing comes in on scroll: task
   199's staggered reveal was the skill's «stock reveal». ── */
.home-section {
  min-width: 0;
  /* The sticky header (56 px) lies over the section's top: 104 leaves the heading 48 px under it at 1 440 × 900. */
  padding-block: clamp(56px, 11.5vh, 104px) clamp(40px, 5vh, 56px);
  background: var(--bg);
}

.home-section--surface {
  background: var(--surface-1);
}

.home-section > .home-wrap {
  display: grid;
  gap: var(--space-6);
  align-content: start;
}

/* A screen tall where a screen can hold it (a desktop window from 700 px high); a phone's section is as tall as it holds. */
@media (min-width: 1000px) and (min-height: 700px) {
  .home-section {
    min-height: 100svh;
  }
}

.home-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
}

.home-section__title {
  max-width: 36ch;
  font-family: var(--home-display);
  font-size: clamp(2rem, 1.2rem + 2vw, 3rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.home-section__more {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--accent-text);
  text-decoration: none;
  text-underline-offset: 3px;
}

.home-section__more:hover {
  text-decoration: underline;
}

.home-section__more::after {
  content: "→";
  display: inline-block;
  margin-left: var(--space-1);
  transition: translate 150ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .home-section__more:hover::after {
    translate: 3px 0;
  }
}

/* ── The market: BrickIndex beside the movers ── */
.home-market__grid {
  display: grid;
  gap: var(--space-7);
}

@media (min-width: 1000px) {
  .home-market__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
  }
}

.home-movers {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.home .home-movers__title {
  font-family: var(--home-display);
  font-size: var(--text-xl);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.home-index {
  position: relative;
  display: grid;
  gap: var(--space-4);
  padding: clamp(20px, 3vw, 32px);
  border-radius: 24px;
  background: var(--stage);
  color: var(--stage-text);
  border: 1px solid var(--stage-border);
  overflow: hidden;
  min-width: 0;
}

.home-index::before {
  content: "";
  position: absolute;
  inset: auto -20% -60% -20%;
  height: 80%;
  background: radial-gradient(closest-side, var(--glow-3), transparent);
  opacity: 0.18;
  pointer-events: none;
}

.home-index .is-up { color: var(--stage-up); }
.home-index .is-down { color: var(--stage-down); }

.home-index__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
}

.home-index__title {
  font-family: var(--home-display);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.home-index__asof {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--stage-muted);
}

.home-index__live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--stage-up);
  box-shadow: 0 0 0 0 var(--stage-up);
}

.home-index__radio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.home-index__switch {
  justify-self: start;
  background: var(--stage-surface);
}

.home-index__switch .ui-segmented__option {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-md);
  color: var(--stage-muted);
}

#home-period-30:checked ~ .home-index__switch [for="home-period-30"],
#home-period-90:checked ~ .home-index__switch [for="home-period-90"] {
  background: var(--stage-border);
  color: var(--stage-text);
}

#home-period-30:focus-visible ~ .home-index__switch [for="home-period-30"],
#home-period-90:focus-visible ~ .home-index__switch [for="home-period-90"] {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

#home-period-30:checked ~ .home-index__figures .home-index__change--90,
#home-period-90:checked ~ .home-index__figures .home-index__change--30 {
  display: none;
}

.home-index__change {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.home-index__figure {
  font-family: var(--home-display);
  font-size: clamp(3.5rem, 2.4rem + 4vw, 5.5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.05em;
  position: relative;
  isolation: isolate;
}

/* The glow round the whole figure is a gradient behind it. A text-shadow would be cut by each odometer reel's box, and
   the drop-shadow filter it was punched a 78 × 27 px transparent hole under the header in WebKit (stand200, Playwright
   WebKit 26.5, 390 and 1 440: the figure 1 300 px down, the hole on the first screen). */
.home-index__figure::before {
  content: "";
  position: absolute;
  inset: -24px -32px;
  z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, currentColor 35%, transparent), transparent);
  pointer-events: none;
}

.home-index__span {
  font-size: var(--text-md);
  color: var(--stage-muted);
}

/* The line: glowing, the 30 / 90 days morph one into the other (CSS «d», both 91 points), the dot rides its end. */
.home-index__plot {
  --end: var(--end30);
  position: relative;
  height: 150px;
}

#home-period-90:checked ~ .home-index__plot {
  --end: var(--end90);
}

.home-index__chart {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.home-index__line {
  d: var(--d30);
  fill: none;
  stroke: var(--stage-muted);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 6px currentColor);
}

.home-index__area {
  d: var(--a30);
  fill: var(--stage-surface);
}

#home-period-90:checked ~ .home-index__plot .home-index__line { d: var(--d90); }
#home-period-90:checked ~ .home-index__plot .home-index__area { d: var(--a90); }

.home-index__plot.is-up { color: var(--stage-up); }
.home-index__plot.is-down { color: var(--stage-down); }
.home-index__plot.is-up .home-index__line,
.home-index__plot.is-down .home-index__line { stroke: currentColor; }
/* The card is the stage in both themes: its area is tinted from the stage's own colours (the theme's --up-bg is a
   pale chip colour in the light theme, and lit the dark card up). */
.home-index__plot.is-up .home-index__area { fill: color-mix(in srgb, var(--stage-up) 18%, transparent); }
.home-index__plot.is-down .home-index__area { fill: color-mix(in srgb, var(--stage-down) 18%, transparent); }

.home-index__dot {
  position: absolute;
  right: -5px;
  top: var(--end);
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px var(--stage), 0 0 18px currentColor;
}

.home-index__breadth {
  position: relative;
  display: flex;
  gap: var(--space-7);
  padding-top: var(--space-4);
  border-top: 1px solid var(--stage-border);
}

.home-index__breadth > div {
  display: grid;
  gap: 2px;
}

.home-index__breadth dt {
  order: 2;
  font-size: var(--text-sm);
  color: var(--stage-muted);
}

.home-index__breadth dd {
  font-family: var(--home-display);
  font-size: var(--text-2xl);
  font-weight: 600;
}

@media (prefers-reduced-motion: no-preference) {
  .home-index__line,
  .home-index__area {
    transition: d 700ms var(--ease-power3);
  }

  .home-index__dot {
    transition: top 700ms var(--ease-power3);
  }

  .home-index__live {
    animation: home-live 1.8s var(--ease-out) infinite;
  }

  .home-index__dot {
    animation: home-live 1.8s var(--ease-out) infinite;
  }

  /* Drawn as it scrolls into view (home.js .is-drawn), from the left. */
  .js-motion [data-chart]:not(.is-drawn) .home-index__chart {
    clip-path: inset(-10px 100% -10px -10px);
  }

  .js-motion [data-chart]:not(.is-drawn) .home-index__dot {
    opacity: 0;
  }

  .js-motion [data-chart].is-drawn .home-index__chart {
    clip-path: inset(-10px -10px -10px -10px);
    transition: clip-path 1400ms var(--ease-power3);
  }

  .js-motion [data-chart].is-drawn .home-index__dot {
    opacity: 1;
    transition: opacity 300ms var(--ease-out);
    transition-delay: 1200ms;
  }
}

@keyframes home-live {
  0% { box-shadow: 0 0 0 0 currentColor; }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.home-index__live {
  color: var(--stage-up);
}

/* Movers */
.home-movers__cols {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 640px) {
  .home-movers__cols {
    grid-template-columns: 1fr 1fr;
  }
}

.home .home-movers__heading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
  font-size: var(--text-md);
  font-weight: 600;
}

.home-movers__heading::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.home-movers__heading--up::before { background: var(--up); box-shadow: 0 0 12px var(--up); }
.home-movers__heading--down::before { background: var(--down); box-shadow: 0 0 12px var(--down); }

.home-movers__list {
  display: grid;
  border-top: 1px solid var(--border);
}

.home-movers__list > li {
  border-bottom: 1px solid var(--border);
}

.home-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  min-height: 68px;
  padding: var(--space-2) var(--space-2);
  color: var(--text);
  text-decoration: none;
  border-radius: 12px;
  transition: background-color var(--duration-1) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .home-row:hover {
    background: var(--surface-2);
    color: var(--text);
  }

  .home-row:hover .home-row__media img {
    scale: 1.03;
  }
}

.home-row__media,
.home-tile__media {
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: var(--photo-bg);
}

.home-row__media {
  width: 56px;
  height: 42px;
}

.home-row__media img {
  display: block;
  width: 100%;
  height: 100%;
  padding: var(--photo-inset);
  object-fit: contain;
  transition: scale 600ms var(--ease-out);
}

.home-row__text {
  display: grid;
  min-width: 0;
}

.home-row__name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 700;
}

.home-row__meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.home-row__figs {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.home-row__price {
  font-weight: 700;
}

.home-row__move {
  font-size: var(--text-sm);
  font-weight: 800;
}

/* ── Before retirement and after (task 219): the retired sets' value against the catalogue price by years since, as bars
   on the stage's dark card (BrickIndex's, the section above), beside the sets that retire next ── */
.home-retire__grid {
  display: grid;
  gap: var(--space-7);
}

@media (min-width: 1000px) {
  .home-retire__grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: start;
  }
}

.home-retire__soon {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.home-curve {
  position: relative;
  display: grid;
  gap: var(--space-2);
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--stage-border);
  border-radius: 24px;
  background: var(--stage);
  color: var(--stage-text);
  overflow: hidden;
  min-width: 0;
}

.home-curve::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto 30%;
  height: 90%;
  background: radial-gradient(closest-side, var(--glow-1), transparent);
  opacity: 0.16;
  pointer-events: none;
}

.home .home-curve__title {
  position: relative;
  font-family: var(--home-display);
  font-size: var(--text-xl);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.home-curve__note {
  position: relative;
  font-size: var(--text-sm);
  color: var(--stage-muted);
}

.home-curve .is-up { color: var(--stage-up); }
.home-curve .is-down { color: var(--stage-down); }

/* Six columns; each bar stands on the zero line (--base up from the track's foot) and is --h of the track tall. Under
   `.home` for the margin: `.home ol` zeroes every list's. */
.home .home-curve__bars {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: clamp(6px, 1.4vw, 20px);
  /* Room over the tallest bar for its figure. */
  margin-top: calc(var(--space-6) + 1.75em);
}

.home-curve__bar {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.home-curve__track {
  position: relative;
  height: clamp(220px, 40vh, 380px);
}

/* The catalogue price: a bar above it is worth more than LEGO asked, one below it less. */
.home-curve__zero {
  position: absolute;
  inset-inline: -6px;
  bottom: var(--base);
  border-top: 1px dashed var(--stage-muted);
}

.home-curve__col {
  position: absolute;
  inset-inline: 0;
  bottom: var(--base);
  height: var(--h);
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, currentColor, color-mix(in srgb, currentColor 22%, transparent));
  opacity: 0.9;
  transform-origin: 50% 100%;
}

.home-curve__bar.is-down .home-curve__col {
  bottom: calc(var(--base) - var(--h));
  border-radius: 4px 4px 10px 10px;
  transform-origin: 50% 0;
}

/* The figure rides the bar's top; a bar under the catalogue price has it over the zero line. */
.home-curve__bar.is-down .home-curve__fig {
  bottom: calc(var(--base) + 8px);
}

.home-curve__fig {
  position: absolute;
  inset-inline: -8px;
  bottom: calc(var(--base) + var(--h) + 8px);
  text-align: center;
  font-family: var(--home-display);
  font-size: clamp(1rem, 0.6rem + 1.1vw, 1.625rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
}

.home-curve__span {
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
  color: var(--stage-text);
}

.home-curve__n {
  font-size: var(--text-xs);
  color: var(--stage-muted);
  text-align: center;
}

/* The bars grow once, left to right, as the card comes in (home.js' [data-chart]); without script or with reduced
   motion they stand. */
@media (prefers-reduced-motion: no-preference) {
  .js-motion .home-curve .home-curve__col {
    transition: scale 900ms var(--ease-power3);
    transition-delay: calc(var(--i) * 90ms);
  }

  .js-motion .home-curve:not(.is-drawn) .home-curve__col {
    scale: 1 0;
  }
}

@media (max-width: 640px) {
  .home-curve__track {
    height: 240px;
  }

  .home-curve__fig {
    font-size: 0.8125rem;
    letter-spacing: -0.02em;
  }

  .home-curve__span {
    font-size: var(--text-xs);
  }

  /* The count is in each bar's sentence; six columns of 50 px have no room to print it. */
  .home-curve__n {
    display: none;
  }
}

.home-row__date {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--warn);
}

/* ── Rails: four a row, two rows, on the desktop; a row to swipe on a phone. A card lifts 2 px and its photo grows 1.03
   (the taste skill's hover layer; task 199's ±10° lean is its «no tilt») ── */
.home-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(168px, 62%);
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 2px;
  padding: var(--space-2) 2px var(--space-4);
  overscroll-behavior-x: contain;
}

.home-rail > li {
  scroll-snap-align: start;
  min-width: 0;
}

@media (min-width: 601px) {
  .home-rail {
    grid-auto-columns: minmax(200px, 34%);
  }
}

@media (min-width: 1000px) {
  .home-rail {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
  }
}

.home-tile {
  position: relative;
  display: grid;
  gap: var(--space-1);
  height: 100%;
  padding: var(--space-3) var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  transition: translate 180ms var(--ease-out), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

/* A rail on --bg takes the raised surface, one on --surface-1 the page's ground: the card always reads as a card. */
.home-section--bg .home-tile {
  background: var(--surface-1);
}

.home-tile:hover {
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-1);
}

@media (hover: hover) and (pointer: fine) {
  .home-tile:hover {
    translate: 0 -2px;
  }
}

/* 16 : 10 and one line of name: two rows of four and the heading are one screen at 1 440 × 900 (4 : 3 and two lines
   were 973 px). */
.home-tile__media {
  position: relative;
  aspect-ratio: 16 / 10;
  margin-bottom: var(--space-2);
  border-radius: 14px;
}

.home-tile__media img {
  display: block;
  width: 100%;
  height: 100%;
  padding: var(--photo-inset);
  object-fit: contain;
  transition: scale 600ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .home-tile:hover .home-tile__media img {
    scale: 1.03;
  }
}

.home-tile__badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--up);
  color: var(--down-contrast);
  font-size: var(--text-sm);
  font-weight: 700;
}

.home-tile__name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.3;
  font-weight: 600;
}

.home-tile__meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.home-tile__date {
  color: var(--warn);
  font-weight: 700;
}

.home-tile__price {
  margin-top: var(--space-1);
  font-family: var(--home-display);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ── «Twoja kolekcja jak portfel», told while the stage is held (home.js sets --p 0 → 1) ── */
.home-scrolly {
  --p: 1;
  position: relative;
  /* The device's glow stays on the stage (clip, not hidden: the held stage inside still sticks). */
  overflow: clip;
  background: var(--stage);
  color: var(--stage-text);
}

.home-scrolly__stage {
  display: grid;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  width: min(var(--home-max), calc(100% - var(--home-gutter) * 2));
  margin-inline: auto;
  padding-block: clamp(48px, 8vw, 96px);
}

@media (min-width: 1000px) {
  .home-scrolly__stage {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  }
}

.home-scrolly__copy {
  display: grid;
  gap: var(--space-5);
  justify-items: start;
}

.home-collect__lead {
  max-width: 48ch;
  color: var(--stage-muted);
  font-size: var(--text-lg);
  line-height: 1.5;
}

.home-scrolly__steps {
  display: grid;
  gap: var(--space-3);
  max-width: 54ch;
  line-height: 1.45;
  color: var(--stage-muted);
}

.home-scrolly__step {
  position: relative;
  padding-left: var(--space-6);
  transition: color 300ms var(--ease), opacity 300ms var(--ease);
}

.home-scrolly__step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
}

.home-scrolly__step b {
  color: var(--stage-text);
}

/* The device: a phone in the app's own look (its row, its figure, its toast). */
.home-device {
  justify-self: center;
  width: min(100%, 360px);
  padding: 12px;
  border-radius: 48px;
  background: var(--stage-border);
  /* A warm light under the device, the stage's own amber (violet until task 207). */
  box-shadow: 0 40px 120px color-mix(in srgb, var(--glow-1) 45%, transparent), 0 0 0 1px var(--stage-border);
}

.home-device__screen {
  position: relative;
  display: grid;
  gap: var(--space-2);
  min-height: 560px;
  padding: 44px 20px 24px;
  border-radius: 38px;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

.home-device__screen::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 96px;
  height: 24px;
  translate: -50% 0;
  border-radius: 999px;
  background: var(--stage);
}

.home-preview__caption {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.home-preview__label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.home-preview__value {
  font-family: var(--home-display);
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.home-preview__unit {
  margin-left: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0;
}

.home-preview__change {
  font-size: var(--text-sm);
  font-weight: 700;
}

.home-preview__change span {
  font-weight: 400;
  color: var(--text-muted);
}

.home-device__chart {
  display: block;
  width: 100%;
  height: 110px;
  overflow: visible;
  color: var(--up);
}

.home-device__line {
  fill: none;
  stroke: var(--up);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 6px var(--up));
}

.home-device__area {
  fill: var(--up-bg);
}

.home .home-preview__rows {
  display: grid;
  margin-top: var(--space-2);
  border-top: 1px solid var(--border);
}

.home-preview__row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-2);
  min-height: 50px;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}

.home-preview__row img {
  width: 40px;
  height: 30px;
  padding: var(--photo-inset);
  object-fit: contain;
  border-radius: var(--radius-1);
  background: var(--photo-bg);
}

.home-preview__name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-preview__fig {
  font-weight: 700;
}

.home-device__alert {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 52px;
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border-radius: 18px;
  background: var(--surface-1);
  /* --shadow-1, not -2: the larger one's 32 px fell on the change line under it, 4.46 : 1 in the light theme (task 200). */
  box-shadow: var(--shadow-1);
  font-size: var(--text-sm);
}

.home-device__alert-text {
  display: grid;
  min-width: 0;
}

.home-device__alert-text span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

.home-device__bell {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-contrast);
}

.home-device__bell svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

/* Held while it is told: three screens of scroll, the stage sticky under the header. */
@media (prefers-reduced-motion: no-preference) {
  .js-motion .home-scrolly {
    height: 300vh;
  }

  .js-motion .home-scrolly__stage {
    position: sticky;
    top: var(--app-header);
    min-height: calc(100svh - var(--app-header));
  }

  .js-motion .home-scrolly .home-device__chart {
    clip-path: inset(-10px calc((1 - clamp(0, (var(--p) - 0.33) * 3, 1)) * 100%) -10px -10px);
  }

  .js-motion .home-scrolly .home-device__alert {
    opacity: clamp(0, (var(--p) - 0.7) * 6, 1);
    transform: translateY(calc((1 - clamp(0, (var(--p) - 0.7) * 6, 1)) * -40px)) scale(calc(0.94 + clamp(0, (var(--p) - 0.7) * 6, 1) * 0.06));
  }

  /* The steps not yet told are dimmed by colour, not opacity: --stage-muted holds its 4.5 : 1 on --stage (ContrastPairs). */
  .js-motion .home-scrolly .home-scrolly__step b {
    color: var(--stage-muted);
  }

  .js-motion .home-scrolly .home-scrolly__step::before {
    background: var(--stage-border);
  }

  .js-motion .home-scrolly[data-at="1"] [data-step="1"],
  .js-motion .home-scrolly[data-at="2"] [data-step="2"],
  .js-motion .home-scrolly[data-at="3"] [data-step="3"],
  .js-motion .home-scrolly[data-at="4"] [data-step="4"] {
    color: var(--stage-text);
  }

  .js-motion .home-scrolly[data-at="1"] [data-step="1"] b,
  .js-motion .home-scrolly[data-at="2"] [data-step="2"] b,
  .js-motion .home-scrolly[data-at="3"] [data-step="3"] b,
  .js-motion .home-scrolly[data-at="4"] [data-step="4"] b {
    color: var(--accent);
  }

  .js-motion .home-scrolly[data-at="1"] [data-step="1"]::before,
  .js-motion .home-scrolly[data-at="2"] [data-step="2"]::before,
  .js-motion .home-scrolly[data-at="3"] [data-step="3"]::before,
  .js-motion .home-scrolly[data-at="4"] [data-step="4"]::before {
    background: var(--accent);
  }
}

/* The phone: the held stage must fit one screen — the title, one line, the device; the four facts are what the device
   shows, the sign-in is the header's. Without script nothing is held and the facts stay. */
@media (max-width: 999px) {
  .js-motion .home-scrolly {
    height: 240vh;
  }

  .home-scrolly__stage {
    gap: var(--space-5);
    padding-block: var(--space-6);
  }

  .home-collect__lead {
    font-size: var(--text-md);
  }

  .js-motion .home-scrolly__steps,
  .js-motion .home-scrolly__copy .hx-btn {
    display: none;
  }

  .home-device {
    width: min(100%, 300px);
    padding: 10px;
    border-radius: 42px;
  }

  .home-device__screen {
    min-height: 0;
    padding: 40px 16px 16px;
    border-radius: 32px;
  }

  .home-preview__value {
    font-size: 1.875rem;
  }

  .home-device__chart {
    height: 84px;
  }
}

/* ── Bento: what an account does, three steps and the catalogue's size (task 199's light at the pointer went with task
   207: a tile without a link does not answer the pointer, the taste skill's `.m-nolift`) ── */
.home-bento__grid {
  display: grid;
  gap: var(--space-4);
}

.home-bento__grid:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
  border-radius: 24px;
}

@media (min-width: 760px) {
  .home-bento__grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .home-bento__tile--1 { grid-column: span 3; }
  .home-bento__tile--2 { grid-column: span 3; }
  .home-bento__tile--3 { grid-column: span 2; }
  .home-bento__tile--4 { grid-column: span 2; }
  .home-bento__tile--stat { grid-column: span 2; }
}

.home-bento__tile {
  position: relative;
  display: grid;
  gap: var(--space-2);
  align-content: start;
  padding: clamp(20px, 3vw, 32px);
  border-radius: 24px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  isolation: isolate;
}

.home-bento__tile--1 { background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--glow-1) 14%, transparent), transparent 60%), var(--surface-1); }
.home-bento__tile--2 { background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--glow-2) 16%, transparent), transparent 60%), var(--surface-1); }
.home-bento__tile--3 { background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--glow-3) 14%, transparent), transparent 60%), var(--surface-1); }
.home-bento__tile--4 { background: radial-gradient(120% 120% at 0% 100%, color-mix(in srgb, var(--glow-1) 12%, transparent), transparent 60%), var(--surface-1); }

.home-bento__tile--stat {
  background: var(--stage);
  color: var(--stage-text);
  border-color: var(--stage-border);
  align-content: end;
}

.home-bento__tile--stat .home-steps__text {
  color: var(--stage-muted);
}

.home-bento__big {
  font-family: var(--home-display);
  font-size: clamp(3rem, 1.8rem + 4vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--glow-1);
}

/* Task 219: each method tile carries its figure — a value, the index on its line, the forecast's band, the score's
   weights. The tile is a column: the title, the figure, then its line at the foot. */
.home-bento__tile:not(.home-bento__tile--stat) {
  grid-template-rows: auto auto 1fr auto;
}

.home-bento__tile .home-bento__big {
  color: var(--text);
  font-size: clamp(2.25rem, 1.4rem + 2.6vw, 3.75rem);
}

.home-bento__tile .home-bento__big.is-up { color: var(--up); }
.home-bento__tile .home-bento__big.is-down { color: var(--down); }
.home-bento__tile--stat .home-bento__big { color: var(--glow-1); font-size: clamp(3rem, 1.8rem + 4vw, 5rem); }

.home-bento__unit {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-muted);
}

.home-bento__of a {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.home-bento__of a:hover {
  text-decoration: underline;
}

.home-bento__spark {
  width: 100%;
  height: 72px;
  align-self: end;
}

.home-bento__spark-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.home-bento__spark-area {
  fill: currentColor;
  opacity: 0.12;
}

/* The forecast's band: a track, the middle half lit — where the price was in half of the similar cases. */
.home-bento__band {
  position: relative;
  align-self: end;
  height: 14px;
  border-radius: 999px;
  background: var(--surface-3);
}

.home-bento__band > span {
  position: absolute;
  inset-block: 0;
  left: 25%;
  right: 25%;
  border-radius: 999px;
  background: var(--accent-gradient);
}

/* The score's five parts: a bar each as wide as its weight, its points and its name. */
.home .home-bento__parts {
  display: grid;
  gap: var(--space-2);
  align-self: end;
}

.home-bento__parts > li {
  position: relative;
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: var(--text-sm);
  color: var(--text-muted);
  isolation: isolate;
}

.home-bento__parts > li::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--w) * 2.5%);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  z-index: -1;
}

.home-bento__parts b {
  display: inline-block;
  min-width: 2ch;
  font-family: var(--home-display);
  color: var(--text);
}

.home-steps__title {
  font-family: var(--home-display);
  font-size: var(--text-xl);
  font-weight: 600;
}

.home-steps__text {
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 44ch;
}

/* ── Questions: the heading on the left line, the list from the split line (7 of 12 columns) — one screen ── */
@media (min-width: 1000px) {
  .home-section > .home-faq__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: 24px;
    align-items: start;
  }
}

.home-faq__list {
  display: grid;
  border-top: 1px solid var(--border);
}

.home-faq__item {
  border-bottom: 1px solid var(--border);
}

.home-faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 64px;
  padding: var(--space-3) var(--space-1);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.home-faq__q::-webkit-details-marker {
  display: none;
}

.home-faq__q::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  rotate: 45deg;
  translate: 0 -3px;
  transition: rotate var(--duration-2) var(--ease-out), translate var(--duration-2) var(--ease-out);
}

.home-faq__item[open] > .home-faq__q::after {
  rotate: 225deg;
  translate: 0 3px;
}

.home-faq__q:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-1);
}

.home-faq__a {
  max-width: 70ch;
  padding: 0 var(--space-1) var(--space-5);
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── The wordmark at the page's end: outlined, filled from the left as it scrolls in (home.js --fill 0 → 1) ── */
/* The page's close (the taste skill's «close-word»). */
.home-wordmark {
  --fill: 1;
  padding: clamp(32px, 6vw, 72px) 12px 0;
  font-family: var(--home-display);
  font-size: clamp(3.5rem, 18.5vw, 19rem);
  font-weight: 600;
  line-height: 0.85;
  letter-spacing: -0.06em;
  text-align: center;
  white-space: nowrap;
  color: transparent;
  /* Two tones, not a stroke (the system face's heavy glyphs overlap their own contours). The part not yet filled is
     --text-faint, 4.73 : 1 dark and 3.58 : 1 light on --bg (task 200: --surface-3 was 1.48 and 1.04, «index» unreadable);
     the fill is an effect over a word that reads without it. */
  background: linear-gradient(90deg, var(--text) 0 50%, var(--text-faint) 50% 100%);
  background-size: 200% 100%;
  background-position: calc((1 - var(--fill)) * 100%) 0;
  background-clip: text;
  -webkit-background-clip: text;
  user-select: none;
}

@media (prefers-reduced-motion: no-preference) {
  .js-motion .home-wordmark {
    --fill: 0;
  }
}

/* ── The phone's stage: the ring between the headline and the line under it, so the first screen moves; the figures
   after the two ways in. The copy's box gives its children to the stage's grid to be ordered. ── */
@media (max-width: 999px) {
  .hx {
    align-content: start;
    gap: var(--space-4);
  }

  .hx-copy {
    display: contents;
  }

  .hx > .home-folio { order: 0; }
  .hx-title { order: 1; }
  .hx-orbit { order: 2; margin-block: calc(var(--space-2) * -1) 0; }
  .hx-lead { order: 3; }
  .home-search { order: 4; }
  .hx-actions { order: 5; }
  .hx-stats { order: 6; }

  /* The bento: a row of compact cards to swipe, not a column of half-empty boxes. */
  .home-bento__grid {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 72%);
    align-items: start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    padding-bottom: var(--space-2);
  }

  .home-bento__grid > li {
    scroll-snap-align: start;
    grid-column: auto;
  }

  .home-bento__tile {
    padding: var(--space-5);
  }

  .home-bento__tile--stat {
    align-content: start;
  }
}

/* ── The phone ── */
@media (max-width: 480px) {
  .home {
    --home-gutter: 16px;
  }

  .hx-actions .hx-btn {
    flex: 1;
  }

  .home-search__go {
    width: 52px;
    padding: 0;
  }

  .home-search__go-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .home-search__go-icon {
    display: block;
  }

  .home-tape__name {
    max-width: 12ch;
  }
}
