/* GP polish layer v4 — song pages. Token-driven (light/dark safe).
   v4: hero CTA row normalization (play button + platform pills share one height
   and baseline) + section architecture (clear banded sections, no more blending). */

:root {
  --radius-1: 10px;
  --radius-2: 12px;
  --radius-3: 16px;
  --radius-pill: 999px;
  --cta-h: 46px;
  --section-gap: clamp(56px, 8vw, 88px);
  --grad-brand: linear-gradient(90deg, var(--violet) 0%, var(--violet-hot) 32%, var(--orange) 68%, var(--gold-hi) 100%);
  --grad-tick: linear-gradient(90deg, var(--violet), var(--orange));
}

/* ============ HERO ============ */
.song-hero, .hero { position: relative; }
.hero { padding-block-end: 8px; }

.hero h1 { position: relative; padding-bottom: 18px; letter-spacing: .01em; }
.hero h1::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 110px; height: 7px;
  border-radius: var(--radius-pill);
  background: var(--grad-brand);
}

.eyebrow {
  display: inline-block;
  background: var(--grad-brand);
  color: var(--paper);
  font-weight: 800; text-transform: uppercase; letter-spacing: .14em;
  padding: 7px 14px; font-size: 11px;
  border-radius: var(--radius-pill);
  box-shadow: 3px 3px 0 var(--line);
}

p.lead {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 21px; line-height: 1.55; font-style: italic;
  max-width: 58ch; color: var(--text);
}

.cover-stage img, .cover-stage {
  border: 2px solid var(--border);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-card);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s cubic-bezier(.2,.8,.2,1);
}
.cover-stage:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-card-hover); }

/* ---- CTA ROW: one height, one baseline, one language ---- */
.platforms {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 12px; margin-block: 18px 6px;
}
.platforms a, .platforms .gpp-play, .hero .gpp-play, button.gpp-play {
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--cta-h); padding: 0 18px; gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-1);
  box-shadow: 3px 3px 0 var(--line);
  font-weight: 700; font-size: 14px; line-height: 1;
  transition: transform var(--transition), box-shadow var(--transition);
  box-sizing: border-box;
}
/* Play preview = primary action */
button.gpp-play, .platforms .gpp-play {
  background: var(--grad-brand);
  color: var(--paper);
  border-color: transparent;
  font-weight: 800; letter-spacing: .02em;
  width: auto; min-width: var(--cta-h);
  cursor: pointer;
}
.platforms a:hover, button.gpp-play:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--line); }
.platforms a:active, button.gpp-play:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--line); }

/* ============ SECTION ARCHITECTURE ============ */
/* Every h2 opens a section: full-width hairline boundary + generous air +
   stronger type. The page becomes bands, not a scroll of similar text. */
h2, .gp-sub {
  display: flex; align-items: center; gap: 12px;
  margin-top: var(--section-gap);
  padding-top: 34px;
  border-top: 1px solid var(--line);
  font-size: clamp(22px, 2.6vw, 27px);
  letter-spacing: .02em;
}
h2::before {
  content: ""; width: 26px; height: 6px; flex: none;
  border-radius: var(--radius-pill);
  background: var(--grad-tick);
}
/* Subsections stay subordinate: no boundary line, smaller */
h2.gp-sub, .gp-sub {
  border-top: none; padding-top: 0;
  margin-top: calc(var(--section-gap) * .45);
  font-size: clamp(18px, 2vw, 21px);
  color: var(--ink-soft);
}

/* Content blocks: distinct surfaces per section type */
.answer, .qa {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  box-shadow: inset 3px 0 0 var(--violet);
  padding: 20px 22px;
  margin-block: 16px;
}
.qa p { margin: 0; font-size: 17px; line-height: 1.7; }

/* Scripture & use: its own tinted card so it never blends with prose */
ul.clean {
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  padding: 10px 22px;
  margin-block: 16px;
}
ul.clean li { padding: 12px 0; border-bottom: 1px solid var(--line-light); }
ul.clean li:last-child { border-bottom: none; }

/* Related-songs cards: end-cap band */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }

