/* ============================================
   MKSTEAM Biology — Main Stylesheet
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Author display rules (e.g. display:grid) outrank the UA's [hidden] rule,
   which silently defeats the attribute. Keep this ahead of everything. */
[hidden] { display: none !important; }

:root {
  --bg: #FBFCFE;
  --bg-alt: #F1F5FA;
  --surface: #FFFFFF;
  --text: #131C2E;
  --text-2: #45536B;
  --text-3: #636F86;
  --teal: #0A7E70;
  --teal-dim: rgba(10,126,112,0.09);
  --teal-mid: rgba(10,126,112,0.18);
  --coral: #E05C3C;
  --coral-dim: rgba(224,92,60,0.08);
  --amber: #ECAA3B;
  --purple: #7C5CBF;
  --purple-dim: rgba(124,92,191,0.08);
  --border: #DCE3EE;
  --border-light: #E7ECF4;
  --shadow-sm: 0 1px 3px rgba(19,28,46,0.04);
  --shadow-md: 0 4px 12px rgba(19,28,46,0.06);
  --shadow-lg: 0 12px 32px rgba(19,28,46,0.08);
  --display: 'Fraunces', 'Georgia', serif;
  --body: 'Outfit', system-ui, sans-serif;
  --radius: 10px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --glow-1: rgba(13,155,138,0.055);
  --glow-2: rgba(124,92,191,0.038);
  --glow-3: rgba(19,28,46,0.030);
  --orb-1: rgba(13,155,138,0.13);
  --orb-2: rgba(124,92,191,0.095);
  --orb-3: rgba(56,120,220,0.085);
  --grain-opacity: 0.022;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1020;
    --bg-alt: #0F1730;
    --surface: #151E38;
    --text: #E8EDF6;
    --text-2: #A8B5CC;
    --text-3: #7B89A6;
    --teal: #1CC9B5;
    --teal-dim: rgba(28,201,181,0.1);
    --teal-mid: rgba(28,201,181,0.2);
    --coral: #F07B5E;
    --coral-dim: rgba(240,123,94,0.1);
    --amber: #F0BC52;
    --purple: #A080E0;
    --purple-dim: rgba(160,128,224,0.1);
    --border: #26314D;
    --border-light: #1C2540;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.25);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.3);
    --glow-1: rgba(28,201,181,0.075);
    --glow-2: rgba(124,111,207,0.065);
    --glow-3: rgba(120,150,255,0.030)
    --orb-1: rgba(28,201,181,0.15);
    --orb-2: rgba(126,110,225,0.135);
    --orb-3: rgba(52,132,235,0.115);
    --grain-opacity: 0.055;
;
  }
}

:root[data-theme="dark"] {
  --bg: #0A1020;
  --bg-alt: #0F1730;
  --surface: #151E38;
  --text: #E8EDF6;
  --text-2: #A8B5CC;
  --text-3: #7B89A6;
  --teal: #1CC9B5;
  --teal-dim: rgba(28,201,181,0.1);
  --teal-mid: rgba(28,201,181,0.2);
  --coral: #F07B5E;
  --coral-dim: rgba(240,123,94,0.1);
  --amber: #F0BC52;
  --purple: #A080E0;
  --purple-dim: rgba(160,128,224,0.1);
  --border: #26314D;
  --border-light: #1C2540;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.25);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.3);
  --glow-1: rgba(28,201,181,0.075);
  --glow-2: rgba(124,111,207,0.065);
  --glow-3: rgba(120,150,255,0.030)
  --orb-1: rgba(28,201,181,0.15);
  --orb-2: rgba(126,110,225,0.135);
  --orb-3: rgba(52,132,235,0.115);
  --grain-opacity: 0.055;
;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--body);
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* ---------- Living background ----------
   Three large, heavily-blurred colour fields drifting on long, mismatched
   cycles, over a faint grain. Because the periods don't divide into each
   other the composition never visibly repeats, and animating only transform
   keeps the whole thing on the compositor. */
.bg-field {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.bg-orb-1 {
  width: 46vw; height: 46vw;
  top: -14vw; right: -6vw;
  background: var(--orb-1);
  animation: drift1 41s ease-in-out infinite alternate;
}
.bg-orb-2 {
  width: 40vw; height: 40vw;
  top: 22vh; left: -10vw;
  background: var(--orb-2);
  animation: drift2 57s ease-in-out infinite alternate;
}
.bg-orb-3 {
  width: 34vw; height: 34vw;
  bottom: -12vw; left: 42vw;
  background: var(--orb-3);
  animation: drift3 73s ease-in-out infinite alternate;
}

@keyframes drift1 {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(-7vw, 6vh, 0) scale(1.14); }
}
@keyframes drift2 {
  from { transform: translate3d(0,0,0) scale(1.06); }
  to   { transform: translate3d(9vw, -8vh, 0) scale(0.92); }
}
@keyframes drift3 {
  from { transform: translate3d(0,0,0) scale(0.96); }
  to   { transform: translate3d(-11vw, -5vh, 0) scale(1.12); }
}

/* Fine grain stops the large soft gradients from banding on wide screens */
.bg-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  .bg-orb { animation: none; }
}

/* Sections sit on the page wash rather than repainting over it, so the
   gradient stays continuous down the whole page. */
.hero, .programs, .resources, .qna, .page-shell { background: transparent; }
.features, .faq { background: color-mix(in srgb, var(--bg-alt) 62%, transparent); }

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: var(--body); cursor: pointer; }

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.15;
  color: var(--text);
}

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 700; text-wrap: balance; }
h3 { font-size: 1.15rem; font-weight: 600; }

.label-sm {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--body);
}

.section-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-2);
  max-width: 540px;
}

/* ---------- Layout ---------- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 88px 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 30px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  transition: all 0.25s var(--ease);
  font-family: var(--body);
  cursor: pointer;
}

.btn-primary {
  background: var(--teal);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13,155,138,0.3);
}

.btn-outline {
  background: transparent;
  color: var(--teal);
  border: 2px solid var(--teal);
}

.btn-outline:hover {
  background: var(--teal);
  color: #fff;
}

.btn-coral {
  background: var(--coral);
  color: #fff;
}

.btn-coral:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.82rem;
}

/* ---------- Navigation ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(246,248,252,0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow 0.3s var(--ease);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .navbar { background: rgba(10,16,32,0.86); }
}
:root[data-theme="dark"] .navbar { background: rgba(10,16,32,0.86); }

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.nav-logo {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-sub {
  font-family: var(--body);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--teal);
  margin-top: 1px;
}

.nav-logo .logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--teal);
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--body);
  font-size: 0.8rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.2s;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--teal);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--teal);
  border-radius: 1px;
}

.nav-cta .btn { padding: 9px 22px; }

.hamburger {
  display: none;
  background: none;
  border: none;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s var(--ease);
  display: block;
}

/* ---------- Hero ---------- */
.hero {
  padding: 148px 0 100px;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.hero-eyebrow {
  color: var(--teal);
  margin-bottom: 16px;
}

.hero h1 {
  margin-bottom: 20px;
}

.hero h1 .highlight {
  font-style: italic;
  color: var(--teal);
}

.hero-content p {
  font-size: 1.08rem;
  color: var(--text-2);
  max-width: 480px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 52px;
}

.hero-stats {
  display: flex;
  gap: 40px;
}

.hero-stat .number {
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--teal);
}

.hero-stat .label {
  font-size: 0.78rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* ---------- Section headers ---------- */
.sec-head {
  text-align: center;
  margin-bottom: 48px;
}

.sec-head .section-label {
  margin-bottom: 10px;
  display: block;
}

.sec-head .section-title {
  margin-bottom: 12px;
}

.sec-head .section-subtitle {
  margin: 0 auto;
}

/* ---------- Tab filters ---------- */
.program-tabs,
.resources-tabs {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.program-tab {
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-2);
  transition: all 0.2s var(--ease);
  font-family: var(--body);
  cursor: pointer;
}

.program-tab:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.program-tab.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

/* ---------- Programs ---------- */
.programs {
  background: var(--bg-alt);
}

.programs-header {
  text-align: center;
  margin-bottom: 48px;
}

.programs-header .section-subtitle {
  margin: 0 auto;
}

.programs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.program-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 28px 28px 28px 32px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  border-left: 4px solid var(--teal);
}

.program-card[data-category="ib"] { border-left-color: var(--purple); }
.program-card[data-category="both"] { border-left-color: var(--coral); }

