/* Mindfully Divergent. Colours come from the logo: lime-to-mint lettering, the rainbow phoenix, and the violet of the podcast art.
   Dark is the default (the logo is made for it); a light theme, three text sizes, two reading fonts and calmer motion are in Display. */
@font-face { font-family: 'Lexend'; font-weight: 400; font-display: swap; src: url(/assets/fonts/lexend-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Lexend'; font-weight: 600; font-display: swap; src: url(/assets/fonts/lexend-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'OpenDyslexic'; font-weight: 400; font-display: swap; src: url(/assets/fonts/opendyslexic-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'OpenDyslexic'; font-weight: 700; font-display: swap; src: url(/assets/fonts/opendyslexic-latin-700-normal.woff2) format('woff2'); }

:root, [data-theme='dark'] {
  color-scheme: dark;
  --bg: #0b0714; --bg2: #120a22; --surface: #170f2b; --surface2: #21173b; --line: rgba(232, 222, 255, .16);
  --text: #f4efff; --muted: #c9bde6; --faint: #a597c9;
  --lime: #b9f56b; --mint: #4ff0a5; --violet: #8c4bff; --violet-soft: #c3a8ff; --pink: #ff5fa8;
  --accent-text: #b9f56b; --link: #c3a8ff;
  --btn: #7c3aed; --btn-hover: #6d28d9; --btn-text: #fff;
  --focus: #ffe066; --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --title-grad: linear-gradient(180deg, #d4ff7a 0%, #b9f56b 45%, #4ff0a5 100%);
  --hero-glow: radial-gradient(60% 70% at 25% 30%, rgba(140, 75, 255, .30), transparent 70%), radial-gradient(50% 60% at 85% 10%, rgba(79, 240, 165, .12), transparent 70%);
}
[data-theme='light'] {
  color-scheme: light;
  --bg: #faf8ff; --bg2: #f1ecff; --surface: #ffffff; --surface2: #f3effc; --line: rgba(40, 20, 80, .16);
  --text: #1b1230; --muted: #4a4066; --faint: #5f557c;
  --accent-text: #2d6a12; --link: #5b21b6;
  --btn: #6d28d9; --btn-hover: #5b21b6; --btn-text: #fff;
  --focus: #1d4ed8; --shadow: 0 8px 24px rgba(40, 20, 80, .12);
  --title-grad: linear-gradient(180deg, #5b21b6 0%, #6d28d9 45%, #0f766e 100%);
  --hero-glow: radial-gradient(60% 70% at 25% 30%, rgba(140, 75, 255, .14), transparent 70%), radial-gradient(50% 60% at 85% 10%, rgba(79, 240, 165, .14), transparent 70%);
}
:root { --font: 'Lexend', system-ui, 'Segoe UI', Arial, sans-serif; --size: 17px; --radius: 16px; --player-h: 0px; }
[data-font='system'] { --font: system-ui, 'Segoe UI', Arial, sans-serif; }
[data-font='dyslexic'] { --font: 'OpenDyslexic', 'Lexend', system-ui, sans-serif; }
[data-size='large'] { --size: 19.5px; }
[data-size='larger'] { --size: 22px; }

*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--size); -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; padding-bottom: var(--player-h); }
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(760px, 100% - 2.5rem); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.grad { background: var(--title-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (forced-colors: active) { .grad { color: CanvasText; background: none; } }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--btn); color: #fff; padding: .6rem 1rem; border-radius: 10px; }
.skip:focus { top: 1rem; }
[hidden] { display: none !important; }

/* ---------- header and footer */
.top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 1rem; min-height: 4.25rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font-weight: 600; font-size: 1.08rem; margin-right: auto; }
.brand img { width: 52px; height: auto; }
.nav { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; }
.nav a, .chipbtn { color: var(--text); text-decoration: none; padding: .45rem .8rem; border-radius: 999px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current='page'] { background: var(--surface2); }
.chipbtn { background: transparent; border: 1px solid var(--line); font: inherit; font-size: .9rem; cursor: pointer; }
.chipbtn:hover { background: var(--surface2); }
@media (max-width: 640px) {
  .brand span { display: none; }
  .nav a.hide-sm { display: none; }
  .top .wrap { gap: .5rem; }
}
footer.foot { border-top: 1px solid var(--line); margin-top: 3rem; padding: 2rem 0 7rem; color: var(--muted); font-size: .92rem; }
footer.foot .wrap { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
footer.foot a { color: var(--link); }
footer.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }

/* ---------- buttons, forms, cards */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.9rem; padding: .6rem 1.25rem; border-radius: 999px; border: 2px solid transparent; background: var(--btn); color: var(--btn-text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--btn-hover); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface2); }
.btn.small { min-height: 2.3rem; padding: .35rem .9rem; font-size: .9rem; }
.btn.danger { background: #b42318; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
label { font-weight: 600; display: block; margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: .65rem .85rem; }
textarea { min-height: 7rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--violet-soft); }
.field { margin-bottom: 1rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: .2rem; flex: none; accent-color: var(--btn); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.notice { border-left: 4px solid var(--mint); background: var(--surface2); padding: .8rem 1rem; border-radius: 10px; margin: 0 0 1rem; }
.notice.warn { border-left-color: #ffb020; }
.notice.bad { border-left-color: #ff5f5f; }
.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 600; padding: .15rem .6rem; border-radius: 999px; background: var(--surface2); color: var(--muted); border: 1px solid var(--line); }
.pill.free { color: var(--accent-text); }
.pill.members { color: var(--violet-soft); }
[data-theme='light'] .pill.members { color: #5b21b6; }
.section { padding: 2.5rem 0; }

/* ---------- hero */
.hero { position: relative; padding: 2.5rem 0 2rem; background: var(--hero-glow); }
.hero .wrap { display: grid; grid-template-columns: minmax(200px, 340px) 1fr; gap: 2rem; align-items: center; }
.hero .logo { width: 100%; max-width: 340px; filter: drop-shadow(0 12px 30px rgba(140, 75, 255, .35)); }
.hero .lead { font-size: 1.12rem; color: var(--muted); max-width: 40rem; }
@media (max-width: 760px) { .hero .wrap { grid-template-columns: 1fr; text-align: center; } .hero .logo { max-width: 230px; margin: 0 auto; } .hero .row { justify-content: center; } .hero .lead { margin-inline: auto; } }
.ticks { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .35rem; }
.ticks li { padding-left: 1.6rem; position: relative; }
.ticks li::before { content: ''; position: absolute; left: .2rem; top: .55em; width: .7rem; height: .7rem; border-radius: 50%; background: var(--title-grad); }
@media (max-width: 760px) { .ticks { text-align: left; max-width: 30rem; margin-inline: auto; } }

/* ---------- library */
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 1rem 0 1.25rem; }
.toolbar .search { flex: 1 1 240px; max-width: 420px; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips button { font: inherit; font-size: .9rem; padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.chips button[aria-pressed='true'] { background: var(--btn); color: #fff; border-color: transparent; }
.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tile .art { position: relative; aspect-ratio: 16 / 9; background: var(--surface2); overflow: hidden; }
.tile .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .art.square img { object-fit: contain; background: radial-gradient(circle at 50% 40%, #2a1b4d, #0b0714); }
.tile .art .made { position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; text-align: center; font-weight: 600; color: #fff; background: linear-gradient(135deg, #3b1d7a, #0b0714 70%), #160c2c; }
.tile .art .made img { width: 64px; height: auto; object-fit: contain; margin-bottom: .4rem; }
.tile .art .kind { position: absolute; left: .6rem; top: .6rem; background: rgba(8, 4, 18, .78); color: #fff; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; }
.tile .art .lock { position: absolute; right: .6rem; top: .6rem; background: rgba(8, 4, 18, .78); color: #e6dbff; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; }
.tile .body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.tile h3 { margin: 0; font-size: 1.02rem; }
.tile .meta { color: var(--muted); font-size: .85rem; }
.tile .acts { margin-top: auto; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.icon-btn { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--surface2); }
.icon-btn svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }
.icon-btn[aria-pressed='true'] { color: var(--pink); }
.empty { padding: 2rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- members */
.price { font-size: 2rem; font-weight: 600; }
.split { display: grid; gap: 1.25rem; grid-template-columns: 1.2fr 1fr; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.course { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 1rem; overflow: hidden; }
.course > summary { list-style: none; cursor: pointer; padding: 1.1rem 1.25rem; display: grid; gap: .3rem; }
.course > summary::-webkit-details-marker { display: none; }
.course > summary h3 { margin: 0; }
.course[open] > summary { border-bottom: 1px solid var(--line); }
.course ol { margin: 0; padding: .5rem 1.25rem 1rem; list-style: none; counter-reset: s; }
.course li { counter-increment: s; display: flex; gap: .75rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.course li:last-child { border-bottom: 0; }
.course li .n::before { content: counter(s); display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--surface2); font-weight: 600; font-size: .85rem; }
.course li.done .n::before { content: '✓'; background: var(--mint); color: #062b18; }
.course li .t { flex: 1; min-width: 0; }
.bar { height: .5rem; background: var(--surface2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--title-grad); }

/* ---------- the audio player (fixed to the bottom while something is playing) */
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--bg2); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0, 0, 0, .35); padding: .6rem 0 calc(.6rem + env(safe-area-inset-bottom, 0px)); }
.player .wrap { display: grid; grid-template-columns: 56px 1fr auto; gap: .8rem; align-items: center; }
.player .art { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--surface2); }
.player .info { min-width: 0; }
.player .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .95rem; }
.player .seek { display: flex; gap: .5rem; align-items: center; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.player input[type=range] { flex: 1; accent-color: var(--mint); min-width: 60px; height: 1.6rem; }
.player .ctrls { display: flex; gap: .3rem; align-items: center; }
.player .play { width: 3rem; height: 3rem; background: var(--btn); color: #fff; border: 0; }
.player .play:hover { background: var(--btn-hover); }
.player .speed { font: inherit; font-size: .8rem; width: auto; padding: .3rem .5rem; border-radius: 10px; }
@media (max-width: 640px) {
  .player .wrap { grid-template-columns: 44px 1fr; row-gap: .35rem; }
  .player .art { width: 44px; height: 44px; }
  .player .ctrls { grid-column: 1 / -1; justify-content: center; }
}

/* ---------- dialogs */
dialog { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--text); padding: 0; width: min(760px, 100% - 1.5rem); max-height: calc(100dvh - 2rem); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(5, 2, 12, .72); }
dialog .dhead { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
dialog .dhead h2 { font-size: 1.2rem; margin: .3rem 0 0; flex: 1; }
dialog .dbody { padding: 1.1rem 1.25rem 1.4rem; }
dialog .desc p { color: var(--muted); }
.video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; margin-bottom: 1rem; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- display options */
.display { position: absolute; right: 1rem; top: calc(100% + .4rem); width: min(340px, calc(100vw - 2rem)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; box-shadow: var(--shadow); }
.display fieldset { border: 0; padding: 0; margin: 0 0 .9rem; }
.display legend { font-weight: 600; margin-bottom: .35rem; padding: 0; }
.seg { display: flex; flex-wrap: wrap; gap: .35rem; }
.seg button { font: inherit; font-size: .88rem; padding: .35rem .75rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); cursor: pointer; }
.seg button[aria-pressed='true'] { background: var(--btn); color: #fff; border-color: transparent; }
.top .wrap { position: relative; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--player-h) + 1.2rem); z-index: 99999999; background: var(--text); color: var(--bg); padding: .7rem 1.1rem; border-radius: 12px; box-shadow: var(--shadow); max-width: calc(100vw - 2rem); }

/* ---------- the floating help buttons sit above the player while it is open */
body.has-player .nh-wa { bottom: calc(var(--player-h) + 92px) !important; }
body.has-player .floatingchat-container-wrap, body.has-player .floatingchat-container-wrap-mobi { bottom: calc(var(--player-h) + 16px) !important; }
body.has-player .floating-chat-kofi-popup-iframe { bottom: calc(var(--player-h) + 75px) !important; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
[data-motion='calm'] *, [data-motion='calm'] *::before, [data-motion='calm'] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media print { .top, .player, footer.foot, .nh-wa { display: none !important; } }

/* ---------- phones: a course session's title gets the full width, its buttons go underneath */
@media (max-width: 560px) {
  .course li { flex-wrap: wrap; row-gap: .4rem; }
  .course li .t { flex: 1 1 calc(100% - 3rem); }
  .course li .icon-btn { margin-left: 2.65rem; }
}
