/* Clarity — design C "bold modern", in two themes.
   Light: soft grey-lilac page, white cards. Night: deep navy page, raised navy cards.
   One indigo accent in both. Every colour below is a token, so components never
   need theme-specific rules. No gradients. */

:root {
  --indigo: #5b5fef;
  --indigo-hover: #4a4ee0;
  --font: "Plus Jakarta Sans", "Segoe UI", Arial, sans-serif;
  --r-m: 16px;
  --r-l: 22px;
  --gutter: 16px;

  /* light theme (default) */
  color-scheme: light;
  --page: #f3f4fa;
  --card: #ffffff;
  --card-line: #e6e7f2;
  --raise: #e9eaf6;        /* blocks that sit on the page but aren't cards (rail, chips, figure) */
  --raise-2: #dcdef0;
  --field: #f4f5fb;
  --text: #151a2e;
  --text-2: #4b5070;
  --text-3: #767b98;
  --read: #2c3150;
  --line: #e4e5f2;
  --track: #e2e3f0;
  --accent-text: #3d3fb8;  /* indigo that is readable as text */
  --soft: #ecedfe;
  --soft-ink: #3d3fb8;
  --ok-soft: #e3f6ee;
  --ok-ink: #136b48;
  --warn-soft: #fff1dc;
  --warn-ink: #7a4800;
  --bad-soft: #fde8e6;
  --bad-ink: #8f2a25;
  --marker-bg: #151a2e;
  --marker-fg: #ffffff;
  --stage: #0e1222;        /* behind the video */
  --loop-stroke: #151a2e;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #11152a;
  --card: #1b2140;
  --card-line: rgba(255, 255, 255, 0.06);
  --raise: #1b2140;
  --raise-2: #283058;
  --field: #232a4d;
  --text: #ffffff;
  --text-2: #b9bedb;
  --text-3: #8b91b3;
  --read: #d6d9ee;
  --line: rgba(255, 255, 255, 0.1);
  --track: rgba(255, 255, 255, 0.12);
  --accent-text: #a9acff;
  --soft: rgba(91, 95, 239, 0.2);
  --soft-ink: #c3c5ff;
  --ok-soft: rgba(31, 157, 107, 0.2);
  --ok-ink: #7be3b6;
  --warn-soft: rgba(230, 150, 30, 0.18);
  --warn-ink: #ffcb7a;
  --bad-soft: rgba(220, 70, 60, 0.2);
  --bad-ink: #ffaaa3;
  --marker-bg: #ffffff;
  --marker-fg: #151a2e;
  --stage: #0a0d1c;
  --loop-stroke: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 400 1.0625rem/1.6 var(--font); transition: background .2s ease, color .2s ease; }
img, video { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--indigo); text-decoration-thickness: 2px; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--indigo); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-weight: 800; line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 .45em; color: var(--text); }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
.lede { font-size: 1.2rem; line-height: 1.55; color: var(--text-2); max-width: 46ch; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: .875rem; }
.dot { color: var(--indigo); }

.panel { background: var(--card); color: var(--text); border-radius: var(--r-l); padding: 28px; box-shadow: 0 0 0 1px var(--card-line); }

/* ---------- Shell ---------- */

