/* ==========================================================================
   Home — Ticker (§4.2): the hero's fan collapsed into one thick vermilion
   string. A ribbon rotated −2.5°, wider than the viewport and clipped by
   <main>, straddling the seam between the paper sheet and Now Playing. The
   genres ride it: js/home/ticker.js moves the marquee and, while the ribbon
   rings, bends the band (an SVG path) and lifts every word with the same wave.
   ========================================================================== */

html[data-page="home"] main > section.ticker[data-env] {
  --tk-h: clamp(84px, 13vh, 150px);
  --tk-type: clamp(1.75rem, 4vw, 4rem);
  --tk-seam: max(4vh, 2.4vw); /* ≥ the rise of the rotated ends, so no gap opens at the seams */
  position: relative;
  z-index: 12; /* above the hero sheet (8), below the fixed chrome (60+) */
  width: 110vw;
  height: var(--tk-h);
  margin: calc(var(--tk-seam) * -1) 0 calc(var(--tk-seam) * -1) -5vw;
  /* The section box stays level and transparent: it is exactly the band at the
     viewport's centre column, so the chrome only re-tints vermilion while the
     ribbon really passes under it (atmos tests this box, not the tilted one). */
  background: none;
  color: var(--ink);
  pointer-events: none;
  user-select: none;
  /* Never the scroll anchor: straddling the seam, the band is often the first
     thing in view above Label, and Now Playing is unhidden after it, so a deep
     link (/#label) that loads before Now Playing would be pushed down by the
     room instead of keeping its place. */
  overflow-anchor: none;
}

/* The ribbon: the same box, tilted −2.5° about its centre. */
html[data-page="home"] .ticker__ribbon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  rotate: -2.5deg;
  /* Words never spill sideways; the ringing band may lift above and below. */
  overflow: clip visible;
  /* Under the band, the two grounds it joins (only seen while the band bends). */
  background: linear-gradient(
    180deg,
    var(--paper) 50%,
    color-mix(in oklab, rgb(var(--art)) 14%, #f8f2d9) 50%
  );
}

html[data-page="home"] main > section.ticker:has(+ #now-playing[hidden]) .ticker__ribbon {
  background: var(--paper);
}

/* The ribbon itself: one filled path (the band) and two fine threads. */
html[data-page="home"] .ticker__band {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

html[data-page="home"] .ticker__fill {
  fill: var(--vermilion);
}

html[data-page="home"] .ticker__threads {
  fill: none;
  stroke: var(--ink);
  stroke-opacity: 0.38;
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}

html[data-page="home"] .ticker__track {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex: none;
  width: max-content;
  will-change: transform;
}

html[data-page="home"] .ticker__group {
  display: flex;
  align-items: center;
  flex: none;
}

html[data-page="home"] :is(.ticker__item, .ticker__sep) {
  display: block;
  flex: none;
  font-family: var(--f-latin);
  font-size: var(--tk-type);
  line-height: 1;
  white-space: nowrap;
  color: var(--ink);
  transform-origin: 50% 50%;
  font-synthesis: none;
}

html[data-page="home"] .ticker__item {
  padding: 0.06em 0.3em 0;
  font-weight: 900;
  font-stretch: 125%;
  font-variation-settings: "wdth" 125;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

html[data-page="home"] .ticker__item--outline {
  color: transparent;
  -webkit-text-stroke: 1.2px var(--ink);
}

@supports not (-webkit-text-stroke: 1px black) {
  html[data-page="home"] .ticker__item--outline {
    color: var(--ink);
    opacity: 0.5;
  }
}

/* The separator echoes the //< mark: two tall hairline strokes. */
html[data-page="home"] .ticker__sep {
  padding: 0.06em 0.16em 0 0.08em;
  font-weight: 300;
  font-stretch: 62%;
  font-variation-settings: "wdth" 62;
  font-size: calc(var(--tk-type) * 1.18);
  letter-spacing: -0.14em;
}

html[data-page="home"] .ticker.is-ringing :is(.ticker__item, .ticker__sep) {
  will-change: transform;
}

@media (max-width: 700px) {
  html[data-page="home"] main > section.ticker[data-env] {
    --tk-h: max(64px, 10vh);
    --tk-type: clamp(1.375rem, 7vw, 2.25rem);
  }

  html[data-page="home"] .ticker__item--outline {
    -webkit-text-stroke-width: 1px;
  }
}

/* Reduced motion: the first group, still, opening on the label's name at the
   page gutter (the ribbon starts 5vw left of the viewport); the cut falls only
   at the right edge, where the string runs on. */
@media (prefers-reduced-motion: reduce) {
  html[data-page="home"] .ticker__track {
    width: max-content;
    margin-left: calc(5vw + var(--gutter));
    transform: none !important;
  }

  html[data-page="home"] .ticker__group[aria-hidden="true"] {
    display: none;
  }

  html[data-page="home"] :is(.ticker__item, .ticker__sep) {
    transform: none !important;
  }
}
