/* Title roller (in-place word reel). Split from the single original stylesheet; zero visual change. */

/* Header: top-center per the radial spec */
/* Decision 21: title + tagline as one tight centered unit atop the oval. */
.center-title { text-align: center; margin-bottom: 0.75rem; }

/* Fluid title (2026-11-05, follow-up to the phone fix): the title
   scales with the viewport instead of jumping at a breakpoint, so
   the full title with the LONGEST option ("an institution", D-021 —
   longer than the old longest, "another word") fits on one line
   from ~320px up. Measured (true 390px render): the longest title
   is ~474px wide at 1.7rem, so it needs ≤ ~16.5px at
   320px (288px available), ≤ ~20.5px at 390px, and is unconstrained
   on desktop — 4.75vw gives 15.2px at 320, 18.5px at 390, 20.4px at
   430, and caps at 1.7rem from ~573px up, so desktop appearance is
   unchanged at normal widths. This replaces the old ≤640px 1.25rem
   rule (which itself had replaced a `.brand` rule that never applied
   — the base selector outranked it). No breakpoint cliff: the size
   moves smoothly with the viewport, and the JS resize handler
   re-measures the reel rows when it changes. */
.center-title .brand { font-size: clamp(0.95rem, 4.75vw, 1.7rem); margin: 0; letter-spacing: -0.01em; color: #1a1a1a; }

.center-title .brand em { font-style: normal; color: var(--accent); }

.center-title .tagline { color: #6b5d4f; margin: 0.25rem 0 0; } /* muted warm gray on paper */

/* Demo feedback item 1 (2026-10-31): title filter as art, not a box.
   REPLACED 2026-11-01 (Roland CONFIRMED) by an in-place reel: the
   word slot inside the title IS the roller — a one-line-high window
   over a vertical strip of the 12 options (D-021: 7 + 5 entity).
   Stepping translates the strip so the word visibly rolls and
   settles on the chosen one.
   The button IS the slot: inline-block, one row high, overflow
   hidden. Rows are 1.35em tall. The slot width ANIMATES to the word
   showing (JS sets --slot-w from the active row's measured width,
   CSS transitions it over the same 0.35s as the roll, so the roll
   masks the width change) — the old widest-option hold left a ~92px
   dead gap after short words. Baseline, measured at true 390px and
   at desktop (2026-11-05): vertical-align 0 puts the word's
   baseline exactly on the sentence baseline in Blink; the old
   -0.4em shift sat the word ~11px LOW at both widths (its sign was
   backwards — the row's text baseline is at the row's bottom edge,
   not 0.4em above it). WebKit places the word ~5px HIGH (its strut
   baseline lands differently for the same font), so JS calibrates
   it at runtime (calibrateFilterBaseline in title-roller.js:
   measures the real offset and sets an inline vertical-align
   correction; a no-op where the engines agree).
   Fluid-title follow-up (2026-11-05): the slot width must NOT
   depend on JS-measured px as the layout-critical path — the title
   still broke on Chrome on iOS (WebKit) after the phone fix, same
   arrangement as the original report. So the width is now
   CSS-intrinsic with JS only refining it: `width: var(--slot-w,
   auto)` falls back to auto (shrink-to-fit = widest row) when JS
   hasn't run, is late, or is off; `max-width: max-content` caps any
   JS value at the widest row, so an over-wide measurement can never
   force a wrap or push the word onto its own line. The fluid font
   (above) guarantees even the widest slot fits on one line from
   ~320px up, so the fallback layout is always one line. */
.title-filter-wrap { display: inline-block; }

.title-filter-btn {
  font: inherit; color: inherit; background: none; border: none;
  padding: 0 0.1em; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 2px; text-underline-offset: 4px;
  display: inline-block; height: 1.35em; overflow: hidden;
  vertical-align: baseline;
  width: var(--slot-w, auto);
  max-width: max-content;
  transition: width 0.35s ease;
}

.word-reel-strip {
  display: flex; flex-direction: column;
  transition: transform 0.35s ease; will-change: transform;
}

.word-reel-strip > span {
  display: block; height: 1.35em; line-height: 1.35em;
  white-space: nowrap; text-align: left;
  /* Shrink-wrap each row to its own text width so JS can measure
     the active row (without this, block rows stretch to the strip
     width and every row measures as the widest). Visually identical:
     rows were already left-aligned. */
  align-self: flex-start;
}

@media (prefers-reduced-motion: reduce) {
  .word-reel-strip { transition: none; }
  .title-filter-btn { transition: none; }
}