.program-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.program-card .card-level {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--teal);
}

.program-card[data-category="ib"] .card-level { color: var(--purple); }
.program-card[data-category="both"] .card-level { color: var(--coral); }

.program-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.program-card p {
  font-size: 0.9rem;
  color: var(--text-2);
  margin-bottom: 16px;
  line-height: 1.6;
}

.program-card .card-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 18px;
}

.program-card .card-topics span {
  font-size: 0.74rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--teal-dim);
  color: var(--teal);
}

.program-card[data-category="ib"] .card-topics span {
  background: var(--purple-dim);
  color: var(--purple);
}

.program-card[data-category="both"] .card-topics span {
  background: var(--coral-dim);
  color: var(--coral);
}

.program-card .card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.program-card .card-footer .price {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
}

/* ---------- Features ---------- */
.features {
  background: var(--bg);
}

.features-header {
  text-align: center;
  margin-bottom: 48px;
}

.features-header .section-subtitle {
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.feature-card .feat-marker {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--teal-dim);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.feature-card .feat-marker svg {
  width: 22px;
  height: 22px;
  stroke: var(--teal);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.65;
}

/* ---------- Resources ---------- */
.resources {
  background: var(--bg-alt);
}

.resources-header {
  text-align: center;
  margin-bottom: 48px;
}

.resources-header .section-subtitle {
  margin: 0 auto;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.resource-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.resource-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.resource-card .video-embed {
  position: relative;
  padding-top: 56.25%;
  background: linear-gradient(135deg, #131C2E, #22315A);
}

.resource-card .video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.resource-card .vid-thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #131C2E, #22315A);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.play-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  transition: all 0.25s var(--ease);
}

.play-btn::after {
  content: '';
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid #fff;
  margin-left: 3px;
}

.resource-card:hover .play-btn {
  background: var(--coral);
  transform: scale(1.08);
}

.vid-cat {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(0,0,0,0.4);
  color: #fff;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.resource-card .resource-body {
  padding: 18px 20px;
}

.resource-card .resource-body h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.resource-card .resource-desc {
  font-size: 0.84rem;
  color: var(--text-2);
  margin-bottom: 10px;
  line-height: 1.55;
}

.resource-card .resource-meta {
  font-size: 0.76rem;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
}

.resource-card .resource-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.resource-tag.ap { background: var(--teal-dim); color: var(--teal); }
.resource-tag.ib { background: var(--purple-dim); color: var(--purple); }
.resource-tag.both { background: var(--coral-dim); color: var(--coral); }

/* Link cards */
.resource-link-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.resource-link-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.resource-link-card .link-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--teal-dim);
  display: grid;
  place-items: center;
}

.resource-link-card .link-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--teal);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.resource-link-card h3 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.resource-link-card p {
  font-size: 0.82rem;
  color: var(--text-2);
  margin-bottom: 6px;
  line-height: 1.55;
}

.resource-link-card .link-url {
  font-size: 0.74rem;
  color: var(--teal);
  font-weight: 500;
  word-break: break-all;
}

.resource-link-card .link-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  display: inline-block;
}

.link-tag.ap { color: var(--teal); }
.link-tag.ib { color: var(--purple); }
.link-tag.both { color: var(--coral); }

/* ---------- CTA ---------- */
.cta {
  background: var(--teal);
  color: #fff;
  text-align: center;
  padding: 72px 0;
}

.cta h2 {
  color: #fff;
  margin-bottom: 14px;
}

.cta p {
  font-size: 1.05rem;
  opacity: 0.9;
  max-width: 460px;
  margin: 0 auto 28px;
}

.cta .btn {
  background: #fff;
  color: var(--teal);
  font-weight: 700;
}

.cta .btn:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  transform: translateY(-2px);
}

/* ---------- Footer ---------- */
.footer {
  background: #101B33;
  color: #93A2BD;
  padding: 56px 0 24px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .footer { background: #070D1A; }
}
:root[data-theme="dark"] .footer { background: #070D1A; }

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}

.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.7;
  max-width: 260px;
}

.footer h4 {
  color: #fff;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  font-family: var(--body);
  font-weight: 700;
}

.footer ul li {
  margin-bottom: 8px;
}

.footer ul a {
  font-size: 0.85rem;
  color: #7B89A6;
  transition: color 0.2s;
}

.footer ul a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid #1F2C48;
  padding-top: 20px;
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-social {
  display: flex;
  gap: 16px;
}

.footer-social a {
  color: #7B89A6;
  transition: color 0.2s;
}

.footer-social a:hover { color: #fff; }

/* ---------- Contact Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 480px;
  width: 100%;
  padding: 36px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-3);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background 0.2s;
  cursor: pointer;
}

.modal-close:hover { background: var(--bg-alt); }

.modal h2 {
  font-size: 1.35rem;
  margin-bottom: 6px;
}

.modal .modal-sub {
  color: var(--text-2);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-dim);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Staggered children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.08s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.16s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.24s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.32s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.4s; }

/* Hero entrance */
.hero-content {
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeIn 0.9s var(--ease) 0.2s forwards;
}

@keyframes heroFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Hero stat counter pulse */
.hero-stat .number {
  transition: transform 0.3s var(--ease);
}

.hero-stat .number.counted {
  animation: counterPop 0.4s var(--ease);
}

@keyframes counterPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-right, .reveal-scale,
  .stagger-children > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-content, .notice-board {
    opacity: 1;
    transform: none;
    animation: none;
  }

}

/* ---------- Scroll to Top ---------- */
.scroll-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  border: none;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--ease);
  z-index: 90;
  cursor: pointer;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  transform: translateY(-2px);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-content p { margin: 0 auto 36px; }
  .hero-buttons { justify-content: center; }
  .hero-stats { justify-content: center; }
  .notice-board { margin-top: 4px; }
  .programs-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .resources-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Nine links plus the sign-in buttons need ~900px; below that the
   hamburger menu takes over. */
@media (max-width: 900px) {
  .nav-links {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    margin: 0;
    background: var(--surface);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transform: translateY(-120%);
    transition: transform 0.3s var(--ease);
  }
  .nav-links.open { transform: translateY(0); }
  .hamburger { display: flex; }
  .nav-cta { display: none; }
}

@media (max-width: 640px) {
  .features-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  section { padding: 64px 0; }
}

/* ---------- Form messages ---------- */
.form-msg {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  line-height: 1.5;
}
.form-msg.success {
  background: rgba(16,185,129,0.1);
  color: #10b981;
  border: 1px solid rgba(16,185,129,0.25);
}
.form-msg.error {
  background: rgba(239,68,68,0.1);
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.25);
}

/* ---------- Modal extras ---------- */
.modal-wide { max-width: 620px; }
.btn-block { width: 100%; justify-content: center; }
.req { color: var(--coral); }
.help-text {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 5px;
}
.modal-foot {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-2);
  margin-top: 16px;
}
.modal-foot a {
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
}
.modal-foot a:hover { text-decoration: underline; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- Opt-in card (1-to-1 interest) ---------- */
.option-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  cursor: pointer;
  margin-bottom: 18px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.option-card:hover { border-color: var(--teal); }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }

.option-check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  margin-top: 2px;
  position: relative;
  transition: all 0.2s var(--ease);
}
.option-check::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.18s var(--ease);
}
.option-card input:checked ~ .option-check {
  background: var(--teal);
  border-color: var(--teal);
}
.option-card input:checked ~ .option-check::after { transform: rotate(45deg) scale(1); }
.option-card:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-dim);
}
.option-card input:focus-visible ~ .option-check {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.option-body { display: flex; flex-direction: column; gap: 3px; }
.option-body strong { font-size: 0.95rem; color: var(--text); }
.option-body span { font-size: 0.83rem; color: var(--text-2); line-height: 1.5; }

/* ---------- Nav greeting ---------- */
.nav-greeting {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-2);
  margin-right: 4px;
}


/* Server-rendered grids: empty + filtered-empty states, links column */
.grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-3);
  padding: 40px 20px;
}

.resource-links-col {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}


/* ============================================
   Brand lockup
   ============================================ */
:root { --brand-1: #12A392; --brand-2: #0A7E70; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --brand-1: #2FD4BC; --brand-2: #12A392; }
}
:root[data-theme="dark"] { --brand-1: #2FD4BC; --brand-2: #12A392; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
}
.brand-mark { display: block; flex-shrink: 0; }

