/* /syllabus/meditation.html: the four meditation animations (yoga nidrā rotation, Om in the body,
   ajapā so'ham, the cakra column). The night stage, buttons and captions come from course.css.
   The figures are <use> copies of shapes kept once in the hidden .md-sprite. */

/* ---------- shared figure language: a gold outline around a night-blue body ---------- */
.md-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.md-out { fill: var(--glow); stroke: var(--glow); stroke-width: 2.6; stroke-linejoin: round; opacity: .75; transition: opacity 1.6s ease, stroke-width 1.6s ease; }
.md-in { fill: #1F2348; stroke: none; }
.md-faint { opacity: .4; }
.hit { fill: transparent; stroke: none; }
.md-card-img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 12px; margin: 0 0 12px; }
.stage h3 { margin-top: 0; }
.stage .stage-cap { min-height: 3em; }
.stage label { display: inline-flex; flex-wrap: wrap; justify-content: center; max-width: 100%; align-items: center; gap: 8px; font: 600 .8rem/1.2 var(--sans); color: rgba(255, 255, 255, .8); }
.stage select { padding: .6em .9em; max-width: 100%; }
.verse i.iast { font-size: 1.12rem; }
.verse .deva, .verse .iast { overflow-wrap: anywhere; }
.md-ck-table td small { color: var(--muted); }
html:not(.js) .stage-controls, html:not(.js) .ck-chips, html:not(.js) .nd-halo { display: none; }