@media (prefers-reduced-motion: reduce) {
  .cover-stage, .platforms a, button.gpp-play, .card { transition: none; }
}

/* ============ v5 — BLEEDING EDGE LAYER (progressive enhancement) ============ */

/* 1. Cross-document View Transitions: cinematic page-to-page crossfade */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation-duration: .22s; }
::view-transition-new(root) { animation-duration: .28s; }

/* 2. Living brand gradient — registered property, ambient angle drift */
@property --grad-angle {
  syntax: "<angle>"; inherits: false; initial-value: 90deg;
}
@supports (animation-timeline: view()) {
  .eyebrow, .hero h1::after {
    background: linear-gradient(var(--grad-angle), var(--violet) 0%, var(--violet-hot) 32%, var(--orange) 68%, var(--gold-hi) 100%);
    animation: gp-drift 14s ease-in-out infinite alternate;
  }
}
@keyframes gp-drift { from { --grad-angle: 75deg; } to { --grad-angle: 115deg; } }

/* 3. Scroll-reveal: sections rise into place (compositor-only: transform+opacity) */
@supports (animation-timeline: view()) {
  h2, .gp-sub, .answer, .qa, ul.clean, .card, p.lead {
    animation: gp-rise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 38%;
  }
}
@keyframes gp-rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 4. Reading progress — scroll-scrubbed gradient hairline at the top */
@supports (animation-timeline: scroll()) {
  body::before {
    content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px;
    background: var(--grad-brand);
    transform-origin: 0 50%; transform: scaleX(0);
    animation: gp-progress linear both;
    animation-timeline: scroll(root);
    z-index: 400;
  }
}
@keyframes gp-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* 5. Glass nav — frosted surface over the ink */
header, .site {
  backdrop-filter: blur(12px) saturate(1.35);
  -webkit-backdrop-filter: blur(12px) saturate(1.35);
}

/* 6. Consistency deep-cuts: selection, scrollbar, focus ring, balanced headings */
::selection { background: var(--violet); color: var(--paper); }
html { scrollbar-color: var(--violet) transparent; }
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 4px;
}
h1, h2, h3 { text-wrap: balance; }

/* 7. Card entrance stagger via view() — related songs cascade in */
@supports (animation-timeline: view()) {
  .card:nth-child(2) { animation-range: entry 8% entry 46%; }
  .card:nth-child(3) { animation-range: entry 16% entry 54%; }
}

/* Calm covenant: all motion honors the reader */
@media (prefers-reduced-motion: reduce) {
  @supports (animation-timeline: view()) {
    h2, .gp-sub, .answer, .qa, ul.clean, .card, p.lead, body::before,
    .eyebrow, .hero h1::after { animation: none; }
  }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* Semantic utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ============ v6 — float containment + light-mode legibility ============ */
/* BFC: panels size beside the floated cover instead of bleeding under it */
.answer, .qa, ul.clean { display: flow-root; }
/* Original .answer inverts fg/bg; our panel bg needs matching fg in BOTH themes */
.answer { color: var(--text); }
/* On-gradient text must be ink in both themes (--offset-ink is dark in light & dark) */
.eyebrow, button.gpp-play, .platforms .gpp-play { color: var(--offset-ink); }

/* ============ v8 — chip parity + centered-hero symmetry ============ */
/* Find-page chips render as <button>; give them the same brand language as .chips a */
.chips button, .chips a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--text);
  font: inherit; font-weight: 700; font-size: 13px;
  letter-spacing: .02em; cursor: pointer;
  box-shadow: 3px 3px 0 var(--line);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.chips button:hover, .chips a:hover {
  background: var(--orange); color: var(--offset-ink);
  transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--line);
}
.chips button:active, .chips a:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--line); }

/* Centered heroes: the accent bar centers under the title (symmetric to both sides) */
.hero.center h1::after { left: 50%; transform: translateX(-50%); }
.hero.center h1 { padding-bottom: 22px; }

/* v9 — appbar joins the radius scale: tiles at radius-1 to match the
   gpp-play/platform interactive language; the pill container at radius-2. */
.appbar { border-radius: var(--radius-2); }
.appbar a { border-radius: var(--radius-1); }