/* Column width is set by the wordmark; the subtitle then stretches to match it. */
.brand-text {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  line-height: 1.05;
}

.brand-name {
  font-family: var(--body);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
}
.brand-name b { font-weight: 700; color: var(--teal); }

/* space-between spreads the nine letters across the full column width, so
   "Education" begins and ends flush with "MK STEAM" directly above it.
   The trailing letter carries no spacing of its own, which is what keeps
   the final "n" aligned to the final "M". */
.brand-sub {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 4px;
  font-family: var(--body);
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-3);
}
.brand-sub span { display: block; }

/* Footer sits on a fixed dark ground in both themes */
.brand--footer { color: #fff; margin-bottom: 14px; }
.brand--footer .brand-name { color: #fff; }
.brand--footer .brand-name b { color: var(--brand-1); }
.brand--footer .brand-sub { color: #93A2BD; }

/* ============================================
   About page
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 34px;
  margin-bottom: 44px;
}
.about-block h2 {
  font-family: var(--display);
  font-size: 1.3rem;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--teal);
  display: inline-block;
}
.about-block p {
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 14px;
}
.about-block p:last-child { margin-bottom: 0; }

.mission {
  margin: 0 0 44px;
  padding: 30px 34px;
  background: var(--teal-dim);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.mission-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}
.mission p {
  font-family: var(--display);
  font-size: 1.18rem;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
}

.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============================================
   Practice papers — index
   ============================================ */
.paper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}
.paper-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.paper-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.paper-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.paper-card h3 { font-family: var(--display); font-size: 1.1rem; line-height: 1.35; margin: 0; }
.paper-card p { color: var(--text-2); font-size: 0.9rem; line-height: 1.6; margin: 0; flex: 1; }
.paper-best {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-dim);
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.paper-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}
.paper-count { font-size: 0.82rem; color: var(--text-3); }

/* ---------- Paper runner ---------- */
.paper-head { margin-bottom: 26px; }
.paper-head h2 {
  font-family: var(--display);
  font-size: 1.6rem;
  margin: 14px 0 6px;
}
.paper-intro { color: var(--text-2); margin: 0 0 6px; max-width: 65ch; }
.paper-meta { font-size: 0.85rem; color: var(--text-3); margin: 0; }

.paper-form { display: flex; flex-direction: column; gap: 16px; }

.q-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.q-card.is-correct { border-left-color: #10b981; }
.q-card.is-wrong   { border-left-color: var(--coral); }
.q-card.is-review  { border-left-color: var(--amber); }

.q-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.q-num {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--teal);
}
.q-marks { font-size: 0.78rem; color: var(--text-3); }
.q-prompt {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 14px;
  white-space: pre-wrap;
}

.q-asset { margin: 0 0 16px; }
.q-asset img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}
.q-pdf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--teal);
  background: var(--bg-alt);
  text-decoration: none;
}
.q-pdf:hover { border-color: var(--teal); }
.q-pdf svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Options ---------- */
.q-options { display: flex; flex-direction: column; gap: 9px; }
.q-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.q-option:hover { border-color: var(--teal); }
.q-option input { position: absolute; opacity: 0; pointer-events: none; }
.q-radio {
  flex-shrink: 0;
  width: 19px; height: 19px;
  border: 2px solid var(--border);
  border-radius: 50%;
  margin-top: 2px;
  position: relative;
  transition: all 0.16s var(--ease);
}
.q-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform 0.16s var(--ease);
}
.q-option input:checked ~ .q-radio { background: var(--teal); border-color: var(--teal); }
.q-option input:checked ~ .q-radio::after { transform: scale(1); }
.q-option:has(input:checked) { border-color: var(--teal); background: var(--teal-dim); }
.q-option input:focus-visible ~ .q-radio { outline: 2px solid var(--teal); outline-offset: 2px; }
.q-option-text { font-size: 0.94rem; line-height: 1.55; color: var(--text); }

.q-option.opt-correct { border-color: #10b981; background: rgba(16,185,129,0.09); }
.q-option.opt-correct .q-radio { border-color: #10b981; background: #10b981; }
.q-option.opt-wrong { border-color: var(--coral); background: var(--coral-dim); }
.q-option.opt-wrong .q-radio { border-color: var(--coral); background: var(--coral); }
.q-option input:disabled ~ .q-option-text { opacity: 0.85; }

.q-text {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--body);
  font-size: 0.94rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}
.q-text:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); }

/* ---------- Feedback ---------- */
.q-feedback {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--bg-alt);
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-2);
}
.q-feedback p { margin: 6px 0 0; }
.fb-good { color: #10b981; }
.fb-bad  { color: var(--coral); }
.fb-model { color: var(--amber); }
.fb-note { color: var(--text-3); font-size: 0.86rem; }

.paper-submit {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 8px;
}
.paper-submit-note { font-size: 0.85rem; color: var(--text-3); }

.paper-score {
  margin-top: 24px;
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  text-align: center;
}
.score-figure {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 16px;
  margin-bottom: 10px;
}
.score-num {
  font-family: var(--display);
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--teal);
  line-height: 1;
}
.score-of { font-size: 1.4rem; color: var(--text-3); font-weight: 600; }
.score-pct {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-2);
}
.score-note { color: var(--text-2); margin: 0 0 20px; font-size: 0.95rem; }


/* ============================================
   Membership tiers
   ============================================ */
.tier-chip {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 20px;
  border: 1px solid;
}
.tier-silver   { color: #8A9BA5; border-color: #8A9BA5; background: rgba(138,155,165,0.1); }
.tier-gold     { color: #C08A2E; border-color: #C08A2E; background: rgba(192,138,46,0.12); }
.tier-platinum { color: #7C6FCF; border-color: #7C6FCF; background: rgba(124,111,207,0.12); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tier-silver   { color: #B4C4CD; border-color: #6F8390; }
  :root:not([data-theme="light"]) .tier-gold     { color: #E8B860; border-color: #A8792A; }
  :root:not([data-theme="light"]) .tier-platinum { color: #B0A4F0; border-color: #6F62BC; }
}
:root[data-theme="dark"] .tier-silver   { color: #B4C4CD; border-color: #6F8390; }
:root[data-theme="dark"] .tier-gold     { color: #E8B860; border-color: #A8792A; }
:root[data-theme="dark"] .tier-platinum { color: #B0A4F0; border-color: #6F62BC; }

.tier-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-2);
}

.upgrade-note {
  margin-top: 22px;
  padding: 20px 24px;
  background: var(--teal-dim);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.upgrade-note strong { display: block; color: var(--text); margin-bottom: 5px; }
.upgrade-note p { margin: 0; color: var(--text-2); font-size: 0.9rem; }

/* ---------- Exclusive videos ---------- */
.ex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 22px;
}
.ex-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s var(--ease);
}
.ex-card:hover { border-color: var(--teal); }
.ex-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.ex-body h3 { font-family: var(--display); font-size: 1.05rem; line-height: 1.35; margin: 0; }
.ex-body p { color: var(--text-2); font-size: 0.88rem; line-height: 1.6; margin: 0; }

/* ---------- Invite completion form ---------- */
.container.narrow { max-width: 680px; }
.invite-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 32px;
}
.invite-form .form-group input:disabled {
  background: var(--bg-alt);
  color: var(--text-3);
  cursor: not-allowed;
}

/* ============================================
   Standalone page shell (FAQ page)
   ============================================ */
.page-shell {
  padding: 140px 0 90px;
  min-height: 70vh;
}

.page-head {
  text-align: center;
  max-width: 660px;
  margin: 0 auto 48px;
}

.page-title {
  font-family: var(--display);
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 10px 0 14px;
}

.page-sub {
  color: var(--text-2);
  font-size: 1.02rem;
  line-height: 1.7;
}

.page-empty {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 56px 32px;
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
}

.page-cta {
  text-align: center;
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
.page-cta p {
  color: var(--text-2);
  margin-bottom: 16px;
  font-size: 0.98rem;
}

/* ============================================
   FAQ
   ============================================ */
.faq { background: var(--bg-alt); }

.faq-list {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.faq-item:hover { border-color: var(--teal); }
.faq-item.open {
  border-color: var(--teal);
  box-shadow: var(--shadow-md);
}

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  line-height: 1.45;
}

.faq-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--ease);
}
.faq-item.open .faq-chevron { transform: rotate(180deg); }

.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s var(--ease);
}
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-a > p {
  overflow: hidden;
  margin: 0;
  padding: 0 24px;
  color: var(--text-2);
  font-size: 0.94rem;
  line-height: 1.7;
  transition: padding 0.32s var(--ease);
}
.faq-item.open .faq-a > p { padding: 0 24px 22px; }

/* ============================================
   Community Q&A
   ============================================ */
.qna-locked {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  padding: 48px 32px;
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
}
.lock-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--teal-dim);
  display: grid;
  place-items: center;
}
.lock-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.qna-locked h3 {
  font-family: var(--display);
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--text);
}
.qna-locked p {
  color: var(--text-2);
  font-size: 0.94rem;
  line-height: 1.65;
  margin-bottom: 24px;
}
.qna-locked-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.qna-content {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 900px) {
  .qna-content { grid-template-columns: 1fr; }
}

