/* BeargrassPublishing v2 — legacy-overrides.css.

   Loaded as the FINAL layer on top of the legacy stack (heritage.css,
   bgai-sales.css, bgai-learn.css, sunrise.css) for Pattern X heritage,
   home, and Learn pages. Carries v2-era polish that the legacy layer
   lacks:

   1. Mode-toggle active state = accent gold (var(--warm)) instead of
      barn red, per Mark 2026-05-04 — the active mode now reads as a
      distinct accent on every chrome.
   2. Learn library hero = tight one-viewport opener with the "Start
      Here" 3-article list visible above the fold. Mark 2026-05-04: the
      Learn library hero was a "trainwreck"; readers need to enter the
      library FAST.
   3. Open-mode body prose lift for Pattern X and Learn pages — black
      ink text on a transparent card riding the dark scene was the
      "black text doesn't work when the animation is dark" bug.
*/

/* ============================================================
   Footer — single canonical centered layout for every page.

   The legacy heritage.css uses a left-aligned auto-fit nav block
   that drifted out of true once Mark added a third footer column.
   The v2 chrome.css already lays the footer out centered for
   banded pages, but heritage / learn pages (which keep the legacy
   stack) inherited the broken left-aligned nav. Locking BOTH
   pipelines to the same centered grid here keeps the masthead
   and the colophon in lockstep visually.
   ============================================================ */

/* Footer — wordmark on top, then a 4-column equally-spaced nav grid,
   then a meta line. No sprig SVG. Mark 2026-05-05: prior layout was
   lopsided. The nav grid binds to --w-content so the masthead, every
   band, and the colophon share one column edge. */
