/* R3-2 "Seven strands, one line" (DESIGN-R3.md section 2), R4-2: the whole framework component (.aligned-fw) on /book/ and /course/.
   Markup parts/aligned-framework.html, engine levers-field.js, both placed by epi-components.php. Tokens fall back for pages without epi-noir.css.
   A fork of go-deeper-bg (H9). The stage is sticky, full screen, and takes no space (margin-bottom: -100vh). */
.aligned-fw .lf-stage { position: sticky; top: 0; height: 100vh; margin-bottom: -100vh; pointer-events: none; z-index: 0; }
.aligned-fw .lf-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* build note (not in DESIGN-R3): the strands pass behind the lever text at the screen centre, where the active row sits.
   On desktop they are kept at 40% strength under the text column so the active row stays readable. */
@media (min-width: 1024px) {
  .aligned-fw .lf-stage canvas { -webkit-mask-image: linear-gradient(90deg, #000 0 42%, rgba(0,0,0,.4) 52%, rgba(0,0,0,.4) 100%);
                                             mask-image: linear-gradient(90deg, #000 0 42%, rgba(0,0,0,.4) 52%, rgba(0,0,0,.4) 100%); }
}
.aligned-fw .lf-fuse {
  position: absolute; left: 8%; right: 8%; top: 50%; height: 1px;
  background: linear-gradient(90deg, transparent, #f2d472 20%, #fff1cf 50%, #f2d472 80%, transparent);
  box-shadow: 0 0 18px 2px rgba(242,212,114,.35); opacity: 0; transition: opacity .8s ease;
}
.aligned-fw .lf-fuse.is-on { opacity: 1; }
/* build note: a dark halo behind the copy, so a strand passing behind a line of text never cuts through it */
html body .aligned-fw .aligned-fw__sub, html body .aligned-fw .aligned-lever__name, html body .aligned-fw .aligned-lever__desc {
  text-shadow: 0 0 3px #030304, 0 0 10px #030304, 0 0 18px #030304 !important; }
@media (prefers-reduced-motion: reduce) { .aligned-fw .lf-fuse { transition: none; } }

/* Verify pass 15 Oct: the halo was not enough, strands still cut through the intro paragraph (after/d-book-framework-lever4.png).
   A soft black pool of shadow behind the paragraph: the strands fade out behind it and the copy reads cleanly. */
html body .aligned-fw .aligned-fw__sub { position: relative; isolation: isolate; }
html body .aligned-fw .aligned-fw__sub::before { content: ''; position: absolute; inset: -36px -56px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(7,7,8,.96) 55%, rgba(7,7,8,.7) 75%, rgba(7,7,8,0)); }

/* =================== R3-2 framework: "Seven strands, one line" (R4-2: one component, .aligned-fw, /book/ + /course/) =================== */
/* sticky needs a non-scrolling ancestor chain: .epi-shell had overflow-x:hidden (epi-site-shell.css), which makes it a
   scroll container and silently disables every position:sticky inside. clip hides the same overflow without that. */
html body .epi-shell:has(.aligned-fw) { overflow-x: clip !important; overflow-y: visible !important; }
html body .epi-shell-main .aligned-fw { background: var(--bg-void, #030304) !important; padding: 140px 0 160px; position: relative; overflow: clip; }
html body .epi-shell-main .aligned-fw::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  width: auto; height: auto; transform: none;   /* course-page.css draws a 1 px hairline on .course-framework::before */
  background: radial-gradient(34% 55% at 50% -6%, rgba(255,228,170,.16), rgba(255,228,170,.05) 45%, rgba(255,228,170,0) 72%),
              linear-gradient(90deg, transparent 49.85%, rgba(255,236,190,.07) 50%, transparent 50.15%);
}
html body .epi-shell-main .aligned-fw > .container { position: relative; z-index: 1; }
html body .epi-shell-main .aligned-fw__title { color: var(--text-bright, #f7f2e8) !important; margin-bottom: 2.25rem !important; }
html body .epi-shell-main .aligned-fw__sub { color: var(--text-secondary, #a39d92) !important; }
/* the shared levers part, restyled inside the component */
html body .epi-shell-main .aligned-fw .aligned-levers { max-width: none !important; gap: 0 !important; display: block; }
html body .epi-shell-main .aligned-fw .aligned-lever {
  background: none !important; border: 0 !important; border-top: 1px solid var(--border-subtle, rgba(255,240,210,.07)) !important; border-radius: 0 !important; box-shadow: none !important;
  padding: 28px 0 !important; min-height: 0; display: grid !important; grid-template-columns: 48px 1fr; align-items: start; gap: 0; position: relative;
}
html body .epi-shell-main .aligned-fw .aligned-lever::before { content: none !important; display: none !important; }
html body .epi-shell-main .aligned-fw .aligned-lever__letter { font-size: 44px !important; line-height: 1 !important; color: #c8a24e !important; transition: color .4s; }
html body .epi-shell-main .aligned-fw .aligned-lever__name { font: 400 30px/1.15 'DM Serif Display', Georgia, serif !important; color: #fff !important; margin: 0 0 8px !important; transition: opacity .4s, color .4s; }
html body .epi-shell-main .aligned-fw .aligned-lever__desc { font: 400 16px/1.6 Inter, system-ui, sans-serif !important; color: var(--text-secondary, #a39d92) !important; max-width: 42ch; margin: 0 !important; transition: opacity .4s; }
.lf-big { display: none; }
@media (min-width: 1024px) {
  html body .epi-shell-main .aligned-fw > .container { display: grid !important; grid-template-columns: 5fr 7fr; column-gap: 72px; align-items: start; }
  html body .epi-shell-main .aligned-fw__header { position: sticky; top: 18vh; text-align: left !important; margin: 0 !important; align-self: start; }
  html body .epi-shell-main .aligned-fw__header .section-label { justify-content: flex-start !important; }
  html body .epi-shell-main .aligned-fw__title { font: 400 clamp(40px, 4vw, 60px)/1.05 'DM Serif Display', Georgia, serif !important; text-align: left !important; margin-bottom: 24px !important; }
  html body .epi-shell-main .aligned-fw__sub { font: 400 16px/1.65 Inter, system-ui, sans-serif !important; max-width: 38ch !important; margin: 0 !important; text-align: left !important; }
  .lf-big { display: block; }
  html body .epi-shell-main .aligned-fw .lf-big__l {
    display: block; font: 400 240px/.8 'DM Serif Display', Georgia, serif !important; margin-top: 48px;
    background: linear-gradient(180deg, #fff1cf 0%, #f2d472 35%, #c8a24e 70%, #8a6a24 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent !important; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 40px rgba(212,168,76,.25)); transition: opacity .18s ease, transform .18s ease;
  }
  html body .epi-shell-main .aligned-fw .lf-big__l.is-out { opacity: 0; transform: translateY(6px); }
  html body .epi-shell-main .aligned-fw .lf-big__n { display: block; margin-top: 18px; font: 600 12px/1 Inter, system-ui, sans-serif !important; letter-spacing: .24em; color: var(--text-secondary, #a39d92) !important; }
  html body .epi-shell-main .aligned-fw .aligned-lever { padding: 44px 0 44px 28px !important; min-height: 168px; grid-template-columns: 64px 1fr; }
  html body .epi-shell-main .aligned-fw .aligned-lever__letter { color: rgba(200,162,78,.28) !important; }
  html body .epi-shell-main .aligned-fw .aligned-lever__name { color: var(--text-primary, #e9e5dc) !important; opacity: .55; }
  html body .epi-shell-main .aligned-fw .aligned-lever__desc { opacity: .55; }
  html body .epi-shell-main .aligned-fw .aligned-lever::after {
    content: ""; position: absolute; left: 0; top: 44px; bottom: 44px; width: 2px; background: linear-gradient(#f2d472, #c8a24e);
    transform: scaleY(0); transform-origin: top; transition: transform .5s cubic-bezier(.2,.7,.2,1);
  }
  html body .epi-shell-main .aligned-fw .aligned-lever.is-active { background: radial-gradient(60% 80% at 0% 50%, rgba(212,168,76,.08), transparent 70%) !important; }
  html body .epi-shell-main .aligned-fw .aligned-lever.is-active .aligned-lever__letter { color: #c8a24e !important; }
  html body .epi-shell-main .aligned-fw .aligned-lever.is-active .aligned-lever__name { color: #fff !important; opacity: 1; }
  html body .epi-shell-main .aligned-fw .aligned-lever.is-active .aligned-lever__desc { opacity: 1; }
  html body .epi-shell-main .aligned-fw .aligned-lever.is-active::after { transform: scaleY(1); }
}
@media (max-width: 1023px) {
  html body .epi-shell-main .aligned-fw { padding: 96px 0 104px; }
  html body .epi-shell-main .aligned-fw__header { text-align: center; }
}