.qna-ask-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 90px;
}
@media (max-width: 900px) {
  .qna-ask-card { position: static; }
}
.qna-ask-card h3 {
  font-family: var(--display);
  font-size: 1.12rem;
  margin-bottom: 16px;
  color: var(--text);
}

.qna-list { display: flex; flex-direction: column; gap: 16px; }

.qna-empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.qna-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: border-color 0.2s var(--ease);
}
.qna-card:hover { border-color: var(--teal); }

.qna-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.qna-card h3 {
  font-family: var(--display);
  font-size: 1.08rem;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--text);
}
.qna-body {
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.qna-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--teal-dim);
  color: var(--teal);
}
.qna-tag.ap { background: var(--teal-dim); color: var(--teal); }
.qna-tag.ib { background: var(--purple-dim); color: var(--purple); }
.qna-tag.exam { background: var(--coral-dim); color: var(--coral); }
.qna-tag.ia { background: rgba(236,170,59,0.12); color: var(--amber); }

.qna-meta { font-size: 0.8rem; color: var(--text-3); }

.qna-answers {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.qna-answer {
  padding: 14px 16px;
  background: var(--bg-alt);
  border-radius: 8px;
  border-left: 3px solid var(--border);
}
.qna-answer.is-admin {
  border-left-color: var(--teal);
  background: var(--teal-dim);
}
.qna-answer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  font-size: 0.86rem;
  color: var(--text);
}
.qna-answer p {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.65;
  white-space: pre-wrap;
}
.qna-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--teal);
  color: #fff;
}

.qna-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.btn-ghost {
  background: none;
  border: 1px solid transparent;
  color: var(--text-3);
}
.btn-ghost:hover { color: var(--coral); border-color: var(--coral); }

.qna-reply { margin-top: 14px; }
.qna-reply textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--body);
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  margin-bottom: 10px;
}
.qna-reply textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-dim);
}

/* Keep registration reachable on short screens and mobile keyboards. */
.modal-overlay { overflow-y: auto; }
.modal { max-height: calc(100dvh - 48px); overflow-y: auto; }
@media (max-width: 600px) {
  .modal-overlay { padding: 12px; }
  .modal { padding: 28px 20px; max-height: calc(100dvh - 24px); }
}
.q-feedback p, .q-option-text { white-space: pre-wrap; }
.pdf-viewer { margin: 20px 0; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.pdf-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.pdf-page { overflow: auto; max-height: 75vh; }
.pdf-page canvas { display: block; max-width: 100%; height: auto; margin: auto; }
.pdf-status { white-space: pre-wrap; }
@media print { .pdf-viewer { display: none !important; } }

/* ============================================
   Course + lesson pages
   ============================================ */
.crumb {
  font-size: 0.85rem;
  color: var(--text-3);
  margin-bottom: 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.crumb a { color: var(--teal); }
.crumb a:hover { text-decoration: underline; }

.course-head { max-width: 760px; margin-bottom: 34px; }
.course-head .page-title { margin-top: 12px; }
.course-level {
  font-size: 0.9rem;
  color: var(--text-3);
  margin-bottom: 12px;
}
.course-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}
.course-topics span {
  font-size: 0.76rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--teal-dim);
  color: var(--teal);
}

.course-overview {
  max-width: 760px;
  margin-bottom: 40px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.course-overview h2 {
  font-family: var(--display);
  font-size: 1.15rem;
  margin-bottom: 12px;
}
.course-overview p {
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 12px;
}
.course-overview p:last-child { margin-bottom: 0; }

.course-lessons-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.course-lessons-head h2 {
  font-family: var(--display);
  font-size: 1.35rem;
}

.lesson-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lesson-row {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s var(--ease);
}
.lesson-row:hover { border-color: var(--teal); }
.lesson-row.is-locked { opacity: 0.72; }
.lesson-row.is-locked:hover { border-color: var(--border); }

.lesson-num {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--teal);
  text-align: center;
}
.lesson-main { min-width: 0; }
.lesson-main h3 {
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.35;
  margin-bottom: 4px;
}
.lesson-main p {
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 6px;
}
.lesson-meta { font-size: 0.8rem; color: var(--text-3); }

.lesson-action {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.lesson-locked-note { font-size: 0.82rem; color: var(--text-3); }

@media (max-width: 640px) {
  .lesson-row { grid-template-columns: 34px 1fr; }
  .lesson-action { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- Lesson viewer ---------- */
.lesson-block { margin-bottom: 42px; }
.lesson-block-title {
  font-family: var(--display);
  font-size: 1.25rem;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px 28px;
  margin-bottom: 14px;
  max-width: 820px;
}
.note-card h3 {
  font-family: var(--display);
  font-size: 1.08rem;
  margin-bottom: 10px;
}
.note-card p {
  color: var(--text-2);
  line-height: 1.8;
  margin-bottom: 12px;
}
.note-card p:last-child { margin-bottom: 0; }

.file-list { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
.file-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s var(--ease);
}
.file-row:hover { border-color: var(--teal); }
.file-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  background: var(--teal-dim);
  border-radius: 8px;
}
.file-icon svg {
  width: 19px; height: 19px;
  fill: none; stroke: var(--teal); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.file-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.file-main strong { font-size: 0.95rem; color: var(--text); }
.file-main span { font-size: 0.84rem; color: var(--text-2); }
.file-size { font-size: 0.8rem; color: var(--text-3); white-space: nowrap; }

.practice-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px 28px;
  background: var(--teal-dim);
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  max-width: 820px;
}
.practice-cta strong { display: block; font-size: 1.02rem; color: var(--text); margin-bottom: 4px; }
.practice-cta p { color: var(--text-2); font-size: 0.9rem; margin: 0; }

.lesson-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}
.pager-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  max-width: 46%;
  transition: border-color 0.2s var(--ease);
}
.pager-link:hover { border-color: var(--teal); }
.pager-link span { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.pager-link strong { font-size: 0.92rem; color: var(--text); line-height: 1.4; }
.pager-next { text-align: right; margin-left: auto; }

/* ============================================
   Featured resource strip (landing page)
   ============================================ */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.featured-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.featured-card:hover { border-color: var(--teal); transform: translateY(-2px); }

.featured-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.featured-main strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.featured-desc {
  font-size: 0.84rem;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.resources-more { text-align: center; margin-top: 28px; }

/* ============================================
   Resource library page
   ============================================ */
.lib-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.lib-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lib-filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  min-width: 62px;
}
#lib-search {
  flex: 1;
  min-width: 220px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: var(--body);
  font-size: 0.88rem;
  background: var(--bg);
  color: var(--text);
}
#lib-search:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-dim);
}

.lib-count {
  font-size: 0.84rem;
  color: var(--text-3);
  margin-bottom: 26px;
}

.lib-group { margin-bottom: 38px; }
.lib-group-title {
  font-family: var(--display);
  font-size: 1.18rem;
  margin-bottom: 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.lib-group-title span {
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-dim);
  padding: 2px 9px;
  border-radius: 20px;
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 12px;
}