.site-foot__inner {
  max-width: var(--w-content);
  margin: 0 auto;
  padding: var(--sp-3xl) var(--pad-x) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-xl);
  text-align: center;
}
.site-foot__nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-xl);
  width: 100%;
  margin: 0;
  padding: 0;
  border-top: 0;
  text-align: center;
  align-items: start;
}
@media (max-width: 900px) {
  .site-foot__nav { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .site-foot__nav { grid-template-columns: 1fr; }
}
.site-foot__col {
  align-items: center;
  text-align: center;
}
.site-foot__meta {
  width: 100%;
  margin: var(--sp-md) auto 0;
  padding-top: var(--sp-md);
  border-top: 1px solid var(--rule);
  text-align: center;
}



/* Mode-toggle active pill — locked to warm-bright yellow in every
   mode and on every body class. Mark 2026-05-05: same yellow
   everywhere, no exceptions. */
.mode-toggle__btn[aria-pressed="true"],
body.bgai-studio .mode-toggle__btn[aria-pressed="true"],
body.bgai-learn  .mode-toggle__btn[aria-pressed="true"],
body[data-sunrise] .mode-toggle__btn[aria-pressed="true"],
html[data-mode="paper"] .mode-toggle__btn[aria-pressed="true"],
html[data-mode="night"] .mode-toggle__btn[aria-pressed="true"],
html[data-mode="open"]  .mode-toggle__btn[aria-pressed="true"] {
  background: var(--warm-bright, #f4c45a);
  color: var(--ink-fixed);
  text-shadow: none;
  box-shadow: 0 1px 2px rgba(35, 31, 26, 0.16);
}

/* ============================================================
   Hero — exactly one viewport on every page
   Pattern X heritage hero (.article-head--hero) + Learn library
   article-head get pinned to 100vh on load so each page opens with
   one cinematic moment, then the content opens.
   ============================================================ */

body.bgai-studio.layout-heritage .article-head--hero,
body.page-index .home-hero,
body.page-about .article-head--hero {
  min-height: 100vh;
  height: 100vh;
}

/* ============================================================
   Learn library — compact reading-oriented hero
   The Learn library opens onto a hero zone that holds the headline
   AND the "Start Here" 3-article list inside one viewport. Visitors
   land in the library and can click a first article without scrolling.

   Markup the legacy fragment ships:
     <aside class="hero-convo hero-convo--card" data-hero-convo="learn">
     <header class="article-head"> headline + deck </header>
     <section class="library-start-here"> Start here + 3-article list </section>
     <section class="library-toc"> 3-column library TOC </section>

   v2 treatment: wrap the article-head and library-start-here into a
   tight cream-paper opener that fits one viewport. The library-toc
   below is the deeper browse.
   ============================================================ */

body.bgai-learn .article-head {
  margin: 0 auto;
  padding: var(--sp-xl) var(--pad-x) var(--sp-md);
  max-width: var(--w-content);
  align-items: end;
}
body.bgai-learn .article-head .headline {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.06;
  max-width: 24ch;
}
body.bgai-learn .article-head .deck {
  font-size: var(--fs-md);
  line-height: 1.45;
  max-width: 56ch;
  margin-top: 0.7rem;
}

body.bgai-learn .library-start-here {
  max-width: var(--w-content);
  margin: 0 auto var(--sp-xl);
  padding: var(--sp-md) var(--pad-x) var(--sp-xl);
  background: var(--paper);
  border-radius: var(--r-sm);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.18),
              0 0 0 1px rgba(35, 31, 26, 0.06);
}
body.bgai-learn .library-start-here .start-here-header {
  border-bottom: 1px solid var(--rule);
  padding-bottom: var(--sp-md);
  margin-bottom: var(--sp-md);
}
body.bgai-learn .library-start-here .eyebrow {
  font-family: var(--ui);
  font-size: var(--fs-xs);
  letter-spacing: 0.05em;
  color: var(--barn);
  font-weight: 700;
}
body.bgai-learn .library-start-here h2 {
  font-family: var(--fraunces);
  font-variation-settings: "opsz" 96, "wght" 500, "SOFT" 40, "WONK" 1;
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  line-height: 1.15;
  color: var(--ink);
  margin: 0.2rem 0 0.4rem;
}
body.bgai-learn .library-start-here .start-here-deck {
  font-family: var(--fraunces);
  font-style: italic;
  font-size: var(--fs-sm);
  color: var(--ink-sec);
  margin: 0;
  max-width: 60ch;
}
body.bgai-learn .library-start-here .start-here-list {
  display: grid;
  gap: var(--sp-md);
  list-style: none;
  margin: 0;
  padding: 0;
}
body.bgai-learn .library-start-here .start-here-list > li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: var(--sp-md);
  padding: var(--sp-sm) 0;
  border-top: 1px solid var(--rule);
}
body.bgai-learn .library-start-here .start-here-list > li:first-child {
  border-top: 0;
  padding-top: 0;
}
body.bgai-learn .library-start-here .start-here-list .num {
  font-family: var(--fraunces);
  font-variation-settings: "opsz" 144, "wght" 600;
  font-size: 1.6rem;
  color: var(--barn);
  line-height: 1;
}
body.bgai-learn .library-start-here .start-here-list h3 {
  font-family: var(--fraunces);
  font-variation-settings: "opsz" 36, "wght" 500, "SOFT" 40;
  font-size: var(--fs-lg);
  line-height: 1.25;
  margin: 0 0 0.3rem;
  color: var(--indigo);
}
body.bgai-learn .library-start-here .start-here-list h3 a {
  color: inherit;
  text-decoration: none;
}
body.bgai-learn .library-start-here .start-here-list h3 a:hover {
  color: var(--barn);
}
body.bgai-learn .library-start-here .start-here-list p {
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--ink-sec);
  margin: 0 0 0.3rem;
}
body.bgai-learn .library-start-here .start-here-list .reading-time {
  font-family: var(--ui);
  font-size: var(--fs-xs);
  letter-spacing: 0.05em;
  color: var(--ink-ter);
}

/* The hero conversation card on the Learn library — sit it floating top-right
   inside the article-head zone, not stretched to a wide pill. */
body.bgai-learn .hero-convo--card {
  margin-top: var(--sp-md);
}

