/* Why Midea as seven stacked scroll chapters, plus the phone quick-links bar. Loads AFTER main.css + commercial.css and
   restyles only what sits inside .why-theater and .go-bar. Colours are DESIGN.md tokens or a color-mix of one. */
.why-theater {
  --ch-bg: var(--primary);
  --ch-text: var(--on-dark);
  --ch-muted: color-mix(in srgb, var(--on-dark) 66%, transparent);
  --ch-faint: color-mix(in srgb, var(--on-dark) 42%, transparent);
  --ch-line: color-mix(in srgb, var(--on-dark) 16%, transparent);
  --ch-btn-bg: var(--on-dark);
  --ch-btn-text: var(--primary);
  --ch-shadow: color-mix(in srgb, var(--media-well) 70%, transparent);
  background: var(--ch-bg);
  color: var(--ch-text);
  border: 0;
  padding: clamp(4rem, 9vw, 7.5rem) 0;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.why-theater .eyebrow, .why-theater p { color: var(--ch-muted); }
.why-theater .lede { font-size: 1.1rem; max-width: 30rem; }
.why-frame { display: grid; grid-template-columns: minmax(16rem, 21rem) 1fr; gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
.why-rail { position: sticky; top: calc(var(--header-h) + 2rem); max-height: calc(100vh - var(--header-h) - 3rem); overflow: auto; scrollbar-width: none; }
.why-rail::-webkit-scrollbar { display: none; }
.why-theater .container > h2, .why-rail h2 { color: var(--ch-text); font-size: clamp(2rem, 3vw, 2.6rem); max-width: 14ch; }
.why-rail .lede { font-size: 1.02rem; margin-bottom: 0.5rem; }

/* the index: a table of contents that follows the scroll; a tap is optional */
.why-toc { display: grid; margin: 1.4rem 0 0.8rem; border-top: 1px solid var(--ch-line); }
.why-toc a {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.68rem 0.6rem 0.68rem 0.2rem;
  border-bottom: 1px solid var(--ch-line);
  color: var(--ch-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  opacity: 0.5;
  transition: opacity 0.2s var(--ease), border-color 0.2s var(--ease);
}
.why-toc a:hover { opacity: 0.85; }
.why-toc a.is-active { opacity: 1; border-bottom-color: var(--accent); }
.why-toc .why-num { display: inline; width: auto; height: auto; border: 0; background: none; border-radius: 0; font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.04em; color: var(--ch-faint); }
.why-toc a.is-active .why-num { color: var(--accent); }
.why-label { display: inline-block; transition: transform 0.3s var(--ease); }
.why-toc a.is-active .why-label { transform: translateX(4px); }
.why-theater .why-progress { margin: 0; font-size: 0.9rem; color: var(--ch-faint); }

/* the contact, kept beside the index all the way down (Matthew, 2026-09-20) */
.why-rail-cta { margin-top: 1.4rem; padding-top: 1.4rem; border-top: 1px solid var(--ch-line); }
.btn-wa { display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem; width: 100%; padding: 0.95rem 1.2rem; font-size: 1.05rem; }
.wa-glyph { flex: 0 0 auto; }
.why-theater .why-rail-note { margin: 0.7rem 0 0; font-size: 0.88rem; color: var(--ch-faint); }
.btn-ghost { background: none; color: var(--ch-text); border-color: color-mix(in srgb, var(--on-dark) 45%, transparent); }
.btn-ghost:hover { border-color: var(--ch-text); }

/* the chapters */
.why-chapter { scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.why-chapter + .why-chapter { margin-top: clamp(4rem, 8vw, 7rem); padding-top: clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--ch-line); }
.why-theater .why-question { display: flex; gap: 0.8rem; align-items: baseline; margin: 0 0 1rem; font-weight: 600; color: var(--ch-muted); }
.why-theater .why-question span { font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.04em; color: var(--accent); }
.why-chapter h3 { color: var(--ch-text); font-size: clamp(2.2rem, 3.9vw, 3.7rem); letter-spacing: -0.045em; line-height: 1.02; max-width: 20ch; margin: 0 0 1.8rem; }
.why-visual { margin: 0 0 2rem; }
.why-theater .why-still { margin: 0; border: 0; background: none; }
.why-theater .why-still img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; height: auto; box-shadow: 0 30px 80px -20px var(--ch-shadow); }
.why-theater .why-still figcaption, .why-theater .video figcaption { margin: 0; padding: 0.8rem 0 0; font-size: 0.85rem; color: var(--ch-faint); }
.why-theater .video { background: none; border: 0; }
.why-theater .video-play { box-shadow: 0 30px 80px -20px var(--ch-shadow); }
.why-theater .video-play img { opacity: 0.9; }
.why-theater .video-play:hover img { opacity: 1; }
.why-theater .video-play::after { content: ""; position: absolute; inset: auto 0 0 0; height: 38%; background: linear-gradient(to top, color-mix(in srgb, var(--media-well) 75%, transparent), transparent); pointer-events: none; }
.why-theater .video-badge { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); padding: 0.7rem 1.2rem 0.7rem 1rem; background: color-mix(in srgb, var(--on-dark) 92%, transparent); color: var(--primary); font-size: 0.95rem; box-shadow: 0 10px 30px color-mix(in srgb, var(--media-well) 50%, transparent); transition: transform 0.3s var(--ease); }
.why-theater .video-play:hover .video-badge { transform: translate(-50%, -50%) scale(1.05); }
.why-theater .video-tri { border-left-color: var(--primary); border-left-width: 11px; border-top-width: 7px; border-bottom-width: 7px; }
.why-theater .video figcaption b { color: var(--ch-muted); font-size: 0.95rem; }
.why-theater .video-channel { display: inline; }
.why-theater .video-honesty { display: block; margin-top: 0.15rem; }

.why-detail { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 4vw, 4rem); align-items: start; }
.why-answer p { color: var(--ch-text); font-size: 1.15rem; max-width: 34rem; }
.why-answer .btn { margin-top: 0.4rem; }
.btn-light { background: var(--ch-btn-bg); color: var(--ch-btn-text); }
.why-theater .stock-row { margin: 0 0 1.2rem; }
.why-theater .stock { background: var(--ch-btn-bg); color: var(--ch-btn-text); }
.why-theater .stock-note { color: var(--ch-muted); }
.why-theater .why-evidence { display: grid; gap: 0; }
.why-theater .fact { background: none; border: 0; border-top: 1px solid var(--ch-line); padding: 0.9rem 0 1rem; }
.why-theater .fact p { margin: 0 0 0.35rem; color: var(--ch-text); font-size: 0.98rem; line-height: 1.5; }
.why-theater .fact .source { font-size: 0.85rem; color: var(--ch-muted); margin: 0; }
.why-theater .fact .source a { color: var(--ch-text); text-decoration-color: var(--accent); }