.lib-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 17px 19px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.lib-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.lib-card h3 {
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.35;
  color: var(--text);
  margin: 0;
}
.lib-card p {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

.lib-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lib-kind {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.lib-kind svg {
  width: 15px; height: 15px;
  fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.lib-kind-link { background: var(--teal-dim); }
.lib-kind-link svg { stroke: var(--teal); }
.lib-kind-video { background: var(--coral-dim); }
.lib-kind-video svg { stroke: var(--coral); fill: var(--coral); }

.lib-host {
  font-size: 0.75rem;
  color: var(--text-3);
  font-family: var(--body);
}

@media (max-width: 560px) {
  .lib-filter-label { min-width: 0; width: 100%; }
}

/* ============================================
   Notice board (hero)
   ============================================ */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.notice-board {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px 8px;
  box-shadow: var(--shadow-lg);
  max-height: 560px;
  display: flex;
  flex-direction: column;
}
/* Softens the hard cut at the card's edge so a clipped notice reads as
   "keep scrolling" rather than as a broken layout. JS clears it at the end. */
.notice-board::after {
  content: '';
  position: absolute;
  left: 1px; right: 1px; bottom: 1px;
  height: 68px;
  border-radius: 0 0 13px 13px;
  background: linear-gradient(to top, var(--surface) 22%, transparent);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s var(--ease);
}
.notice-board.nb-end::after { opacity: 0; }

.nb-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.nb-head h2 {
  font-family: var(--display);
  font-size: 1.18rem;
  font-weight: 700;
  margin: 0;
}

.nb-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-3);
  white-space: nowrap;
}
.nb-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal);
  position: relative;
}
/* A slow pulse reads as "kept current" without becoming a distraction */
.nb-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--teal);
  animation: nbPulse 2.6s ease-out infinite;
}
@keyframes nbPulse {
  0%   { transform: scale(1);   opacity: 0.6; }
  70%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}

.nb-list {
  list-style: none;
  margin: 0;
  /* bottom room so the last notice clears the fade overlay */
  padding: 0 4px 30px 0;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
}
.nb-list::-webkit-scrollbar { width: 6px; }
.nb-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.nb-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
  /* staggered entrance, one after another down the list */
  animation: nbIn 0.5s var(--ease) backwards;
  animation-delay: calc(0.45s + var(--i) * 0.09s);
}
.nb-item:last-child { border-bottom: 0; }
@keyframes nbIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.nb-item.is-pinned {
  background: var(--teal-dim);
  margin: 0 -12px;
  padding: 16px 12px;
  border-radius: 8px;
  border-bottom-color: transparent;
}

.nb-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}

.nb-type {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}
.nb-type-exam     { background: rgba(224,92,60,0.12);  color: var(--coral); }
.nb-type-deadline { background: rgba(236,170,59,0.16); color: #9A6B10; }
.nb-type-syllabus { background: var(--purple-dim);     color: var(--purple); }
.nb-type-resource { background: var(--teal-dim);       color: var(--teal); }
.nb-type-news     { background: rgba(56,120,220,0.12); color: #2C63B8; }

.nb-tag {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-3);
}
.nb-tag.ap   { color: var(--teal); }
.nb-tag.ib   { color: var(--purple); }
.nb-tag.both { color: var(--text-3); }

.nb-pin { display: inline-flex; }
.nb-pin svg {
  width: 13px; height: 13px;
  fill: none; stroke: var(--teal); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.nb-date {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-3);
  white-space: nowrap;
}

.nb-item h3 {
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.35;
  margin: 0 0 5px;
  color: var(--text);
}
.nb-item p {
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text-2);
  margin: 0;
}

.nb-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
}
.nb-link:hover { text-decoration: underline; }
.nb-link svg {
  width: 13px; height: 13px;
  fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.2s var(--ease);
}
.nb-link:hover svg { transform: translateX(3px); }

.nb-empty {
  color: var(--text-3);
  font-size: 0.9rem;
  padding: 24px 0;
}

@media (prefers-reduced-motion: reduce) {
  .nb-dot::after { animation: none; }
}

/* Stacked under the hero the board grows to its natural height, so there is
   no inner scroll — and therefore nothing for the fade or its padding to do. */
@media (max-width: 900px) {
  .notice-board { max-height: none; }
  .notice-board::after { content: none; }
  .nb-list { padding-bottom: 0; }
}

/* ============================================
   Membership: pricing, checkout, account
   ============================================ */