/* ============================================================
   Open mode — Pattern X heritage + Learn body prose contrast lift
   When the cream paper card is stripped in Open mode, body type was
   left as ink-color over the dark scene. Lift to cream with a strong
   shadow stack so prose stays legible across all SMIL phases.
   ============================================================ */

/* Body prose lift on bgai-studio non-banded and bgai-learn surfaces
   in Open mode. H2/H3 are excluded; sheen owns the heading register
   via .sec-heading background-clip:text. The navy text-shadow on
   transparent-fill text was muddying the gradient. */
html[data-mode="open"] body.bgai-studio:not(.layout-banded) main p,
html[data-mode="open"] body.bgai-studio:not(.layout-banded) main li,
html[data-mode="open"] body.bgai-learn main p,
html[data-mode="open"] body.bgai-learn main li,
html[data-mode="open"] body.bgai-learn .library-start-here p,
html[data-mode="open"] body.bgai-learn .library-toc p {
  color: #f0e6cf;
  text-shadow: 0 1px 4px rgba(10, 16, 36, 0.75),
               0 0 14px rgba(10, 16, 36, 0.45);
}
html[data-mode="open"] body.bgai-learn .library-start-here {
  background: rgba(10, 16, 36, 0.42);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  border: 1px solid rgba(240, 230, 207, 0.18);
}

/* ============================================================
   C1 + C2 fix — Learn pages mode parity for cards (CRITICAL)
   The legacy bgai-learn.css hard-codes cream backgrounds on every
   library card and on the .article-body for essays. In Night that
   produces cream-on-cream invisible body text; in Open the half-cream
   alpha washes prose to ghost. Override per mode so all 11 Learn
   pages stay readable in every mode.

   Paper-mode card on .article-body: the prior Pattern X JS wrap
   script provided this card by wrapping article-head + main into
   `.pattern-x-card`. After the v2 banded-hero-on-essays change the
   article-head is stripped from the fragment so the wrap script
   bails. We restore the cream paper card directly on .article-body
   so the long reading prose has its plate to live on.
   ============================================================ */

html[data-mode="paper"] body.bgai-learn .article-body,
body.bgai-learn .article-body {
  background: var(--paper);
  border-radius: var(--r-md);
  padding: var(--sp-2xl) var(--sp-xl);
  margin: var(--sp-2xl) auto;
  max-width: var(--w-essay);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.16),
              0 0 0 1px rgba(35, 31, 26, 0.06);
}

html[data-mode="night"] body.bgai-learn .article-head,
html[data-mode="night"] body.bgai-learn .library-start-here,
html[data-mode="night"] body.bgai-learn .library-toc > div,
html[data-mode="night"] body.bgai-learn .library-editorial > div,
html[data-mode="night"] body.bgai-learn .soft-cta,
html[data-mode="night"] body.bgai-learn .article-body,
html[data-mode="night"] body.bgai-learn .pattern-x-card {
  background: rgba(22, 33, 46, 0.94);
  border: 1px solid rgba(240, 230, 207, 0.18);
  color: #f0e6cf;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55),
              0 0 0 1px rgba(240, 230, 207, 0.06);
}
html[data-mode="night"] body.bgai-learn .article-body p,
html[data-mode="night"] body.bgai-learn .article-body li,
html[data-mode="night"] body.bgai-learn .library-toc p,
html[data-mode="night"] body.bgai-learn .library-toc h2,
html[data-mode="night"] body.bgai-learn .library-toc h3,
html[data-mode="night"] body.bgai-learn .library-editorial p,
html[data-mode="night"] body.bgai-learn .library-editorial h2,
html[data-mode="night"] body.bgai-learn .library-editorial h3,
html[data-mode="night"] body.bgai-learn .library-start-here p,
html[data-mode="night"] body.bgai-learn .library-start-here h2,
html[data-mode="night"] body.bgai-learn .library-start-here h3,
html[data-mode="night"] body.bgai-learn .soft-cta p {
  color: #f0e6cf;
}
html[data-mode="night"] body.bgai-learn .article-head .deck,
html[data-mode="night"] body.bgai-learn .library-start-here p,
html[data-mode="night"] body.bgai-learn .library-toc p,
html[data-mode="night"] body.bgai-learn .article-body .body-text,
html[data-mode="night"] body.bgai-learn .article-body p {
  color: #c9bea4;
}

