/* v1.0.6 dhyan: "The Biology & Metaphysics of Dhyan" (includes/views/dhyan-journey.php, assets/js/dhyan-journey.js).
   Scoped to .dj. On the homepage (.dj--home) the section follows the site theme (Temple Dark by default, or light);
   in the lab (.dj--science) it is always dark. The stage itself is a dark window in every theme so the light reads.
   ≥ 900px: a sticky column (scrubber + stage) beside four beats. Below: the scrubber and a shorter stage stick under the
   header (and the lab's module tabs, measured by the script into --dj-extra) and the beats scroll up beneath them.
   .dj[data-stage="1..4"] picks the stage; .is-in (on screen) starts its animations; .is-live = the script runs.
   Static frames (no JS, reduced motion) show each stage's settled state; the animations play from the agitated one. */

.dj {
  --dj-bg: var(--parchment, #0D0B09);
  --dj-surface: var(--surface, #171411);
  --dj-ink: var(--ink, #FCFBF7);
  --dj-muted: var(--muted, #BBA996);
  --dj-gold: var(--gold-text, #F2B54C);
  --dj-line: var(--champagne, rgba(245, 158, 11, 0.2));
  --dj-line-strong: var(--champagne-strong, rgba(245, 158, 11, 0.45));
  --dj-wash: rgba(217, 119, 6, 0.09);
  --dj-wash-2: rgba(136, 19, 55, 0.07);
  --dj-scrub-bg: var(--header-bg-solid, rgba(13, 11, 9, 0.92));
  --dj-focus: var(--focus, #FCD34D);
  --dj-top: calc(var(--header-h, 64px) + env(safe-area-inset-top, 0px) + var(--djjs-global-h, 0px) + var(--dj-extra, 0px));
  --dj-ease: var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
  position: relative;
  color: var(--dj-ink);
  background: radial-gradient(900px 620px at 18% 10%, var(--dj-wash), transparent 64%),
              radial-gradient(800px 600px at 100% 90%, var(--dj-wash-2), transparent 60%), var(--dj-bg);
  border-block: 1px solid var(--dj-line);
  scroll-margin-top: var(--dj-top);
}
[data-theme="dark"] .dj { --dj-wash: rgba(217, 119, 6, 0.12); --dj-wash-2: rgba(136, 19, 55, 0.22); }
.dj--science {
  --dj-bg: #0D0B09; --dj-surface: #171411; --dj-ink: #FCFBF7; --dj-muted: #BBA996; --dj-gold: #F2B54C;
  --dj-line: rgba(242, 181, 76, 0.16); --dj-line-strong: rgba(242, 181, 76, 0.38);
  --dj-wash: rgba(6, 182, 212, 0.07); --dj-wash-2: rgba(136, 19, 55, 0.2); --dj-scrub-bg: rgba(13, 11, 9, 0.93); --dj-focus: #FCD34D;
  color-scheme: dark;
}
.dj :focus-visible { outline: 2px solid var(--dj-focus); outline-offset: 3px; }

/* ---------- Head ---------- */
.dj__head { max-width: 46rem; margin: 0 auto clamp(18px, 3vw, 40px); text-align: center; }
.dj__eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dj-gold); }
.dj__eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: #F2B54C; box-shadow: 0 0 0 4px rgba(242, 181, 76, 0.16), 0 0 16px rgba(242, 181, 76, 0.8); }
.dj__title { font-family: var(--serif, Georgia, serif); font-weight: 600; font-size: clamp(2.2rem, 1.35rem + 3.5vw, 4.1rem); line-height: 1.02; letter-spacing: -0.01em; margin: 0 0 0.35em; color: var(--dj-ink); text-wrap: balance; }
.dj__title em { font-style: italic; font-weight: 500; color: var(--dj-gold); }
.dj__lead { margin: 0 auto; max-width: 38rem; color: var(--dj-muted); font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem); line-height: 1.65; }

/* ---------- Body: sticky pin (scrubber + stage) beside the beats ---------- */
.dj__body { position: relative; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 0 clamp(28px, 4.5vw, 80px); }
.dj__pin {
  position: sticky; top: var(--dj-top); align-self: start; z-index: 3;
  height: calc(100vh - var(--dj-top)); height: calc(100svh - var(--dj-top));
  display: flex; flex-direction: column; justify-content: center; padding-block: 12px 18px;
}
@media (min-width: 900px) { .dj .dj__stage { flex: 0 1 auto; height: min(100%, 940px); } } /* tall screens (4K): no empty column */
.dj__scrub { flex: none; }
.dj__tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.dj__tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 52px; padding: 6px 4px;
  border: 1px solid transparent; border-radius: 14px; background: none; color: var(--dj-muted); cursor: pointer; text-align: center;
  transition: background-color 300ms var(--dj-ease), border-color 300ms var(--dj-ease), color 300ms var(--dj-ease); -webkit-tap-highlight-color: transparent;
}
.dj__tab-min { font: 600 0.7rem/1.2 var(--sans, system-ui); letter-spacing: 0.14em; font-variant-numeric: tabular-nums; }
.dj__tab-name { font: 600 1.06rem/1.15 var(--serif, Georgia, serif); color: var(--dj-ink); opacity: 0.78; white-space: nowrap; }
.dj__tab[aria-current="step"] { color: var(--dj-gold); border-color: var(--dj-line-strong); background: linear-gradient(160deg, rgba(242, 181, 76, 0.16), rgba(242, 181, 76, 0.03)); }
.dj__tab[aria-current="step"] .dj__tab-name { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .dj__tab:hover:not([aria-current="step"]) { background: rgba(242, 181, 76, 0.07); } }

.dj__track { position: relative; height: 30px; margin: 8px 6px 0; --dj-p: 0; }
.dj__rail, .dj__fill { position: absolute; left: 0; right: 0; top: 6px; height: 2px; border-radius: 2px; }
.dj__rail { background: var(--dj-line); }
.dj__fill { background: linear-gradient(90deg, #22D3EE, #F2B54C 55%, #FDE68A); transform-origin: 0 50%; transform: scaleX(var(--dj-p)); box-shadow: 0 0 10px rgba(242, 181, 76, 0.45); }
.dj__knob { position: absolute; top: 2px; left: calc(var(--dj-p) * 100%); width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #FDE68A; box-shadow: 0 0 0 3px rgba(242, 181, 76, 0.25), 0 0 14px rgba(253, 230, 138, 0.9); }
.dj__tick { position: absolute; top: 13px; left: calc(var(--x) * 1%); transform: translateX(calc(var(--x) * -1%)); font: 600 0.68rem/1 var(--sans, system-ui); letter-spacing: 0.08em; color: var(--dj-muted); opacity: 0.75; transition: color 300ms, opacity 300ms; font-variant-numeric: tabular-nums; }
.dj__tick.is-on { color: var(--dj-gold); opacity: 1; }

/* ---------- The stage: a dark window in every theme ---------- */
.dj__stage {
  position: relative; flex: 1 1 auto; min-height: 0; margin-top: 10px; display: grid; place-items: center; overflow: hidden; isolation: isolate;
  border-radius: 26px; border: 1px solid rgba(242, 181, 76, 0.22);
  background: radial-gradient(60% 46% at 50% 30%, rgba(217, 119, 6, 0.13), transparent 70%),
              radial-gradient(50% 40% at 85% 100%, rgba(136, 19, 55, 0.24), transparent 70%), #0A0807;
  box-shadow: 0 30px 80px -44px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(252, 211, 77, 0.08);
  color-scheme: dark;
}
.dj__stage::before, .dj__stage::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 900ms var(--dj-ease); }
.dj__stage::before { background: radial-gradient(55% 45% at 50% 45%, rgba(6, 182, 212, 0.16), transparent 70%); }
.dj__stage::after { background: radial-gradient(55% 50% at 50% 30%, rgba(253, 230, 138, 0.2), transparent 72%); }
.dj[data-stage="1"] .dj__stage::before, .dj[data-stage="3"] .dj__stage::before { opacity: 1; }
.dj[data-stage="4"] .dj__stage::after { opacity: 1; }
.dj-svg { display: block; width: 100%; height: 100%; max-height: 880px; overflow: hidden; }
.dj__clock { position: absolute; top: 14px; left: 18px; z-index: 1; display: flex; align-items: baseline; gap: 6px; color: #F2B54C; pointer-events: none; }
.dj__clock-n { font: 600 clamp(1.6rem, 1.2rem + 1vw, 2.3rem)/1 var(--serif, Georgia, serif); font-variant-numeric: tabular-nums; min-width: 1.2em; text-align: right; }
.dj__clock-u { font: 600 0.66rem/1 var(--sans, system-ui); letter-spacing: 0.2em; text-transform: uppercase; color: #BBA996; }

/* ---------- Beats ---------- */
.dj__beats { margin: 0; padding: 0 0 10vh; list-style: none; }
.dj__beat { display: flex; align-items: center; min-height: 92vh; min-height: 92svh; padding-block: 5vh; --dj-hue: #F2B54C; }
.dj__beat[data-dj-beat="1"] { --dj-hue: #22D3EE; }
.dj__beat[data-dj-beat="2"] { --dj-hue: #FB923C; }
.dj__beat[data-dj-beat="3"] { --dj-hue: #67E8F9; }
.dj__card {
  width: 100%; max-width: 33rem; padding: clamp(22px, 2.6vw, 34px); border-radius: 24px; border: 1px solid var(--dj-line);
  background: var(--dj-surface); box-shadow: var(--shadow-soft, 0 20px 50px -30px rgba(0, 0, 0, 0.8));
  transition: opacity 500ms var(--dj-ease), border-color 500ms var(--dj-ease), box-shadow 500ms var(--dj-ease);
}
.dj.is-live .dj__beat:not(.is-current) .dj__card { opacity: 0.42; }
.dj.is-live .dj__beat.is-current .dj__card { border-color: var(--dj-line-strong); box-shadow: 0 30px 80px -42px rgba(217, 119, 6, 0.5), inset 0 1px 0 rgba(252, 211, 77, 0.14); }
.dj__kicker { display: flex; align-items: baseline; gap: 0.8em; margin: 0 0 0.7rem; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dj-gold); font-variant-numeric: tabular-nums; }
.dj__num { font-family: var(--serif, Georgia, serif); font-size: 1.5rem; font-weight: 500; letter-spacing: 0.04em; line-height: 1; color: var(--dj-gold); }
.dj__h { font-family: var(--serif, Georgia, serif); font-weight: 600; font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.45rem); line-height: 1.08; margin: 0 0 0.55em; color: var(--dj-ink); text-wrap: balance; }
.dj__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1rem; padding: 0; list-style: none; }
.dj__chips li { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--dj-line-strong); background: rgba(242, 181, 76, 0.06); color: var(--dj-ink); font-size: 0.8rem; font-weight: 600; line-height: 1.3; }
.dj__chips li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--dj-hue); box-shadow: 0 0 8px var(--dj-hue); }
.dj__line { margin: 0; color: var(--dj-muted); font-size: clamp(0.98rem, 0.94rem + 0.2vw, 1.06rem); line-height: 1.7; }
.dj__pillars { display: grid; gap: 10px; margin: 1.1rem 0 0; padding: 0; list-style: none; }
.dj__pillar { display: grid; gap: 2px; padding: 2px 0 2px 14px; border-left: 2px solid rgba(242, 181, 76, 0.55); }
.dj__pillar-term { font: 600 1.14rem/1.2 var(--serif, Georgia, serif); color: var(--dj-ink); }
.dj__pillar-term span { font-weight: 500; font-style: italic; color: var(--dj-gold); }
.dj__pillar-line { font-size: 0.9rem; line-height: 1.5; color: var(--dj-muted); }

/* ---------- Footnote and calls to action ---------- */
.dj__foot { display: grid; justify-items: center; gap: 18px; margin-top: clamp(24px, 4vw, 56px); text-align: center; }
.dj__note { max-width: 54rem; margin: 0; font-size: 0.84rem; line-height: 1.65; color: var(--dj-muted); }
.dj__note span { color: var(--dj-gold); margin-right: 2px; }
.dj__ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.dj-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0.6em 1.6em; border-radius: 999px; border: 1px solid transparent;
  font: 600 0.96rem/1.2 var(--sans, system-ui); text-decoration: none; text-align: center; cursor: pointer; transition: box-shadow 200ms var(--dj-ease), border-color 200ms, background-color 200ms; touch-action: manipulation; }
.dj-btn--gold { color: #1F0A06; background: linear-gradient(135deg, #FDE7AE 0%, #F2B54C 45%, #D97706 100%); box-shadow: 0 0 0 1px rgba(242, 181, 76, 0.5), 0 10px 30px -12px rgba(217, 119, 6, 0.75); }
.dj-btn--ghost { color: var(--dj-gold); border-color: var(--dj-line-strong); background: transparent; }
.dj a.dj-btn--gold, .dj a.dj-btn--gold:visited { color: #1F0A06; }
@media (hover: hover) and (pointer: fine) {
  .dj-btn--gold:hover { box-shadow: 0 0 0 1px rgba(242, 181, 76, 0.85), 0 14px 38px -10px rgba(217, 119, 6, 0.95); }
  .dj-btn--ghost:hover { border-color: var(--dj-gold); background: rgba(242, 181, 76, 0.08); }
}

/* ---------- Phones and tablets: the pin sticks under the header, the beats scroll beneath ---------- */
@media (max-width: 899.98px) {
  .dj__body { display: block; }
  .dj__pin {
    height: auto; padding-block: 8px 10px;
    margin-inline: calc(-1 * max(var(--gutter, 16px), var(--safe-x, 0px))); padding-inline: max(var(--gutter, 16px), var(--safe-x, 0px));
    background: var(--dj-bg); box-shadow: 0 1px 0 var(--dj-line);
  }
  .dj__pin::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 28px; background: linear-gradient(var(--dj-bg), transparent); pointer-events: none; }
  .dj__stage { flex: none; height: clamp(220px, 34vh, 380px); height: clamp(220px, 34svh, 380px); margin-top: 6px; border-radius: 20px; }
  .dj--science .dj__stage { height: clamp(200px, 30vh, 340px); height: clamp(200px, 30svh, 340px); } /* under the lab's module tabs too */
  .dj__tab { min-height: 44px; padding-block: 4px; }
  .dj__beat { min-height: 70vh; min-height: 70svh; padding-block: 4vh; }
  .dj__beats { padding-bottom: 0; }
  .dj__beat:last-child { min-height: 64vh; min-height: 64svh; }
  .dj__card { max-width: 40rem; margin-inline: auto; }
}
@media (max-width: 599.98px) {
  .dj__tab-min { font-size: 0.62rem; letter-spacing: 0.08em; }
  .dj__tab-name { font-size: 0.95rem; }
  .dj__track { height: 24px; margin-top: 6px; }
  .dj__tick { top: 12px; font-size: 0.62rem; }
  .dj__clock { top: 10px; left: 12px; }
  .dj__card { padding: 20px 18px; border-radius: 20px; }
  .dj__h { font-size: 1.6rem; }
  .dj__chips { gap: 6px; margin-bottom: 0.8rem; }
  .dj__chips li { font-size: 0.75rem; padding: 4px 10px; }
  .dj__line { font-size: 0.95rem; line-height: 1.6; }
  .dj__pillars { gap: 8px; margin-top: 0.9rem; }
  .dj__pillar-term { font-size: 1.04rem; }
  .dj__pillar-line { font-size: 0.84rem; }
  .dj-btn { width: 100%; }
  .dj__ctas { width: 100%; }
}
@media (max-height: 560px) and (max-width: 899.98px) { .dj__stage { height: 200px; } }

/* =================================== The artwork (SVG) =================================== */
.dj-svg text { font-family: var(--sans, system-ui, sans-serif); }
.dj-bg circle { fill: none; stroke: rgba(242, 181, 76, 0.07); stroke-width: 1; }
.dj-bg .dj-bg__dots { stroke: rgba(242, 181, 76, 0.22); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 0.1 9; }
.dj-l { opacity: 0; transform-box: view-box; transform-origin: 200px 230px; transition: opacity 800ms var(--dj-ease), transform 1100ms var(--dj-ease); }
.dj-l-body { opacity: 1; transform-origin: 200px 94px; }
.dj[data-stage="1"] .dj-l-ns, .dj[data-stage="2"] .dj-l-endo, .dj[data-stage="3"] .dj-l-brain, .dj[data-stage="4"] .dj-l-ether { opacity: 1; }
.dj[data-stage="2"] .dj-l-ns { opacity: 0.2; }
.dj[data-stage="2"] .dj-l-ns :is(.dj-lbls, .dj-inset, .dj-hot, .dj-pg, .dj-sense) { opacity: 0; }
.dj[data-stage="3"] .dj-l-body { opacity: 0; transform: scale(1.35); }
.dj-l-brain { transform: scale(0.9); }
.dj[data-stage="3"] .dj-l-brain { transform: none; }
.dj-l-ether { transform-origin: 200px 84px; }
.dj-lbls, .dj-inset, .dj-legend { transition: opacity 600ms var(--dj-ease); }

/* labels */
.dj-lbl { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; fill: #E9DCC6; }
.dj-lbl--tiny { font-size: 11px; letter-spacing: 0.12em; fill: #CDBCA7; }
.dj-lbl--red { fill: #FCA5A5; font-weight: 500; }
.dj-lbl--gold { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; fill: #F2B54C; }
.dj-lbl--pillar { font-family: var(--serif, Georgia, serif) !important; font-size: 17px; fill: #FDE8B8; letter-spacing: 0.01em; }
.dj-lbl--sub { font-size: 11.5px; font-weight: 500; font-style: italic; fill: #CDBCA7; }
.dj-leader { fill: none; stroke: rgba(233, 220, 198, 0.32); stroke-width: 0.8; }
@media (max-width: 599.98px) {
  .dj-lbl { font-size: 17px; }
  .dj-lbl--tiny { font-size: 14px; letter-spacing: 0.06em; }
  .dj-lbl--gold { font-size: 14px; letter-spacing: 0.12em; }
  .dj-lbl--pillar { font-size: 18px; }
  .dj-lbl--sub { font-size: 15px; }
  .dj-band { font-size: 16px !important; }
}

/* the figure */
.dj-skin { stroke: rgba(242, 181, 76, 0.42); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.dj-contour { fill: none; stroke: rgba(242, 181, 76, 0.2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.dj-fig { transition: opacity 1100ms var(--dj-ease); }
.dj-aura, .dj-ether { opacity: 0; transition: opacity 1200ms var(--dj-ease); }
.dj[data-stage="4"] .dj-fig { opacity: 0; }
.dj[data-stage="4"] .dj-aura, .dj[data-stage="4"] .dj-ether { opacity: 1; }
.dj-ether__glow { fill: none; stroke: #F59E0B; stroke-linejoin: round; }
.dj-ether__glow--a { stroke-width: 24; stroke-opacity: 0.08; }
.dj-ether__glow--b { stroke-width: 9; stroke-opacity: 0.2; }
.dj-ether__fill { stroke: #FDE68A; stroke-width: 1.2; stroke-opacity: 0.8; }
.dj-ether__line { stroke: #FFF1C9; stroke-width: 1.4; stroke-opacity: 0.55; stroke-dasharray: 2 6; stroke-linecap: round; }

/* stage 1: nervous system, settled state (static frame) */
.dj-brain-front ellipse { fill: rgba(242, 181, 76, 0.06); stroke: rgba(242, 181, 76, 0.35); stroke-width: 1; }
.dj-brain-front path { fill: none; stroke: rgba(242, 181, 76, 0.28); stroke-width: 1; }
.dj-hot { opacity: 0.08; }
.dj-cool { opacity: 1; }
.dj-nv path { fill: none; stroke-linecap: round; }
.dj-nv--hot path { stroke: #EF4444; stroke-width: 2.2; stroke-dasharray: 5 4; }
.dj-nv--cool path { stroke: #22D3EE; stroke-width: 1.5; stroke-opacity: 0.8; }
.dj-chain path { fill: none; stroke: #DC2626; stroke-width: 1.2; stroke-opacity: 0.7; }
.dj-chain circle { fill: #F87171; }
.dj-sense path { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 4 6; }
.dj-sense--hot path { stroke: #F87171; }
.dj-sense--cool path { stroke: #67E8F9; stroke-opacity: 0.3; }
.dj-vagus { fill: none; stroke: #A5F3FC; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 10 5; }
.dj-gate { fill: rgba(6, 182, 212, 0.14); stroke: #67E8F9; stroke-width: 1.4; }
.dj-thalamus { fill: #FDE68A; }
.dj-heart { fill: #FB7185; transform-box: fill-box; transform-origin: 50% 60%; }
.dj-heart--endo { fill: rgba(251, 113, 133, 0.55); }
.dj-inset rect { fill: rgba(7, 6, 10, 0.78); stroke: rgba(242, 181, 76, 0.22); stroke-width: 1; }
.dj-hrv { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.dj-hrv--hot { stroke: #F87171; opacity: 0; }
.dj-hrv--cool { stroke: #67E8F9; }

/* stage 2: endocrine */
.dj-endo-paths path { fill: none; stroke: rgba(242, 181, 76, 0.3); stroke-width: 1.3; stroke-dasharray: 2 5; stroke-linecap: round; }
.dj-gland { fill: #FDE68A; }
.dj-gland--soft { fill: rgba(253, 230, 138, 0.5); }
.dj-gland-glow { transform-box: fill-box; transform-origin: 50% 50%; }
.dj-kidney { fill: rgba(244, 114, 182, 0.1); stroke: rgba(251, 113, 133, 0.32); stroke-width: 1; }
.dj-adrenal { fill: #C08A7A; }
.dj-cortisol-glow { opacity: 0.18; }
.dj-dot-gold { fill: #FDE68A; }
.dj-dot-red { fill: #F87171; }

/* stage 3: brain + EEG, illuminated state */
.dj-head { stroke: rgba(242, 181, 76, 0.38); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.dj-brain { fill: #1C1612; stroke: rgba(242, 181, 76, 0.5); stroke-width: 1.2; }
.dj-brain-lit { opacity: 0.5; }
.dj-cerebellum { fill: #1C1612; stroke: rgba(242, 181, 76, 0.3); stroke-width: 1; }
.dj-stem { fill: none; stroke: rgba(242, 181, 76, 0.3); stroke-width: 7; stroke-linecap: round; }
.dj-gyri path { fill: none; stroke: #F2C14E; stroke-opacity: 0.9; stroke-width: 2.2; stroke-linecap: round; }
.dj-pfc { fill: rgba(253, 224, 138, 0.42); stroke: rgba(253, 230, 138, 0.7); stroke-width: 1; }
.dj-amyg { fill: rgba(251, 113, 133, 0.28); stroke: rgba(251, 113, 133, 0.55); stroke-width: 1; }
.dj-shift { fill: none; stroke: #F2B54C; stroke-width: 2; stroke-linecap: round; }
.dj-eeg rect { fill: rgba(7, 6, 10, 0.85); stroke: rgba(103, 232, 249, 0.24); stroke-width: 1; }
.dj-eeg__grid { fill: none; stroke: rgba(103, 232, 249, 0.08); stroke-width: 1; }
.dj-eeg__trace { fill: none; stroke: #67E8F9; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.dj-eeg__out { fill: #A5F3FC; }
.dj-band { font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; fill: #A5F3FC; transition: fill 400ms, opacity 400ms; }
.dj.is-anim .dj-band { fill: #8C7B6B; }
.dj.is-anim .dj-band.is-on { fill: #67E8F9; }

/* stage 4: the luminous body */
.dj-beams path { fill: none; stroke: #F2C14E; stroke-opacity: 0.5; stroke-width: 1.2; stroke-dasharray: 3 6; stroke-linecap: round; }
.dj-ajna-glow { transform-box: fill-box; transform-origin: 50% 50%; }
.dj-rays { transform-box: view-box; transform-origin: 200px 84px; }
.dj-rays line { stroke: #FDE68A; stroke-width: 1.2; stroke-opacity: 0.7; stroke-linecap: round; }
.dj-ajna { fill: #FFF7E0; }
.dj-pillar__halo { fill: rgba(242, 181, 76, 0.1); transform-box: fill-box; transform-origin: 50% 50%; }
.dj-pillar__ring { fill: rgba(13, 11, 9, 0.88); stroke: #F2B54C; stroke-width: 1.3; }
.dj-pillar__icon { fill: none; stroke: #FDE68A; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dj-pillar__icon circle[r="3"], .dj-pillar__icon path[d^="M0-14"] { fill: rgba(253, 230, 138, 0.4); }

/* particles (created by the script) */
.dj-pg circle { pointer-events: none; }

/* =================================== Motion (only when allowed, only on screen) =================================== */
@media (prefers-reduced-motion: no-preference) {
  /* stage 1: alarm cools into rest */
  .dj.is-in[data-stage="1"] .dj-hot { animation: dj-fade-out 3.4s var(--dj-ease) 0.5s both; }
  .dj.is-in[data-stage="1"] .dj-cool { animation: dj-fade-in 3.4s var(--dj-ease) 0.5s both; }
  .dj.is-in[data-stage="1"] .dj-hrv--hot { animation: dj-fade-out-full 3.4s var(--dj-ease) 0.5s both; }
  .dj.is-in[data-stage="1"] .dj-hrv--cool { animation: dj-fade-in 3.4s var(--dj-ease) 0.5s both; }
  .dj.is-in[data-stage="1"] .dj-gate { animation: dj-gate 3.4s var(--dj-ease) 0.9s both; }
  .dj.is-in[data-stage="1"] .dj-nv--hot path, .dj.is-in[data-stage="1"] .dj-sense path { animation: dj-dash 0.7s linear infinite; }
  .dj.is-in[data-stage="1"] .dj-vagus { animation: dj-dash-slow 3s linear infinite; }
  .dj.is-in[data-stage="1"] .dj-heart { animation: dj-beat-fast 0.55s ease-in-out 6, dj-beat 1.3s ease-in-out 3.3s infinite; }
  .dj.is-in[data-stage="1"] .dj-hot .dj-chain { animation: dj-jitter 0.22s steps(2) infinite; }
  /* stage 2: glands glow, cortisol ebbs */
  .dj.is-in[data-stage="2"] .dj-gland-glow { animation: dj-pulse 3.6s ease-in-out infinite; }
  .dj.is-in[data-stage="2"] .dj-gland-glow--b { animation-delay: -1.8s; }
  .dj.is-in[data-stage="2"] .dj-cortisol-glow { animation: dj-ebb 5s var(--dj-ease) 0.3s both; }
  .dj.is-in[data-stage="2"] .dj-adrenal { animation: dj-adrenal 5s var(--dj-ease) 0.3s both; }
  .dj.is-in[data-stage="2"] .dj-endo-paths path { animation: dj-dash-slow 2.4s linear infinite; }
  /* stage 3: the cortex lights, the amygdala yields to the prefrontal cortex */
  .dj.is-in[data-stage="3"] .dj-gyri path { animation: dj-gyrus 1.6s var(--dj-ease) both; animation-delay: calc(0.8s + var(--i) * 0.42s); }
  .dj.is-in[data-stage="3"] .dj-brain-lit { animation: dj-lit 6s var(--dj-ease) 0.6s both; }
  .dj.is-in[data-stage="3"] .dj-pfc { animation: dj-fade-in 3s var(--dj-ease) 3.6s both; }
  .dj.is-in[data-stage="3"] .dj-amyg { animation: dj-amyg 4.5s var(--dj-ease) 0.4s both; }
  .dj.is-in[data-stage="3"] .dj-shift { stroke-dasharray: 60; animation: dj-draw 1.8s var(--dj-ease) 3s both; }
  /* stage 4: the luminous body */
  .dj.is-in[data-stage="4"] .dj-aura { animation: dj-breathe 7s ease-in-out infinite; }
  .dj.is-in[data-stage="4"] .dj-rays { animation: dj-spin 60s linear infinite; }
  .dj.is-in[data-stage="4"] .dj-ajna-glow { animation: dj-pulse 4s ease-in-out infinite; }
  .dj.is-in[data-stage="4"] .dj-pillar { animation: dj-fade-in 1.4s var(--dj-ease) both; animation-delay: calc(1s + var(--i) * 0.4s); }
  .dj.is-in[data-stage="4"] .dj-pillar__halo { animation: dj-pulse 4.4s ease-in-out infinite; animation-delay: calc(var(--i) * -1.1s); }
  .dj.is-in[data-stage="4"] .dj-beams path { animation: dj-beam 1.2s linear infinite, dj-fade-in 1.2s var(--dj-ease) 0.6s backwards; }
  .dj:not(.is-in) .dj-svg * { animation-play-state: paused !important; }

  @keyframes dj-fade-in { from { opacity: 0; } }
  @keyframes dj-fade-out { from { opacity: 1; } }
  @keyframes dj-fade-out-full { from { opacity: 1; } to { opacity: 0; } }
  @keyframes dj-gate { from { opacity: 0; transform: scale(0.3); } }
  @keyframes dj-dash { to { stroke-dashoffset: -18; } }
  @keyframes dj-dash-slow { to { stroke-dashoffset: -30; } }
  @keyframes dj-beam { to { stroke-dashoffset: -18; } }
  @keyframes dj-jitter { 50% { transform: translateX(1.2px); } }
  @keyframes dj-beat-fast { 50% { transform: scale(1.22); } }
  @keyframes dj-beat { 0%, 100% { transform: scale(1); } 14% { transform: scale(1.14); } 28% { transform: scale(1); } }
  @keyframes dj-pulse { 0%, 100% { transform: scale(0.86); opacity: 0.7; } 50% { transform: scale(1.12); opacity: 1; } }
  @keyframes dj-breathe { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
  @keyframes dj-ebb { from { opacity: 1; } }
  @keyframes dj-adrenal { from { fill: #EF4444; } }
  @keyframes dj-gyrus { from { stroke: #4A3B2E; stroke-opacity: 0.8; } }
  @keyframes dj-lit { from { opacity: 0; } }
  @keyframes dj-amyg { from { fill: rgba(239, 68, 68, 0.85); stroke: #F87171; } }
  @keyframes dj-draw { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }
  @keyframes dj-spin { to { transform: rotate(360deg); } }
}
.dj-gate { transform-box: fill-box; transform-origin: 50% 50%; }
.dj-hot .dj-chain { transform-box: fill-box; }

@media print {
  .dj__pin { position: static; height: auto; }
  .dj__beat { min-height: 0; }
  .dj.is-live .dj__beat:not(.is-current) .dj__card { opacity: 1; }
}

/* Reduced motion: still frames. Stages swap with a short cross-fade only (no zoom, no sliding). */
@media (prefers-reduced-motion: reduce) {
  .dj-l { transition: opacity 300ms linear; }
  .dj-l, .dj[data-stage] .dj-l { transform: none; }
  .dj__tab, .dj__card, .dj__tick { transition-duration: 1ms; }
}