/* ---------- Pricing page ---------- */
.period-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 auto 36px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.period-btn {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: 600 0.88rem var(--body);
  padding: 9px 20px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.period-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.period-hint {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-3);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-alt);
}
.period-hint.save { color: var(--teal); background: var(--teal-dim); }

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  align-items: stretch;
}
.plan-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.plan-featured { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal), var(--shadow-md); }
.plan-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-tag { font-size: 0.72rem; font-weight: 600; color: var(--text-3); }
.plan-featured .plan-tag { color: var(--teal); }
.plan-summary { color: var(--text-2); font-size: 0.92rem; line-height: 1.55; min-height: 2.9em; }
.plan-price { display: flex; flex-direction: column; gap: 2px; }
.plan-price .amount {
  font-family: var(--display);
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}
.plan-price .per { font-size: 0.82rem; color: var(--text-3); }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 9px; margin: 4px 0; flex: 1; }
.plan-features li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; color: var(--text-2); line-height: 1.5; }
.plan-features svg { flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: var(--teal); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }
.plan-cta { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.plan-note { font-size: 0.82rem; color: var(--text-3); text-align: center; }
.plan-note a { color: var(--teal); font-weight: 600; text-decoration: none; }
.pricing-note { text-align: center; color: var(--text-3); font-size: 0.86rem; max-width: 640px; margin: 28px auto 0; line-height: 1.6; }
.pricing-faq { margin-top: 72px; }
.pricing-faq .section-title { margin-bottom: 24px; }

@media (max-width: 900px) {
  .plans-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
}

/* ---------- Checkout ---------- */
.checkout-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.checkout-plan { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.checkout-price { font-family: var(--display); font-size: 1.9rem; font-weight: 700; color: var(--text); }
.checkout-price small { font-family: var(--body); font-size: 0.8rem; font-weight: 500; color: var(--text-3); margin-left: 6px; }
.checkout-summary { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border-light); padding-top: 18px; margin: 0; }
.checkout-summary > div { display: flex; justify-content: space-between; gap: 16px; font-size: 0.9rem; flex-wrap: wrap; }
.checkout-summary dt { color: var(--text-3); }
.checkout-summary dd { color: var(--text); font-weight: 500; text-align: right; }
.checkout-summary .checkout-hint dd { width: 100%; text-align: left; font-weight: 400; color: var(--teal); font-size: 0.84rem; }
.checkout-fine { font-size: 0.8rem; color: var(--text-3); text-align: center; line-height: 1.5; }

/* ---------- Account ---------- */
.account-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 26px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.account-card h2 { margin: 4px 0 8px; }
.account-card > p, .account-card-head p { color: var(--text-2); font-size: 0.92rem; line-height: 1.55; }
.account-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.account-card-head > div:first-child { flex: 1 1 320px; }
.membership-status { flex: 0 0 auto; }
.membership-status { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.membership-status strong { font-family: var(--display); font-size: 1.5rem; color: var(--text); }
.membership-status span { font-size: 0.82rem; color: var(--text-3); }
.membership-gold { border-left: 4px solid #C08A2E; }
.membership-platinum { border-left: 4px solid #7C6FCF; }
.account-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.account-actions .plan-note { margin-left: auto; }
.account-empty { color: var(--text-3); font-size: 0.9rem; margin-top: 8px; }
.table-wrap { overflow-x: auto; margin-top: 10px; }
.account-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.account-table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.account-table td { padding: 10px; border-bottom: 1px solid var(--border-light); vertical-align: top; color: var(--text-2); }
.account-table small { color: var(--text-3); }
.order-status { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 9px; border-radius: 999px; }
.order-paid { color: var(--teal); background: var(--teal-dim); }
.order-pending { color: var(--amber); background: rgba(236,170,59,0.14); }
.order-failed, .order-refunded { color: var(--coral); background: var(--coral-dim); }

/* Keep the signed-in state compact so the link row never wraps */
.nav-account { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; white-space: nowrap; }
.nav-account:hover .nav-greeting { color: var(--teal); }
.nav-account .tier-chip { font-size: 0.58rem; padding: 3px 7px; }
.nav-account .nav-greeting { margin-right: 0; }
@media (min-width: 901px) {
  .nav-links a { white-space: nowrap; }
  .nav-links { gap: 22px; margin: 0 20px; }
  .nav-cta { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
}
@media (min-width: 901px) and (max-width: 1300px) {
  .nav-account .nav-greeting { display: none; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .nav-links { gap: 16px; margin: 0 12px; }
}

@media (max-width: 640px) {
  .account-card-head { flex-direction: column; }
  .membership-status { text-align: left; }
  .account-actions .plan-note { margin-left: 0; }
}

/* ---------- Plan picker (register modal) ---------- */
.plan-picker { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border-light); }
.plan-picker-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.plan-picker-head label { margin: 0; }
.plan-picker-period { display: inline-flex; gap: 2px; padding: 2px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 999px; }
.pp-period { border: 0; background: transparent; color: var(--text-3); font: 600 0.76rem var(--body); padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.pp-period.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.plan-picker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pp-option { cursor: pointer; }
.pp-option input { position: absolute; opacity: 0; pointer-events: none; }
.pp-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  height: 100%;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.pp-option input:checked + .pp-body { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); background: var(--surface); }
.pp-option input:focus-visible + .pp-body { outline: 2px solid var(--teal); outline-offset: 2px; }
.pp-body .tier-chip { align-self: flex-start; }
.pp-price { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--text); }
.pp-sub { font-size: 0.74rem; color: var(--text-3); line-height: 1.35; }
@media (max-width: 560px) {
  .plan-picker-grid { grid-template-columns: 1fr; }
  .pp-body { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .pp-sub { width: 100%; }
}

/* ---------- Resources dropdown in the nav ---------- */
.nav-item.has-menu { position: relative; }
.nav-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 0;
  padding: 0;
  font: 500 0.88rem var(--body);
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-menu-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s var(--ease); }
.nav-menu-btn:hover, .nav-menu-btn.active, .has-menu.open .nav-menu-btn { color: var(--teal); }
.has-menu.open .nav-menu-btn svg { transform: rotate(180deg); }
.nav-menu-btn.active::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 2px;
  background: var(--teal);
  border-radius: 1px;
}
.nav-menu-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}
.nav-menu-group a { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nav-menu-group .tier-chip { font-size: 0.56rem; padding: 2px 7px; }

@media (min-width: 901px) {
  .nav-menu {
    position: absolute;
    top: calc(100% + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    min-width: 250px;
    padding: 14px 16px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 14px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
    z-index: 30;
  }
  /* Invisible bridge so the pointer can travel from the button to the panel */
  .nav-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }
  .has-menu.open .nav-menu, .has-menu:hover .nav-menu, .has-menu:focus-within .nav-menu {
    opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
  }
  .nav-menu-group + .nav-menu-group { border-top: 1px solid var(--border-light); padding-top: 12px; }
  .nav-links .nav-menu a { padding: 7px 8px; margin: 0 -8px; border-radius: 8px; font-size: 0.86rem; }
  .nav-links .nav-menu a:hover { background: var(--teal-dim); }
  .nav-links .nav-menu a.active::after { content: none; }
  .nav-links .nav-menu a.active { color: var(--teal); }
}

@media (max-width: 900px) {
  /* In the stacked menu the groups are simply listed, slightly indented */
  .nav-item.has-menu { display: flex; flex-direction: column; align-items: center; gap: 12px; }
  .nav-menu-btn svg { display: none; }
  .nav-menu-btn { cursor: default; font-weight: 500; }
  .nav-menu {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 12px 24px; border-radius: var(--radius); background: var(--bg-alt);
  }
  .nav-menu-group { display: flex; flex-direction: column; align-items: center; gap: 10px; }
  .nav-menu-group a { justify-content: center; }
  .nav-menu-label { margin-bottom: 0; }
}

/* ---------- Resources page: members-only vs free ---------- */
.lib-section-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 0 0 18px; }
.lib-section-title { font-family: var(--display); font-size: 1.45rem; font-weight: 700; color: var(--text); }
.lib-section-head p { font-size: 0.88rem; color: var(--text-3); }
.lib-section-head a { color: var(--teal); font-weight: 600; text-decoration: none; }
.member-resources { margin-bottom: 56px; padding-bottom: 48px; border-bottom: 1px solid var(--border-light); }
.member-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.member-card {
  display: flex;
  gap: 18px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.member-card:nth-child(2) { border-left-color: #7C6FCF; }
.member-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.member-icon { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 12px; background: var(--teal-dim); display: grid; place-items: center; }
.member-card:nth-child(2) .member-icon { background: var(--purple-dim); }
.member-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.member-card:nth-child(2) .member-icon svg { stroke: var(--purple); }
.member-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.member-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.member-top h3 { font-size: 1.1rem; margin: 0; }
.member-body p { font-size: 0.9rem; color: var(--text-2); line-height: 1.6; margin: 0; }
.member-cta { font-size: 0.86rem; font-weight: 600; color: var(--teal); margin-top: 2px; }
@media (max-width: 760px) { .member-grid { grid-template-columns: 1fr; } }

/* ---------- Currency picker ---------- */
.currency-picker { display: inline-flex; align-items: center; gap: 10px; font-size: 0.86rem; color: var(--text-3); }
.currency-picker label { font-weight: 600; color: var(--text-2); }
.currency-picker select {
  font: 500 0.86rem var(--body);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 34px 8px 14px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23636F86' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  cursor: pointer;
}
.currency-picker select:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.pricing-controls { display: flex; justify-content: center; margin-bottom: 18px; }
.currency-picker-inline { justify-content: space-between; width: 100%; padding: 12px 14px; background: var(--bg-alt); border-radius: var(--radius); }

/* ---------- Tutoring add-on on the pricing page ---------- */
.addon-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  margin-top: 40px;
  padding: 30px 32px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--amber);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.addon-body h2 { font-family: var(--display); font-size: 1.6rem; margin: 4px 0 8px; }
.addon-body p { color: var(--text-2); font-size: 0.94rem; line-height: 1.65; max-width: 620px; }
.addon-price { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; text-align: right; }
.addon-price .amount { font-family: var(--display); font-size: 2.2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.addon-price .per { font-size: 0.82rem; color: var(--text-3); margin-bottom: 10px; }
@media (max-width: 760px) {
  .addon-card { flex-direction: column; align-items: stretch; }
  .addon-price { align-items: flex-start; text-align: left; }
}

/* ---------- Tutoring page ---------- */
.tutor-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 22px 26px;
  margin-bottom: 44px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.tutor-price { display: flex; flex-direction: column; }
.tutor-price .amount { font-family: var(--display); font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.tutor-price .per { font-size: 0.82rem; color: var(--text-3); }
.tutor-tz { width: 100%; font-size: 0.84rem; color: var(--text-3); border-top: 1px solid var(--border-light); padding-top: 12px; }
.tutor-section { margin-bottom: 48px; }
.slot-days { display: flex; flex-direction: column; gap: 26px; }
.slot-day-title { font-family: var(--display); font-size: 1.1rem; font-weight: 600; margin-bottom: 10px; color: var(--text); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.slot-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: 600 0.95rem var(--body);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.slot-btn small { font-size: 0.72rem; font-weight: 500; color: var(--text-3); }
.slot-btn .slot-tutor { color: var(--teal); font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Tutors on the tutoring page: the course-page teacher cards, side by side */
.tutor-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.tutor-card { transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease); }
.tutor-card.is-chosen { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); }
.tutor-subjects { font-size: 0.82rem; font-weight: 600; color: var(--teal); margin: -4px 0 8px; }
.tutor-tabs { margin-bottom: 22px; }

.mc-heading { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal); padding: 14px 0 4px; }
.mc-heading strong { color: var(--text); letter-spacing: 0; text-transform: none; font-size: 0.9rem; }

/* Course structure: units and topics above their lessons */
.unit-head { margin: 34px 0 10px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.unit-head:first-child { margin-top: 0; }
.unit-title { font-family: var(--display); font-size: 1.25rem; font-weight: 700; }
.unit-sub { font-size: 0.9rem; color: var(--text-2); margin-top: 4px; }
.topic-title { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); margin: 20px 0 8px; }
.topic-sub { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-3); margin-left: 8px; }
.lesson-list + .unit-head { margin-top: 34px; }

/* Jobs page and the request-a-tutor form */
.job-list { display: flex; flex-direction: column; gap: 18px; }
.job-card { padding: 24px 26px; background: var(--surface); border: 1px solid var(--border-light); border-radius: 16px; box-shadow: var(--shadow); }
.job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.job-head h2 { font-family: var(--display); font-size: 1.3rem; margin: 8px 0 4px; }
.job-meta { font-size: 0.86rem; color: var(--text-3); }
.job-summary { margin-top: 12px; color: var(--text-2); line-height: 1.6; }
.job-details { margin-top: 12px; color: var(--text-2); line-height: 1.6; }
.job-details summary { cursor: pointer; font-weight: 600; color: var(--teal); margin-bottom: 8px; }
.job-details p { margin-bottom: 10px; }
.job-apply, .tutor-request { margin-top: 18px; padding: 20px 22px; background: var(--bg-2, var(--surface)); border: 1px solid var(--border); border-radius: 14px; }
.job-apply h3 { font-family: var(--display); font-size: 1.05rem; margin-bottom: 12px; }
.job-apply label, .tutor-request label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 12px; }
.job-apply input, .job-apply textarea, .job-apply select, .tutor-request input, .tutor-request textarea, .tutor-request select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font: 500 0.92rem var(--body); color: var(--text); background: var(--surface);
}
.job-apply textarea, .tutor-request textarea { resize: vertical; }
.job-apply .form-grid, .tutor-request .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.job-note { margin-top: 10px; font-size: 0.86rem; color: var(--coral); font-weight: 600; }
@media (max-width: 640px) { .job-apply .form-grid, .tutor-request .form-grid { grid-template-columns: 1fr; } }
.slot-btn:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--teal); }
.session-list { display: flex; flex-direction: column; gap: 10px; }
.session-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}
.session-row.is-past { opacity: 0.6; }
.session-when { display: flex; flex-direction: column; gap: 2px; }
.session-when strong { font-size: 0.98rem; color: var(--text); }
.session-when span { font-size: 0.8rem; color: var(--text-3); }