/* Open mode — drop the dark slab cards entirely on Learn pages so the
   long reading prose rides the persistent sunrise scene the same way
   banded body prose does. Type lifts to cream, shadow stack carries it
   through every SMIL warm-peak phase. The previous half-cream slab
   read as a card pinned over the scene, which Mark called out as
   visually mismatched. */
/* Open mode Learn surfaces — same frosted dark plate as the v2
   banded .band__content so the legacy article-body / library cards
   read with the same Open register the rest of the site uses.
   Mark 2026-05-05: essays were dropping the plate in Open and
   prose was riding the scene; restore the plate so H2 frosted
   strips and prose contrast hold. */
html[data-mode="open"] body.bgai-learn .article-head,
html[data-mode="open"] body.bgai-learn .library-start-here,
html[data-mode="open"] body.bgai-learn .library-toc > div,
html[data-mode="open"] body.bgai-learn .library-editorial > div,
html[data-mode="open"] body.bgai-learn .soft-cta,
html[data-mode="open"] body.bgai-learn .article-body,
html[data-mode="open"] body.bgai-learn .pattern-x-card {
  background: rgba(10, 16, 36, 0.38);
  -webkit-backdrop-filter: blur(8px) saturate(0.95);
          backdrop-filter: blur(8px) saturate(0.95);
  border: 1px solid rgba(240, 230, 207, 0.14);
  border-radius: var(--r-md);
  box-shadow: 0 18px 36px rgba(10, 16, 36, 0.32);
  padding: var(--sp-2xl) var(--sp-2xl) var(--sp-xl);
  color: #f0e6cf;
}
/* Body prose inside bgai-learn surfaces lifts to cream-fixed in Open
   mode so essays read against the sunrise scene. h1/h2/h3/h4 are
   EXCLUDED from this rule: the canonical .sec-heading and
   .band__hero-headline rules own H1/H2 sheen (cream → warm-bright
   gradient via background-clip:text). The previous version included
   h1-h4 here and the navy text-shadow was muddying the gradient on
   Open mode bgai-learn pages, producing grey/dark heading text. */
