/* /syllabus/ hub: the ten parts of the notes, the books, and the full theory and practical syllabus.
   Three night stages: .ci-lotus (ten petals, one per part), .ci-shelf (five prescribed books),
   .ci-path (theory and practical as paths of dots that light while you scroll).
   Motion uses transform and opacity only; nothing animates until JS adds .is-live, and
   reduced motion drops every animation (style.css already drops transitions). */
:root {
  --ci-yoga: #C9A95C;
  --ci-body: #7B8F6E;
  --ci-teach: #C4654A;
  --ci-well: #A97A9C;
}
html:not(.js) .ci-needs-js { display: none; }

/* ---------- the syllabus lotus ---------- */
.ci-lotus-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 20px 36px; align-items: center; margin-top: 6px; }
.ci-lotus-fig { min-width: 0; }
.stage .ci-lotus-svg { max-width: 520px; margin: 0 auto; overflow: visible; }
.ci-breath { transform-origin: 300px 300px; animation: ci-breathe 8s ease-in-out infinite paused; }
.ci-ring-a { transform-origin: 300px 300px; animation: ci-spin 180s linear infinite paused; }
.ci-ring-b { transform-origin: 300px 300px; animation: ci-spin 120s linear infinite reverse paused; }
.ci-bloom { animation: ci-open 8s ease-in-out infinite paused; }
.ci-lotus.is-live .ci-breath, .ci-lotus.is-live .ci-ring-a, .ci-lotus.is-live .ci-ring-b, .ci-lotus.is-live .ci-bloom { animation-play-state: running; }
@keyframes ci-breathe { 0%, 100% { transform: scale(.95); } 50% { transform: scale(1); } }
@keyframes ci-spin { to { transform: rotate(360deg); } }
@keyframes ci-open { 0%, 100% { transform: translateY(6px); } 50% { transform: translateY(-3px); } }

