/* BeargrassPublishing v2 — bands.css.

   Owns the banded layout primitive: the .band wrapper, scene
   background with desktop/mobile dual-object swap, the hero band
   variant (eyebrow + headline + deck + conversation overlay), and
   per-mode treatments (Paper cream card / Night dark card / Open
   no-card frosted-strip cinema).

   Architecture:
     <section class="band band--hero">           hero band (one per page)
       <div class="band__bg">
         <object .band__bg-desktop ...>
         <object .band__bg-mobile ...>
       </div>
       <header class="band__content band__content--hero">...</header>
     </section>

     <main class="banded-main">
       <section class="band band--content" data-band-ordinal="N">
         <div class="band__bg">...</div>
         <div class="band__content">...content fragment...</div>
       </section>
       ...repeat per band...
     </main>

   Three modes (Paper / Night / Open) handled at the .band__content
   level. No !important.
*/

/* ============================================================
   Banded-main: full-width main, no inherited width constraints.
   ============================================================ */

body.layout-banded { background: var(--page-bg-deep); }
body.layout-banded main.banded-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* ============================================================
   Band primitive
   ============================================================ */

.band {
  position: relative;
  isolation: isolate;
  width: 100%;
  margin: 0;
  padding: var(--sp-3xl) var(--pad-x);
  min-height: 70vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Hero band — exactly one viewport on load. Eyebrow + headline +
   conversation overlay sit centered; scroll cue at bottom invites
   the read. Per Mark 2026-05-04: every page hero must be the viewport
   on load, no taller, no shorter, so the visitor sees "one moment,
   then the content opens". */
.band--hero {
  min-height: 100vh;
  height: 100vh;
  padding: 5rem var(--pad-x) 2rem;
  align-items: stretch;
  flex-direction: column;
  justify-content: space-between;
}

@media (max-width: 720px) {
  .band         { min-height: 60vh; padding: var(--sp-2xl) var(--pad-x); }
  .band--hero   { min-height: 100vh; height: 100vh; padding: 4rem var(--pad-x) 2rem; }
}

/* ============================================================
   Scene background — dual-object desktop/mobile swap
   ============================================================ */

.band__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--page-bg-deep);
}
.band__bg-desktop,
.band__bg-mobile {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.band__bg-desktop ::part(svg),
.band__bg-mobile  ::part(svg) { width: 100%; height: 100%; }

/* CSS object-fit on <object> isn't universally honored; use stretching
   inset:0 + width/height 100% which is the wrapping pattern that ships
   with the existing scene SVGs (they declare preserveAspectRatio="xMidYMid slice"). */
.band__bg-desktop { display: block; }
.band__bg-mobile  { display: none; }

@media (max-width: 768px) {
  .band__bg-desktop { display: none; }
  .band__bg-mobile  { display: block; }
}

.band > *:not(.band__bg) {
  position: relative;
  z-index: 1;
}

/* ============================================================
   Band content card (Paper + Night)
   ============================================================ */

.band__content {
  max-width: clamp(640px, 60vw, 880px);
  width: 100%;
  margin: 0 auto;
  padding: var(--sp-2xl) var(--sp-2xl) var(--sp-xl);
  background: var(--paper);
  border-radius: 10px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45),
              0 0 0 1px rgba(35, 31, 26, 0.08);
  color: var(--ink);
}
:root[data-mode="night"] .band__content {
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7),
              0 0 0 1px rgba(240, 230, 207, 0.1);
}

/* Hero band content — transparent, no card. */
.band__content--hero {
  background: transparent;
  box-shadow: none;
  padding: 0;
  max-width: var(--w-wide);
  color: var(--cream-fixed);
}

/* Open mode — no card on any band. Type rides scene. */
:root[data-mode="open"] .band__content {
  background: transparent;
  box-shadow: none;
  color: var(--cream-fixed);
  padding: var(--sp-2xl) var(--sp-2xl) var(--sp-xl);
}

/* ============================================================
   Hero band typography (locked spec — preserved from v1)
   ============================================================ */