html[data-mode="open"] body.bgai-learn p,
html[data-mode="open"] body.bgai-learn li {
  color: #f0e6cf;
  text-shadow: 0 1px 4px rgba(10, 16, 36, 0.9),
               0 0 22px rgba(10, 16, 36, 0.65);
}
html[data-mode="open"] body.bgai-learn .reading-time {
  color: var(--warm-bright, #f4c45a);
  text-shadow: 0 1px 4px rgba(10, 16, 36, 0.85);
}
/* Open eyebrow pill on every bgai-learn surface — explicit dark
   frosted pill with warm-bright gold text. Higher specificity than
   the legacy bgai-learn.css `.eyebrow` color rule so the pill always
   wins on essays / library / topics, matching the homepage.
   Mark 2026-05-05: pill tags must use the yellow accent across
   every Learn page so readers can see the text. */
html[data-mode="open"] body.bgai-learn .eyebrow,
html[data-mode="open"] body.bgai-learn span.fx-eyebrow,
html[data-mode="open"] body.bgai-learn p.fx-eyebrow,
html[data-mode="open"] body.bgai-learn .article-body .eyebrow,
html[data-mode="open"] body.bgai-learn .article-head .eyebrow,
html[data-mode="open"] body.bgai-learn .library-start-here .eyebrow,
html[data-mode="open"] body.bgai-learn .library-toc .eyebrow,
html[data-mode="open"] body.bgai-learn .library-editorial .eyebrow {
  display: block;
  width: fit-content;
  max-width: 100%;
  background: rgba(10, 16, 36, 0.62);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  color: var(--warm-bright, #f4c45a);
  padding: 0.32em 0.7em;
  border-radius: var(--r-pill);
  border: 1px solid rgba(240, 230, 207, 0.22);
  font-weight: 700;
  font-size: var(--fs-xs);
  letter-spacing: 0.05em;
  text-transform: none;
  text-shadow: 0 1px 4px rgba(10, 16, 36, 0.85);
  margin: 0 0 0.85rem;
}
html[data-mode="open"] body.bgai-learn .article-head .rail {
  color: #d4a25a;
  text-shadow: 0 1px 4px rgba(10, 16, 36, 0.85);
}

/* C3 fix — Open banded body prose lift (stronger shadow stack so cream
   reads at every SMIL phase, including the bright peak). Matches the
   pullquote-band shadow stack so banded prose stays legible. */
html[data-mode="open"] body.layout-banded .band__content p,
html[data-mode="open"] body.layout-banded .band__content li {
  color: #f0e6cf;
  text-shadow: 0 1px 4px rgba(10, 16, 36, 0.85),
               0 0 18px rgba(10, 16, 36, 0.5);
}
html[data-mode="open"] body.layout-banded .band__content b,
html[data-mode="open"] body.layout-banded .band__content strong {
  color: #f0e6cf;
  text-shadow: 0 1px 4px rgba(10, 16, 36, 0.95),
               0 0 18px rgba(10, 16, 36, 0.65);
}
html[data-mode="open"] body.layout-banded .band__content a {
  color: #f4c45a;
  text-shadow: 0 1px 4px rgba(10, 16, 36, 0.85);
}

/* C7 retired 2026-05-05 — the frosted-strip H2 treatment was removed
   when sheen consolidated to one canonical letter-pan. The inline +
   padding + box-decoration-break rule was leaving a visible pill
   behind the H2 on Open mode bgai-learn surfaces. Sheen uses
   background-clip:text and does not need an inline pill wrapper. */

/* H8 fix — Open mode drop-cap lift. The dropped letter needs the
   same drop-shadow stack the hero gets so it reads against any
   SMIL phase. */
html[data-mode="open"] .drop-cap::first-letter {
  color: #d4a25a;
  text-shadow: 0 2px 8px rgba(10, 16, 36, 0.85),
               0 0 24px rgba(10, 16, 36, 0.55);
  filter: drop-shadow(0 0 1px rgba(244, 196, 90, 0.45));
}

/* H6 fix — Heritage Pattern X heroes are exactly one viewport on load,
   matching the banded hero contract. */
body.bgai-studio.layout-heritage > .article-head:first-of-type,
body.bgai-studio.layout-heritage > .layout-heritage-main > .article-head:first-of-type,
body.bgai-studio.layout-heritage main > .article-head:first-of-type {
  min-height: 70vh;
  display: flex;
  align-items: center;
}
body.page-index .home-hero,
body.page-about .article-head--hero {
  min-height: 100vh;
}

/* Footer + chrome share one canonical column edge: --w-content. */
.site-foot__inner,
.sss-triptych__inner {
  max-width: var(--w-content);
}

/* H2 fix — SSS triptych sentence punchier so it reads against
   paper-elev card without ghosting. */
.sss-triptych__sentence {
  color: var(--ink);
  font-weight: 400;
  opacity: 0.92;
}

/* SSS triptych is sales surface. Suppress on Learn chromes so reading
   register dominates. */
body.bgai-learn .sss-triptych { display: none; }

/* C5 — Learn library hero scene: replace the empty sky-only persistent
   sunrise-bg behind the Learn library + topics + colophon with one of
   the named scenes (Many Glacier morning) so place is established the
   moment the reader lands. The CSS swaps the persistent sunrise SVG
   per body class. */
body.bgai-learn .sunrise-bg {
  background: var(--page-bg-deep);
}
body.bgai-learn .sunrise-bg object,
body.bgai-learn .sunrise-bg img {
  content: url('/static/images/scenes/scene_sunrise_many_glacier_desktop.svg');
}
@media (max-width: 768px) {
  body.bgai-learn .sunrise-bg object,
  body.bgai-learn .sunrise-bg img {
    content: url('/static/images/scenes/scene_sunrise_many_glacier_mobile.svg');
  }
}

/* Night — keep the cream cards + dark surfaces working on legacy
   pages too. Card surface gets dark, body type already cream by
   token swap, no further fix needed. */

/* ============================================================
   Skip-to-content link — visually hidden until focused.
   Required for keyboard users; lands on every page via the
   chrome template.
   ============================================================ */

.skip-link {
  position: absolute;
  left: -10000px;
  top: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  background: #231f1a;
  color: #f0e6cf;
  padding: 0.6rem 1rem;
  font-family: var(--ui, "Public Sans", system-ui, sans-serif);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  text-decoration: none;
  z-index: 9999;
  border-radius: var(--r-xs);
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  outline: 2px solid #d4a25a;
  outline-offset: 2px;
}

/* Mobile burger nav drawer styling lives in chrome.css under the
   @media (max-width: 980px) block. The May-2026 cream-chrome override
   that was here painted the open drawer cream-on-cream against V2's
   dark inverted chrome and was removed 2026-05-08. */

/* ============================================================
   Reduced-motion — guard every legacy keyframe animation.
   sunrise.css has dozens of unguarded animations; v2 layer
   guards the v2 ones; this file catches anything that slipped
   through.
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .sec-heading.sheen-swell,
  .headline.sheen-swell,
  :root[data-mode="open"] .band__content .sec-heading,
  :root[data-mode="open"] .band__content h2,
  :root[data-mode="open"] .band__content h3,
  :root[data-mode="night"] .band__hero-headline,
  body.bgai-studio .headline,
  body.bgai-learn .headline {
    animation: none !important;
    background-position: 50% 0% !important;
  }
  .article-head--hero__cue-arrow,
  .home-hero__cue-arrow,
  .band__hero-cue-arrow {
    animation: none !important;
  }
}
/* ============================================================
   Chrome nav — locked to cream-on-dark-gradient on every page.
   Mark 2026-05-05: nav text color was drifting between Learn pages
   and homepage because legacy heritage.css and v2/chrome.css
   disagreed under certain mode / body-class combos. Explicit
   per-mode + per-body-class rules below force the same color in
   every state.
   ============================================================ */

html[data-mode="paper"] body.bgai-studio .heritage-sitenav a,
html[data-mode="paper"] body.bgai-learn  .heritage-sitenav a,
html[data-mode="night"] body.bgai-studio .heritage-sitenav a,
html[data-mode="night"] body.bgai-learn  .heritage-sitenav a,
html[data-mode="open"]  body.bgai-studio .heritage-sitenav a,
html[data-mode="open"]  body.bgai-learn  .heritage-sitenav a {
  color: var(--cream-fixed);
  opacity: 0.92;
  text-shadow: 0 1px 3px rgba(10, 16, 36, 0.85);
}
html[data-mode="paper"] body.bgai-studio .heritage-sitenav a:hover,
html[data-mode="paper"] body.bgai-learn  .heritage-sitenav a:hover,
html[data-mode="night"] body.bgai-studio .heritage-sitenav a:hover,
html[data-mode="night"] body.bgai-learn  .heritage-sitenav a:hover,
html[data-mode="open"]  body.bgai-studio .heritage-sitenav a:hover,
html[data-mode="open"]  body.bgai-learn  .heritage-sitenav a:hover {
  opacity: 1;
  color: var(--warm-bright, #f4c45a);
}
html[data-mode="paper"] body.bgai-studio .heritage-sitenav a.is-active,
html[data-mode="paper"] body.bgai-learn  .heritage-sitenav a.is-active,
html[data-mode="night"] body.bgai-studio .heritage-sitenav a.is-active,
html[data-mode="night"] body.bgai-learn  .heritage-sitenav a.is-active,
html[data-mode="open"]  body.bgai-studio .heritage-sitenav a.is-active,
html[data-mode="open"]  body.bgai-learn  .heritage-sitenav a.is-active {
  color: var(--warm-bright, #f4c45a);
}