.ci-petal { cursor: pointer; outline: none; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.ci-p { opacity: .96; stroke: #FFF4D6; stroke-opacity: .55; stroke-width: .8; transition: opacity .5s, filter .5s; }
.ci-vein { fill: none; stroke: #6E5526; stroke-opacity: .4; stroke-width: 1; }
.ci-pn { font: 400 27px var(--serif); fill: #2A2346; fill-opacity: .72; text-anchor: middle; dominant-baseline: central; pointer-events: none; transition: fill-opacity .5s; }
.ci-lotus-svg.has-on .ci-petal:not(.on) .ci-p { opacity: .6; }
.ci-petal.on { transform: translateY(-10px); }
.ci-petal.on .ci-p, .ci-petal:hover .ci-p { opacity: 1; filter: brightness(1.12) drop-shadow(0 0 10px rgba(255, 236, 180, .85)); }
.ci-petal.on .ci-pn { fill-opacity: 1; }
.ci-petal:focus-visible .ci-p { stroke: #fff; stroke-opacity: 1; stroke-width: 2.5; }

.ci-c-num { font: 400 66px var(--serif); fill: var(--glow); text-anchor: middle; }
.ci-c-name { font: italic 500 25px var(--serif-it); fill: #fff; text-anchor: middle; letter-spacing: .02em; }
.ci-in { animation: ci-in .5s ease both; }
@keyframes ci-in { from { opacity: 0; transform: translateY(6px); } }

.stage .ci-legend { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: .8rem; }
.stage .ci-legend li { display: flex; align-items: center; gap: 8px; margin: 0; color: rgba(255, 255, 255, .72); }
.ci-sw { flex: none; width: 11px; height: 11px; border-radius: 50% 0; transform: rotate(45deg); background: linear-gradient(135deg, #FFF6DC, var(--ci-yoga)); }
.ci-sw[data-part="body"] { background: linear-gradient(135deg, #F1F5E8, #93A882); }
.ci-sw[data-part="teach"] { background: linear-gradient(135deg, #FCE6DA, #CC7E60); }
.ci-sw[data-part="well"] { background: linear-gradient(135deg, #F8E6EE, #B58AA9); }

.ci-panel { padding: 22px 22px 22px; border-radius: 20px; border: 1px solid rgba(243, 223, 168, .22); background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); }
.stage .ci-p-k { margin: 0 0 .5em; font: 600 .75rem/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--glow); }
.subject .ci-p-t { margin: 0 0 .7em; font: 400 1.5rem/1.2 var(--serif); letter-spacing: 0; text-transform: none; color: #fff; }
.stage .ci-p-list { list-style: none; padding: 0; margin: 0 0 1.2em; display: grid; gap: 6px; }
.stage .ci-p-list li { position: relative; margin: 0; padding-left: 18px; font-size: .95rem; line-height: 1.5; }
.ci-p-list li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 8px var(--glow); }
.stage .ci-p-open { display: inline-block; padding: .75em 1.25em; border-radius: 999px; background: var(--glow); color: var(--night); font: 600 .88rem/1 var(--sans); text-decoration: none; }
.stage .ci-p-open:hover { background: #fff; }

/* ---------- unit cards ---------- */
.subject .ci-cards { list-style: none; padding: 0; margin: 2em 0 1.8em; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ci-card { --part: var(--ci-yoga); position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 14px; align-content: start; padding: 18px 20px 20px; background: #fff; border: 1px solid var(--border); border-top: 3px solid var(--part); border-radius: 18px; transition: transform .3s, box-shadow .3s, border-color .3s; }
.subject .ci-card { margin: 0; }
.ci-card[data-part="body"] { --part: var(--ci-body); }
.ci-card[data-part="teach"] { --part: var(--ci-teach); }
.ci-card[data-part="well"] { --part: var(--ci-well); }
.ci-card img { grid-row: 1 / span 2; align-self: center; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.ci-card-k { margin: 0; align-self: end; font: 600 .72rem/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--sage-dk); }
.subject .ci-card h3 { margin: .2em 0 0; font-size: 1.15rem; line-height: 1.25; }
.ci-card h3 a { color: var(--char); text-decoration: none; outline: none; }
.ci-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 18px; }
.ci-sum, .ci-topics { grid-column: 1 / -1; }
.ci-sum { margin: .9em 0 .5em; font-size: .93rem; line-height: 1.55; }
.subject .ci-topics { list-style: none; padding: 0; margin: 0; display: grid; gap: 3px; font-size: .85rem; line-height: 1.45; color: var(--muted); }
.subject .ci-topics li { position: relative; margin: 0; padding-left: 14px; }
.ci-topics li::before { content: ""; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: var(--part); }
.ci-card:hover, .ci-card:focus-within { transform: translateY(-3px); border-color: var(--part); box-shadow: 0 24px 40px -30px rgba(45, 41, 38, .45); }
.ci-card:hover h3 a, .ci-card:focus-within h3 a { color: var(--terra-dk); }
.ci-card:focus-within { outline: 2px solid var(--terra-dk); outline-offset: 2px; }

/* ---------- the book shelf ---------- */
.ci-shelf-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 28px 32px; align-items: end; margin-top: 4px; }
.ci-shelf { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 5px; padding: 36px 6px 0; margin-bottom: 18px; }
.ci-shelf::before { content: ""; position: absolute; left: 6%; right: 6%; bottom: 0; height: 75%; background: radial-gradient(50% 65% at 50% 100%, rgba(243, 223, 168, .2), transparent 72%); pointer-events: none; }
.ci-shelf::after { content: ""; position: absolute; left: 0; right: 0; bottom: -14px; height: 14px; border-radius: 3px; background: linear-gradient(180deg, #7A5636 0%, #5A3D25 45%, #3B2818 100%); box-shadow: 0 16px 24px -12px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 230, 190, .35); }
.stage .ci-book {
  --c1: #4E2320; --c2: #7E3A2D; --ink: #F3DFA8;
  --bg: linear-gradient(90deg, var(--c1) 0%, var(--c2) 38%, var(--c2) 62%, var(--c1) 100%);
  position: relative; z-index: 1; flex: 0 1 auto; min-width: 38px; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  width: var(--w, 54px); height: var(--h, 230px); padding: 22px 0 18px; border: 0; border-radius: 5px 5px 2px 2px;
  background: var(--bg); color: var(--ink); font: inherit; cursor: pointer; transform-origin: 50% 100%;
  box-shadow: inset 2px 0 0 rgba(255, 255, 255, .12), inset -3px 0 6px rgba(0, 0, 0, .35), 0 10px 18px -10px rgba(0, 0, 0, .8);
  transition: transform .7s cubic-bezier(.2, .75, .2, 1), box-shadow .7s, filter .7s;
}
.stage .ci-book:hover, .stage .ci-book[aria-pressed="true"] { background: var(--bg); color: var(--ink); }
.stage .ci-book:hover { transform: translateY(-8px); }
.stage .ci-book[aria-pressed="true"] { transform: translateY(-28px) rotate(-2deg); filter: brightness(1.12); box-shadow: inset 2px 0 0 rgba(255, 255, 255, .18), inset -3px 0 6px rgba(0, 0, 0, .3), 0 0 28px rgba(243, 223, 168, .45), 0 24px 26px -14px rgba(0, 0, 0, .9); }
.ci-book::before, .ci-book::after { content: ""; position: absolute; left: 6px; right: 6px; height: 4px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); opacity: .55; }
.ci-book::before { top: 10px; }
.ci-book::after { bottom: 8px; }
.ci-spine-t { writing-mode: vertical-rl; white-space: nowrap; font: italic 500 1.08rem/1 var(--serif-it); letter-spacing: .04em; }
.ci-spine-a { writing-mode: vertical-rl; white-space: nowrap; font: 600 .75rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; opacity: .82; }
.ci-book[data-book="loy"] { --w: 58px; --h: 244px; }
.ci-book[data-book="sad"] { --w: 50px; --h: 236px; --c1: #263C2E; --c2: #42654D; }
.ci-book[data-book="ys"] { --w: 46px; --h: 214px; --c1: #1C2150; --c2: #2F3A78; }
.ci-book[data-book="hyp"] { --w: 56px; --h: 276px; --c1: #7E3410; --c2: #B85A1C; --ink: #FFF1D6; }
.ci-book[data-book="apmb"] { --w: 64px; --h: 262px; --c1: #8E7748; --c2: #CDB57E; --ink: #3B2A14; }

.ci-shelf-info { min-height: 220px; padding: 20px 22px; border-radius: 18px; border: 1px solid rgba(243, 223, 168, .22); background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); }
.stage .ci-si-k { margin: 0 0 .5em; font: 600 .75rem/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--glow); }
.subject .ci-si-t { margin: 0 0 .15em; font: 400 1.45rem/1.2 var(--serif); letter-spacing: 0; text-transform: none; color: #fff; }
.stage .ci-si-by { margin: 0 0 .7em; font: italic 500 1.1rem/1.3 var(--serif-it); color: var(--glow); }
.stage .ci-si-use { margin: 0; font-size: .95rem; line-height: 1.6; }
.stage .ci-si-for { margin: .8em 0 0; font-size: .88rem; color: rgba(255, 255, 255, .72); }

/* the five books as cards under the shelf */
.subject .ci-books { list-style: none; padding: 0; margin: 1.8em 0 1.6em; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.subject .ci-books > li { margin: 0; }
.ci-books #book-classic { grid-column: 1 / -1; }
.ci-bk-by { margin: -.25em 0 .6em; font: italic 500 1.08rem/1.3 var(--serif-it); color: var(--muted); }
.ci-bk-use { font-size: .93rem; }
.subject ul.ci-bk-use { padding-left: 1.1em; }
.ci-bk-for { font-size: .85rem; color: var(--muted); }
.ci-books .card.is-on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(197, 165, 90, .18); }

/* ---------- theory and practical paths ---------- */
.stage .ci-path { --p: 0; position: relative; list-style: none; margin: 22px 0 0; padding: 0 0 0 32px; }
.ci-path::before, .ci-path::after { content: ""; position: absolute; left: 9px; top: 8px; width: 2px; border-radius: 2px; }
.ci-path::before { bottom: 8px; background: rgba(243, 223, 168, .14); }
.ci-path::after { height: calc(var(--p) * (100% - 16px)); background: linear-gradient(180deg, var(--glow), var(--gold) 55%, #E59C76); box-shadow: 0 0 12px rgba(243, 223, 168, .7); }
.stage .ci-path li { position: relative; z-index: 1; margin: 0; }
.stage .ci-step { padding: 7px 0; font-size: .95rem; line-height: 1.5; }
.ci-dot { position: absolute; left: -28px; top: 13px; width: 12px; height: 12px; border-radius: 50%; background: var(--night); border: 2px solid rgba(243, 223, 168, .4); transition: background .45s, border-color .45s, box-shadow .45s, transform .45s; }
.ci-step.on .ci-dot { background: var(--glow); border-color: var(--glow); box-shadow: 0 0 0 5px rgba(243, 223, 168, .13), 0 0 14px rgba(243, 223, 168, .85); transform: scale(1.15); }
.ci-code { display: inline-block; min-width: 2.6em; margin-right: .3em; font: 600 .78rem/1 var(--sans); letter-spacing: .04em; color: var(--glow); }
.stage .ci-path a { color: #fff; text-decoration: underline; text-decoration-color: rgba(243, 223, 168, .35); text-underline-offset: 3px; }
.stage .ci-path a:hover { color: var(--glow); text-decoration-color: var(--glow); }
.ci-where { margin-left: .3em; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .62); white-space: nowrap; }
.stage .ci-path .ci-grp { margin: 20px 0 6px -32px; }
.stage .ci-path .ci-grp:first-child { margin-top: 0; }
.subject .ci-grp h4 { display: inline-block; margin: 0; padding: 7px 14px; border-radius: 999px; background: var(--night-2); border: 1px solid rgba(243, 223, 168, .3); font: 600 .72rem/1.35 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--glow); }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .ci-lotus-grid, .ci-shelf-grid { grid-template-columns: 1fr; }
  .stage .ci-lotus-svg { max-width: 420px; }
  .ci-panel, .ci-shelf-info { padding: 18px; }
  .ci-shelf-info { min-height: 0; }
  .subject .ci-p-t { font-size: 1.3rem; }
  .stage .ci-step { font-size: .92rem; }
  .ci-books #book-classic { grid-column: auto; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .ci-breath, .ci-ring-a, .ci-ring-b, .ci-bloom, .ci-in { animation: none !important; }
  .ci-card:hover, .ci-card:focus-within, .stage .ci-book:not([aria-pressed="true"]):hover { transform: none; }
}