.band__hero-inner {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 380px);
  gap: 3rem;
  align-items: center;
  flex: 1;
  width: 100%;
  max-width: var(--w-wide);
  margin: 0 auto;
}
@media (max-width: 720px) {
  .band__hero-inner { grid-template-columns: 1fr; gap: 2rem; align-items: end; }
}

.band__hero-copy { color: var(--cream-fixed); }

.band__hero-eyebrow {
  font-family: var(--type-ui);
  font-size: var(--fs-xxs);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--cream-fixed);
  opacity: 0.92;
  margin: 0 0 1rem;
  text-shadow: 0 1px 4px rgba(10, 16, 36, 0.5);
}

.band__hero-rule {
  width: 64px;
  height: 1px;
  background: linear-gradient(90deg, rgba(240, 230, 207, 0.55), rgba(240, 230, 207, 0.05));
  margin: 1rem 0 1.4rem;
}

.band__hero-deck {
  font-family: var(--type-italic);
  font-variation-settings: "opsz" 36, "wght" 400, "SOFT" 50;
  font-style: italic;
  font-size: var(--fs-lg);
  line-height: 1.5;
  color: rgba(240, 230, 207, 0.94);
  text-shadow: 0 1px 4px rgba(10, 16, 36, 0.7);
  margin: 0;
  max-width: 52ch;
}

/* Hero H1 — Fraunces variable, opsz 144 + axisSwell breath. Sized +
   tracked to match the v1 sunrise.css hero exactly (clamp(2.2, 4.6vw,
   3.6rem), max-width 16ch, line-height 1.05). No background-clip
   gradient on Paper hero; mode-specific overrides below add the Night
   gradient pan and the Open Caslon-breath pulse. Fraunces is the v1
   "beautiful template" hero font — variable axes give visible breath
   that Libre Caslon Display lacks. */
.band__hero-headline {
  font-family: var(--type-italic);
  font-variation-settings: "opsz" 144, "wght" 400, "SOFT" 30, "WONK" 0;
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.018em;
  font-weight: 400;
  color: var(--cream-fixed);
  -webkit-text-fill-color: var(--cream-fixed);
  background: none;
  background-image: none;
  margin: 0 0 1rem;
  max-width: 16ch;
  text-shadow: 0 2px 12px rgba(10, 16, 36, 0.7),
               0 0 30px rgba(10, 16, 36, 0.45);
  animation: heroAxisSwell var(--axis-duration) ease-in-out infinite;
}
@keyframes heroAxisSwell {
  0%, 100% { font-variation-settings: "opsz" 130, "wght" 400, "SOFT" 30, "WONK" 0; }
  50%      { font-variation-settings: "opsz" 144, "wght" 460, "SOFT" 70, "WONK" 1; }
}
@media (prefers-reduced-motion: reduce) {
  .band__hero-headline { animation: none; }
}

/* Night hero — cream → gold gradient text-clip pan, 12s. */
:root[data-mode="night"] .band__hero-headline {
  background: linear-gradient(100deg,
    var(--cream-fixed) 0%, var(--cream-fixed) 40%,
    var(--warm-bright) 50%,
    var(--cream-fixed) 60%, var(--cream-fixed) 100%);
  background-size: 300% 100%;
  background-position: 100% 0%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 2px 8px rgba(10, 16, 36, 0.7));
  animation: heroNightSheen 12s ease-in-out infinite;
}

/* Open hero — solid cream Caslon, drop-shadow stack with cream
   inner glow. Scrubbed text-shadow (combining with cream-clip read
   as fog on bright backgrounds in v1; the locked spec uses filter
   drop-shadow only). */
:root[data-mode="open"] .band__hero-headline {
  text-shadow: none;
  filter: drop-shadow(0 2px 8px rgba(10, 16, 36, 0.85))
          drop-shadow(0 0 24px rgba(10, 16, 36, 0.55))
          drop-shadow(0 0 1px rgba(244, 196, 90, 0.4));
  animation: heroCaslonBreath 14s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  :root[data-mode="open"] .band__hero-headline { animation: none; }
}