.topbar__in { max-width: 1120px; margin: 0 auto; padding: 22px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.03em; text-decoration: none; color: var(--text); }
.wordmark:hover { color: var(--text); }
.nav { display: flex; align-items: center; gap: 6px; font-size: .95rem; }
.nav a, .linkbtn { color: var(--text-2); text-decoration: none; padding: 8px 14px; border-radius: 999px; background: none; border: 0; font: inherit; cursor: pointer; }
.nav a:hover, .linkbtn:hover { color: var(--text); background: var(--raise); }
.nav a[aria-current="page"] { color: var(--text); background: var(--raise); }
.nav form { margin: 0; }
.theme-toggle { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--raise); color: var(--text); display: grid; place-items: center; cursor: pointer; margin-left: 4px; }
.theme-toggle:hover { background: var(--raise-2); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle.spin svg { animation: toggle-spin .7s cubic-bezier(.65, 0, .25, 1); }
@keyframes toggle-spin { from { transform: rotate(-180deg) scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }

/* Theme switch: the new theme is revealed as a circle growing from the toggle (see layout.php). */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }
.theme-anim body { transition: none; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 28px var(--gutter) 88px; }
.wrap--narrow { max-width: 760px; }
.foot { border-top: 1px solid var(--line); color: var(--text-3); font-size: .85rem; }
.foot__in { max-width: 1120px; margin: 0 auto; padding: 22px var(--gutter); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Buttons & forms ---------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 26px; border-radius: 12px; border: 2px solid var(--indigo); background: var(--indigo); color: #fff; font: 700 1rem/1 var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--indigo-hover); border-color: var(--indigo-hover); color: #fff; }
.btn--quiet { background: transparent; color: var(--text); border-color: var(--line); }
.btn--quiet:hover { background: transparent; border-color: var(--indigo); color: var(--text); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn--block { width: 100%; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 28px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
.field .hint { font-size: .85rem; color: var(--text-3); margin: 6px 0 0; }
.input { width: 100%; min-height: 50px; padding: 12px 14px; border: 2px solid transparent; border-radius: 12px; background: var(--field); font: inherit; color: var(--text); }
.input:focus { outline: none; border-color: var(--indigo); }

.notice { border-radius: 12px; padding: 14px 18px; margin-bottom: 20px; background: var(--soft); color: var(--soft-ink); font-weight: 500; }
.notice--error { background: var(--bad-soft); color: var(--bad-ink); }
.notice--warn { background: var(--warn-soft); color: var(--warn-ink); }

.pill { display: inline-block; font-size: .8rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: var(--field); color: var(--text-2); white-space: nowrap; }
.pill--active { background: var(--soft); color: var(--soft-ink); }
.pill--passed { background: var(--ok-soft); color: var(--ok-ink); }

/* ---------- Landing ---------- */

.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 56px; align-items: center; padding: 36px 0 12px; }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.2rem); line-height: 1.02; letter-spacing: -0.04em; margin-bottom: 22px; }
.hero-note { color: var(--text-3); font-size: .9rem; margin-top: 16px; }
.loop-figure { margin: 0; background: var(--raise); border-radius: var(--r-l); padding: 28px; }
.loop-figure svg { width: 100%; height: auto; }
.loop-figure .loop { stroke: var(--loop-stroke); }
.loop-figure .lbl1 { fill: var(--text-3); }
.loop-figure .lbl2 { fill: var(--text-2); }
.loop-figure figcaption { color: var(--text-2); font-size: .9rem; margin-top: 14px; }

.section-h { margin: 88px 0 22px; font-size: 1.9rem; }
.steps3 { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps3 .panel { padding: 24px; }
.bignum { display: block; font-size: 2.6rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; color: var(--indigo); margin-bottom: 18px; }
.steps3 b { display: block; font-size: 1.15rem; margin-bottom: 6px; }
.steps3 p { color: var(--text-2); margin: 0; }
.inside { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.inside > div { background: var(--raise); border-radius: var(--r-m); padding: 22px; }
.inside b { display: block; margin-bottom: 6px; }
.inside p { color: var(--text-2); margin: 0; font-size: .95rem; }

/* ---------- Entry test ---------- */

.test-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 12px; }
.test-head h1 { font-size: 1.15rem; margin: 0; letter-spacing: 0; }
.meter { height: 6px; background: var(--track); border-radius: 3px; overflow: hidden; margin-bottom: 24px; }
.meter > span { display: block; height: 100%; background: var(--indigo); width: 0; transition: width .25s ease; }
.q { border: 0; padding: 0; margin: 0; }
.q + .q { margin-top: 36px; }
.q legend { font-size: clamp(1.3rem, 2.6vw, 1.7rem); line-height: 1.3; font-weight: 800; letter-spacing: -0.02em; padding: 0; margin-bottom: 24px; }
.qnum { display: block; font-size: .85rem; font-weight: 700; color: var(--accent-text); letter-spacing: 0; margin-bottom: 8px; }
.choices { display: grid; gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 18px; background: var(--field); border: 2px solid transparent; border-radius: 12px; cursor: pointer; font-weight: 600; }
.choice span::before { content: ""; width: 20px; height: 20px; border: 2px solid var(--text-3); border-radius: 50%; flex: none; }
.choice:hover span { border-color: var(--line); }
.choice input:checked + span { border-color: var(--indigo); background: var(--soft); color: var(--soft-ink); }
.choice input:checked + span::before { border-color: var(--indigo); background: var(--indigo); box-shadow: inset 0 0 0 4px var(--card); }
.choice input:focus-visible + span { outline: 3px solid var(--indigo); outline-offset: 2px; }
.test-nav { display: flex; justify-content: space-between; margin-top: 28px; gap: 12px; }

/* ---------- Scale track ---------- */

.scale { margin: 26px 0 6px; }
.scale__bar { display: flex; gap: 4px; height: 12px; }
.scale__seg { flex: 1; background: var(--track); border-radius: 6px; }
.scale__seg.is-here { background: var(--indigo); }
.scale__marker { position: relative; height: 44px; }
.scale__marker span { position: absolute; top: 9px; transform: translateX(-50%); white-space: nowrap; font-weight: 800; font-size: .8rem; background: var(--marker-bg); color: var(--marker-fg); padding: 3px 10px; border-radius: 999px; }
.scale__labels { display: flex; gap: 4px; }
.scale__labels span { flex: 1; font-size: .82rem; color: var(--text-3); }
.scale__labels span.is-here { color: var(--text); font-weight: 700; }

/* ---------- Unlock / result ---------- */

.split { display: grid; grid-template-columns: 1fr 400px; gap: 40px; align-items: start; }
.price { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.04em; margin: 6px 0 0; line-height: 1.1; }
.ticks { list-style: none; padding: 0; margin: 14px 0 0; }
.ticks li { padding-left: 32px; position: relative; margin-bottom: 10px; color: var(--text-2); }
.ticks li::before { content: ""; position: absolute; left: 0; top: .2em; width: 20px; height: 20px; border-radius: 50%; background: var(--indigo); }
.ticks li::after { content: ""; position: absolute; left: 6px; top: calc(.2em + 6px); width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.dots { padding-left: 1.2em; margin: 12px 0 0; color: var(--text-2); }
.dots li { margin-bottom: 10px; padding-left: 4px; }
.dots li::marker { color: var(--indigo); }
.locked-result { background: var(--raise); border-radius: var(--r-l); padding: 26px; margin-top: 28px; position: relative; }
.locked-result .bar { height: 12px; border-radius: 6px; background: var(--track); margin-bottom: 10px; }
.locked-result .bar:nth-child(2) { width: 78%; }
.locked-result .bar:nth-child(3) { width: 56%; }
.lock-badge { position: absolute; top: 20px; right: 20px; }
.band-name { font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1; letter-spacing: -0.045em; margin: 0 0 14px; }
.auth-tabs { display: flex; gap: 6px; background: var(--raise); padding: 6px; border-radius: 14px; margin-bottom: 20px; }
.auth-tabs a { flex: 1; text-align: center; padding: 10px; text-decoration: none; color: var(--text-2); border-radius: 10px; font-weight: 600; }
.auth-tabs a[aria-current="page"] { background: var(--card); color: var(--text); }

/* ---------- Dashboard ---------- */

.dash-hero { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: end; margin-bottom: 40px; }
.dash-hero h1 { font-size: clamp(2.2rem, 4.8vw, 3.6rem); line-height: 1.02; letter-spacing: -0.04em; margin: 0; }
.dash-hero .hello { color: var(--text-2); margin-bottom: 10px; font-weight: 600; }
.result-chip { background: var(--raise); border-radius: var(--r-m); padding: 18px 20px; }
.result-chip b { display: block; font-size: 1.25rem; margin: 2px 0 6px; }
.course-h { margin-top: 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.course-h h2 { font-size: 1.25rem; margin: 0; max-width: 40ch; }
.mods { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mods > li { display: flex; }
.mod { display: flex; flex-direction: column; width: 100%; }
.mod__top { display: flex; justify-content: space-between; align-items: flex-start; }
.mod .bignum { margin-bottom: 14px; }
.mod h3 { font-size: 1.2rem; margin-bottom: 4px; }
.mod__meta { color: var(--text-3); font-size: .9rem; margin: 0 0 16px; }
.mod__foot { margin-top: auto; }
.segs { display: flex; gap: 4px; margin-bottom: 16px; }
.segs i { flex: 1; height: 6px; border-radius: 3px; background: var(--track); }
.segs i.on { background: var(--indigo); }
.mod--locked { background: var(--raise); box-shadow: none; }
.mod--locked .bignum, .mod--soon .bignum { color: var(--text-3); }
.mod--soon { background: transparent; box-shadow: none; border: 2px dashed var(--line); }

/* ---------- Module ---------- */

.crumb { font-size: .9rem; color: var(--text-3); margin-bottom: 10px; }
.crumb a { color: var(--text-2); }
.module-h { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 32px; }
.module-h .bignum { font-size: 4rem; margin: 0; }
.module-h h1 { margin: 0; font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.05; }
.module { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 32px; align-items: start; }
.rail { position: sticky; top: 24px; background: var(--raise); border-radius: var(--r-l); padding: 22px; }
.rail h2 { font-size: .85rem; letter-spacing: 0; color: var(--text-3); font-weight: 700; margin-bottom: 12px; }
.rail ol { list-style: none; padding: 0; margin: 0; }
.rail li { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.rail .node { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: .8rem; font-weight: 800; background: var(--raise-2); color: var(--text-3); }
.rail li.done .node { background: var(--indigo); color: #fff; }
.rail li.current .node { background: var(--text); color: var(--page); }
.rail a, .rail .lbl { text-decoration: none; color: var(--text-2); font-weight: 600; }
.rail li.current a { color: var(--text); }
.rail li.todo .lbl { color: var(--text-3); font-weight: 500; }

.stepcard { padding: clamp(22px, 4vw, 44px); }
.step-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 14px; }
.reading { max-width: 66ch; }
.reading p { font-size: 1.1rem; line-height: 1.8; color: var(--read); }
.reading h3 { margin-top: 1.8em; font-size: 1.25rem; }
.parts { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; counter-reset: part; }
.parts li { counter-increment: part; background: var(--field); border-radius: 14px; padding: 18px; }
.parts li::before { content: "0" counter(part); display: block; font-weight: 800; font-size: 1.4rem; color: var(--indigo); margin-bottom: 6px; letter-spacing: -0.03em; }
.parts strong { display: block; }
.parts span { color: var(--text-2); font-size: .95rem; }

/* Self-reflection: each statement is a card; answers carry a small strength meter (Never → Almost always). */
.reflect__progress { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 14px; padding: 12px 0; margin-bottom: 6px; background: var(--card); }
.reflect__count { font-size: .9rem; color: var(--text-2); white-space: nowrap; }
.reflect__count b { color: var(--text); }
.reflect__bar { flex: 1; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.reflect__bar i { display: block; height: 100%; width: 0; background: var(--indigo); border-radius: 3px; transition: width .3s ease; }

.likert { border: 2px solid transparent; margin: 0 0 12px; padding: 18px; background: var(--field); border-radius: 18px; transition: border-color .2s ease, background .2s ease; }
.likert.is-answered { border-color: var(--indigo); background: var(--card); }
.likert legend { display: flex; align-items: flex-start; gap: 14px; width: 100%; padding: 0; margin-bottom: 14px; float: left; }
.likert legend + * { clear: both; }
.likert__n { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--soft-ink); font-weight: 800; font-size: .95rem; letter-spacing: -0.02em; }
.likert.is-answered .likert__n { background: var(--indigo); color: #fff; }
.likert__q { flex: 1; font-weight: 700; font-size: 1.05rem; line-height: 1.45; padding-top: 8px; }
.likert__tick { flex: none; width: 24px; height: 24px; margin-top: 8px; border-radius: 50%; border: 2px solid var(--line); position: relative; }
.likert.is-answered .likert__tick { background: var(--indigo); border-color: var(--indigo); }
.likert.is-answered .likert__tick::after { content: ""; position: absolute; left: 6px; top: 5px; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }

.likert__opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding-left: 54px; }
.likert__opt { position: relative; }
.likert__opt input { position: absolute; opacity: 0; inset: 0; }
.likert__face { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px 10px; border-radius: 12px; background: var(--card); border: 2px solid var(--line); cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.likert.is-answered .likert__face { background: var(--field); }
.likert__opt:hover .likert__face { border-color: var(--indigo); }
.likert__meter { display: flex; gap: 3px; align-items: flex-end; height: 14px; }
.likert__meter i { width: 6px; border-radius: 2px; background: var(--track); }
.likert__meter i:nth-child(1) { height: 6px; }
.likert__meter i:nth-child(2) { height: 10px; }
.likert__meter i:nth-child(3) { height: 14px; }
.likert__meter i.on { background: var(--indigo); }
.likert__lab { font-size: .88rem; font-weight: 600; text-align: center; line-height: 1.25; }
.likert__opt input:checked + .likert__face { background: var(--indigo); border-color: var(--indigo); color: #fff; transform: translateY(-1px); }
.likert__opt input:checked + .likert__face .likert__meter i { background: rgba(255, 255, 255, .35); }
.likert__opt input:checked + .likert__face .likert__meter i.on { background: #fff; }
.likert__opt input:focus-visible + .likert__face { outline: 3px solid var(--indigo); outline-offset: 2px; }

.result-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.score-big { font-size: clamp(2.4rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; }

.case-note { background: var(--soft); color: var(--soft-ink); border-radius: 14px; padding: 16px 18px; font-weight: 500; margin-bottom: 8px; }

.mcq { border: 0; margin: 0; padding: 22px 0; border-top: 1px solid var(--line); }
.mcq legend { font-weight: 700; padding: 0; margin-bottom: 12px; float: left; width: 100%; }
.mcq legend + * { clear: both; }
.mcq .qn { color: var(--accent-text); margin-right: 8px; }
.mcq label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; cursor: pointer; margin-bottom: 4px; }
.mcq label:hover { background: var(--field); }
.mcq input { margin-top: 4px; accent-color: var(--indigo); width: 18px; height: 18px; flex: none; }
.mcq .right { background: var(--ok-soft); }
.mcq .wrong { background: var(--bad-soft); }

/* ---------- Video player ---------- */

.lesson { display: grid; gap: 28px; margin-top: 8px; }
.lesson--portrait { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: start; }
.lesson--portrait .tools { grid-template-columns: 1fr; margin-top: 0; }

.player { position: relative; background: var(--stage); border-radius: 20px; overflow: hidden; color: #fff; user-select: none; }
.lesson--landscape .player { aspect-ratio: 16 / 9; }
.lesson--portrait .player { aspect-ratio: 9 / 16; max-height: 76vh; }
.player video { width: 100%; height: 100%; object-fit: contain; background: var(--stage); }
.player__big {
  position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%;
  border: 0; background: var(--indigo); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.player__big:hover { background: var(--indigo-hover); }
.player__big svg { width: 30px; height: 30px; margin-left: 4px; }
.player.is-playing .player__big { display: none; }
.player__bar {
  position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 10px;
  background: rgba(10, 13, 28, 0.82); border-radius: 14px; padding: 8px 12px;
  transition: opacity .2s ease;
}
.player.is-playing.is-idle .player__bar { opacity: 0; }
.player__btn { width: 36px; height: 36px; flex: none; border: 0; border-radius: 10px; background: transparent; color: #fff; display: grid; place-items: center; cursor: pointer; }
.player__btn:hover { background: rgba(255, 255, 255, 0.12); }
.player__btn svg { width: 20px; height: 20px; }
.player__btn .i-pause, .player.is-playing .player__btn .i-play { display: none; }
.player.is-playing .player__btn .i-pause { display: block; }
.player__btn .i-muted, .player.is-muted .player__btn .i-vol { display: none; }
.player.is-muted .player__btn .i-muted { display: block; }
.player__track { position: relative; flex: 1; height: 22px; cursor: pointer; display: flex; align-items: center; }
.player__track::before { content: ""; position: absolute; left: 0; right: 0; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.2); }
.player__seen, .player__now { position: absolute; left: 0; height: 5px; border-radius: 3px; width: 0; }
.player__seen { background: rgba(255, 255, 255, 0.35); }
.player__now { background: var(--indigo); }
.player__now::after { content: ""; position: absolute; right: -7px; top: -4.5px; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.player__time { font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; color: #dfe1f5; }
.player__done { display: none; }
.player.is-done .player__done { display: inline-block; position: absolute; top: 12px; left: 12px; }
.player-note { font-size: .85rem; color: var(--text-3); margin: 10px 0 0; }

.video-missing { padding: 24px; text-align: center; max-width: 42ch; margin: auto; display: grid; place-items: center; height: 100%; }
.tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 24px; }
.tools div { background: var(--field); border-radius: 14px; padding: 18px; }
.tools b { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.tools span { color: var(--text-2); font-size: .95rem; }
.tools-h { font-size: 1.05rem; margin: 0 0 12px; }
details.transcript { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
details.transcript summary { cursor: pointer; font-weight: 700; }

/* ---------- Module art ---------- */

.module-h { position: relative; }
.module-h .art--banner { margin-left: auto; width: min(420px, 42%); height: auto; flex: none; }
.art { overflow: visible; }

/* banner: loop draws itself, then drifts gently; bubbles rise and fade; a clear line leads out */
.a-loop { stroke: var(--text); stroke-dasharray: 1; stroke-dashoffset: 1; animation: a-draw 2.2s cubic-bezier(.6, 0, .3, 1) .2s forwards; }
.a-drift { transform-box: fill-box; transform-origin: center; animation: a-drift 14s ease-in-out 2.4s infinite alternate; }
.a-out { stroke: var(--indigo); stroke-dasharray: 1; stroke-dashoffset: 1; animation: a-draw 1.6s cubic-bezier(.4, 0, .2, 1) 1.9s forwards; }
.a-dot { fill: var(--indigo); opacity: 0; transform-box: fill-box; transform-origin: center; animation: a-pop .5s ease-out 3.3s forwards; }
.a-ring { fill: none; stroke: var(--indigo); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; animation: a-pulse 3.2s ease-out 3.8s infinite; }
.a-bub { stroke: var(--text-3); opacity: 0; transform-box: fill-box; transform-origin: center; animation: a-rise 7s ease-in-out infinite; }
.a-bub.b1 { animation-delay: .4s; }
.a-bub.b2 { animation-delay: 2.1s; animation-duration: 8.5s; }
.a-bub.b3 { animation-delay: 3.6s; }
.a-bub.b4 { animation-delay: 5s; animation-duration: 9s; }
.a-bub.b5 { animation-delay: 6.2s; animation-duration: 7.5s; }

@keyframes a-draw { to { stroke-dashoffset: 0; } }
@keyframes a-drift { from { transform: rotate(-5deg) scale(.98); } to { transform: rotate(6deg) scale(1.02); } }
@keyframes a-pop { 0% { opacity: 0; transform: scale(.2); } 70% { opacity: 1; transform: scale(1.25); } 100% { opacity: 1; transform: scale(1); } }
@keyframes a-pulse { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(2.8); } }
@keyframes a-rise { 0% { opacity: 0; transform: translateY(14px) scale(.6); } 25% { opacity: .75; } 70% { opacity: .45; } 100% { opacity: 0; transform: translateY(-38px) scale(1.1); } }

/* pass: the loop fades as the straight line draws, then the tick lands */
.pass-art { display: flex; justify-content: center; background: var(--field); border-radius: 18px; padding: 20px; margin: 4px 0 24px; }
.art--pass { width: min(100%, 380px); height: auto; }
.p-loop { stroke: var(--text-3); stroke-dasharray: 1; stroke-dashoffset: 1; animation: a-draw 1s ease-in-out forwards, p-fade .6s ease-in 1.2s forwards; }
.p-line { stroke: var(--indigo); stroke-dasharray: 1; stroke-dashoffset: 1; animation: a-draw 1s cubic-bezier(.4, 0, .2, 1) 1.4s forwards; }
.p-badge { fill: var(--indigo); opacity: 0; transform-box: fill-box; transform-origin: center; animation: a-pop .5s ease-out 2.3s forwards; }
.p-tick { stroke: #fff; stroke-dasharray: 1; stroke-dashoffset: 1; animation: a-draw .45s ease-out 2.7s forwards; }
@keyframes p-fade { to { opacity: 0; transform: scale(.85); } }
.p-loop { transform-box: fill-box; transform-origin: center; }

/* anger: the gauge — needle swings hot, heat rises, then it settles back to cool */
.g-cool { stroke: #8f92f5; }
.g-warm { stroke: #f0b24a; }
.g-hot { stroke: #e5625a; }
.g-hub { fill: var(--text); }
.g-needle, .gp-needle { stroke: var(--text); transform-box: view-box; }
.g-needle { transform-origin: 110px 120px; transform: rotate(-55deg); animation: g-rise 3.2s cubic-bezier(.5, 0, .3, 1) .3s both, g-sway 7s ease-in-out 3.5s infinite alternate; }
.gp-needle { transform-origin: 112px 96px; transform: rotate(-60deg); animation: gp-drop 1.6s cubic-bezier(.4, 0, .2, 1) .3s both; }
.g-heat { stroke: #e5625a; opacity: 0; animation: g-heat 3.2s ease-out .7s both; }
.g-out { stroke: var(--indigo); stroke-dasharray: 1; stroke-dashoffset: 1; animation: a-draw 1.4s cubic-bezier(.4, 0, .2, 1) 3.1s forwards; }
.g-dot { fill: var(--indigo); opacity: 0; transform-box: fill-box; transform-origin: center; animation: a-pop .5s ease-out 4.3s forwards; }
.g-ring { fill: none; stroke: var(--indigo); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; animation: a-pulse 3.2s ease-out 4.8s infinite; }
@keyframes g-rise { 0% { transform: rotate(-80deg); } 36% { transform: rotate(70deg); } 46% { transform: rotate(60deg); } 100% { transform: rotate(-55deg); } }
@keyframes g-sway { from { transform: rotate(-55deg); } to { transform: rotate(-44deg); } }
@keyframes gp-drop { from { transform: rotate(65deg); } to { transform: rotate(-60deg); } }
@keyframes g-heat { 0% { opacity: 0; transform: translateY(8px); } 30% { opacity: .9; } 100% { opacity: 0; transform: translateY(-16px); } }

/* breathing guide */
.breathe { display: flex; align-items: center; gap: 22px; background: var(--field); border-radius: 18px; padding: 18px 22px; margin-top: 20px; }
.breathe__stage { position: relative; width: 112px; height: 112px; flex: none; display: grid; place-items: center; }
.breathe__ring { position: absolute; inset: 0; border-radius: 50%; border: 2px dashed var(--line); }
.breathe__orb { position: absolute; inset: 0; margin: auto; width: 100%; height: 100%; border-radius: 50%; background: var(--soft); box-shadow: inset 0 0 0 2px var(--indigo); transform: scale(.5); transition: transform 4s ease-in-out; }
.breathe.is-in .breathe__orb { transform: scale(1); transition-duration: 4s; }
.breathe.is-out .breathe__orb { transform: scale(.5); transition-duration: 6s; }
.breathe.is-running .breathe__ring { animation: b-spin 30s linear infinite; }
.breathe__count { position: relative; font-weight: 800; font-size: 1.6rem; color: var(--soft-ink); font-variant-numeric: tabular-nums; }
.breathe__copy b { display: block; font-size: 1.05rem; }
.breathe__status { color: var(--text-2); margin: 2px 0 12px; font-size: .95rem; min-height: 1.5em; }
.breathe__btn { min-height: 42px; padding: 0 18px; }
@keyframes b-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .a-loop, .a-out, .p-loop, .p-line, .p-tick, .g-out { stroke-dashoffset: 0 !important; }
  .a-dot, .p-badge, .g-dot { opacity: 1 !important; }
  .p-loop, .a-bub, .a-ring, .g-heat, .g-ring { opacity: 0 !important; }
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .mods { grid-template-columns: repeat(2, 1fr); }
  .inside { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 880px) {
  .hero, .split, .dash-hero { grid-template-columns: 1fr; gap: 28px; }
  .module { grid-template-columns: 1fr; gap: 16px; }
  .rail { position: static; padding: 14px; }
  .rail h2 { display: none; }
  .rail ol { display: flex; justify-content: space-between; gap: 4px; }
  .rail li { flex-direction: column; gap: 6px; padding: 0; font-size: .75rem; text-align: center; flex: 1; }
  .lesson--portrait { grid-template-columns: 1fr; }
  .module-h { flex-wrap: wrap; align-items: center; gap: 4px 14px; }
  .module-h h1 { flex: 1; min-width: 0; }
  .module-h .art--banner { order: -1; width: 100%; max-width: 320px; margin: 0 0 6px; }
  .lesson--portrait .player { width: min(100%, 360px); margin: 0 auto; }
}
@media (max-width: 640px) {
  .wrap { padding-top: 12px; }
  .panel { padding: 20px; border-radius: 18px; }
  .steps3, .mods, .inside, .parts, .tools { grid-template-columns: 1fr; }
  .section-h { margin-top: 60px; }
  .likert { padding: 14px; }
  .likert__opts { grid-template-columns: repeat(2, 1fr); padding-left: 0; }
  .likert__n { width: 34px; height: 34px; border-radius: 10px; }
  .likert__q { font-size: 1rem; padding-top: 5px; }
  .module-h .bignum { font-size: 2.8rem; }
  .nav a, .linkbtn { padding: 8px 10px; }
  .topbar__in { flex-wrap: wrap; row-gap: 8px; padding-top: 16px; padding-bottom: 12px; }
  .nav { flex-wrap: wrap; justify-content: flex-end; gap: 2px; margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