/* motion: scroll-driven, decorative only (Chrome 115+, Safari 26; Firefox shows the static layout) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .why-chapter h3, .why-chapter .why-question { animation: why-rise linear both; animation-timeline: view(); animation-range: entry 5% entry 35%; }
    .why-theater .why-still img { animation: why-drift linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
    .why-theater .why-still { overflow: hidden; }
  }
}
@keyframes why-rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes why-drift { from { transform: translateY(-5%) scale(1.12); } to { transform: translateY(5%) scale(1.12); } }

/* phone conversion bar: price and the quote button always one tap away */
.go-bar { display: none; }

@media (max-width: 1024px) {
  .why-frame { display: block; }
  /* the rail's box goes away so the index strip's sticky parent is .why-frame, which spans every chapter;
     inside the rail it was released before chapter 01 (found in review 2026-09-26) */
  .why-rail { display: contents; }
  .why-rail-cta { display: none; } /* the phone bar below carries the same button */
  .why-rail h2 { max-width: 16ch; }
  .why-toc { position: sticky; top: var(--header-h); z-index: 2; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0.5rem; padding: 0.75rem 0; margin: 1.25rem 0 0; border-top: 0; background: var(--ch-bg); scrollbar-width: none; }
  .why-toc::-webkit-scrollbar { display: none; }
  .why-toc a { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem 0.6rem 0.8rem; border: 1px solid var(--ch-line); border-radius: var(--pill); opacity: 0.8; white-space: nowrap; scroll-snap-align: start; font-size: 0.95rem; }
  .why-toc a.is-active { opacity: 1; background: var(--ch-btn-bg); color: var(--ch-btn-text); border-color: var(--ch-btn-bg); }
  .why-toc a.is-active .why-num { color: var(--ch-btn-text); }
  .why-theater .why-progress { margin: 0.75rem 0 2.5rem; }
  .why-detail { grid-template-columns: minmax(0, 1fr); }
  .why-answer .btn { white-space: normal; text-align: center; }
  .why-theater .fact .source a { overflow-wrap: anywhere; }
  .why-chapter h3 { max-width: none; }
  .go-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; gap: 0.5rem; padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent); border-top: 1px solid var(--hairline); backdrop-filter: blur(10px); }
  .go-bar a { flex: 1 1 0; text-align: center; padding: 0.75rem 0.8rem; border-radius: var(--pill); border: 1px solid var(--primary); color: var(--primary); text-decoration: none; font-weight: 600; font-size: 0.98rem; }
  .go-bar .go-bar-cta { background: var(--primary); color: var(--surface); }
  body { padding-bottom: 4.5rem; }
}
@media (max-width: 640px) {
  .why-theater { padding: 3.5rem 0; }
}
@media (prefers-reduced-motion: reduce) {
  .why-toc a, .why-label, .why-theater .video-badge { transition: none; }
}
