:root {
  --bg: #ffffff;
  --soft: #f5f3ff;
  --ink: #17132b;
  --muted: #5b5775;
  --brand: #5b3df5;
  --brand-dark: #4429d6;
  --accent: #ffb020;
  --line: #e6e3f5;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(40, 20, 120, .08);
  --gutter: max(16px, calc((100vw - 1120px) / 2));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }

.container { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* Anything marked hidden stays hidden, even when its own style says display: inline-flex (like .btn) */
[hidden] { display: none !important; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn--sm { padding: 9px 18px; font-size: .9rem; }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(91, 61, 245, .3); }
.btn--primary:hover { background: var(--brand-dark); }
.btn--ghost { border-color: var(--line); color: var(--ink); background: #fff; }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn--light { background: #fff; color: var(--brand-dark); }
.btn--outline-light { border-color: rgba(255,255,255,.7); color: #fff; }
.btn--outline-light:hover { background: rgba(255,255,255,.12); }

.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.actions--center { justify-content: center; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.logo { font-weight: 800; font-size: 1.4rem; color: var(--brand); letter-spacing: -.03em; }
.nav__links { display: flex; gap: 28px; font-weight: 600; color: var(--muted); }
.nav__links a:hover { color: var(--brand); }
.nav__cta { display: flex; align-items: center; gap: 16px; }
.link { font-weight: 600; color: var(--muted); }
.link:hover { color: var(--brand); }

/* Categories mega menu */
.nav__btn {
  font: inherit; font-weight: 600; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer;
}
.nav__btn:hover, .nav__btn[aria-expanded="true"] { color: var(--brand); }
.mega { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 20px 40px rgba(40, 20, 120, .12); }
.mega[hidden] { display: none; }
.mega__inner { display: grid; grid-template-columns: 320px 1fr; grid-template-rows: minmax(0, 1fr); gap: 32px; padding: 24px 0; height: min(70vh, 560px); box-sizing: content-box; }
.mega__cats, .mega__subs { overflow-y: auto; min-height: 0; }
.mega__cats { list-style: none; margin: 0; padding: 0 8px 0 0; border-right: 1px solid var(--line); }
.mega__cats button {
  width: 100%; display: flex; justify-content: space-between; gap: 8px; text-align: left;
  font: inherit; font-weight: 600; color: var(--ink); background: none; border: 0; border-radius: 10px;
  padding: 10px 12px; cursor: pointer;
}
.mega__cats button:hover, .mega__cats button.is-active { background: var(--soft); color: var(--brand-dark); }
.mega__subs ul { list-style: none; margin: 14px 0 0; padding: 0; columns: 3 200px; column-gap: 24px; }
.mega__subs li { break-inside: avoid; }
.mega__subs li a { display: block; padding: 6px 0; color: var(--muted); }
.mega__subs li a:hover, .mega__all:hover { color: var(--brand); }
.mega__all { font-weight: 700; color: var(--brand); }

/* Hero */
.hero { padding: 48px 0 40px; background: #fff; }
/* Hero and category rows: media takes 50% of the page, text the other 50% */
.hero__inner { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 0; align-items: center; }
.hero__copy { padding: 24px clamp(24px, 5vw, 80px); max-width: 680px; justify-self: center; }
.eyebrow {
  display: inline-block;
  font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  color: var(--brand); margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.7rem); font-weight: 800; }
.hero h1 span { color: var(--brand); }
.lead { font-size: 1.12rem; color: var(--muted); margin-top: 18px; max-width: 56ch; }
.hero__media, .group__media { display: grid; place-items: center; width: 100%; }

/* Floating scenes: every character and object is its own sprite that bobs in the air */
.scene { position: relative; width: 100%; max-width: 760px; margin-inline: auto; }
.sprite {
  position: absolute; height: auto; max-width: none;
  will-change: transform; z-index: 1;
  animation: float var(--dur, 5s) ease-in-out var(--delay, 0s) infinite alternate;
}
.sprite--back { z-index: 0; }
@keyframes float {
  from { transform: translate3d(calc(var(--dx, 0px) * -1), calc(var(--dy, 10px) * .5), 0) rotate(calc(var(--rot, 2deg) * -1)); }
  to   { transform: translate3d(var(--dx, 0px), calc(var(--dy, 10px) * -1), 0) rotate(var(--rot, 2deg)); }
}
@media (prefers-reduced-motion: reduce) {
  .sprite { animation: none; }
}

/* Values */
.values { padding: 8px 0 56px; }
.values__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.value {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.value h3 { font-size: 1.1rem; margin-bottom: 6px; color: var(--brand-dark); }
.value p { color: var(--muted); font-size: .95rem; }

/* Sections */
.section { padding: 80px 0; background: #fff; }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 32px; }
.section h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 800; }
.section__head p { margin-top: 12px; color: var(--muted); font-size: 1.1rem; }

/* Category groups: alternating image / copy rows */
.group {
  width: 100vw; margin-left: calc(50% - 50vw);
  display: grid; grid-template-columns: 1fr 1fr; gap: 0; align-items: center;
  padding: 32px 0;
}
.group__copy { padding: 24px clamp(24px, 5vw, 80px); max-width: 680px; justify-self: center; }
.group__copy h3 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; margin-bottom: 10px; }
.group__copy > p { color: var(--muted); font-size: 1.1rem; }
.subcats { margin: 24px 0; display: grid; gap: 14px; }
.subcats div {
  padding: 14px 18px; border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: 12px; background: #fff;
}
.subcats dt { font-weight: 700; }
.subcats dd { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.subcats dt a { display: inline-block; }
.subcats a:hover { color: var(--brand); text-decoration: underline; }
.more { font-weight: 700; color: var(--brand); }
.more:hover { text-decoration: underline; }
.allcats { text-align: center; margin-top: 32px; }
.allcats p { margin: 18px auto 0; max-width: 780px; color: var(--muted); font-size: .95rem; }

/* AI assistant */
.assistant { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.steps {
  list-style: none; counter-reset: step; padding: 0; margin: 26px 0 30px;
  display: grid; gap: 12px;
}
.steps li { counter-increment: step; display: flex; align-items: center; gap: 14px; }
.steps li::before {
  content: counter(step);
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 800; font-size: .9rem;
}
.chat {
  background: #fff; border: 1px solid var(--line); border-radius: 24px;
  padding: 24px; box-shadow: var(--shadow); display: grid; gap: 12px;
}
.chat__head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.chat__head strong { color: var(--ink); }
.msg { max-width: 88%; padding: 12px 16px; border-radius: 18px; }
.msg--user { justify-self: end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg--ai { justify-self: start; background: var(--soft); border-bottom-left-radius: 4px; display: grid; gap: 8px; }
.course {
  margin-top: 4px; padding: 12px 14px; background: #fff; border: 1px solid var(--line);
  border-left: 4px solid var(--accent); border-radius: 12px; display: grid; gap: 2px;
}
.course__label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* Customer reviews: continuous left-sliding carousel, 3 cards at a time */
.carousel {
  --per: 3; --gap: 24px;
  width: min(1120px, 100% - 32px); margin-inline: auto;
  overflow: hidden; padding: 8px 0 16px;
}
.carousel__track {
  display: flex; gap: var(--gap); width: 100%;
  animation: slide 50s linear infinite;
}
.carousel:hover .carousel__track,
.carousel:focus-within .carousel__track { animation-play-state: paused; }
.review {
  flex: 0 0 calc((100% - (var(--per) - 1) * var(--gap)) / var(--per));
  margin: 0; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.review blockquote { margin: 0; color: var(--ink); }
.review figcaption { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--brand-dark); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--soft); color: var(--brand); font-weight: 800;
}
/* 10 originals + 10 clones; shift by exactly 10 card steps, then restart */
@keyframes slide {
  to { transform: translateX(calc(-1 * (100% + var(--gap)) * 10 / var(--per))); }
}
@media (max-width: 960px) { .carousel { --per: 2; } }
@media (max-width: 640px) { .carousel { --per: 1; } }
@media (prefers-reduced-motion: reduce) {
  .carousel { overflow-x: auto; }
  .carousel__track { animation: none; width: max-content; }
  .review { flex-basis: 300px; }
}

/* Mission */
.mission { max-width: 700px; text-align: center; }
.mission p { margin-top: 18px; font-size: 1.15rem; color: var(--muted); }
.mission .btn { margin-top: 30px; }

/* Affiliate: image runs to the right edge of the screen */
.affiliate {
  display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  background: #fff; padding: 40px 0;
}
.affiliate__copy { padding: 40px var(--gutter) 40px 48px; }
.affiliate__copy h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 800; }
.affiliate__media img { width: 100%; max-height: 640px; object-fit: contain; object-position: left center; }

/* Final CTA */
.final {
  padding: 88px 0; text-align: center; color: #fff;
  background: linear-gradient(135deg, var(--brand), #2a1a9e);
}
.final h2 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; max-width: 18ch; margin-inline: auto; }
.final p { margin-top: 14px; font-size: 1.15rem; opacity: .9; }

/* Footer */
.footer { padding: 28px 0; border-top: 1px solid var(--line); }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }

/* Responsive */
@media (max-width: 960px) {
  .nav__links a { display: none; }
  .mega__inner { grid-template-columns: 1fr; grid-template-rows: 220px minmax(0, 1fr); gap: 12px; height: 70vh; }
  .mega__cats { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 8px; }
  .mega__subs ul { columns: 2 140px; }
  .hero__inner, .assistant, .group { grid-template-columns: 1fr; }
  .values__grid { grid-template-columns: repeat(2, 1fr); }
  .group { gap: 16px; padding: 24px 0; width: 100%; margin-left: 0; }
  .group__media { order: -1; }
  .scene { max-width: 420px; }
  .group__copy, .hero__copy { padding: 8px 0; }
  .section { padding: 56px 0; }
  .affiliate__copy { padding: 32px 16px 32px 24px; }
}
@media (max-width: 640px) {
  .affiliate { grid-template-columns: 1fr; }
  .affiliate__copy { padding: 32px 16px; }
}
@media (max-width: 520px) {
  .values__grid { grid-template-columns: 1fr; }
  .actions .btn { width: 100%; text-align: center; }
  .nav__cta .link { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* ===== Header search ===== */
.search { position: relative; flex: 1; max-width: 300px; margin-inline: 8px; }
.search__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; font: inherit; font-size: .95rem; padding: 10px 14px 10px 40px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink);
}
.search input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.search__list {
  list-style: none; margin: 8px 0 0; padding: 6px; position: absolute; left: 0; right: 0; top: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); z-index: 20; min-width: 280px;
}
.search__list[hidden] { display: none; }
.search__list a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 12px; border-radius: 10px; }
.search__list a:hover, .search__list li.is-active a { background: var(--soft); color: var(--brand-dark); }
.search__list small { color: var(--muted); font-size: .78rem; text-align: right; }
.search__empty { padding: 10px 12px; color: var(--muted); font-size: .92rem; }
.search__toggle { display: none; background: none; border: 0; padding: 6px; color: var(--muted); cursor: pointer; }
.nav__inner { gap: 12px; }

/* ===== Category pages ===== */
.crumbs ol { list-style: none; margin: 0 auto; padding: 16px 0 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .88rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; }
.crumbs a:hover { color: var(--brand); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }
.page-head { padding: 32px 0 24px; }
.page-head h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; }
.page-head p { color: var(--muted); font-size: 1.1rem; margin-top: 10px; max-width: 62ch; }
.page-head .eyebrow { margin-bottom: 8px; color: var(--brand); }
.section--tight { padding: 32px 0 48px; }
.block-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 20px; }
.chips { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a {
  display: inline-block; font-size: .85rem; font-weight: 600; padding: 7px 14px; border-radius: 999px;
  background: var(--soft); color: var(--brand-dark); border: 1px solid transparent;
}
.chips a:hover { border-color: var(--brand); }
.chips a.is-current { background: var(--brand); color: #fff; }

.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cat-grid--three { grid-template-columns: repeat(3, 1fr); }
.cat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
}
.cat-card h2, .cat-card h3 { font-size: 1.2rem; font-weight: 800; }
.cat-card h2 a:hover, .cat-card h3 a:hover { color: var(--brand); }
.cat-card p { color: var(--muted); font-size: .95rem; }
.cat-card .chips { margin: 4px 0 8px; }
.cat-card .more { margin-top: auto; }
.cat-card--small { box-shadow: none; }

.course-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.course-card[hidden] { display: none; }
.course-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.course-card__link { display: grid; grid-template-columns: 260px 1fr; column-gap: 28px; align-items: stretch; height: 100%; }
.course-card__thumb { position: relative; width: 100%; min-width: 0; height: 100%; min-height: 150px; overflow: hidden; background: linear-gradient(135deg, #ece8ff, #fdf2d9); display: grid; place-items: center; }
.course-card__thumb img { width: 100%; height: 100%; object-fit: contain; }
.course-card__ph { font-size: 2.4rem; font-weight: 800; color: var(--brand); opacity: .55; }
.course-card__body { padding: 18px 22px; display: grid; gap: 8px; align-content: center; }
.course-card__tag { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); }
.course-card h3 { font-size: 1.15rem; line-height: 1.35; }
.course-card__desc { color: var(--muted); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.course-card time { font-size: .82rem; color: var(--muted); }
.course-card time.is-new { display: inline-block; justify-self: start; background: var(--accent); color: var(--ink); font-weight: 800; padding: 2px 10px; border-radius: 999px; }
.loadmore { text-align: center; margin-top: 32px; }
.empty { text-align: center; padding: 56px 16px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty a { color: var(--brand); font-weight: 700; }
.back { margin-top: 32px; }

.strip { padding: 16px 0 32px; }
.strip__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--soft); border-radius: var(--radius); padding: 20px 24px;
}

/* ===== Alexandria chat bubble ===== */
.alex__fab {
  position: fixed; left: 20px; bottom: 20px; z-index: 50; width: 58px; height: 58px; border-radius: 50%;
  border: 0; cursor: pointer; background: linear-gradient(135deg, var(--brand), #2a1a9e); color: #fff;
  font: 800 1.4rem 'Plus Jakarta Sans', sans-serif; box-shadow: 0 10px 24px rgba(91, 61, 245, .4);
  transition: transform .15s ease;
}
.alex__fab:hover { transform: scale(1.06); }
.alex__panel {
  position: fixed; left: 20px; bottom: 90px; z-index: 50; width: min(360px, calc(100vw - 32px)); height: min(480px, 70vh);
  background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 20px 50px rgba(40, 20, 120, .22);
  display: flex; flex-direction: column; overflow: hidden;
}
.alex__panel[hidden] { display: none; }
.alex__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--brand); color: #fff; }
.alex__head span:nth-child(2) { display: grid; line-height: 1.25; }
.alex__head small { opacity: .85; }
.alex__avatar { width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--brand); display: grid; place-items: center; font-weight: 800; }
.alex__new { margin-left: auto; background: none; border: 0; color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer; opacity: .85; }
.alex__new:hover { opacity: 1; }
.alex__close { background: none; border: 0; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.alex__msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.alex__msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: .94rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.alex__msg a { color: var(--brand-dark); font-weight: 600; }
.alex__msg .alex__cta { display: inline-block; margin-top: 8px; padding: 6px 14px; border-radius: 999px; background: var(--brand); color: #fff; text-decoration: none; }
.alex__msg--typing::after { content: '• • •'; letter-spacing: 2px; animation: alex-dots 1s ease-in-out infinite; }
@keyframes alex-dots { 50% { opacity: .3; } }
.alex__note { margin: 0; padding: 0 14px 10px; font-size: .72rem; color: var(--muted, #6b6b80); line-height: 1.35; }
.alex__left { font-weight: 700; color: var(--brand-dark); }
.alex__msg--ai { background: var(--soft); align-self: flex-start; border-bottom-left-radius: 4px; }
.alex__msg--user { background: var(--brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.alex__chips { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.alex__chips button {
  font: inherit; font-size: .88rem; text-align: left; cursor: pointer; padding: 8px 12px;
  background: #fff; color: var(--brand-dark); border: 1px solid var(--line); border-radius: 999px;
}
.alex__chips button:hover { border-color: var(--brand); }
/* Alexandria's replies: text, then course cards (like the homepage mockup), page buttons and answer buttons */
.alex__msg--ai:has(.alex__card) { max-width: 92%; }
.alex__text { margin: 0; }
.alex__cards, .alex__pages, .alex__choices { display: grid; gap: 8px; }
.alex__cards:not(:empty), .alex__pages:not(:empty), .alex__choices:not(:empty) { margin-top: 10px; }
.alex__text[hidden] + .alex__cards { margin-top: 0; }
.alex__msg a.alex__card {
  display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: start; padding: 10px; background: #fff;
  border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px;
  color: var(--ink); font-weight: 400; text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.alex__msg a.alex__card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.alex__card.is-loading { min-height: 64px; background: linear-gradient(90deg, #fff, var(--soft), #fff); }
.alex__card:not(:has(img)) { grid-template-columns: 1fr; }
.alex__card-img { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; background: var(--soft); }
.alex__card-body { display: grid; gap: 2px; min-width: 0; line-height: 1.3; }
.alex__card-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.alex__card-name { font-size: .92rem; }
.alex__card-by { font-size: .78rem; color: var(--muted); }
.alex__card-why { font-size: .82rem; margin-top: 2px; }
.alex__card-go { font-size: .8rem; font-weight: 700; color: var(--brand-dark); margin-top: 4px; }
.alex__pages { display: flex; flex-wrap: wrap; }
.alex__msg a.alex__page {
  padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  color: var(--brand-dark); font-size: .84rem; font-weight: 600; text-decoration: none;
}
.alex__msg a.alex__page:hover { border-color: var(--brand); }
.alex__page.is-loading { visibility: hidden; }
.alex__choices { display: flex; flex-wrap: wrap; }
.alex__choices button {
  font: inherit; font-size: .86rem; cursor: pointer; padding: 7px 12px;
  background: #fff; color: var(--brand-dark); border: 1px solid var(--brand); border-radius: 999px;
}
.alex__choices button:hover { background: var(--brand); color: #fff; }
.alex__form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.alex__form input { flex: 1; font: inherit; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; }
.alex__form input:focus { outline: 2px solid var(--brand); border-color: transparent; }
.alex__form button { width: 42px; border: 0; border-radius: 50%; background: var(--brand); color: #fff; cursor: pointer; }

@media (max-width: 960px) {
  .cat-grid, .cat-grid--three { grid-template-columns: repeat(2, 1fr); }
  .search__toggle { display: inline-flex; }
  .search {
    display: none; position: absolute; left: 0; right: 0; top: 100%; max-width: none; margin: 0;
    padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--line);
  }
  .search__icon { left: 30px; }
  .nav.is-searching .search { display: block; }
}
@media (max-width: 560px) {
  .cat-grid, .cat-grid--three { grid-template-columns: 1fr; }
  .alex__fab { left: 14px; bottom: 14px; }
  .alex__panel { left: 16px; bottom: 82px; }
}
@media (prefers-reduced-motion: reduce) { .course-card, .alex__fab { transition: none; } .alex__msg--typing::after { animation: none; } }

/* Brand logo */
.logo { display: inline-flex; align-items: center; line-height: 0; }
.logo img { height: 34px; width: auto; display: block; }
.footer .logo img { height: 26px; }


/* ===== Pricing ===== */
.page-head--center { text-align: center; }
.page-head--center p { margin-inline: auto; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
.plan {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 32px 28px;
  background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow);
}
.plan--featured { border: 2px solid var(--brand); box-shadow: 0 16px 40px rgba(91, 61, 245, .18); }
.plan__badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--ink); font-size: .78rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em; padding: 5px 14px; border-radius: 999px;
}
.plan h2 { font-size: 1.3rem; font-weight: 800; }
.plan__price { display: flex; align-items: baseline; gap: 6px; }
.plan__price strong { font-size: 3rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.plan__price span { color: var(--muted); font-weight: 600; }
.plan__note { color: var(--muted); }
.plan__list { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 12px; flex: 1; }
.plan__list li { display: flex; gap: 10px; align-items: flex-start; }
.plan__list svg { flex: none; margin-top: 3px; color: var(--brand); }
.plan .btn { text-align: center; }
.plans__foot { text-align: center; margin-top: 32px; color: var(--muted); }
@media (max-width: 960px) { .plans { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; } .plan__badge { top: -14px; } }

/* ===== Explore page ===== */
.hero-slider { position: relative; width: min(1120px, 100% - 32px); margin: 24px auto 0; border-radius: 24px; overflow: hidden; }
.slides { position: relative; height: clamp(200px, 30vw, 340px); }
.slide {
  position: absolute; inset: 0; background: var(--c, var(--brand)); display: flex; align-items: center; padding: 32px 56px;
  opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility .6s ease; color: #fff;
}
.slide.is-active { opacity: 1; visibility: visible; }
.slide__copy { max-width: 520px; display: grid; gap: 12px; justify-items: start; }
.slide__copy h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 800; }
.slider__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.85); color: var(--ink); font-size: 1.6rem; line-height: 1; cursor: pointer; z-index: 2;
}
.slider__arrow:hover { background: #fff; }
.slider__arrow--prev { left: 14px; }
.slider__arrow--next { right: 14px; }
.slider__dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.slider__dot { width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.55); cursor: pointer; }
.slider__dot.is-active { background: #fff; width: 26px; border-radius: 999px; }
.hero-slider.is-single .slider__arrow, .hero-slider.is-single .slider__dots { display: none; }
.feed-title { grid-column: 1 / -1; font-size: 1.1rem; font-weight: 800; margin-top: 12px; color: var(--brand-dark); }
.feed-title:first-child { margin-top: 0; }
.feed-title[hidden] { display: none; }
.cat-row { margin-top: 36px; }
.cat-row__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.cat-row__head h3 { font-size: 1.15rem; font-weight: 800; }
@media (prefers-reduced-motion: reduce) { .slide { transition: none; } }
@media (max-width: 560px) { .slide { padding: 24px; } .slider__arrow { display: none; } }

@media (max-width: 560px) { .course-card__link { grid-template-columns: 110px 1fr; } .course-card__thumb { min-height: 110px; } .course-card__body { padding: 12px 14px; } .course-card h3 { font-size: 1rem; } }

.badge-new { position: absolute; top: 12px; left: 12px; background: var(--accent); color: var(--ink); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 4px 12px; border-radius: 999px; box-shadow: 0 4px 10px rgba(0,0,0,.12); }
.badge-new[hidden] { display: none; }
.course-card__body { padding-left: 0; padding-right: 24px; }
@media (max-width: 560px) { .course-card__link { column-gap: 14px; } .course-card__body { padding-right: 14px; } .badge-new { top: 8px; left: 8px; padding: 3px 9px; font-size: .68rem; } }

/* ===== Affiliate page ===== */
.aff-hero { padding: 40px 0 24px; }
.aff-hero__inner { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 0; align-items: center; }
.aff-hero__copy { padding: 24px clamp(24px, 5vw, 80px); max-width: 680px; justify-self: center; }
.aff-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
.aff-hero h1 span { color: var(--brand); }
.aff-hero__media img { width: 100%; max-height: 680px; object-fit: contain; margin-inline: auto; }
.step-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.step-card__n { width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.step-card h3 { font-size: 1.2rem; font-weight: 800; }
.step-card p { color: var(--muted); }
.earn { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.earn h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); font-weight: 800; }
.earn__table { width: 100%; margin-top: 22px; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.earn__table th, .earn__table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); }
.earn__table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--soft); }
.earn__table tr:last-child td { border-bottom: 0; }
.earn__table strong { color: var(--brand-dark); font-size: 1.15rem; }
.calc { background: var(--soft); border-radius: 24px; padding: 28px; display: grid; gap: 14px; }
.calc h3 { font-size: 1.2rem; font-weight: 800; }
.calc__toggle { display: inline-flex; background: #fff; border-radius: 999px; padding: 4px; justify-self: start; }
.calc__toggle button { font: inherit; font-weight: 700; border: 0; background: none; padding: 8px 18px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.calc__toggle button.is-active { background: var(--brand); color: #fff; }
.calc input[type=range] { width: 100%; accent-color: var(--brand); }
.calc__result { font-size: 1.2rem; }
.calc__result strong { font-size: 2.2rem; color: var(--brand-dark); display: block; line-height: 1.1; }
.calc small { color: var(--muted); }
.linkbox { background: #fff; border: 2px solid var(--brand); border-radius: 24px; padding: 32px; box-shadow: 0 16px 40px rgba(91, 61, 245, .14); display: grid; gap: 14px; }
.linkbox h2 { font-size: 1.7rem; font-weight: 800; }
.linkbox > p { color: var(--muted); }
.linkbox__row { display: flex; gap: 12px; flex-wrap: wrap; }
.linkbox__row input { flex: 1 1 280px; font: inherit; padding: 13px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); color: var(--ink); }
.linkbox__share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.linkbox__share > span { font-weight: 700; margin-right: 4px; }
.chip-link { font: inherit; font-size: .85rem; font-weight: 700; padding: 7px 14px; border-radius: 999px; background: var(--soft); color: var(--brand-dark); border: 1px solid transparent; cursor: pointer; }
.chip-link:hover { border-color: var(--brand); }
.chip-link[hidden] { display: none; }
.linkbox__note { font-size: .9rem; color: var(--muted); }
.linkbox__note a { color: var(--brand); font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 24px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; opacity: .75; }
.stat strong { display: block; font-size: 1.8rem; font-weight: 800; color: var(--brand-dark); }
.stat span { color: var(--muted); font-size: .9rem; }
.faqs { max-width: 760px; }
.faq { border: 1px solid var(--line); border-radius: 14px; padding: 4px 20px; margin-bottom: 12px; background: #fff; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--brand); line-height: 1; }
.faq[open] summary::after { content: "–"; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { color: var(--muted); padding-bottom: 16px; }
@media (max-width: 960px) { .aff-hero__inner, .earn { grid-template-columns: 1fr; } .step-cards { grid-template-columns: 1fr; } .stats { grid-template-columns: repeat(2, 1fr); } .aff-hero__media { order: -1; } .aff-hero__media img { max-height: 320px; } }

@media (max-width: 960px) { .aff-hero__inner { gap: 16px; } .aff-hero__copy { padding: 8px 16px; max-width: none; } }

/* ===== Footer links and legal pages ===== */
.footer__links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer__links a:hover { color: var(--brand); text-decoration: underline; }
.legal { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; align-items: start; }
.legal__toc { position: sticky; top: 90px; font-size: .95rem; }
.legal__toc summary { font-weight: 800; margin-bottom: 10px; cursor: pointer; }
.legal__toc ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--muted); }
.legal__toc a:hover { color: var(--brand); }
.legal__body { max-width: 74ch; }
.legal__summary { background: var(--soft); border-radius: var(--radius); padding: 24px 28px; margin-bottom: 36px; }
.legal__summary h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: 10px; }
.legal__summary ul { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; }
.legal__summary p { font-size: .9rem; color: var(--muted); }
.legal__section { margin-bottom: 32px; scroll-margin-top: 90px; }
.legal__section h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 10px; }
.legal__section h2 span { color: var(--brand); margin-right: 4px; }
.legal__section p, .legal__section li { color: #3b3754; }
.legal__section p + p, .legal__section p + ul, .legal__section ul + p { margin-top: 10px; }
.legal__section ul { padding-left: 22px; display: grid; gap: 6px; }
.legal__top { margin-top: 40px; }
.legal__top a { color: var(--brand); font-weight: 700; }
@media (max-width: 960px) { .legal { grid-template-columns: 1fr; gap: 24px; } .legal__toc { position: static; } }
@media print { .nav, .footer, .alex, .legal__toc, .legal__top, .strip { display: none !important; } .legal { display: block; } }

.legal__section ol { padding-left: 22px; display: grid; gap: 8px; }
.footer__inner { row-gap: 8px; }


/* ===== Mobile fixes: phones and tablets only, desktop is unchanged ===== */
.menu-toggle { display: none; }
.mnav[hidden] { display: none; }

@media (max-width: 960px) {
  /* Header: logo, search, Get Started and a menu button on one line */
  .nav__links { display: none; }
  .mega { display: none !important; }
  .nav__inner { gap: 8px; }
  .nav__cta { gap: 6px; }
  .nav .logo img { height: 28px !important; }
  .nav .btn--sm { white-space: nowrap; padding: 8px 14px; font-size: .85rem; }
  .menu-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 40px; height: 40px; padding: 9px; background: none; border: 0; border-radius: 10px; cursor: pointer;
  }
  .menu-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
  .nav.is-menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.is-menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .nav.is-menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  /* The menu is fixed to the screen right under the header, so it opens where you are on the page.
     The header's blur is dropped on phones because it would trap the fixed panel inside the header. */
  .nav { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
  .mnav {
    position: fixed; left: 0; right: 0; top: var(--mnav-top, 68px); bottom: 0; z-index: 40; background: #fff;
    border-top: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  }
  .mnav__inner { display: flex; flex-direction: column; padding: 4px 0 16px; }
  .mnav__inner > a, .mnav__cats-btn {
    display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 15px 4px;
    font: inherit; font-size: 1.05rem; font-weight: 700; color: var(--ink); text-align: left;
    background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer;
  }
  .mnav__inner > a.mnav__login { color: var(--brand); border-bottom: 0; }
  .mnav__cats { padding: 4px 0 8px 8px; border-bottom: 1px solid var(--line); }
  .mnav__all { display: block; padding: 10px 4px; font-weight: 700; color: var(--brand); }
  .mnav__cat > button {
    width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 11px 4px;
    font: inherit; font-weight: 600; color: var(--ink); text-align: left; background: none; border: 0; cursor: pointer;
  }
  .mnav__cat > button span { color: var(--brand); font-weight: 800; }
  .mnav__cat ul { list-style: none; margin: 0 0 8px; padding: 0 0 0 12px; border-left: 2px solid var(--soft); }
  .mnav__cat li a { display: block; padding: 8px 4px; color: var(--muted); }

  /* Homepage hero text no longer touches the screen edge */
  .hero__copy { padding: 8px 16px; }

  /* Sub category chips: one swipeable row instead of a tall block */
  .page-head .chips--wrap {
    flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 0 16px 8px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .cat-card .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .page-head .chips--wrap::-webkit-scrollbar, .cat-card .chips::-webkit-scrollbar { display: none; }
  .chips li { flex: none; }

  /* Course cards: the thumbnail stays inside its column */
  .course-card__thumb { aspect-ratio: auto; height: auto; min-height: 0; }
  .course-card__tag { font-size: .7rem; }

  /* Explore: newest per category becomes a swipeable row */
  .cat-row .course-grid {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(78%, 320px);
    overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -16px; padding: 0 16px 8px; scrollbar-width: none;
  }
  .cat-row .course-grid::-webkit-scrollbar { display: none; }
  .cat-row .course-card { scroll-snap-align: start; }
  .cat-row .course-card__link { grid-template-columns: 1fr; column-gap: 0; }
  .cat-row .course-card__thumb { aspect-ratio: 16 / 9; min-height: 0; }
  .cat-row .course-card__body { padding: 12px 14px 16px; }

  /* Legal pages: contents list in a soft box (collapsed by script) */
  .legal__toc { background: var(--soft); border-radius: 14px; padding: 12px 16px; }
  .legal__toc summary { margin-bottom: 0; }
  .legal__toc details[open] summary { margin-bottom: 10px; }
}

@media (max-width: 560px) {
  .hero h1 { font-size: 2rem; }
  .section { padding: 44px 0; }
  .page-head { padding: 20px 0 16px; }

  /* Homepage */
  .values__grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .value { padding: 14px; }
  .value h3 { font-size: .98rem; }
  .value p { font-size: .85rem; }
  .subcats { gap: 8px; margin: 16px 0; }
  .subcats div { padding: 10px 14px; }
  .subcats dd { display: none; }

  /* Course cards */
  .course-card__link { grid-template-columns: 104px 1fr; }
  .course-card__thumb { min-height: 104px; }
  .course-card__desc { -webkit-line-clamp: 2; font-size: .88rem; }
  .cat-row .course-card__link { grid-template-columns: 1fr; }

  /* Category cards and strips */
  .cat-card { padding: 18px; }
  .strip__inner { padding: 16px; }
  .strip__inner .btn { width: 100%; text-align: center; }

  /* Keep the Alexandria button clear of the footer text */
  .alex__fab { width: 52px; height: 52px; font-size: 1.25rem; }
  .footer { padding-bottom: 92px; }
}

@media (max-width: 960px) { .cat-grid > *, .cat-card { min-width: 0; } }


/* ===== Phone homepage, Duolingo style: logo-only header and a one-screen hero ===== */
@media (max-width: 560px) {
  .page-home .nav__inner { height: 60px; position: relative; }
  .page-home:not(.is-past-hero) .nav { border-bottom-color: transparent; }
  .page-home:not(.is-past-hero) .nav__cta { visibility: hidden; }
  .page-home:not(.is-past-hero) .nav .logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
  .page-home:not(.is-past-hero) .nav .logo img { height: 34px !important; }
  .page-home:not(.is-past-hero) .alex__fab { display: none; }

  .page-home .hero { min-height: calc(100svh - 60px); display: flex; align-items: stretch; padding: 0 0 8px; background: #fff; }
  .page-home .hero__inner { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; gap: 0; }
  .page-home .hero .eyebrow { display: none; }
  .page-home .hero__media { width: 100%; }
  .page-home .hero__media .scene { width: min(82vw, 32svh); max-width: none; margin-inline: auto; }
  .page-home .hero__copy { text-align: center; padding: 4px 20px 0; }
  .page-home .hero h1 { font-size: clamp(1.6rem, 7vw, 1.95rem); line-height: 1.15; }
  .page-home .hero .lead { font-size: .95rem; line-height: 1.45; margin: 10px auto 0; }
  .page-home .hero .actions { flex-direction: column; gap: 10px; margin-top: 16px; }
  .page-home .hero .actions .btn { padding: 13px 20px; }
}

/* ===== Phones and tablets: title first, then the picture, then the rest of the text ===== */
@media (max-width: 960px) {
  .group { display: flex; flex-direction: column; gap: 0; }
  .group__copy { display: contents; }
  .group__copy h3 { order: 1; }
  .group__media { order: 2; margin: 6px 0 18px; }
  .group__copy > p, .group__copy > dl { order: 3; }

  .assistant { display: flex; flex-direction: column; gap: 0; }
  .assistant__copy { display: contents; }
  .assistant__copy .eyebrow, .assistant__copy h2 { order: 1; }
  .assistant .alex-demo { order: 2; margin: 18px 0 22px; }
  .assistant__copy .lead, .assistant__copy .steps, .assistant__copy .btn { order: 3; }
  .assistant__copy .btn { align-self: flex-start; }
  .assistant__copy .eyebrow { align-self: flex-start; }

  .affiliate { display: flex; flex-direction: column; }
  .affiliate__copy { display: contents; }
  .affiliate__copy > * { margin-inline: 16px; }
  .affiliate__copy .eyebrow, .affiliate__copy h2 { order: 1; }
  .affiliate__copy .eyebrow { align-self: flex-start; }
  .affiliate__media { order: 2; margin: 14px 0 18px; }
  .affiliate__copy .lead, .affiliate__copy .steps, .affiliate__copy .btn { order: 3; }
  .affiliate__copy .btn { align-self: flex-start; }
}

@media (max-width: 960px) { .group, .assistant, .affiliate { align-items: stretch; } .group__copy h3, .group__copy > p { padding-inline: 0; } }


/* ===== Homepage on phones: shorter Alexandria chat, centered text, trimmed extras ===== */
.t-phone { display: none; }
@media (max-width: 560px) {
  /* Alexandria: shorter conversation, no label, slightly smaller example */
  .t-desk { display: none; }
  .t-phone { display: inline; }
  .msg--desk { display: none; }
  .page-home .assistant__copy .eyebrow { display: none; }
  .page-home .alex-demo .alex__msgs { padding: 14px; }

  /* Removed on phones: the "Also: ..." list of other categories */
  .page-home .allcats p { display: none; }

  /* Center the homepage text (chat bubbles keep chat alignment) */
  .page-home main { text-align: center; }
  .page-home .alex-demo { text-align: left; }
  .page-home .lead { margin-inline: auto; }
  .page-home .steps { justify-items: center; }
  .page-home .steps li { justify-content: center; text-align: left; }
  .page-home .assistant__copy .btn, .page-home .affiliate__copy .btn { align-self: center; }
  .page-home .affiliate__copy .eyebrow { align-self: center; }
  .page-home .subcats dt, .page-home .subcats dd { text-align: center; }
  .page-home .review figcaption { justify-content: center; }
  .page-home .footer__inner { justify-content: center; text-align: center; }
  .page-home .footer__links { justify-content: center; }
}

/* ===== Login, sign up and password pages ===== */
.auth { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 48px 16px 72px; background: #fff; }
.auth__card { width: min(440px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 36px 32px; box-shadow: var(--shadow); }
.auth__card h1 { font-size: 1.8rem; font-weight: 800; }
.auth__sub { color: var(--muted); margin: 8px 0 22px; }
.auth__field { margin-bottom: 16px; }
.auth__field label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; }
.auth__input { position: relative; }
.auth__input input {
  width: 100%; font: inherit; padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink);
}
.auth__input input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.auth__input input[type=password], .auth__input input[type=text][name=password], .auth__input input[name=confirm] { padding-right: 70px; }
.auth__toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--brand); font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; padding: 6px 10px; }
.auth__row { text-align: right; margin: -4px 0 18px; font-size: .9rem; }
.auth__row a, .auth__foot a, .auth__hint a, .auth__done a, .auth__wait a { color: var(--brand); font-weight: 700; }
.auth__row a:hover, .auth__foot a:hover { text-decoration: underline; }
.auth__submit { width: 100%; text-align: center; margin-top: 4px; }
.auth__submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.auth__hint { color: var(--muted); font-size: .85rem; margin-top: 14px; text-align: center; }
.auth__foot { text-align: center; margin-top: 22px; color: var(--muted); }
.auth__msg { padding: 12px 14px; border-radius: 12px; font-size: .92rem; margin-bottom: 16px; }
.auth__msg.is-error { background: #fdeceb; color: #9b1c1c; }
.auth__msg.is-ok { background: #e8f7ee; color: #1b6b3a; }
.auth__msg[hidden], .auth__done[hidden], .auth__wait[hidden], #auth-form[hidden] { display: none; }
.auth__done { text-align: center; padding: 8px 0; }
.auth__done h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; }
.auth__done p { color: var(--muted); }
.auth__wait { color: var(--muted); }
button.link { font: inherit; font-weight: 600; background: none; border: 0; cursor: pointer; padding: 0; color: var(--muted); }
button.link:hover { color: var(--brand); }
@media (max-width: 560px) { .auth { padding: 24px 16px 56px; align-items: start; } .auth__card { padding: 26px 20px; } }

/* ===== Header avatar menu (signed-in members) ===== */
.acct { position: relative; }
.acct__btn { width: 40px; height: 40px; border-radius: 50%; padding: 0; border: 2px solid var(--brand); background: var(--soft); cursor: pointer; overflow: hidden; display: grid; place-items: center; }
.acct__btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acct.is-empty .acct__btn::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--brand); opacity: .5; }
.acct__menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 200px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; z-index: 30; display: grid; }
.acct__menu[hidden] { display: none; }
.acct__name { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; line-height: 1.3; }
.acct__name span { color: var(--muted); font-size: .85rem; }
.acct__menu a, .acct__menu button { text-align: left; font: inherit; font-weight: 600; padding: 9px 10px; border-radius: 10px; background: none; border: 0; cursor: pointer; color: var(--ink); }
.acct__menu a:hover, .acct__menu button:hover { background: var(--soft); color: var(--brand-dark); }

/* ===== Explore: personalized rows ===== */
.cat-rows__title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cat-rows__title .more[hidden], .cat-row[hidden] { display: none; }
.cat-row__empty { color: var(--muted); padding: 18px; border: 1px dashed var(--line); border-radius: var(--radius); }

/* ===== Profile setup (/welcome/) and My Profile (/profile/) ===== */
.setup__card { width: min(640px, 100%); }
.setup__card.is-loading > *:not(.auth__msg) { opacity: .35; pointer-events: none; }
.setup__progress { display: flex; gap: 6px; margin-bottom: 22px; }
.setup__progress span { flex: 1; height: 6px; border-radius: 999px; background: var(--line); transition: background .3s ease; }
.setup__progress span.is-on { background: var(--brand); }
.setup__label { font-size: .92rem; font-weight: 700; margin-bottom: 10px; }
.setup__h2 { font-size: 1.35rem; font-weight: 800; margin-top: 28px; }
.avatars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.avatar-pick { position: relative; display: grid; gap: 6px; justify-items: center; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--muted); font-size: .8rem; font-weight: 600; }
.avatar-pick img { width: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; border: 3px solid transparent; outline: 1px solid var(--line); transition: transform .15s ease, border-color .15s ease; }
.avatar-pick:hover img { transform: scale(1.04); }
.avatar-pick.is-picked img { border-color: var(--brand); outline-color: var(--brand); }
.avatar-pick.is-picked { color: var(--brand-dark); }
.avatar-pick.is-picked::after {
  content: "✓"; position: absolute; top: 2px; right: 6%; width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: .8rem; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff;
}
.setup__count { display: block; text-align: right; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.member-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: linear-gradient(135deg, var(--soft), #fff7e6); margin: 6px 0 22px; }
.member-card img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: var(--shadow); }
.member-card img.is-placeholder { filter: grayscale(1); opacity: .45; }
.member-card div { display: grid; line-height: 1.35; }
.member-card div span[data-username] { color: var(--muted); font-size: .88rem; }
.setup__counter { font-weight: 700; color: var(--brand-dark); margin-bottom: 12px; }
.picks { display: flex; flex-wrap: wrap; gap: 10px; }
.pick-more { margin-top: 10px; }
.pick-more[hidden] { display: none; }
.pick { font: inherit; font-size: .92rem; font-weight: 600; padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; transition: background .15s ease, border-color .15s ease, opacity .15s ease; }
.pick:hover { border-color: var(--brand); }
.pick.is-picked { background: var(--brand); border-color: var(--brand); color: #fff; }
.pick.is-picked::before { content: "✓ "; }
.pick.is-dim { opacity: .45; }
.setup__more { background: none; border: 0; padding: 0; margin-top: 14px; font: inherit; font-weight: 700; color: var(--brand); cursor: pointer; }
.setup__more[hidden] { display: none; }
.setup__actions { display: flex; gap: 12px; margin-top: 24px; }
.setup__actions .btn { flex: 1; text-align: center; }
.setup__actions .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.setup__skip { text-align: center; margin-top: 14px; }
.setup__skip a { color: var(--muted); font-weight: 600; text-decoration: underline; }
.setup__done { text-align: center; }
.setup__big-avatar { width: 150px; height: 150px; border-radius: 50%; margin: 6px auto 16px; border: 4px solid var(--brand); box-shadow: 0 16px 40px rgba(91, 61, 245, .25); animation: float 4.5s ease-in-out infinite alternate; --dy: 10px; --dx: 0px; --rot: 2deg; }
.setup__done h1 { font-size: 1.7rem; }
.setup__done-chips { justify-content: center; margin: 14px 0 18px; }
.setup__done-chips li { font-size: .88rem; font-weight: 700; padding: 7px 14px; border-radius: 999px; background: var(--soft); color: var(--brand-dark); }
.setup__tip { display: flex; gap: 12px; align-items: flex-start; text-align: left; background: var(--soft); border-radius: 16px; padding: 14px 16px; margin-bottom: 22px; }
.setup__tip p a { color: var(--brand); font-weight: 700; }
.setup__go { width: 100%; text-align: center; }
.setup__account p { margin-top: 8px; color: var(--muted); }
.setup__account strong { color: var(--ink); }
@media (max-width: 560px) {
  .avatars { gap: 8px; }
  .avatar-pick span { font-size: .7rem; }
  .welcome-sticky, [data-setup="welcome"] .setup__actions { position: sticky; bottom: 0; background: #fff; padding: 12px 0; margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) { .setup__big-avatar { animation: none; } }

/* The floating pictures keep their own layering inside the scene, so they never cover the header menus. */
.scene { isolation: isolate; z-index: 0; }


.setup__retry { margin-left: 6px; font: inherit; font-weight: 700; color: inherit; text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; }


/* ===== Account menu (header avatar): dropdown on desktop, bottom sheet on phones ===== */
.acct__menu { min-width: 280px; padding: 8px; border-radius: 16px; }
.acct__menu hr { border: 0; height: 1px; background: var(--line); margin: 6px 8px; }
.acct__menu a, .acct__menu button { display: flex; align-items: center; gap: 12px; width: 100%; text-decoration: none; }
.acct__menu a svg, .acct__menu button svg { flex: none; color: var(--muted); }
.acct__menu a:hover svg, .acct__menu button:hover svg { color: var(--brand-dark); }
.acct__menu [hidden] { display: none; }
.acct__who { padding: 8px 10px; }
.acct__who img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--brand); flex: none; }
.acct__who .acct__name { flex: 1; min-width: 0; padding: 0; border: 0; margin: 0; }
.acct__who .acct__name strong, .acct__who .acct__name span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct__chev { margin-left: auto; color: var(--muted); }
.acct__grab, .acct__backdrop { display: none; }
@media (max-width: 640px) {
  .acct__backdrop:not([hidden]) { display: block; position: fixed; inset: 0; background: rgba(23, 19, 43, .45); z-index: 70; }
  .acct__menu { position: fixed; left: 10px; right: 10px; bottom: 10px; top: auto; min-width: 0; width: auto; max-height: 82vh; overflow-y: auto; border-radius: 22px; padding: 6px 10px 12px; z-index: 71; animation: sheet-up .22s ease-out; }
  .acct__grab { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 6px auto 8px; }
  .acct__menu a, .acct__menu button { padding: 13px 10px; font-size: 1.02rem; }
  .acct-open .alex { display: none; }
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .acct__menu { animation: none; } }

/* ===== Account page (/profile/) ===== */
.setup__card--account { width: min(980px, 100%); padding: 32px; }
.acctpage { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 36px; }
.acctpage__side { position: sticky; top: 96px; align-self: start; display: grid; gap: 14px; }
.plan-pill { font-size: .78rem; font-weight: 800; padding: 5px 12px; border-radius: 999px; background: #fff; color: var(--brand-dark); border: 1.5px solid var(--line); margin-top: 6px; }
.plan-pill.is-paid { background: var(--brand); border-color: var(--brand); color: #fff; }
.acctpage__nav { display: grid; gap: 4px; }
.acctpage__nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--muted); font-weight: 600; text-decoration: none; }
.acctpage__nav a:hover { background: var(--soft); color: var(--brand-dark); }
.acctpage__nav a.is-on { background: var(--soft); color: var(--brand-dark); box-shadow: inset 3px 0 0 var(--brand); }
.acctpage__nav svg { flex: none; }
.panel[hidden] { display: none; }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel__head h1 { font-size: 1.7rem; font-weight: 800; }
.panel__sub { color: var(--muted); margin: 6px 0 20px; }
.panel__h2 { font-size: 1.25rem; font-weight: 800; margin: 34px 0 0; padding-top: 28px; border-top: 1px solid var(--line); }
.autosave { font-size: .85rem; font-weight: 700; color: var(--muted); min-height: 1.2em; }
.autosave.is-ok { color: #1b6b3a; }
.autosave.is-warn { color: #8a5a00; }

/* Library card: cartoon style to match the avatars (thick ink outline, flat colors, hard shadow) */
.lcard { --ink: #17132b; position: relative; overflow: hidden; isolation: isolate; border: 3px solid var(--ink); border-radius: 22px; padding: 14px 18px 12px; margin: 4px 8px 30px 0; background: #e9e4ff; --fg: var(--ink); --dot: rgba(23, 19, 43, .2); box-shadow: 7px 7px 0 var(--ink); transition: background .3s ease; }
.lcard[data-plan="monthly"] { background: var(--brand); --fg: #fff; --dot: rgba(255, 255, 255, .28); }
.lcard[data-plan="lifetime"] { background: var(--accent); }
.lcard::before { content: ""; position: absolute; z-index: -1; right: -26px; top: -26px; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle, var(--dot) 2.2px, transparent 2.8px) 0 0 / 14px 14px; }
.lcard::after { content: ""; position: absolute; z-index: -1; left: -84px; bottom: -104px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .28); border: 3px solid var(--ink); }
.lcard__top { display: flex; align-items: center; gap: 10px; }
.lcard__brand { font-weight: 900; font-size: 1.05rem; letter-spacing: .14em; text-transform: uppercase; color: var(--fg); }
.lcard__tag { font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: #fff; padding: 4px 10px; border-radius: 999px; transform: rotate(-3deg); }
.lcard__body { position: relative; display: flex; align-items: center; gap: 16px; margin: 14px 0 12px; padding-right: 96px; }
.lcard__avatar { flex: none; width: 92px; height: 92px; border-radius: 50%; object-fit: cover; background: #fff; border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.lcard__avatar.is-placeholder { filter: grayscale(1); opacity: .6; }
.lcard__avatar.is-pop { animation: avatar-pop .4s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes avatar-pop { 0% { transform: scale(.75) rotate(-6deg); } 100% { transform: none; } }
.lcard__who { display: grid; gap: 6px; min-width: 0; justify-items: start; }
.lcard__who strong { font-size: 1.6rem; font-weight: 900; line-height: 1.1; color: var(--fg); overflow-wrap: anywhere; }
.lcard__who span { font-size: .85rem; font-weight: 800; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; overflow-wrap: anywhere; }
.lcard .lcard__plan { position: absolute; right: 0; top: 4px; margin: 0; padding: 6px 14px; font-size: .85rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; box-shadow: 3px 3px 0 var(--ink); transform: rotate(5deg); }
.lcard .lcard__plan.is-paid { background: #fff; color: var(--ink); border-color: var(--ink); }
.lcard__foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 10px; border-top: 2.5px dashed var(--fg); font-size: .82rem; font-weight: 700; color: var(--fg); }
.lcard__foot b { font-weight: 900; }
.lcard__star { position: absolute; z-index: -1; fill: #fff; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.lcard__star--a { width: 34px; height: 34px; right: 112px; bottom: 54px; transform: rotate(12deg); }
.lcard__star--b { width: 20px; height: 20px; right: 26px; bottom: 46px; transform: rotate(-14deg); }
@media (prefers-reduced-motion: reduce) { .lcard__avatar.is-pop { animation: none; } .lcard { transition: none; } }
@media (max-width: 560px) {
  .lcard { padding: 12px 14px 10px; box-shadow: 5px 5px 0 var(--ink); margin-right: 5px; }
  .lcard__body { gap: 12px; padding-right: 0; margin-top: 12px; }
  .lcard__avatar { width: 72px; height: 72px; box-shadow: 3px 3px 0 var(--ink); }
  .lcard__who strong { font-size: 1.3rem; }
  .lcard__body { position: static; }
  .lcard__tag { display: none; }
  .lcard .lcard__plan { top: 10px; right: 12px; padding: 4px 10px; font-size: .75rem; }
  .lcard__star--a { right: 20px; bottom: 54px; }
  .lcard__star--b { display: none; }
}

.engraved { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: #f1eff9; box-shadow: inset 0 2px 4px rgba(40, 20, 120, .12); margin-top: 6px; }
.engraved__lock { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--muted); }
.engraved div { display: grid; gap: 2px; min-width: 0; }
.engraved strong { letter-spacing: .03em; color: #3b3753; text-shadow: 0 1px 0 #fff; overflow-wrap: anywhere; }
.engraved small { color: var(--muted); font-size: .85rem; }

/* Sign-in and security rows */
.prow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.prow__text { display: grid; gap: 2px; min-width: 0; }
.prow__text strong { overflow-wrap: anywhere; }
.prow__label { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.prow__btn { flex: none; font: inherit; font-weight: 700; font-size: .9rem; color: var(--brand); background: none; border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 16px; cursor: pointer; }
.prow__btn:hover { border-color: var(--brand); }
.prow__form { padding: 16px; margin: 12px 0 4px; border-radius: 16px; background: var(--soft); }
.prow__form[hidden] { display: none; }
.prow__form .auth__input input { background: #fff; }
.prow__actions { display: flex; gap: 10px; justify-content: flex-end; }
.prow__actions .btn { padding: 10px 20px; }
.prow__actions .btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.panel .auth__msg { margin: 12px 0 0; }
.prow__form .auth__msg { margin: 0 0 12px; }

/* Favorites and History (empty for now) */
.empty { text-align: center; padding: 44px 20px; border: 1.5px dashed var(--line); border-radius: 22px; display: grid; justify-items: center; gap: 8px; }
.empty__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--soft); color: var(--brand); margin-bottom: 6px; }
.empty h3 { font-size: 1.2rem; font-weight: 800; }
.empty p { color: var(--muted); max-width: 34ch; margin-bottom: 10px; }

@media (max-width: 760px) {
  .setup__card--account { padding: 20px 16px; }
  .acctpage { grid-template-columns: 1fr; gap: 20px; }
  .acctpage__side { position: static; gap: 12px; }
  .acctpage__nav { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 2px; scrollbar-width: none; }
  .acctpage__nav::-webkit-scrollbar { display: none; }
  .acctpage__nav a { flex: none; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 999px; }
  .acctpage__nav a.is-on { border-color: var(--brand); box-shadow: none; }
  .panel__head h1 { font-size: 1.45rem; }
}
@media (max-width: 560px) {
  .prow__actions .btn { flex: 1; }
  .empty { padding: 32px 16px; }
}

/* Pricing page: the member's own plan */
.plan .btn.is-current { background: var(--soft); color: var(--brand-dark); border-color: var(--brand); box-shadow: none; cursor: default; pointer-events: none; transform: none; }
.plan.is-current { border-color: var(--brand); }

/* Trial Month members: the $30 Lifetime upgrade offer (pricing card and library card) */
.plan__offer { margin: 0; padding: 10px 14px; border-radius: 12px; background: #fff4d6; border: 1.5px dashed var(--accent); color: var(--ink, #17132b); font-weight: 700; font-size: .92rem; }
.lcard__offer { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 14px; background: #fff; color: #17132b; border: 2px solid #17132b; border-radius: 999px; box-shadow: 3px 3px 0 #17132b; font-size: .85rem; font-weight: 900; text-decoration: none; }
.lcard__offer:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 #17132b; }
.plan__offer[hidden], .lcard__offer[hidden] { display: none; }

/* ===== Course page: dark banner, side card with plan-aware buttons, description ===== */
.course-hero { background: var(--ink); color: #fff; padding: 36px 0 48px; min-height: 360px; }
.course-hero__copy { max-width: calc(100% - 400px); display: grid; gap: 14px; justify-items: start; }
.course-hero__crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; font-size: .92rem; font-weight: 700; }
.course-hero__crumbs li + li::before { content: "›"; margin-right: 8px; color: rgba(255, 255, 255, .5); }
.course-hero__crumbs a { color: #c9bfff; }
.course-hero__crumbs a:hover { color: #fff; text-decoration: underline; }
.course-hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.course-hero__lead { font-size: 1.12rem; line-height: 1.55; color: rgba(255, 255, 255, .85); max-width: 62ch; }
.course-hero__badges { display: flex; flex-wrap: wrap; gap: 8px; }
.course-badge { font-size: .78rem; font-weight: 800; padding: 4px 10px; border-radius: 6px; background: #fff4d6; color: #6b4300; }
.course-badge--new { background: var(--accent); color: var(--ink); }
.course-badge[hidden] { display: none; }
.course-hero__by { color: rgba(255, 255, 255, .85); }
.course-hero__by strong { color: #fff; }
.course-hero__meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .92rem; color: rgba(255, 255, 255, .8); }
.course-hero__meta li { display: inline-flex; align-items: center; gap: 6px; }
.course-hero__meta a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.course-hero__meta a:hover { color: #c9bfff; }

.course-body { padding: 0 0 72px; }
.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
.course-side { grid-column: 2; grid-row: 1; margin-top: -320px; position: sticky; top: 88px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 20px 50px rgba(23, 19, 43, .18); overflow: hidden; z-index: 2; }
.course-side__img { aspect-ratio: 16 / 10; background: linear-gradient(135deg, #ece8ff, #fdf2d9); display: grid; place-items: center; }
.course-side__img img { width: 100%; height: 100%; object-fit: contain; }
.course-side__body { padding: 20px 22px 22px; display: grid; gap: 10px; }
.course-side__head { font-weight: 800; font-size: 1.05rem; }
.course-side .btn { width: 100%; text-align: center; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.course-side .btn[hidden], .course-side__note[hidden], .course-side__msg[hidden], .course-side__perks[hidden] { display: none; }
.course-side__note { font-size: .85rem; color: var(--muted); text-align: center; }
.course-side__msg { font-size: .88rem; font-weight: 600; color: var(--brand-dark); background: var(--soft); border-radius: 12px; padding: 10px 12px; }
.course-side__sales { display: grid; gap: 6px; padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line); }
.course-side__sales .btn { border-style: dashed; border-color: #b9adff; color: var(--brand-dark); }
.course-side__sales small { text-align: center; color: var(--muted); font-size: .8rem; }
.course-side__perks { list-style: none; margin: 4px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; color: var(--muted); font-size: .92rem; }
.course-side__perks li { display: flex; align-items: center; gap: 10px; }

.course-main { grid-column: 1; grid-row: 1; padding-top: 0; display: grid; gap: 40px; }
.course-promo { display: flex; align-items: stretch; margin-top: -28px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; z-index: 1; transition: border-color .15s ease; }
.course-promo:hover { border-color: var(--brand); }
.course-promo[hidden] { display: none; }
.course-promo__tag { flex: none; display: grid; place-items: center; align-content: center; gap: 2px; padding: 16px 22px; background: var(--brand); color: #fff; font-size: .95rem; }
.course-promo__text { padding: 16px 20px; align-self: center; color: var(--muted); line-height: 1.55; }
.course-promo__text strong { color: var(--ink); }
.course-promo__text u { color: var(--brand); font-weight: 700; }
.course-about h2, .course-related h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 14px; }
.course-about__text { display: grid; gap: 10px; color: #3b3755; line-height: 1.65; overflow-wrap: anywhere; }
.course-about__text.is-folded { max-height: 22em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.course-about__more { margin-top: 12px; background: none; border: 0; padding: 0; font: inherit; font-weight: 800; color: var(--brand); cursor: pointer; }
.course-about__more:hover { text-decoration: underline; }
.course-about__more[hidden] { display: none; }
.course-related .cat-row__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.course-related .course-card__link { grid-template-columns: 200px 1fr; column-gap: 20px; }
.course-bar { display: none; }

@media (max-width: 960px) {
  .course-hero { min-height: 0; padding: 24px 0 72px; }
  .course-hero__copy { max-width: none; }
  .course-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .course-side { grid-column: 1; grid-row: 1; margin-top: -48px; position: static; width: 100%; max-width: 560px; justify-self: center; }
  .course-main { grid-row: 2; }
  .course-promo { margin-top: 0; }
}
@media (max-width: 760px) {
  .course-bar { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(23, 19, 43, .08); transform: translateY(110%); transition: transform .2s ease; }
  .course-bar.is-shown { transform: none; }
  .course-bar .btn { display: block; width: 100%; text-align: center; }
  .page-course.bar-on .alex__fab { bottom: 84px; }
  .page-course .footer { padding-bottom: 96px; }
  .course-related .course-card__link { grid-template-columns: 120px 1fr; column-gap: 14px; }
}
@media (max-width: 560px) {
  .course-hero h1 { font-size: 1.55rem; }
  .course-hero__lead { font-size: 1rem; }
  .course-promo { flex-direction: column; }
  .course-promo__tag { grid-auto-flow: column; justify-content: start; gap: 8px; padding: 10px 16px; }
  .course-side__body { padding: 16px; }
}

/* Home hero (desktop): fills the first screen exactly (window height minus the menu bar), picture as large as fits */
@media (min-width: 961px) {
  .page-home .hero { min-height: calc(100svh - 69px); display: flex; align-items: center; padding: 16px 0; box-sizing: border-box; }
  .page-home .hero .scene { max-width: min(calc(50vw - 16px), max(480px, calc((100svh - 69px - 32px) * 1234 / 1274))); }
}

/* ===== Admin page (/admin/) ===== */
.admin { min-height: 70vh; }
.admin__state { text-align: center; padding: 80px 16px; color: var(--muted); }
.admin__denied { display: grid; justify-items: center; gap: 12px; }
.admin [hidden], .admin__dialog [hidden] { display: none !important; }
.admin__denied h1 { font-size: 2rem; font-weight: 800; color: var(--ink); }
.admin__mfa { margin: 24px auto; }
.admin__mfa h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
.admin__qr { display: grid; justify-items: center; gap: 10px; margin: 8px 0 18px; text-align: center; }
.admin__qr img { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; width: 180px; height: 180px; }
.admin__secret { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.admin__secret code { display: block; margin-top: 4px; font-weight: 800; color: var(--ink); letter-spacing: .06em; }
.admin__wide { width: 100%; }
.admin__link { background: none; border: 0; padding: 0; font: inherit; font-weight: 800; color: var(--brand); cursor: pointer; }
.admin__link:hover { text-decoration: underline; }
.admin__soon { display: flex; align-items: center; gap: 12px; padding: 11px 14px; color: #a39fbd; font-weight: 600; cursor: default; }
.admin__soon em { margin-left: auto; font-style: normal; font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: var(--soft); color: var(--muted); padding: 2px 8px; border-radius: 999px; }

.admin__stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--soft); border-radius: 16px; padding: 16px 18px; display: grid; gap: 4px; }
.stat strong { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.stat span { color: var(--muted); font-weight: 700; font-size: .88rem; }
.stat.is-accent { background: #fff4d6; }
.stat.is-warn { background: #fdeceb; }
.stat.is-warn strong { color: #9b1c1c; }

.admin__chart { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 170px; padding-top: 8px; }
.admin__chart .bar { display: grid; grid-template-rows: 1fr auto; gap: 6px; height: 100%; align-items: end; }
.admin__chart .bar i { display: block; background: var(--brand); border-radius: 6px 6px 2px 2px; min-height: 3px; opacity: .85; }
.admin__chart .bar:hover i { opacity: 1; }
.admin__chart .bar span { font-size: .72rem; color: var(--muted); text-align: center; }

.admin__feed { list-style: none; margin: 14px 0 0; padding: 0; display: grid; }
.admin__feed li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.admin__feed small { color: var(--muted); }
.admin__feed .admin__none { color: var(--muted); justify-content: flex-start; }

.admin__filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.admin__filters input, .admin__filters select, .admin__dialog select, .admin__dialog input[type="date"] { font: inherit; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.admin__filters input { flex: 1; min-width: 200px; }
.admin__filters input:focus, .admin__filters select:focus { outline: none; border-color: var(--brand); }
.admin__list { display: grid; gap: 8px; }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px 16px; align-items: center; text-align: left; font: inherit; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 16px; cursor: pointer; color: var(--ink); transition: border-color .15s ease; }
.mrow:hover { border-color: var(--brand); }
.mrow__who { display: grid; min-width: 0; }
.mrow__who strong, .mrow__who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow__who small, .mrow__date { color: var(--muted); font-size: .85rem; }
.mrow .plan-pill { margin-top: 0; }
.tag { font-style: normal; font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.tag--warn { background: #fdeceb; color: #9b1c1c; }
.tag--admin { background: #fff4d6; color: #6b4300; }
.admin__pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; color: var(--muted); font-weight: 700; }
.admin__pager .btn:disabled { opacity: .4; cursor: default; transform: none; }

.admin__dialog { border: 0; border-radius: 22px; padding: 26px; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 30px 80px rgba(23, 19, 43, .35); color: var(--ink); }
.admin__dialog::backdrop { background: rgba(23, 19, 43, .55); }
.admin__dlg-close { position: absolute; top: 12px; right: 14px; margin: 0; }
.admin__dlg-close button { background: none; border: 0; font-size: 1.8rem; line-height: 1; color: var(--muted); cursor: pointer; }
.admin__dialog h2 { font-size: 1.4rem; font-weight: 800; padding-right: 28px; }
.admin__dialog h3 { font-size: 1rem; font-weight: 800; margin-bottom: 10px; }
.admin__meta { color: var(--muted); margin: 6px 0 14px; overflow-wrap: anywhere; }
.admin__warn { color: #9b1c1c; }
.admin__block { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; display: grid; gap: 10px; justify-items: start; }
.admin__block .auth__field { margin-bottom: 4px; width: 100%; }
.admin__note { color: var(--muted); font-size: .92rem; }
.admin__check { display: flex; gap: 10px; align-items: center; font-size: .92rem; margin-bottom: 10px; }
.admin__danger { border-top: 1px dashed #e8b4b0; padding-top: 14px; margin-top: 6px; display: grid; gap: 10px; width: 100%; justify-items: start; }
.admin__danger .auth__input { width: 100%; }
.btn--danger { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn--danger:hover { background: #a02d21; }
.btn--danger:disabled { opacity: .4; cursor: default; transform: none; }

@media (max-width: 760px) {
  .mrow { grid-template-columns: minmax(0, 1fr) auto; }
  .mrow__date, .mrow .tag { justify-self: start; }
  .admin__chart { gap: 3px; }
  .admin__soon { display: none; }
  .admin__dialog { padding: 20px 16px; }
}

/* Pricing page: plans a member already has are locked, their own plan is marked */
.plan { transition: opacity .2s ease; }
.plan.is-locked { opacity: .62; box-shadow: none; }
.plan .btn.is-locked { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #f2f1f8; color: #7a7692; border-color: #e3e1ef; box-shadow: none; cursor: not-allowed; pointer-events: none; transform: none; }
.plan__badge--you { background: var(--brand); color: #fff; }
.plan.is-current .plan__badge:not(.plan__badge--you) { display: none; }
.plans__msg { margin-inline: auto; padding: 10px 18px; border-radius: 14px; background: var(--soft); color: var(--brand-dark); font-weight: 700; max-width: 56ch; }
.plans__msg[hidden], .page-head p[hidden], .plans__foot[hidden] { display: none; }

/* Profile page: Log out at the bottom of every section */
.panel__logout { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-start; }
.panel__logout .btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; }
.panel__logout .btn:hover { border-color: #c0392b; color: #c0392b; }
@media (max-width: 560px) { .panel__logout .btn { width: 100%; justify-content: center; } }

/* Phones: the course picture sits on top of the card at full width, so the whole image is big enough to read */
@media (max-width: 560px) {
  .course-card__link, .course-related .course-card__link { grid-template-columns: 1fr; column-gap: 0; }
  .course-card__thumb { aspect-ratio: 16 / 9; height: auto; min-height: 0; }
  .course-card__body { padding: 12px 14px 16px; }
}

/* ===== Affiliate dashboard (/work-with-us/ for signed-in members) ===== */
.aff { display: grid; gap: 20px; }
.aff[hidden], .linkbox[hidden], [data-aff-member] [hidden] { display: none !important; }
.astats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.astat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: grid; gap: 4px; }
.astat strong { font-size: 1.7rem; font-weight: 800; line-height: 1.1; color: var(--brand-dark); }
.astat span { color: var(--muted); font-weight: 700; font-size: .88rem; }
.astat.is-accent { background: #fff4d6; border-color: #f5d68a; }
.aff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.aff-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; display: grid; gap: 10px; align-content: start; justify-items: start; }
.aff-card h3 { font-size: 1.15rem; font-weight: 800; }
.aff-card__big { font-size: 2.2rem; font-weight: 800; line-height: 1; color: var(--ink); }
.aff-card__note { color: var(--muted); font-size: .93rem; }
.aff-card .auth__input { width: 100%; }
.aff-card__row { display: flex; align-items: center; gap: 12px; }
.aff-card .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.aff-empty { color: var(--muted); }
.atable { width: 100%; overflow-x: auto; }
.atable table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.atable th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.atable td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.atable td small { color: var(--muted); }
.tag--hold { background: #f2f1f8; color: #5b5775; text-transform: none; }
.tag--ok { background: #e8f7ee; color: #1b6b3a; }
.tag--req { background: #fff4d6; color: #6b4300; }
.tag--paid { background: var(--soft); color: var(--brand-dark); }
@media (max-width: 760px) {
  .astats { grid-template-columns: repeat(2, 1fr); }
  .aff-grid { grid-template-columns: 1fr; }
  .astat strong { font-size: 1.4rem; }
}

/* Admin: payout requests */
.preq { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px 18px; align-items: center; background: #fff; border: 1.5px solid #f5d68a; border-radius: 14px; padding: 14px 16px; }
.preq__who { display: grid; gap: 2px; min-width: 0; }
.preq__who small { color: var(--muted); overflow-wrap: anywhere; }
.preq__amount { font-size: 1.4rem; font-weight: 800; }
.preq__actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 760px) { .preq { grid-template-columns: 1fr; } }
/* Admin: section headings inside panels stay small (the page-wide ".section h2" size is for marketing pages) */
.admin .panel__h2 { font-size: 1.25rem; }
/* Account and admin pages: wide tables scroll inside their box instead of stretching the page on phones */
.acctpage > * { min-width: 0; }

/* Member-only and visitor-only parts of a page (switched by account.js) */
[data-member-only][hidden], [data-visitor-only][hidden] { display: none !important; }

/* Affiliate dashboard page (/earnings/) */
.earnings-page { padding-top: 8px; }
.earnings-page__loading { text-align: center; color: var(--muted); padding: 48px 0; }
.earnings-page__loading[hidden] { display: none; }
.page-earnings .page-head .more { color: var(--brand); font-weight: 700; margin-left: 6px; }
.aff-rules ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); }
.aff-rules .more { color: var(--brand); font-weight: 700; }

/* Account page: the link out to the affiliate dashboard, under the section menu */
.acctpage__out { display: flex; align-items: center; gap: 12px; padding: 11px 14px; margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0; color: var(--brand-dark); font-weight: 700; text-decoration: none; }
.acctpage__out span:last-child { margin-left: auto; }
.acctpage__out:hover { background: var(--soft); border-radius: 12px; }
@media (max-width: 760px) {
  .acctpage__out { flex: none; margin-top: 0; border: 1.5px solid var(--brand); border-radius: 999px; padding: 9px 14px; }
  .acctpage__out span:last-child { margin-left: 0; }
}

/* ===== Search: header suggestions ===== */
.search__list { max-height: min(70vh, 520px); overflow-y: auto; min-width: 360px; }
.search__group { padding: 8px 12px 4px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.search__list a.search__course { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: center; justify-content: stretch; }
.search__thumb { width: 56px; height: 36px; border-radius: 8px; overflow: hidden; background: linear-gradient(135deg, #ece8ff, #fdf2d9); display: grid; place-items: center; }
.search__thumb img { width: 100%; height: 100%; object-fit: contain; }
.search__ph { font-weight: 800; color: var(--brand); opacity: .6; }
.search__text { display: grid; gap: 1px; min-width: 0; }
.search__title { font-size: .92rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.search__list .search__text small { text-align: left; }
.search__list mark, .search-page mark, .course-card mark { background: #fff1c2; color: inherit; border-radius: 3px; padding: 0 1px; }
.search__all a { justify-content: center; font-weight: 800; color: var(--brand); border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; margin-top: 4px; }
@media (max-width: 960px) { .search__list { min-width: 0; } }

/* ===== Search results page (/search/) ===== */
.search-head h1 { margin-bottom: 14px; }
.search-page__form { position: relative; display: flex; gap: 10px; max-width: 760px; }
.search-page__icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-page__form input { flex: 1; min-width: 0; font: inherit; font-size: 1.05rem; padding: 14px 18px 14px 52px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); }
.search-page__form input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.search-page__status { font-weight: 700; color: var(--ink); margin-bottom: 14px; }
.search-page__hint { color: var(--muted); font-size: .92rem; margin: 4px 0 0; }
.search-page__cats .chips { margin-top: 8px; }
.search-page__cats .chips small { color: var(--muted); font-weight: 600; }
.search-page__cats { margin-bottom: 18px; }
.search-page__tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.search-page__tools[hidden] { display: none; }
.search-page__filter { margin: 0; }
.search-page__filter .chip-link.is-on { background: var(--brand); color: #fff; }
.search-page__sort { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); font-size: .9rem; }
.search-page__sort select { font: inherit; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
@media (max-width: 560px) {
  .search-page__form .btn { padding-inline: 18px; }
  .search-page__form input { padding-left: 46px; font-size: 1rem; }
  .search-page__filter { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .search-page__filter .chip-link { flex: none; }
}
/* Search suggestions: wide enough for long course titles on desktop */
@media (min-width: 961px) { .search__list { width: 460px; right: auto; } }

/* Course page: "Course needs a password?" under the Download button */
.course-side__pw { font-size: .85rem; color: var(--muted); text-align: center; margin-top: -2px; }
.course-side__pw a { color: var(--brand); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.course-side__pw[hidden] { display: none; }

/* Course password page (/password/) */
.pw-page { min-height: 60vh; }
.pw-card { max-width: 520px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 36px 32px; display: grid; justify-items: center; gap: 14px; text-align: center; }
.pw-card__lock { width: 64px; height: 64px; border-radius: 50%; background: var(--soft); color: var(--brand); display: grid; place-items: center; }
.pw-card h1 { font-size: 1.8rem; font-weight: 800; }
.pw-card__sub { color: var(--muted); max-width: 38ch; }
.pw-count { position: relative; width: 120px; height: 120px; display: grid; place-items: center; margin: 6px 0; }
.pw-count[hidden] { display: none; }
.pw-count svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.pw-count circle { fill: none; stroke-width: 8; }
.pw-count__track { stroke: var(--soft); }
.pw-count__ring { stroke: var(--brand); stroke-linecap: round; }
.pw-count span { font-size: 2.6rem; font-weight: 800; color: var(--brand-dark); }
.pw-reveal { width: 100%; display: grid; gap: 8px; }
.pw-reveal[hidden] { display: none; }
.pw-reveal__label { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pw-reveal__box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 20px; border: 2px dashed var(--brand); border-radius: 16px; background: var(--soft); }
.pw-reveal__box code { font-size: 1.35rem; font-weight: 800; color: var(--ink); letter-spacing: .02em; overflow-wrap: anywhere; text-align: left; }
.pw-reveal__note { font-size: .88rem; color: var(--muted); }
.pw-card__back { color: var(--brand); font-weight: 700; margin-top: 6px; }
@media (max-width: 560px) { .pw-card { padding: 28px 18px; } .pw-reveal__box code { font-size: 1.15rem; } }

/* ===== Pricing page: on a computer screen the three plans fit without scrolling (sizes follow the window height) ===== */
@media (min-width: 961px) {
  .page-pricing .page-head { padding-top: clamp(12px, 2.6vh, 36px); padding-bottom: 0; }
  .page-pricing .page-head h1 { font-size: clamp(1.7rem, 5.2vh, 2.8rem); }
  .page-pricing .plans__msg { margin-top: clamp(6px, 1.2vh, 14px); padding: clamp(6px, 1vh, 10px) 18px; font-size: clamp(.85rem, 1.9vh, 1rem); }
  .page-pricing .section--tight { padding-top: clamp(16px, 3.4vh, 40px); padding-bottom: clamp(10px, 2vh, 30px); }
  .page-pricing .plans { gap: 20px; }
  .page-pricing .plan { padding: clamp(14px, 2.4vh, 28px) clamp(18px, 2vw, 32px); gap: clamp(5px, 1.1vh, 12px); }
  .page-pricing .plan h2 { font-size: clamp(1.05rem, 2.6vh, 1.3rem); }
  .page-pricing .plan__price strong { font-size: clamp(2.1rem, 6.2vh, 3rem); }
  .page-pricing .plan__note, .page-pricing .plan__list { font-size: clamp(.82rem, 1.85vh, 1rem); line-height: 1.35; }
  .page-pricing .plan__list { gap: clamp(5px, 1.2vh, 12px); margin: 2px 0 clamp(4px, 1vh, 12px); }
  .page-pricing .plan__offer { padding: clamp(6px, 1vh, 10px) 14px; font-size: clamp(.78rem, 1.7vh, .92rem); }
  .page-pricing .plan .btn { padding-block: clamp(9px, 1.5vh, 14px); }
  .page-pricing .page-head:has(.plans__msg:not([hidden])) [data-plans-lead] { display: none; }   /* a member's own message replaces the lead line */
  .page-pricing .plans__msg { max-width: 900px; }
  .page-pricing .section--tight { padding-top: clamp(16px, 3vh, 40px); }
  .page-pricing .plans__foot { margin-top: clamp(10px, 2vh, 28px); font-size: clamp(.8rem, 1.8vh, .95rem); line-height: 1.4; }
}
@media (min-width: 961px) and (max-height: 660px) {   /* short windows (small laptops) */
  .page-pricing .page-head h1 { font-size: 1.6rem; }
  .page-pricing .plan { gap: 4px; padding-block: 12px; }
  .page-pricing .plan__list { gap: 3px; }
  .page-pricing .plan__price strong { font-size: 2rem; }
  .page-pricing .section--tight { padding-top: 14px; }
}

/* ===== History & Favorites: picture cards (Explore "Continue Learning", Profile panels) and the course page heart ===== */
.cl[hidden], .cl-grid[hidden], [data-fav-empty][hidden], [data-hist-empty][hidden], [data-hist-clear][hidden] { display: none; }
.cl { padding-bottom: 0; }
.cl__head { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.cl__head .block-title { margin: 0; }
.cl__all { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--ink); transition: background .15s ease, color .15s ease; }
.cl__all:hover { background: var(--soft); color: var(--brand); }
/* Continue Learning: a carousel showing 3 cards at a time */
.cl__arrows { margin-left: auto; display: flex; gap: 8px; }
.cl__arrows[hidden] { display: none; }
.cl__arrow { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.cl__arrow:hover:not(:disabled) { background: var(--brand); border-color: var(--brand); color: #fff; }
.cl__arrow:disabled { opacity: .35; cursor: default; }
.cl__row { --gap: 22px; display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 4px 2px 6px; margin: -4px -2px 0; scroll-padding-inline: 2px; }
.cl__row::-webkit-scrollbar { display: none; }
.cl__row .cl-card { flex: 0 0 calc((100% - 2 * var(--gap)) / 3); scroll-snap-align: start; }
.cl__row .cl-card__title { font-size: 1.08rem; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.cl__row .cl-card__cat { font-size: .76rem; }
.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; margin-top: 8px; }
.cl-card { position: relative; min-width: 0; }
.cl-card__link { display: block; color: inherit; text-decoration: none; }
.cl-card__thumb {
  position: relative; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, #ece8ff, #fdf2d9); border: 1px solid var(--line); transition: transform .15s ease, box-shadow .15s ease;
}
.cl-card__thumb img { width: 100%; height: 100%; object-fit: contain; }
.cl-card__ph { font-size: 2.2rem; font-weight: 800; color: var(--brand); opacity: .55; }
.cl-card__link:hover .cl-card__thumb { transform: translateY(-3px); box-shadow: var(--shadow); }
.cl-card__badge {
  position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px;
  background: rgba(23, 19, 43, .82); color: #fff; font-size: .74rem; font-weight: 700; backdrop-filter: blur(4px);
}
.cl-card__badge.is-done { background: var(--brand); }
.cl-card__cat { margin-top: 10px; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-card__title { margin-top: 3px; font-size: .98rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-card__link:hover .cl-card__title { color: var(--brand); }
.cl-card__btn {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 9px; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(23, 19, 43, .82); color: #fff; opacity: .9; transition: background .15s ease, opacity .15s ease;
}
.cl-card__btn:hover, .cl-card__btn:focus-visible { background: #e5484d; opacity: 1; }
.cl-card__btn.is-fav { color: #ff6b81; }
.cl-card__btn.is-fav:hover { color: #fff; }
@media (max-width: 960px) {
  /* one swipeable row on tablets and phones */
  .cl__row { --gap: 14px; }
  .cl__row .cl-card { flex-basis: calc((100% - var(--gap)) / 2); }
}
@media (max-width: 560px) { .cl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } .cl-card__title { font-size: .9rem; } }
.hist-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.course-side__fav {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 10px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.course-side__fav:hover { border-color: #ff6b81; color: #e5484d; }
.course-side__fav.is-on { border-color: #ff6b81; background: #fff0f3; color: #e5484d; }
.course-side__fav.is-on svg { fill: currentColor; }
@media (max-width: 560px) { .cl__row .cl-card { flex-basis: 80%; } .cl__arrows { display: none; } }

/* ===== Date filter (admin page, affiliate dashboard) ===== */
.dfilter { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 18px; display: grid; gap: 10px; }
.dfilter__top { display: flex; align-items: center; gap: 10px; }
.dfilter__icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--soft); color: var(--brand); }
.dfilter__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dfilter__chips button {
  font: inherit; font-size: .88rem; font-weight: 700; padding: 7px 13px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.dfilter__chips button:hover { border-color: var(--brand); color: var(--brand); }
.dfilter__chips button.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.dfilter__custom { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding-left: 44px; }
.dfilter__custom[hidden], .dfilter__err[hidden] { display: none; }
.dfilter__custom label { display: grid; gap: 4px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.dfilter__custom input { font: inherit; font-size: .92rem; padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.dfilter__custom input:focus { outline: none; border-color: var(--brand); }
.dfilter__err { width: 100%; margin: 0; color: #9b1c1c; font-size: .85rem; font-weight: 700; }
.dfilter__note { margin: 0; padding-left: 44px; font-size: .85rem; font-weight: 700; color: var(--brand-dark); }
@media (max-width: 560px) {
  .dfilter__icon { display: none; }
  .dfilter__custom, .dfilter__note { padding-left: 0; }
  .dfilter__chips button { padding: 6px 11px; font-size: .82rem; }
}
.stat.is-period { background: #fff; border: 1.5px solid var(--brand); }
.admin__chart { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.admin__chart .bar span { white-space: nowrap; }
.aff-period { display: grid; gap: 10px; margin-top: 6px; }
.aff-period .dfilter { margin-bottom: 0; }
.earnings-page .aff .aff-period__h { font-size: 1.25rem; font-weight: 800; margin: 0; }
.earnings-page .aff .aff-period__h--sub { margin-top: 6px; font-size: 1.05rem; }
.astats--three { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 761px) { .aff .astats:not(.astats--three) { grid-template-columns: repeat(4, 1fr); } }
.dfilter, .aff-period > * { min-width: 0; }
.dfilter__custom label { min-width: 0; flex: 1 1 130px; }
.dfilter__custom input { width: 100%; min-width: 0; box-sizing: border-box; }
.aff { grid-template-columns: minmax(0, 1fr); }
.astat { min-width: 0; }
@media (max-width: 560px) { .astats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .astats--three .astat:last-child { grid-column: 1 / -1; } .astat strong { font-size: 1.4rem; } }

/* Affiliate dashboard: the payout request form (amount + PayPal email) */
.payout-form { display: grid; gap: 14px; align-content: start; }
.payout-form .auth__field { margin: 0; display: grid; gap: 6px; }
.payout-form label { font-weight: 700; font-size: .9rem; }
.payout-form__amount { display: flex; gap: 8px; align-items: center; }
.payout-form__amount .auth__input { flex: 1; min-width: 0; }
.payout-form__amount input { padding-left: 30px; font-weight: 800; font-size: 1.05rem; }
.payout-form__cur { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-weight: 800; color: var(--muted); pointer-events: none; }
.payout-form__hint { color: var(--muted); font-size: .82rem; }
.payout-form input:disabled { background: #f6f5fa; color: var(--muted); }
.payout-form .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Course page: notice on courses added more than 3 years ago */
.old-note[hidden] { display: none; }
.old-note { padding: 14px 0 0; background: var(--bg); }
.old-note__bar {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; padding: 12px 18px; border-radius: 12px;
  background: #f25c05; color: #fff; font-weight: 600; font-size: .95rem; line-height: 1.4; text-align: center;
}
.old-note__bar svg { flex: none; }
.old-note__bar strong { font-weight: 800; }
.page-course .old-note + .course-hero { margin-top: 14px; }
@media (max-width: 560px) { .old-note__bar { font-size: .86rem; padding: 10px 14px; text-align: left; justify-content: flex-start; } }

/* ---------- Free courses ---------- */
.badge-free { position: absolute; top: 12px; right: 12px; background: #12805c; color: #fff; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 4px 12px; border-radius: 999px; box-shadow: 0 4px 10px rgba(0,0,0,.12); }
@media (max-width: 560px) { .badge-free { top: 8px; right: 8px; padding: 3px 9px; font-size: .68rem; } }
.course-badge--free { background: #e3f6ee; color: #0b5d42; }
.plan__more { margin-top: 10px; font-weight: 700; font-size: .95rem; }
.plan__more a { color: var(--brand); }
.free-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-start; margin-top: 20px; }
.free-cta[hidden], [data-visitor-only][hidden] { display: none !important; }
.free-filter { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.free-filter label { font-weight: 700; }
.free-filter select { font: inherit; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); max-width: 100%; }
.course-card[hidden] { display: none !important; }
.free-upgrade { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 28px; border-radius: var(--radius); background: var(--soft); border: 1px solid var(--line); }
.free-upgrade h2 { font-size: 1.4rem; }
.free-upgrade p { color: var(--muted); margin-top: 6px; max-width: 56ch; }
.free-upgrade[hidden], [data-free-upgrade][hidden] { display: none !important; }
.free-row .course-grid { margin-top: 4px; }

/* Home page: a picture of the real Alexandria chat (uses the chat's own .alex__ pieces) */
.alex-demo { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 20px 50px rgba(40, 20, 120, .16); overflow: hidden; display: flex; flex-direction: column; width: 100%; max-width: 440px; justify-self: center; }
.alex-demo .alex__msgs { overflow: visible; padding: 18px 16px; }
.alex-demo .alex__msg--ai:has(.alex__card) { max-width: 94%; }
.alex-demo .alex__form input { min-width: 0; background: #fff; }
.alex-demo .alex__note { padding-top: 0; }
.alex-demo .alex__choices button { cursor: pointer; }
.alex-demo .alex__msg { white-space: normal; }

/* $30 Lifetime offer for new Trial Month members: countdown bar at the very top, and a once-a-day pop-up (account.js) */
.offer-bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 16px; padding: 9px 16px; background: linear-gradient(90deg, #4429d6, #7a3df5); color: #fff; font-size: .92rem; text-align: center; }
.offer-bar__time { display: inline-block; min-width: 9ch; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent); }
.offer-bar__btn { background: var(--accent); color: #17132b; font-weight: 700; padding: 6px 14px; border-radius: 999px; text-decoration: none; white-space: nowrap; }
.offer-bar__btn:hover { background: #ffc24d; }
.offer-pop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(23, 19, 43, .55); }
.offer-pop__box { position: relative; width: 100%; max-width: 440px; background: #fff; border-radius: 20px; padding: 30px 26px 22px; text-align: center; box-shadow: 0 30px 80px rgba(23, 19, 43, .35); }
.offer-pop__box h2 { margin: 6px 0 12px; font-size: 1.5rem; color: var(--ink); }
.offer-pop__box p { color: var(--muted); margin: 0 0 12px; line-height: 1.5; }
.offer-pop__tag { display: inline-block; background: var(--soft); color: var(--brand) !important; font-weight: 700; font-size: .82rem; padding: 4px 12px; border-radius: 999px; }
.offer-pop__ends { margin: 16px 0 2px !important; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.offer-pop__time { font-size: 2rem; font-weight: 800; color: var(--brand) !important; font-variant-numeric: tabular-nums; margin-bottom: 18px !important; }
.offer-pop__go { display: block; width: 100%; }
.offer-pop__later { margin-top: 10px; background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }
.offer-pop__x { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--soft); color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer; }

/* Explore hero with a picture: the box takes the picture's shape (wide on computers, taller on phones) so nothing is cropped */
.hero-slider--img .slides { height: auto; aspect-ratio: 2000 / 593; }
.slide--img { padding: 0; }
.slide__img, .slide__link { position: absolute; inset: 0; display: block; }
.slide__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 560px) { .hero-slider--img .slides { aspect-ratio: 1000 / 584; } .slide--img { padding: 0; } }

/* ===== Aucto, the creator, talking at the top of Explore (aucto.js) ===== */
.aucto { width: min(1120px, 100% - 32px); margin: 24px auto 0; }
.aucto[hidden] { display: none; }
.aucto__card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 1fr auto; column-gap: 30px; row-gap: 14px; padding: 24px 32px 0; border-radius: 24px; background: linear-gradient(135deg, #f5f3ff 0%, #ece7ff 55%, #ffe9dc 100%); box-shadow: var(--shadow); overflow: hidden; }
.aucto__me { grid-row: 1 / 3; align-self: end; display: flex; align-items: flex-end; gap: 14px; }
.aucto__face { display: block; width: auto; height: 250px; max-width: 240px; object-fit: contain; object-position: bottom; transform-origin: 50% 100%; margin-bottom: 8px; }
.aucto.is-bounce .aucto__face { animation: aucto-bounce .5s ease; }
@keyframes aucto-bounce { 0% { transform: scale(.94, 1.04); } 40% { transform: scale(1.05, .96); } 70% { transform: scale(.98, 1.02); } 100% { transform: none; } }
/* The comic panel with the knife: its place is kept empty until it pops up, so nothing moves */
.aucto__knife { display: none; width: 112px; height: auto; align-self: center; visibility: hidden; border-radius: 4px; box-shadow: 0 10px 26px rgba(30, 20, 60, .28); transform: rotate(-5deg); }
.aucto.is-knife .aucto__knife { display: block; }
.aucto.is-out .aucto__knife { visibility: visible; animation: aucto-pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes aucto-pop { 0% { transform: scale(.2) rotate(14deg); opacity: 0; } 100% { transform: rotate(-5deg); opacity: 1; } }
.aucto.is-out .aucto__face { animation: aucto-shiver .35s linear; }
@keyframes aucto-shiver { 0%, 100% { transform: none; } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.aucto__bubble { position: relative; align-self: end; background: #fff; border: 2.5px solid #2b2733; border-radius: 22px; padding: 18px 24px; box-shadow: 0 8px 22px rgba(40, 20, 120, .1); }
.aucto__bubble::before { content: ""; position: absolute; left: -12px; bottom: 34px; width: 20px; height: 20px; background: #fff; border-left: 2.5px solid #2b2733; border-bottom: 2.5px solid #2b2733; transform: rotate(45deg); border-radius: 0 0 0 4px; }
.aucto__who { font-size: .78rem; font-weight: 800; letter-spacing: .04em; color: var(--brand); margin: 0 0 2px; }
.aucto__title { font-size: 1.4rem; font-weight: 800; line-height: 1.2; color: var(--ink); margin: 0 0 6px; }
.aucto__text { color: var(--muted); font-size: 1.02rem; margin: 0; line-height: 1.5; }
.aucto__text strong { color: var(--ink); }
.aucto__btns { display: flex; flex-wrap: wrap; gap: 10px; align-self: start; padding: 0 110px 18px 0; }
.aucto__btn { padding: 10px 18px; font-size: .92rem; }
.aucto__hide { position: absolute; right: 20px; bottom: 24px; background: none; border: 0; font: inherit; color: var(--muted); font-size: .82rem; cursor: pointer; padding: 4px 2px; }
.aucto__hide:hover { color: var(--ink); text-decoration: underline; }
.aucto.is-typing .aucto__bubble > :not(.aucto__dots), .aucto.is-typing .aucto__btns { visibility: hidden; }
.aucto__dots { display: none; position: absolute; left: 24px; top: 50%; margin-top: -5px; gap: 6px; }
.aucto.is-typing .aucto__dots { display: inline-flex; }
.aucto__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); opacity: .35; animation: aucto-dot 1s infinite ease-in-out; }
.aucto__dots i:nth-child(2) { animation-delay: .15s; }
.aucto__dots i:nth-child(3) { animation-delay: .3s; }
@keyframes aucto-dot { 0%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
/* The tour lights up the part of the page it talks about */
.aucto-spot { outline: 3px solid var(--accent) !important; outline-offset: 4px; border-radius: 12px; animation: aucto-spot 1.2s ease-in-out infinite; }
@keyframes aucto-spot { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 176, 32, .55); } 50% { box-shadow: 0 0 0 10px rgba(255, 176, 32, 0); } }
@media (max-width: 640px) {
  /* Phone: the speech bubble across the top, Aucto below it pointing up at it, buttons beside Aucto */
  .aucto__card { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; row-gap: 12px; padding: 14px 14px 0; }
  .aucto__bubble { grid-column: 1 / -1; grid-row: 1; padding: 14px 16px; border-radius: 18px; }
  .aucto__bubble::before { left: 30px; bottom: -12px; border-left: 0; border-right: 2.5px solid #2b2733; border-radius: 0 0 4px 0; }
  .aucto__who { font-size: .72rem; }
  .aucto__title { font-size: 1.15rem; }
  .aucto__text { font-size: .95rem; }
  .aucto__me { grid-column: 1; grid-row: 2; gap: 6px; }
  .aucto__face { height: 128px; max-width: 124px; margin-bottom: 6px; }
  .aucto__face { order: -1; }                 /* Aucto first, so the bubble's tail points at his head and the knife panel sits beside him */
  .aucto__knife { width: 62px; }
  .aucto__dots { left: 16px; }
  .aucto__btns { grid-column: 2; grid-row: 2; align-self: center; flex-direction: column; flex-wrap: nowrap; gap: 8px; padding: 0 0 26px; }
  .aucto__btn { width: 100%; text-align: center; padding: 10px 12px; font-size: .88rem; }
  .aucto__hide { right: 14px; bottom: 6px; font-size: .76rem; }
}
@media (prefers-reduced-motion: reduce) { .aucto.is-bounce .aucto__face, .aucto.is-out .aucto__face, .aucto.is-out .aucto__knife, .aucto__dots i, .aucto-spot { animation: none; } }
/* Glow on the courses an Aucto button points at */
.aucto-flash { animation: aucto-flash 2.4s ease-out; border-radius: 16px; }
@keyframes aucto-flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 176, 32, 0); } 15%, 60% { box-shadow: 0 0 0 5px rgba(255, 176, 32, .9), 0 10px 30px rgba(255, 176, 32, .35); } }
@media (prefers-reduced-motion: reduce) { .aucto-flash { animation: none; box-shadow: 0 0 0 4px rgba(255, 176, 32, .9); } }