/* SVG parts that act as buttons */
[role="button"].ck-lotus, [role="button"].au-zone { cursor: pointer; outline: none; }
.ck-lotus:focus-visible .hit, .au-zone:focus-visible .hit { stroke: #fff; stroke-width: 1.5; stroke-dasharray: 3 3; }

/* ---------- 1 · yoga nidrā ---------- */
.stage .nd-steps { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0; margin: 4px auto 14px; max-width: 860px; }
.stage .nd-steps li { margin: 0; }
.stage .nd-steps button { font: 600 .74rem/1.2 var(--sans); padding: .5em .85em; }
.stage .nd-steps button.done { border-color: rgba(243, 223, 168, .55); color: var(--glow); }
.stage .nd-steps button.done:hover { color: var(--night); }
.stage .nd-steps button[aria-current="step"] { background: var(--glow); border-color: var(--glow); color: var(--night); }
html:not(.js) .nd-steps button { pointer-events: none; }
.nd-svg { max-width: 920px; margin: 0 auto; overflow: visible; }
.nd-sense { fill: none; stroke: var(--glow); stroke-width: 1.2; stroke-dasharray: 2 7; opacity: 0; transform: scale(1.12); transition: transform 3s ease, opacity 2s ease; }
.nd-svg[data-sense="0"] .nd-sense { opacity: .4; transform: scale(1.08); }
.nd-svg[data-sense="1"] .nd-sense { opacity: .45; transform: scale(1); }
.nd-svg[data-sense="2"] .nd-sense { opacity: .25; transform: scale(.93); }
.nd-svg[data-sense="0"] .md-out, .nd-svg[data-sense="1"] .md-out { opacity: .4; }
.nd-svg[data-sense="2"] .md-out { opacity: .95; }
.nd-tint { fill: transparent; opacity: 0; pointer-events: none; transition: opacity 1.6s ease, fill 1.6s ease; }
.nd-svg[data-feel="heavy"] .nd-tint { fill: #070A1E; opacity: .6; }
.nd-svg[data-feel="heavy"] .md-out { stroke-width: 4.5; }
.nd-svg[data-feel="light"] .nd-tint { fill: #FFF4D6; opacity: .22; }
.nd-svg[data-feel="light"] .md-out { stroke-width: 1.4; opacity: .55; }
.nd-svg[data-feel="cold"] .nd-tint { fill: #8DB6E6; opacity: .3; }
.nd-svg[data-feel="warm"] .nd-tint { fill: #E8A15A; opacity: .32; }
.nd-hls use { fill: var(--glow); opacity: 0; transition: opacity .8s ease; }
.nd-hls use.on { opacity: .26; }
.nd-pt { fill: rgba(243, 223, 168, .3); transition: fill .6s, stroke .6s; }
.nd-pt.was { fill: rgba(243, 223, 168, .82); }
.nd-pt.on { fill: #fff; }
.nd-pt.nd-b { fill: none; stroke: rgba(243, 223, 168, .5); stroke-width: 1.1; stroke-dasharray: 2 2.4; }
.nd-pt.nd-b.was { stroke: rgba(243, 223, 168, .9); }
.nd-pt.nd-b.on { stroke: #fff; stroke-width: 1.8; }
.nd-spine { stroke-dasharray: 3 5; }
.nd-halo { opacity: 0; pointer-events: none; transition: transform .7s cubic-bezier(.4, 0, .2, 1), opacity .5s ease; }
.nd-halo.on { opacity: 1; }
.nd-halo-in { transition: transform 1s ease; }
.nd-halo.vis .nd-halo-in { transform: scale(2); }
.nd-halo-glow { transform-origin: 0 0; animation: nd-pulse 1.8s ease-in-out infinite; }
@keyframes nd-pulse { 50% { transform: scale(1.3); opacity: .7; } }
.nd-halo-core { fill: #fff; }
.nd-seed { opacity: 0; transform: scale(.4); transition: transform 1s ease, opacity 1s ease; }
.nd-seed-core { fill: #fff; }
.nd-svg[data-seed="keep"] .nd-seed { opacity: .35; transform: scale(.6); }
.nd-svg[data-seed="1"] .nd-seed { opacity: .65; transform: scale(.6); }
.nd-svg[data-seed="2"] .nd-seed { opacity: .8; transform: scale(.8); }
.nd-svg[data-seed="3"] .nd-seed { opacity: .95; transform: scale(1); }
.nd-svg[data-seed="4"] .nd-seed { opacity: .9; transform: scale(1.1); }
.nd-svg[data-seed="5"] .nd-seed { opacity: 1; transform: scale(1.25); }
.nd-svg[data-seed="6"] .nd-seed { opacity: 1; transform: scale(1.45); }
.nd-breath { opacity: 0; transform: scale(.7); transition: transform 2.4s ease-in-out, opacity 1s ease; }
.nd-svg[data-breath="in"] .nd-breath { opacity: .95; transform: scale(1.25); }
.nd-svg[data-breath="out"] .nd-breath { opacity: .5; transform: scale(.75); }
.nd-now { text-align: center; margin: 12px 0 0; min-height: 3.2em; }
.nd-group { display: block; font: 600 .72rem/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.nd-word { display: block; font: italic 500 1.5rem/1.3 var(--serif-it); color: var(--glow); }
.stage .nd-legend { text-align: center; font-size: .78rem; color: rgba(255, 255, 255, .58); margin: 6px 0 0; }
.nd-key { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; margin: 0 3px 0 8px; }
.nd-key-f { background: var(--glow); }
.nd-key-b { border: 1.5px dashed var(--glow); }

/* ---------- 2 · Om in the body ---------- */
.au-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 16px 36px; align-items: center; max-width: 820px; margin: 0 auto; }
.au-svg { max-width: 340px; margin: 0 auto; overflow: visible; }
.au-aura { opacity: 0; transition: opacity 1.4s ease; }
.au-fill { fill: var(--glow); opacity: 0; transition: opacity 1.4s ease; }
.au-stage[data-ph="3"] .au-aura { opacity: .3; }
.au-stage[data-ph="3"] .au-fill { opacity: .16; }
.au-stage[data-ph="3"] .md-out { opacity: 1; }
.au-rip { fill: none; stroke: var(--glow); stroke-width: 1.3; opacity: 0; }
.au-stage:not(.is-live) .au-rip:nth-child(1) { opacity: .45; }
.au-stage:not(.is-live) .au-rip:nth-child(2) { opacity: .25; }
.au-stage:not(.is-live) .au-rip:nth-child(3) { opacity: .12; }
.au-stage:not(.is-live) .au-zone.on .au-rip:nth-child(1) { opacity: .9; }
.au-stage:not(.is-live) .au-zone.on .au-rip:nth-child(2) { opacity: .6; }
.au-stage:not(.is-live) .au-zone.on .au-rip:nth-child(3) { opacity: .35; }
.au-dot { fill: var(--glow); opacity: .55; transition: opacity .5s; }
.au-zone.on .au-dot { fill: #fff; opacity: 1; }
.au-letter { font: italic 500 28px var(--serif-it); fill: rgba(243, 223, 168, .5); transition: fill .5s; }
.au-letter.on { fill: #fff; }
.stage .au-legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.stage .au-legend li { margin: 0; }
.stage .au-legend button { width: 100%; display: grid; grid-template-columns: 2.2em minmax(0, 1fr); gap: 2px 10px; align-items: center; text-align: left; border-radius: 14px; padding: .65em .9em; font: 500 .88rem/1.3 var(--sans); }
.au-legend b { grid-row: span 2; font: italic 500 1.9rem/1 var(--serif-it); color: var(--glow); text-align: center; }
.au-legend span { color: #fff; }
.au-legend small { color: rgba(255, 255, 255, .62); font-size: .78rem; }
.stage .au-legend button:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.stage .au-legend button[aria-pressed="true"] { background: rgba(243, 223, 168, .14); border-color: var(--glow); color: #fff; }
.au-wave { max-width: 760px; margin: 18px auto 0; overflow: visible; }
.au-base { stroke: rgba(255, 255, 255, .15); stroke-width: 1; }
.au-line { fill: none; stroke: var(--glow); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.au-stage[data-ph="3"] .au-line { filter: drop-shadow(0 0 4px rgba(243, 223, 168, .8)); }
.stage .au-wave-key { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 760px; margin: 4px auto 0; text-align: center; font: 600 .7rem/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.au-stage.is-live .au-wave-key { visibility: hidden; }

/* ---------- 3 · ajapā: so'ham ---------- */
.aj-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 250px); gap: 12px 28px; align-items: center; max-width: 640px; margin: 0 auto; }
.aj-svg { max-width: 320px; margin: 0 auto; overflow: visible; }
.aj-path { fill: none; stroke: var(--glow); stroke-width: 1.6; stroke-dasharray: 1 6; stroke-linecap: round; opacity: .85; }
.aj-end { fill: var(--glow); }
.aj-lead { fill: none; stroke: rgba(255, 255, 255, .3); stroke-width: 1; stroke-dasharray: 2 3; }
.aj-lab { font: 500 12.5px var(--sans); fill: rgba(255, 255, 255, .7); letter-spacing: .04em; }
.aj-arrow { fill: none; stroke: var(--glow); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.aj-word { font: italic 500 21px var(--serif-it); fill: var(--glow); }
.aj-live { display: none; }
.aj-stage.is-live .aj-live { display: inline; }
.aj-stage.is-live .aj-static { display: none; }
.aj-core { fill: #fff; }
.stage .aj-phase { font: italic 500 1.3rem/1.3 var(--serif-it); color: var(--glow); margin: 0 0 .7em; }
.stage .aj-count { font-size: .9rem; margin: 0 0 .7em; }
.aj-count b { font: 400 2.2rem/1 var(--serif); color: #fff; margin-right: .15em; }
.stage .aj-day { font-size: .82rem; color: rgba(255, 255, 255, .62); margin: 0; }

/* ---------- 4 · the cakra column ---------- */
.ck-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 330px); gap: 16px 36px; align-items: center; max-width: 840px; margin: 0 auto; }
.ck-svg { max-width: 380px; margin: 0 auto; overflow: visible; }
.ck-spine { fill: none; stroke: var(--glow); stroke-width: 1; stroke-dasharray: 2 5; opacity: .45; }
.ck-rise { fill: none; stroke: var(--glow); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; opacity: .85; transition: stroke-dashoffset 2s ease; }
.ck-bloom { transition: transform .8s cubic-bezier(.3, 1.4, .5, 1); }
.ck-lotus.on .ck-bloom { transform: scale(1.4); }
.ck-bloom path { fill: var(--c); fill-opacity: .3; stroke: var(--c); stroke-width: .7; transition: fill-opacity .6s; }
.ck-lotus.on .ck-bloom path, .ck-lotus:hover .ck-bloom path { fill-opacity: .72; }
.ck-core { fill: var(--night); stroke: var(--c); stroke-width: 1; transition: fill .6s; }
.ck-lotus.on .ck-core { fill: var(--c); }
.ck-glow { opacity: .22; transition: opacity .6s; }
.ck-lotus.lit .ck-glow { opacity: .55; }
.ck-lotus.on .ck-glow { opacity: 1; animation: ck-pulse 3.2s ease-in-out infinite; }
@keyframes ck-pulse { 50% { opacity: .55; } }
.ck-panel { min-height: 16em; }
.stage .ck-num { font: 600 .72rem/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .6); margin: 0 0 .4em; }
.stage .ck-name { font: 400 1.7rem/1.15 var(--serif); color: #fff; margin: 0 0 .15em; }
.ck-name .deva { display: block; font-size: 1.15rem; line-height: 1.5; color: var(--glow); }
.stage .ck-mean { font: italic 500 1.15rem/1.3 var(--serif-it); color: var(--glow); margin: 0 0 .8em; }
.ck-facts { margin: 0; display: grid; gap: 6px; }
.ck-facts div { display: grid; grid-template-columns: 5.4em minmax(0, 1fr); gap: 10px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .9rem; }
.ck-facts dt { font: 600 .72rem/1.6 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.ck-facts dd { margin: 0; color: #fff; }
.ck-sw { display: inline-block; width: .8em; height: .8em; border-radius: 50%; margin-right: .45em; vertical-align: -.05em; }
.stage .ck-chips { list-style: none; padding: 0; margin: 16px auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 760px; }
.stage .ck-chips li { margin: 0; }
.stage .ck-chips button { font: 600 .76rem/1.2 var(--sans); padding: .5em .85em; }

@media (max-width: 760px) {
  .au-grid, .aj-grid, .ck-grid { grid-template-columns: 1fr; gap: 12px; }
  .ck-panel { min-height: 0; }
  .aj-panel { text-align: center; }
  .nd-word { font-size: 1.25rem; }
  .stage .au-legend button { padding: .55em .8em; }
  /* the lying figure shrinks to about half size on a phone: thicker outline, bigger dots */
  .nd-svg .md-out { stroke-width: 4; }
  .nd-pt { r: 4px; }
  .nd-pt.nd-b { r: 5.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .nd-halo-glow, .ck-lotus.on .ck-glow { animation: none; }
}