/* ---------- Tutoring: benefits, packs, credits ---------- */
.credit-banner {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline;
  padding: 14px 18px; margin: -24px 0 36px;
  background: var(--teal-dim); border: 1px solid var(--teal-mid); border-radius: var(--radius);
  font-size: 0.92rem; color: var(--text-2);
}
.credit-banner strong { color: var(--teal); }
.benefit-grid { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.benefit-grid li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.94rem; color: var(--text-2); line-height: 1.55; }
.benefit-grid svg { flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: var(--teal); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; margin-top: 3px; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.pack-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 22px; background: var(--surface); border: 1px solid var(--border-light); border-radius: 14px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.pack-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.pack-best { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.pack-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pack-count { font-weight: 600; color: var(--text); }
.pack-save { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal); background: var(--teal-dim); padding: 3px 9px; border-radius: 999px; }
.pack-price { font-family: var(--display); font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--text); margin-top: 6px; }
.pack-each { font-size: 0.8rem; color: var(--text-3); margin-bottom: 12px; }
.pack-card .btn { margin-top: auto; }
@media (max-width: 640px) { .benefit-grid { grid-template-columns: 1fr; } }
.plan-picker-controls { display: flex; align-items: center; gap: 8px; }
.pp-currency { font: 600 0.76rem var(--body); color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 10px; cursor: pointer; }

/* ---------- Video types: standard lessons vs masterclasses ---------- */
.masterclass-chip {
  display: inline-block; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; color: #7C6FCF; background: rgba(124,111,207,0.12); border: 1px solid rgba(124,111,207,0.35);
  vertical-align: middle;
}
.lesson-block-title .masterclass-chip { margin-left: 10px; }
.lesson-block-sub { color: var(--text-3); font-size: 0.9rem; margin: -8px 0 18px; }
.ex-card.ex-masterclass { border-color: rgba(124,111,207,0.45); }
.ex-card.ex-masterclass .ex-body .masterclass-chip { margin-bottom: 8px; }
.mc-list { display: flex; flex-direction: column; gap: 10px; }
.mc-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 18px; background: var(--surface); border: 1px solid var(--border-light); border-left: 4px solid #7C6FCF;
  border-radius: var(--radius); text-decoration: none; color: inherit;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.mc-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mc-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.mc-main strong { color: var(--text); font-size: 0.98rem; }
.mc-main span { font-size: 0.8rem; color: var(--text-3); }
.mc-go { font-size: 0.84rem; font-weight: 600; color: var(--teal); white-space: nowrap; }
.program-card .card-footer .price { display: flex; flex-direction: column; gap: 2px; }
.program-card .card-footer .price small { font-weight: 500; font-size: 0.78rem; color: var(--text-3); }
.card-access { text-decoration: none; font-weight: 700; font-size: 0.86rem; }
.card-access.access-silver { color: var(--text-2); }
.card-access.access-gold { color: #C08A2E; }
.card-access.access-platinum { color: #7C6FCF; }
.card-access:hover { text-decoration: underline; }

/* ============================================
   AP / IB curricula
   ============================================ */

/* The AP / IB pill — nav switcher, hero eyebrow, register modal */
.curr-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 50px;
  font: 700 0.68rem var(--body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
  border: 1.5px solid currentColor;
}
.curr-pill.curr-ap { color: var(--teal);   background: var(--teal-dim); }
.curr-pill.curr-ib { color: var(--purple); background: var(--purple-dim); }
.hero-eyebrow .curr-pill { margin-right: 8px; vertical-align: middle; }
.curr-none { font-weight: 500; }

/* Nav switcher: sits at the end of the link row, next to Sign In */
.nav-curriculum .nav-menu-btn { gap: 6px; }
.nav-curriculum .nav-menu-btn:hover .curr-pill { filter: brightness(0.92); }
.nav-curriculum .nav-menu { min-width: 280px; }
.nav-curriculum .nav-menu a b { font-weight: 700; margin-right: 4px; }
.nav-curriculum .nav-menu a.active b { color: var(--teal); }
.curr-reg {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--bg-alt);
  padding: 2px 7px;
  border-radius: 50px;
  white-space: nowrap;
}
.nav-menu-note {
  display: block;
  margin-top: 8px;
  font-size: 0.74rem;
  color: var(--text-3);
  line-height: 1.4;
}
@media (min-width: 901px) {
  .nav-curriculum { margin-left: 4px; }
  .nav-curriculum .nav-menu { left: auto; right: 0; transform: translateX(0) translateY(6px); }
  .nav-curriculum.open .nav-menu, .nav-curriculum:hover .nav-menu, .nav-curriculum:focus-within .nav-menu {
    transform: translateX(0) translateY(0);
  }
}
@media (max-width: 900px) {
  .nav-curriculum .nav-menu { text-align: center; }
  .nav-menu-note { text-align: center; }
  /* The stacked menu marks the current item by colour, not the underline */
  .nav-links .nav-menu a.active::after { content: none; }
  .nav-links .nav-menu a.active { color: var(--teal); }
}

/* Landing hero: "registered for IB — back to your page" line */
.hero-switch-note {
  font-size: 0.86rem !important;
  color: var(--text-3) !important;
  margin: -24px 0 40px !important;
}
.hero-switch-note a { color: var(--teal); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Front page: choose a curriculum ---------- */
.choose-hero { padding-bottom: 80px; }
.choose-intro { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.choose-intro .hero-eyebrow { margin-bottom: 14px; }
.choose-intro h1 { margin-bottom: 18px; }
.choose-intro p { font-size: 1.08rem; color: var(--text-2); line-height: 1.7; margin: 0 auto 12px; }
.choose-intro .choose-prompt { font-weight: 600; color: var(--text); margin-top: 22px; }

.choose-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 880px;
  margin: 0 auto;
}
.choose-card {
  --accent: var(--teal);
  --accent-dim: var(--teal-dim);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 34px 32px 30px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.choose-card.choose-ib { --accent: var(--purple); --accent-dim: var(--purple-dim); }
.choose-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--accent);
}
.choose-card::after {
  content: '';
  position: absolute;
  right: -60px; top: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: var(--accent-dim);
  pointer-events: none;
}
.choose-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.choose-card.is-registered { border-color: var(--accent); }
.choose-code {
  font-family: var(--display);
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.choose-name { font-weight: 600; font-size: 1.05rem; }
.choose-blurb { color: var(--text-2); font-size: 0.94rem; line-height: 1.6; }
.choose-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 4px;
}
.choose-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-weight: 700;
  color: var(--accent);
}
.choose-cta svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s var(--ease); }
.choose-card:hover .choose-cta svg { transform: translateX(4px); }
.choose-foot { text-align: center; color: var(--text-3); font-size: 0.86rem; margin-top: 28px; }
@media (max-width: 640px) {
  .choose-grid { grid-template-columns: 1fr; }
  .choose-card { padding: 28px 24px 26px; }
  .choose-code { font-size: 2.6rem; }
}