/* Scroll cue */
.band__hero-cue {
  text-align: center;
  margin: 2rem auto 0;
  color: var(--cream-fixed);
  font-family: var(--type-ui);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-weight: 600;
  opacity: 0.8;
  text-shadow: 0 1px 4px rgba(10, 16, 36, 0.5);
}
.band__hero-cue-label { display: block; margin-bottom: 0.6em; }
.band__hero-cue-arrow {
  display: block;
  margin: 0 auto;
  width: 18px;
  height: 26px;
  animation: heroBounce 2.6s ease-in-out infinite;
}
.band__hero-cue-arrow svg { width: 100%; height: 100%; }
@media (prefers-reduced-motion: reduce) {
  .band__hero-cue-arrow { animation: none; }
}

/* ============================================================
   Hero conversation overlay (typed Q+A bubbles)
   ============================================================ */

.hero-convo {
  position: relative;
  z-index: 5;
  color: var(--cream-fixed);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  min-height: 7rem;
}
.hero-convo__bubble {
  position: relative;
  padding: 0.9em 1.1em 0.9em 2.4em;
  margin-bottom: 0.9em;
  background: rgba(10, 16, 36, 0.45);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  border-radius: 4px 14px 14px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  opacity: 0;
  transform: translateY(8px);
  overflow: hidden;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.hero-convo__bubble--agent {
  border-radius: 14px 4px 14px 14px;
  background: rgba(212, 162, 90, 0.22);
  border-color: rgba(212, 162, 90, 0.45);
  margin-left: 1.4em;
}
.hero-convo__bubble.is-visible { opacity: 1; transform: translateY(0); }
.hero-convo__bubble.is-fading  { opacity: 0; transform: translateY(8px); }
.hero-convo__role {
  position: absolute;
  top: 0.85em;
  left: 0.85em;
  font-family: var(--type-ui);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 700;
  opacity: 0.78;
}
.hero-convo__bubble--human .hero-convo__role { color: var(--olive); }
.hero-convo__bubble--agent .hero-convo__role { color: var(--warm); }
.hero-convo__text {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  white-space: nowrap;
  width: 0;
}
.hero-convo__bubble.is-typed .hero-convo__text {
  width: 100%;
  white-space: normal;
}
.hero-convo__cursor {
  display: inline-block;
  width: 6px;
  height: 1em;
  background: currentColor;
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: heroConvoCaret 1s steps(2, end) infinite;
}
@keyframes heroConvoCaret { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .hero-convo__bubble { opacity: 1; transform: none; }
  .hero-convo__text   { width: auto; white-space: normal; }
  .hero-convo__cursor { animation: none; opacity: 0.5; }
}

@media (max-width: 720px) {
  .hero-convo { font-size: 12px; min-height: 6rem; }
  .hero-convo__bubble { padding: 0.75em 0.9em 0.75em 2.2em; }
  .hero-convo__bubble--agent { margin-left: 0.7em; }
}

/* ============================================================
   Per-band ornament glyph — chapter mark above the eyebrow.
   Each band carries a unique craft glyph in config; generator
   emits `<figure class="band__ornament">` at the top of the
   band content. Color follows the band's text color so the
   glyph reads in every mode without per-mode rules.
   ============================================================ */

.band__ornament {
  margin: 0 0 var(--sp-lg);
  width: 96px;
  height: 80px;
  color: var(--barn);
  opacity: 0.78;
  display: block;
}
.band__ornament svg {
  width: 100%;
  height: 100%;
  display: block;
}
.band__ornament svg, .band__ornament svg * { color: currentColor; }

/* Divider-sprig and divider-mountain ornaments are wide horizontals;
   they read better centered + spanning more width. */
.band__ornament[data-ornament="bg-divider-sprig"],
.band__ornament[data-ornament="bg-divider-mountain"],
.band__ornament[data-ornament="bg-buds"],
.band__ornament[data-ornament="bg-quotebloom"] {
  width: 220px;
  height: 40px;
  margin: 0 auto var(--sp-md);
}

/* Pullquote bands — ornament centers above the cinematic statement. */
.band[data-treatment="pullquote"] .band__ornament {
  margin: 0 auto var(--sp-md);
  color: var(--warm);
  opacity: 0.92;
  filter: drop-shadow(0 1px 4px rgba(10, 16, 36, 0.55));
}

/* Magazine bands — ornament floats wider to balance the spread. */
.band[data-treatment="magazine"] .band__ornament {
  width: 120px;
  height: 92px;
  margin-bottom: var(--sp-lg);
}

/* Pullquote bands center the ornament above the cinematic line. */
.band[data-treatment="pullquote"] .band__ornament {
  width: 110px;
  height: 88px;
}

/* Per-mode color tuning. Paper barn, Night warm, Open warm with lift. */
:root[data-mode="night"] .band__ornament { color: var(--warm); opacity: 0.86; }
:root[data-mode="open"]  .band__ornament {
  color: var(--warm);
  opacity: 0.92;
  filter: drop-shadow(0 1px 4px rgba(10, 16, 36, 0.65));
}

/* ============================================================
   Sec-break inside a band
   ============================================================ */

.band__content > .sec-break {
  margin: var(--sp-md) auto;
  max-width: 360px;
}
.sec-break .rule-line {
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.sec-break svg {
  width: 36px;
  height: 12px;
  color: currentColor;
}

/* ============================================================
   Treatment: m3 pullquote — no card, cinematic centered statement.
   The band carries one heading + one short paragraph, rendered as
   cream display type over the scene, like a verse on a wall. Used
   between prose bands to give the eye a beat.
   ============================================================ */

.band[data-treatment="pullquote"] {
  min-height: 80vh;
}
.band[data-treatment="pullquote"] .band__content {
  background: transparent;
  box-shadow: none;
  color: var(--cream-fixed);
  max-width: clamp(640px, 70vw, 980px);
  padding: var(--sp-2xl) var(--sp-md);
  text-align: center;
}
.band[data-treatment="pullquote"] .band__content header.fx-eyebrow {
  text-align: center;
  margin-bottom: var(--sp-md);
}
.band[data-treatment="pullquote"] .band__content .eyebrow {
  color: var(--warm);
  text-shadow: 0 1px 4px rgba(10, 16, 36, 0.7);
}
.band[data-treatment="pullquote"] .band__content .eyebrow::after {
  background: color-mix(in srgb, var(--warm) 55%, transparent);
}
.band[data-treatment="pullquote"] .band__content .sec-heading,
.band[data-treatment="pullquote"] .band__content h2 {
  font-family: var(--type-display);
  font-variation-settings: "opsz" 96, "wght" 400, "SOFT" 0, "WONK" 0;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.014em;
  color: var(--cream-fixed);
  -webkit-text-fill-color: var(--cream-fixed);
  background: none;
  background-image: none;
  text-shadow: 0 2px 12px rgba(10, 16, 36, 0.78),
               0 0 30px rgba(10, 16, 36, 0.45);
  max-width: 28ch;
  margin: 0 auto var(--sp-md);
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  animation: none;
  display: block;
  width: auto;
}
.band[data-treatment="pullquote"] .band__content p {
  font-family: var(--type-italic);
  font-variation-settings: "opsz" 96, "wght" 400, "SOFT" 60;
  font-style: italic;
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  line-height: 1.5;
  color: var(--cream-fixed);
  text-shadow: 0 1px 4px rgba(10, 16, 36, 0.75),
               0 0 18px rgba(10, 16, 36, 0.5);
  max-width: 46ch;
  margin: 0 auto 1rem;
}
.band[data-treatment="pullquote"] .band__content a.cta {
  margin-top: var(--sp-md);
}

/* Cinematic statement reveal — the pullquote band is the cinematic beat
   of the page. Eyebrow, headline, and statement fade up + breathe in on
   scroll-into-view. View-timeline is honored on browsers that support
   it; older browsers fall back to a simple page-load fade-in (still
   cinematic-feeling). prefers-reduced-motion lands the band fully
   visible at start, no animation. */
@keyframes pullquoteReveal {
  0%   { opacity: 0; transform: translateY(20px); filter: blur(2px); }
  60%  { opacity: 1; transform: translateY(0);    filter: blur(0); }
  100% { opacity: 1; transform: translateY(0);    filter: blur(0); }
}
.band[data-treatment="pullquote"] .band__ornament,
.band[data-treatment="pullquote"] .band__content header.fx-eyebrow,
.band[data-treatment="pullquote"] .band__content .sec-heading,
.band[data-treatment="pullquote"] .band__content h2,
.band[data-treatment="pullquote"] .band__content p {
  animation: pullquoteReveal 1.2s ease-out both;
}
.band[data-treatment="pullquote"] .band__content header.fx-eyebrow { animation-delay: 0.05s; }
.band[data-treatment="pullquote"] .band__content .sec-heading,
.band[data-treatment="pullquote"] .band__content h2 { animation-delay: 0.25s; }
.band[data-treatment="pullquote"] .band__content p { animation-delay: 0.5s; }

@supports (animation-timeline: view()) {
  .band[data-treatment="pullquote"] .band__ornament,
  .band[data-treatment="pullquote"] .band__content header.fx-eyebrow,
  .band[data-treatment="pullquote"] .band__content .sec-heading,
  .band[data-treatment="pullquote"] .band__content h2,
  .band[data-treatment="pullquote"] .band__content p {
    animation-timeline: view();
    animation-range: entry 0% cover 35%;
    animation-fill-mode: both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .band[data-treatment="pullquote"] .band__ornament,
  .band[data-treatment="pullquote"] .band__content header.fx-eyebrow,
  .band[data-treatment="pullquote"] .band__content .sec-heading,
  .band[data-treatment="pullquote"] .band__content h2,
  .band[data-treatment="pullquote"] .band__content p {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* ============================================================
   Treatment: m2 magazine — wider card, two-column body. Eyebrow,
   sec-heading, body-open lead, and CTA span both columns; prose
   paragraphs flow into two columns with a hairline rule. Used for
   list-heavy bands (five-step process, six-things-included, four-rule
   Agent shape) where dense information benefits from a feature-article
   register.
   ============================================================ */

.band[data-treatment="magazine"] .band__content {
  max-width: clamp(820px, 88vw, 1200px);
  padding: var(--sp-2xl) var(--sp-3xl) var(--sp-xl);
}
.band[data-treatment="magazine"] .band__content > p {
  font-size: var(--fs-md);
  line-height: 1.6;
}
@media (min-width: 880px) {
  .band[data-treatment="magazine"] .band__content {
    column-count: 2;
    column-gap: var(--sp-2xl);
    column-rule: 1px solid var(--rule);
  }
  .band[data-treatment="magazine"] .band__content > .band__ornament,
  .band[data-treatment="magazine"] .band__content > header.fx-eyebrow,
  .band[data-treatment="magazine"] .band__content > .body-open,
  .band[data-treatment="magazine"] .band__content > p.body-open,
  .band[data-treatment="magazine"] .band__content > p.drop-cap,
  .band[data-treatment="magazine"] .band__content > a.cta,
  .band[data-treatment="magazine"] .band__content > .related-reading__list,
  .band[data-treatment="magazine"] .band__content > figure {
    column-span: all;
  }
  .band[data-treatment="magazine"] .band__content > p {
    break-inside: avoid;
    margin: 0 0 0.85rem;
  }
}
:root[data-mode="night"] .band[data-treatment="magazine"] .band__content {
  column-rule-color: rgba(240, 230, 207, 0.18);
}
:root[data-mode="open"] .band[data-treatment="magazine"] .band__content {
  column-rule-color: rgba(240, 230, 207, 0.22);
}