/* ---------- Register modal / invitation form: pick AP or IB ---------- */
.curr-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.curr-option { display: block; position: relative; cursor: pointer; }
.curr-option input { position: absolute; opacity: 0; pointer-events: none; }
.curr-option-body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-2);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.curr-option:hover .curr-option-body { border-color: var(--teal); }
.curr-option input:checked + .curr-option-body {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-dim);
  color: var(--text);
  font-weight: 600;
}
.curr-option input:focus-visible + .curr-option-body { outline: 2px solid var(--teal); outline-offset: 2px; }
@media (max-width: 420px) {
  .curr-choice { grid-template-columns: 1fr; }
}

/* ============================================
   Passes per curriculum + the All Pass
   ============================================ */

/* The All Pass chip: teal into purple, AP into IB */
.tier-all {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(100deg, var(--brand-1), var(--purple));
}
.nav-account .tier-chip { white-space: nowrap; }

/* Pricing: four cards once the All Pass is on sale */
@media (min-width: 1101px) {
  .plans-grid:has(.plan-all) { grid-template-columns: repeat(4, 1fr); gap: 18px; }
}
@media (min-width: 641px) and (max-width: 1100px) {
  .plans-grid:has(.plan-all) { grid-template-columns: repeat(2, 1fr); }
}
.plan-all { border-color: var(--purple); box-shadow: 0 0 0 1px var(--purple), var(--shadow-md); }
.plan-all .plan-tag { color: var(--purple); }

/* Checkout: which curriculum a Gold / Platinum pass is for */
.checkout-scope { font-size: 0.8rem; font-weight: 600; color: var(--text-3); margin-left: 8px; }
.checkout-curriculum { margin: 4px 0 18px; }
.checkout-curriculum-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}
.checkout-curriculum .curr-option-body > span:last-child { display: flex; flex-direction: column; line-height: 1.3; }
.checkout-curriculum .curr-option-body small { font-size: 0.72rem; font-weight: 500; color: var(--text-3); }
.curr-option.is-blocked { opacity: 0.55; cursor: not-allowed; }
.curr-option.is-blocked:hover .curr-option-body { border-color: var(--border); }
.checkout-all-hint { font-size: 0.82rem; color: var(--text-3); margin-top: 10px; }
.checkout-all-hint a { color: var(--purple); font-weight: 600; }

/* Account: one card per curriculum, then the All Pass strip */
.pass-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.pass-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--bg);
}
.pass-card.pass-gold     { border-color: rgba(192,138,46,0.45); }
.pass-card.pass-platinum { border-color: rgba(124,111,207,0.5); }
.pass-head { display: flex; align-items: center; gap: 8px; }
.pass-status { display: flex; flex-direction: column; line-height: 1.3; }
.pass-status strong { font-family: var(--display); font-size: 1.15rem; }
.pass-status span { font-size: 0.78rem; color: var(--text-3); }
.pass-card > p { font-size: 0.86rem; color: var(--text-2); line-height: 1.5; }
.pass-card .form-msg { margin: 4px 0 0; padding: 9px 12px; font-size: 0.82rem; }
.pass-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.pass-all {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              linear-gradient(100deg, var(--brand-1), var(--purple)) border-box;
}
.pass-all > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pass-all strong { font-size: 0.95rem; }
.pass-all > div > span:last-child { font-size: 0.82rem; color: var(--text-3); }
@media (max-width: 640px) {
  .pass-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Courses sold on their own (IA / EE support) + PayPal
   ============================================ */
.tier-course { color: #C24E2F; border-color: #C24E2F; background: var(--coral-dim); }

/* Course page: price and buy box, or "you own this" */
.course-buy {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--coral);
  border-radius: 12px;
  background: var(--surface);
}
.course-buy-main { display: flex; flex-direction: column; gap: 6px; }
.course-buy-main .tier-chip { align-self: flex-start; }
.course-buy-main strong { font-family: var(--display); font-size: 1.5rem; line-height: 1.1; }
.course-buy-main strong small { font-family: var(--body); font-size: 0.8rem; font-weight: 600; color: var(--text-3); }
.course-buy-main span { font-size: 0.88rem; color: var(--text-2); line-height: 1.5; }
.lesson-locked-note[href] { color: var(--coral); font-weight: 600; text-decoration: none; }

/* Landing page: IA & EE support cards */
.support { padding: 96px 0; background: transparent; }
.support-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.support-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-top: 4px solid var(--coral);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.support-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.support-card.support-ee { border-top-color: var(--purple); }
.support-card.support-ee .tier-chip { color: var(--purple); border-color: var(--purple); background: var(--purple-dim); }
.support-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.support-subject { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.support-card h3 { font-family: var(--display); font-size: 1.15rem; line-height: 1.3; }
.support-card > p { font-size: 0.9rem; color: var(--text-2); line-height: 1.55; flex: 1; }
.support-includes { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--text-2); }
.support-includes li::before { content: '✓'; color: var(--teal); font-weight: 700; margin-right: 7px; }
.support-card .card-footer { margin-top: 6px; }
.support-card .price strong { font-family: var(--display); font-size: 1.25rem; }
.support-card .price small { display: block; font-size: 0.72rem; color: var(--text-3); }
.support-owned { color: var(--teal); font-size: 0.95rem !important; }
@media (max-width: 1000px) { .support-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .support-grid { grid-template-columns: 1fr; } .support { padding: 64px 0; } }

/* Checkout: one button per payment provider */
.checkout-pay { display: flex; flex-direction: column; gap: 10px; }
.checkout-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-right: 8px; }
.btn-paypal { background: #FFC439; color: #003087; border: 1px solid #f2b52a; }
.btn-paypal:hover { background: #f5b92c; color: #003087; }
.btn-paypal b { font-weight: 800; color: #003087; margin-left: 2px; }
.btn-paypal i { font-style: italic; font-weight: 800; color: #0070BA; }

/* ============================================
   Learning: progress, drip, reviews, instructors
   ============================================ */
.lesson-progress-bar { height: 8px; border-radius: 4px; background: var(--bg-alt); overflow: hidden; }
.lesson-progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-1), var(--brand-2)); border-radius: 4px; transition: width 0.4s var(--ease); }
.lesson-progress { margin: 36px 0 8px; padding: 18px 20px; border: 1px solid var(--border-light); border-radius: 12px; background: var(--surface); }
.lesson-progress-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.lesson-progress-text { font-size: 0.88rem; color: var(--text-2); }
.course-progress { display: flex; align-items: center; gap: 14px; margin-top: 16px; font-size: 0.84rem; color: var(--text-2); }
.course-progress .lesson-progress-bar { flex: 0 0 220px; }
.lesson-row.is-done .lesson-num { background: var(--teal); color: #fff; }
.course-meta-line { margin-top: 10px; font-size: 0.9rem; color: var(--text-2); }
.course-stars { color: #E5A400; letter-spacing: 1px; }
.stars-off { color: var(--border); }
.course-instructors { margin: 48px 0; }
.instructor-grid { display: grid; gap: 16px; }
.instructor-card { display: flex; gap: 18px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--border-light); border-radius: 14px; }
.instructor-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.instructor-initial { display: inline-flex; align-items: center; justify-content: center; background: var(--teal-dim); color: var(--teal); font: 700 1.4rem var(--display); }
.instructor-card strong { font-family: var(--display); font-size: 1.1rem; }
.instructor-headline { font-size: 0.86rem; color: var(--text-3); margin: 2px 0 8px; }
.instructor-card p { font-size: 0.9rem; color: var(--text-2); line-height: 1.55; }
.instructor-links { display: flex; gap: 12px; margin-top: 8px; }
.instructor-links a { font-size: 0.82rem; font-weight: 600; color: var(--teal); }
.course-reviews { margin: 48px 0 24px; }
.review-form { padding: 18px 20px; background: var(--surface); border: 1px solid var(--border-light); border-radius: 12px; margin-bottom: 18px; }
.review-list { display: flex; flex-direction: column; gap: 12px; }
.review-card { padding: 16px 18px; background: var(--surface); border: 1px solid var(--border-light); border-radius: 12px; }
.review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.review-card p { font-size: 0.9rem; color: var(--text-2); line-height: 1.55; }
.review-meta { display: block; margin-top: 8px; font-size: 0.78rem; color: var(--text-3); }
.plan-subscription { border-color: var(--purple); }
.sub-plans { margin-top: 56px; }
.video-embed video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; }
