/* Anthropic Academy — Stadika University */

/* Fonts loaded from index.html via preconnect + link */

:root {
  --primary:        #3B82F6;
  --primary-deep:   #1d4ed8;
  --bg:             #F5F1EB;
  --on-surface:     #1A2B48;
  --on-surface-var: #4a5568;
  --surface:        #ebe7e0;
  --surface-low:    #FAF8F4;
  --outline:        #d0cdc7;
  --inverse-bg:     #0F1B33;
  --inverse-bg-2:   #1A2B48;
  --inverse-on:     #F3EADA;
  --accent:         #D97706;     /* amber — Бесплатно, прогресс */
  --accent-soft:    #FCD9A2;
  --done:           #059669;     /* emerald — пройдено */
  --done-soft:      #C8EBD9;

  --serif: 'Newsreader', 'Times New Roman', Georgia, serif;
  --sans:  'Public Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, Menlo, monospace;

  --radius-card: 1.5rem;
  --radius-pill: 9999px;
  --radius-sm:   0.5rem;
  --radius-md:   0.875rem;

  --shadow-lift: 0 8px 32px rgba(26, 43, 72, .08);
  --shadow-card: 0 1px 0 rgba(255,255,255,.6) inset, 0 2px 8px rgba(26, 43, 72, .04);
  --glass:       rgba(255, 255, 255, 0.6);
  --glass-deep:  rgba(255, 255, 255, 0.78);
}

[data-theme="dark"] {
  --bg:             #0E1A30;
  --on-surface:     #F3EADA;
  --on-surface-var: #B6BFD0;
  --surface:        #182947;
  --surface-low:    #122039;
  --outline:        #2a3a59;
  --inverse-bg:     #060D1C;
  --inverse-bg-2:   #0E1A30;
  --inverse-on:     #F3EADA;
  --glass:          rgba(24, 41, 71, 0.6);
  --glass-deep:     rgba(24, 41, 71, 0.85);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* Android Chrome "font boosting" inflates text blocks unpredictably and made
   the hero h1 overflow on real phones even though DevTools showed it fits.
   Lock text size to what CSS says. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--on-surface);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* Long Russian words ("кинематографичной" etc) must never overflow the
   viewport on mobile: hard-break only as a last resort. Headings never
   hyphenate — words wrap whole (Alina, 10.09). Hyphenation stays only in
   long-form course content (lesson titles, breadcrumbs, ledes). */
h1, h2, h3, h4, .card-title {
  overflow-wrap: break-word;
  -webkit-hyphens: none;
  hyphens: none;
}
.lesson-title, .breadcrumbs, .lede {
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* First screen: no word hyphenation (Alina, 10.09). Words there are short
   enough to wrap whole; hanging prepositions handled with nbsp in JSX. */
.hero h1, .hero-lede, .hero-eyebrow, .hero-stat .lbl {
  -webkit-hyphens: none;
  hyphens: none;
  overflow-wrap: normal;
}

/* ===== Layout ===== */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 32px; width: 100%; }
.container-narrow { max-width: 880px; margin: 0 auto; padding: 0 32px; width: 100%; }

/* ===== Top nav ===== */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--outline);
}
.topnav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: -0.01em;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--on-surface); color: var(--bg);
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 16px;
}
.brand-sep { color: var(--outline); margin: 0 4px; font-weight: 300; }
.brand-sub { color: var(--on-surface-var); font-family: var(--sans); font-weight: 500; font-size: 14px; }
.topnav-links { display: flex; gap: 28px; font-size: 14px; color: var(--on-surface-var); font-weight: 500; }
.topnav-links a:hover { color: var(--on-surface); }
.topnav-right { display: flex; align-items: center; gap: 12px; }
.topnav-right-mobile { display: none; }
.burger { display: none; background: none; border: none; cursor: pointer; padding: 8px; flex-direction: column; gap: 4px; }
.burger span { display: block; width: 20px; height: 2px; background: var(--on-surface); border-radius: 2px; }

@media (max-width: 640px) {
  .brand-sep, .brand-sub { display: none; }
  .brand-name { font-size: 16px; }
  .topnav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--outline);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    padding: 8px 0;
  }
  .topnav-links.open { display: flex; }
  .topnav-links a { padding: 12px 24px; }
  .topnav-links a:hover { background: var(--surface-1); }
  .topnav-right-desktop { display: none; }
  .topnav-right-mobile { display: block; padding: 8px 24px 12px; }
  .burger { display: flex; }
  .topnav-inner { position: relative; }
}

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden;
  background: var(--inverse-bg);
  color: var(--inverse-on);
  border-radius: 0 0 32px 32px;
  margin: 0 16px;
}
.hero-inner {
  position: relative; z-index: 2;
  padding: 72px 32px 88px;
  max-width: 1240px; margin: 0 auto;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
}
.hero-bg svg { width: 100%; height: 100%; display: block; }
/* course-title ribbon, English original twisting into Russian (HeroRibbon.jsx) */
.hero-ribbon {
  position: absolute; right: 0; top: 0; bottom: 0; z-index: 1;
  width: min(44%, 640px);
  pointer-events: none;
}
.hero-ribbon svg { width: 100%; height: 100%; display: block; }
@media (max-width: 1200px) { .hero-ribbon { opacity: .35; } }
@media (max-width: 900px) { .hero-ribbon { width: 100%; opacity: .16; } }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 8px;
  background: rgba(217, 119, 6, .15);
  border: 1px solid rgba(217, 119, 6, .35);
  color: #FCD9A2;
  border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 500;
  margin-bottom: 28px;
}
.hero-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #F59E0B;
  box-shadow: 0 0 0 4px rgba(245,158,11,.18);
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  /* fits "по официальным курсам" (18.6ch) but not "Освойте AI по официальным"
     (21.6ch) — forces the clean 2-line split at every font size */
  max-width: 19.5ch;
}
/* Must come AFTER the base .hero h1 rule (same specificity, source order).
   8.5vw keeps the nbsp-glued "по официальным" chunk inside any phone width,
   including Android font boost headroom. */
@media (max-width: 480px) {
  .hero h1 { font-size: clamp(25px, 7.6vw, 31px); line-height: 1.1; }
  .hero-eyebrow { font-size: 12px; }
}
@media (max-width: 360px) {
  .hero h1 { font-size: 24px; }
  .hero-cta .btn { padding: 14px 18px; font-size: 15px; }
}
/* Phones: btn-lg with long Russian labels must not push the page wide */
@media (max-width: 480px) {
  .btn.btn-lg { padding: 14px 18px; font-size: 15px; white-space: normal; text-align: center; justify-content: center; }
}
.hero h1 em {
  font-style: italic;
  color: #FCD9A2;
  font-weight: 500;
}
.hero-lede {
  font-size: 19px;
  color: rgba(243, 234, 218, .78);
  max-width: 56ch;
  margin: 0 0 36px;
  line-height: 1.5;
}
@media (max-width: 480px) {
  .hero-lede { font-size: 17px; }
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-stats {
  display: flex; gap: 48px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid rgba(243, 234, 218, .12);
  flex-wrap: wrap;
}
.hero-stat .num {
  font-family: var(--serif);
  font-size: 44px; font-weight: 500;
  line-height: 1; letter-spacing: -0.02em;
  color: var(--inverse-on);
}
.hero-stat .lbl {
  font-size: 13px; color: rgba(243, 234, 218, .55);
  margin-top: 8px;
  letter-spacing: 0.01em;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--primary); color: white;
  box-shadow: 0 4px 14px rgba(59, 130, 246, .35);
}
.btn-primary:hover { background: var(--primary-deep); }
.btn-light {
  background: var(--inverse-on); color: var(--inverse-bg-2);
}
.btn-light:hover { background: white; }
.btn-ghost {
  background: transparent; color: var(--inverse-on);
  border-color: rgba(243,234,218,.25);
}
.btn-ghost:hover { background: rgba(243,234,218,.08); }
.btn-on-light {
  background: var(--on-surface); color: var(--bg);
}
.btn-on-light:hover { background: #0d1a35; }
.btn-outline {
  background: transparent; color: var(--on-surface);
  border-color: var(--outline);
}
.btn-outline:hover { background: var(--surface); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 28px; font-size: 16px; }

/* ===== Section ===== */
.section { padding: 64px 0; }
.section-tight { padding: 40px 0; }
.section-head {
  display: flex; flex-direction: column; align-items: flex-start;
  margin-bottom: 28px; gap: 12px;
}
.section-head h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  /* section headings use short words — wrap whole, never hyphenate */
  -webkit-hyphens: none; hyphens: none; overflow-wrap: normal;
}
.section-head .sub {
  color: var(--on-surface-var);
  font-size: 15px;
  max-width: 70ch;
  line-height: 1.55;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-surface-var);
  margin-bottom: 12px;
}

/* ===== Filter chips ===== */
.filter-group {
  margin-bottom: 20px;
}
.filter-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--on-surface-var);
  margin-bottom: 8px;
  padding-left: 4px;
}
.filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 8px;
  background: var(--surface-low);
  border: 1px solid var(--outline);
  border-radius: 16px;
}
.chip {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 500;
  color: var(--on-surface-var);
  background: transparent;
  border: 0;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s, color .15s;
}
.chip:hover { color: var(--on-surface); background: var(--surface); }
.chip.active {
  background: var(--on-surface);
  color: var(--bg);
}
.chip .count {
  font-size: 11.5px;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.filters-providers {
  margin-bottom: 0;
}
.chip-sm {
  padding: 5px 12px;
  font-size: 13px;
}

/* ===== Course grid ===== */
/* Columns follow the real width of the grid, not the reported viewport: 3 on desktop, 2 on tablets, 1 on phones.
   iPhone Safari in «desktop website» mode reports a wide viewport, media queries kept 3 squeezed columns (Jürgen 03.10) */
.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  container: cgrid / inline-size;
}
.grid[data-density="4"] { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; }

/* ===== Course card ===== */
.card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--outline);
  border-radius: var(--radius-card);
  padding: 0;
  display: flex; flex-direction: column;
  text-align: left;
  width: 100%;
  cursor: pointer;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in oklab, var(--on-surface), transparent 80%);
}
.card-art {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--outline);
}
.card-art svg { width: 100%; height: 100%; display: block; }
.card-badge {
  position: absolute;
  top: 14px; right: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 8px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.02em;
}
.card-badge .dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.85); }
.card-badge.done { background: var(--done); }
.card-new {
  position: absolute;
  top: 44px; left: 14px;
  padding: 4px 10px;
  background: #16a34a;
  color: white;
  border-radius: var(--radius-pill);
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em;
}
.card-cat {
  position: absolute;
  top: 14px; left: 14px;
  padding: 4px 10px;
  background: rgba(255,255,255,.85);
  color: var(--on-surface);
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.card-body {
  padding: 22px 22px 20px;
  display: flex; flex-direction: column;
  flex: 1;
  gap: 12px;
}
.card-title {
  font-family: var(--serif);
  font-size: 22px; font-weight: 600;
  line-height: 1.18; letter-spacing: -0.01em;
  margin: 0;
  color: var(--on-surface);
}
.card-desc {
  font-size: 14px;
  color: var(--on-surface-var);
  line-height: 1.5;
  margin: 0;
  text-wrap: pretty;
}
.card-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--on-surface-var);
  margin-top: auto;
  padding-top: 4px;
}
.card-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.card-meta-item svg { width: 14px; height: 14px; opacity: 0.6; }
.card-foot {
  padding: 14px 22px 18px;
  border-top: 1px solid var(--outline);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-foot.with-progress { flex-direction: column; align-items: stretch; gap: 10px; }
.card-progress { font-size: 12px; color: var(--on-surface-var); display: flex; justify-content: space-between; }
.card-progress b { color: var(--on-surface); font-weight: 600; }

.progress-track {
  height: 6px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-pill);
  transition: width .4s ease;
}
.progress-fill.done {
  background: var(--done);
}

.card-action {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600;
  color: var(--primary);
}
.card-action.done { color: var(--done); }

/* ===== Value strip ===== */
.values {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--surface-low);
  border: 1px solid var(--outline);
  border-radius: var(--radius-card);
  overflow: hidden;
}
@media (max-width: 900px) { .values { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .values { grid-template-columns: 1fr; } }
.value {
  padding: 28px;
  border-right: 1px solid var(--outline);
  display: flex; flex-direction: column; gap: 10px;
}
.value:last-child { border-right: 0; }
@media (max-width: 900px) {
  .value:nth-child(2n) { border-right: 0; }
  .value:nth-child(-n+2) { border-bottom: 1px solid var(--outline); }
}
.value-num {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--on-surface-var);
}
.value h3 {
  font-family: var(--serif); font-weight: 600; font-size: 22px;
  margin: 0; line-height: 1.1; letter-spacing: -0.01em;
  -webkit-hyphens: none; hyphens: none;
}
.value p { margin: 0; font-size: 14px; color: var(--on-surface-var); line-height: 1.5; }

/* ===== "About the courses" note panel ===== */
.about-note-fine {
  margin: 24px 0 0; max-width: 70ch;
  font-size: 13px; color: var(--on-surface-var);
  line-height: 1.6; opacity: 0.75;
}

/* ===== JTBD segment picker ===== */
.segments {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.seg-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 24px 20px;
  background: var(--surface-low);
  border: 1px solid var(--outline);
  border-radius: var(--radius-card);
  text-align: left; cursor: pointer;
  font: inherit; color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.seg-card:hover {
  border-color: var(--primary, #3B82F6);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}
.seg-card h3 {
  font-family: var(--serif); font-weight: 600; font-size: 19px;
  margin: 0; line-height: 1.15; letter-spacing: -0.01em;
}
.seg-card p { margin: 0; font-size: 13px; color: var(--on-surface-var); line-height: 1.5; flex: 1; }
.seg-card .seg-cta { font-weight: 600; font-size: 14px; margin-top: 4px; }
@media (max-width: 1100px) {
  .segments { grid-template-columns: repeat(2, 1fr); }
  .seg-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .segments { grid-template-columns: 1fr; }
  .seg-card:last-child { grid-column: auto; }
}

/* ===== Footer CTA ===== */
.cta-band {
  background: var(--inverse-bg);
  color: var(--inverse-on);
  border-radius: var(--radius-card);
  padding: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  flex-wrap: wrap;
}
.cta-band h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(28px, 4vw, 44px); line-height: 1.1;
  letter-spacing: -0.02em; margin: 0; max-width: 22ch;
  -webkit-hyphens: none; hyphens: none; overflow-wrap: normal;
}
.cta-band p { color: rgba(243,234,218,.7); margin: 12px 0 0; max-width: 50ch; }
/* Dev band: light split card with a code terminal. The run of dark cards
   still read as identical (Alina, 11.09) — each band now differs in SHAPE,
   not just color: dark biz card / light dev card+terminal / plain centered
   text / slim amber strip. */
.cta-band--dev {
  background: var(--surface);
  color: var(--on-surface);
  border: 1px solid var(--outline);
  align-items: center;
}
.cta-band--dev p { color: var(--on-surface-var); }
.dev-terminal {
  flex: 0 1 400px;
  min-width: 280px;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
}
.dev-terminal-bar { display: flex; gap: 6px; padding: 12px 14px; background: #1e293b; }
.dev-terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: #475569; }
.dev-terminal pre {
  margin: 0; padding: 14px 18px 18px;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 12.5px; line-height: 1.65;
  color: #cbd5e1; overflow-x: auto;
}
@media (max-width: 820px) { .dev-terminal { display: none; } }
/* "Не знаете, с чего начать": plain centered breather, no card at all */
.cta-plain { max-width: 640px; margin: 0 auto; text-align: center; }
.cta-plain h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(26px, 3.4vw, 38px); line-height: 1.1;
  letter-spacing: -0.02em; margin: 0 0 14px;
  -webkit-hyphens: none; hyphens: none; overflow-wrap: normal;
}
.cta-plain p { color: var(--on-surface-var); margin: 0 0 26px; line-height: 1.6; }
.cta-plain-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
/* Community band: slim warm horizontal strip, not another hero-sized card */
.cta-band--community {
  background: linear-gradient(135deg, #2b2113 0%, #1c150a 55%, #241a0c 100%);
  border: 1px solid rgba(245,158,11,.3);
  padding: 36px 48px;
}
.cta-band--community h2 { font-size: clamp(22px, 2.6vw, 30px); }
.cta-band--community p { font-size: 15px; max-width: 62ch; }
.cta-band--community .eyebrow {
  color: #F59E0B;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
@media (max-width: 560px) {
  .cta-band { padding: 32px 24px; }
}
.cta-band--dev .eyebrow {
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

/* ===== Pricing ===== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) { .pricing-grid { grid-template-columns: 1fr; max-width: 420px; } }
.pricing-card {
  background: var(--surface-low);
  border: 1px solid var(--outline);
  border-radius: var(--radius-card);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}
.pricing-card--popular {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-lift);
}
.pricing-card--biz {
  background: var(--inverse-bg);
  color: var(--inverse-on);
  border-color: transparent;
}
.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 16px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pricing-label {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--on-surface-var);
}
.pricing-card--biz .pricing-label { color: rgba(243,234,218,.6); }
.pricing-price {
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 8px 0 2px;
}
.pricing-price span { font-size: 28px; font-weight: 400; }
.pricing-period {
  font-size: 13px;
  color: var(--on-surface-var);
  margin-bottom: 16px;
}
.pricing-card--biz .pricing-period { color: rgba(243,234,218,.5); }
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  line-height: 1.45;
  flex: 1;
}
.pricing-features li {
  padding-left: 20px;
  position: relative;
}
.pricing-features li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--done);
  font-weight: 700;
}
.pricing-card--biz .pricing-features li::before { color: var(--accent); }
.pricing-cta {
  margin-top: auto;
}
.pricing-cta .btn { width: 100%; justify-content: center; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--on-surface);
  color: var(--on-surface);
}
.btn-outline:hover { background: var(--on-surface); color: var(--bg); }
.pricing-card--biz .btn-outline {
  border-color: var(--inverse-on);
  color: var(--inverse-on);
}
.pricing-card--biz .btn-outline:hover {
  background: var(--inverse-on);
  color: var(--inverse-bg);
}

/* ===== Business CTA ===== */
.cta-band--biz {
  background: linear-gradient(135deg, #1a2744 0%, #0f1b33 60%, #162240 100%);
  border: 1px solid rgba(217,119,6,.25);
}
.cta-band--biz .eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
/* Biz band is content-heavy: text uses the full band width, buttons go below
   ("текст не на всю ширину блока" — Alina, 10.09) */
.cta-band--biz { display: block; }
.cta-band--biz h2 { max-width: none; }
.cta-band--biz p { max-width: 80ch; }
.cta-band--biz > div:last-child { margin-top: 28px; }
.biz-features {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.biz-features li {
  font-size: 14px;
  color: rgba(243,234,218,.7);
  padding-left: 20px;
  position: relative;
}
.biz-features li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ===== User dropdown ===== */
.user-dropdown {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  min-width: auto;
  background: var(--surface-low);
  border: 1px solid var(--outline);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 32px rgba(0,0,0,.15);
  z-index: 200;
  padding: 4px 0 20px;
  overflow: hidden;
}
@media (min-width: 641px) {
  .user-dropdown {
    position: absolute;
    bottom: auto;
    top: calc(100% + 8px);
    right: 16px;
    left: auto;
    min-width: 220px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    padding: 4px 0;
  }
}
.user-dropdown-header {
  padding: 12px 16px;
}
.user-dropdown-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--on-surface);
}
.user-dropdown-username {
  font-size: 12.5px;
  color: var(--on-surface-var);
  margin-top: 2px;
}
.user-dropdown-divider {
  height: 1px;
  background: var(--outline);
  margin: 2px 0;
}
.user-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--on-surface-var);
  background: none;
  border: none;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.user-dropdown-item:hover {
  background: var(--surface);
  color: var(--on-surface);
}
.user-dropdown-logout {
  color: #dc2626;
}
.user-dropdown-logout:hover {
  background: #fef2f2;
  color: #dc2626;
}
/* user-dropdown-backdrop for mobile touch dismiss */
.user-dropdown-backdrop {
  display: none;
}
@media (max-width: 640px) {
  .user-dropdown-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.3);
    z-index: 199;
  }
}

/* ===== Footer ===== */
.footer {
  margin-top: 80px;
  padding: 40px 0 60px;
  border-top: 1px solid var(--outline);
  color: var(--on-surface-var);
  font-size: 13px;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-brand-name { font-weight: 500; color: var(--on-surface); }
.footer-brand-sub { font-size: 12px; margin-top: 4px; }
.footer-social { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer-social-link {
  display: flex; align-items: center; gap: 6px;
  color: var(--on-surface-var); text-decoration: none; font-size: 13px;
  transition: color 0.15s;
}
.footer-social-link:hover { color: var(--primary); }
.course-text { margin-top: 40px; max-width: 70ch; }
.course-text h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 0 0 12px; letter-spacing: -0.01em; }
.course-text p, .course-text li { line-height: 1.65; }
.course-faq details { border-bottom: 1px solid var(--outline); padding: 12px 0; }
.course-faq summary { cursor: pointer; font-weight: 600; }
.course-faq details p { margin: 8px 0 0; color: var(--on-surface-var); }
/* Telegram login helper (TopNav): fallback link when the browser blocked the new tab */
.login-helper { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 300; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; max-width: min(560px, calc(100vw - 24px)); padding: 14px 16px; border-radius: 14px; background: var(--inverse-bg); color: var(--inverse-on); box-shadow: 0 10px 40px rgba(0,0,0,.25); font-size: 14px; line-height: 1.4; }
.login-helper-text { flex: 1 1 240px; }
.login-helper-btn { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; background: #2aabee; color: #fff; font-weight: 600; text-decoration: none; white-space: nowrap; }
.login-helper-close { background: none; border: 0; color: inherit; font-size: 20px; opacity: .7; cursor: pointer; }
/* Promo code (utils/promo.js, components/PromoCode.jsx) */
.promo { display: flex; flex-direction: column; gap: 6px; margin: 20px 0 4px; }
.promo--center { align-items: center; }
.promo--left { align-items: flex-start; }
.promo-toggle { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 14px; color: var(--on-surface-var); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.promo-toggle:hover { color: var(--on-surface); }
.promo-form { display: flex; gap: 8px; width: 100%; max-width: 380px; }
.promo-input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--outline); border-radius: 10px; background: var(--surface, #fff); font: inherit; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; }
.promo-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.promo-input--error { border-color: #c2410c; }
.promo-apply { height: 44px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--on-surface); color: var(--bg); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.promo-apply:disabled { opacity: 0.45; cursor: default; }
.promo-error { font-size: 13px; color: #c2410c; }
.promo-chip { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 8px 8px 12px; border-radius: 999px; background: rgba(23, 163, 74, 0.1); color: #166534; font-size: 14px; line-height: 1.3; }
.promo-chip b { letter-spacing: 0.06em; }
.promo-check { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #17a34a; color: #fff; font-size: 12px; }
.promo-remove { background: none; border: 0; width: 26px; height: 26px; border-radius: 50%; font-size: 18px; line-height: 1; color: inherit; opacity: 0.6; cursor: pointer; }
.promo-remove:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }
.promo-banner { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px 16px; background: #166534; color: #fff; font-size: 14px; text-align: center; flex-wrap: wrap; }
.promo-banner s { opacity: 0.7; }
.promo-banner-link { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.pricing-old { font-size: 0.5em; opacity: 0.45; margin-right: 6px; font-weight: 500; }
.lesson-announce-frame { margin: 0 0 20px; }
.lesson-announce-frame img { width: 100%; height: auto; border-radius: 12px; display: block; }
.lesson-guides { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--outline); font-size: 14px; }
.lesson-guides a { margin-right: 16px; }
.footer-guides { display: flex; gap: 8px 20px; flex-wrap: wrap; align-items: baseline; margin-top: 24px; }
.footer-guides-label { font-size: 12px; font-weight: 600; color: var(--on-surface-var); }
.footer-legal { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--outline); }
.footer-legal-links { display: flex; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 10px; }
.footer-legal-link { color: var(--on-surface-var); text-decoration: none; font-size: 12px; }
.footer-legal-link:hover { color: var(--primary); }
.footer-requisites { font-size: 11px; color: var(--on-surface-var); opacity: 0.8; line-height: 1.6; }
.footer-requisites a { color: inherit; }

/* Legal doc pages */
.legal-doc { max-width: 780px; padding-top: 40px; padding-bottom: 40px; }
.legal-doc h1 { font-size: 32px; margin-bottom: 8px; }
.legal-doc .legal-sub { color: var(--on-surface-var); font-size: 14px; margin-bottom: 28px; }
.legal-doc h2 { font-size: 20px; margin: 28px 0 12px; }
.legal-doc p, .legal-doc li { font-size: 15px; line-height: 1.65; margin-bottom: 10px; }
.legal-doc ul { padding-left: 22px; margin-bottom: 12px; }

/* FAQ section */
.faq-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 1.7fr);
  gap: 48px;
  align-items: start;
}
.faq-head { position: sticky; top: 96px; }
.faq-head h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1;
  letter-spacing: -0.02em; margin: 8px 0 0;
  -webkit-hyphens: none; hyphens: none; overflow-wrap: normal;
}
.faq-head .sub { margin: 14px 0 0; max-width: 34ch; line-height: 1.55; color: var(--on-surface-var); }
.faq-actions { margin-top: 20px; }
@media (max-width: 860px) {
  .faq-grid { grid-template-columns: 1fr; gap: 24px; }
  .faq-head { position: static; }
}
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--surface-low);
  border: 1px solid var(--outline, #e5e0d5);
  border-radius: 14px;
  padding: 0 22px;
  transition: border-color .15s ease;
}
.faq-item:hover { border-color: var(--on-surface-var); }
.faq-item[open] { border-color: var(--on-surface-var); }
.faq-q {
  cursor: pointer;
  padding: 18px 0;
  font-weight: 600;
  font-size: 15px;
  color: var(--on-surface);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: '+';
  font-size: 20px;
  font-weight: 400;
  color: var(--on-surface-var);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 16px;
}
details[open] > .faq-q::after { content: '\2212'; }
.faq-a {
  padding: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--on-surface-var);
}

/* Updates feed */
.updates-list { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.update-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.update-date {
  font-size: 13px;
  color: var(--on-surface-var);
  white-space: nowrap;
  min-width: 120px;
}
.update-body { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.update-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.update-badge--new { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.update-badge--upd { background: rgba(59, 130, 246, 0.15); color: #3B82F6; }
.update-providers { font-size: 13px; color: var(--on-surface-var); }

@media (max-width: 640px) {
  .update-item { flex-direction: column; align-items: flex-start; gap: 6px; }
  .update-date { min-width: auto; }
}

/* Original tooltip */
.footer-original-wrap { position: static; display: inline-flex; }
.footer-original-trigger {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.footer-original-tooltip {
  display: none;
  position: fixed;
  bottom: 64px;
  left: 12px;
  right: 12px;
  width: auto;
  max-width: 400px;
  padding: 14px 16px;
  background: var(--surface, #fff);
  color: var(--on-surface, #333);
  border: 1px solid var(--outline, #ddd);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  z-index: 100;
}
.footer-original-tooltip--visible { display: block; }
@media (min-width: 640px) {
  .footer-original-wrap { position: relative; }
  .footer-original-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    left: auto;
    width: 320px;
  }
  .footer-original-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 24px;
    border: 6px solid transparent;
    border-top-color: var(--outline, #ddd);
  }
}

/* ===== Course detail page ===== */
.crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--on-surface-var);
  padding: 24px 0 0;
}
.crumbs a:hover { color: var(--on-surface); }
.crumbs .sep { opacity: 0.4; }

/* Provider hero banner */
.provider-hero {
  margin: 16px 0 0;
  border-radius: var(--radius-card);
  background-color: var(--inverse-bg);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  position: relative;
}
.provider-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.2) 100%);
}
.provider-hero-content {
  position: relative; z-index: 1;
  padding: 48px 40px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
}
.provider-logo {
  height: 36px; width: auto;
  opacity: 0.9;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
  margin-bottom: 4px;
}
.provider-hero h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600; line-height: 1.1;
  color: #fff;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
  margin: 0;
}
.provider-hero-stats {
  font-size: 15px; color: rgba(255,255,255,0.85);
  font-family: var(--sans); margin: 0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
@media (max-width: 640px) {
  .provider-hero-content { padding: 32px 24px; }
  .provider-logo { height: 28px; }
}

.course-head {
  padding: 32px 0 48px;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 56px;
  align-items: end;
}
@media (max-width: 900px) { .course-head { grid-template-columns: 1fr; gap: 32px; } }

.course-head h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 600;
  line-height: 1.05; letter-spacing: -0.02em;
  margin: 12px 0 20px;
}
.course-head .lede {
  font-size: 18px;
  color: var(--on-surface-var);
  max-width: 56ch; margin: 0 0 28px;
  line-height: 1.5;
}
.course-meta-row {
  display: flex; gap: 24px; flex-wrap: wrap;
  margin-bottom: 32px;
  padding: 16px 0;
  border-top: 1px solid var(--outline);
  border-bottom: 1px solid var(--outline);
}
.course-meta-row .item { display: flex; flex-direction: column; gap: 2px; min-width: 100px; }
.course-meta-row .item .k { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-surface-var); font-family: var(--mono); }
.course-meta-row .item .v { font-size: 16px; font-weight: 600; color: var(--on-surface); }

.course-art {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--outline);
  position: relative;
  background: var(--surface);
}
.course-art svg { width: 100%; height: 100%; }
.course-art .live-progress {
  position: absolute;
  left: 20px; right: 20px; bottom: 20px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 13px;
  display: flex; flex-direction: column; gap: 8px;
}

/* ===== Course body ===== */
.course-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 56px;
  padding: 8px 0 80px;
}
@media (max-width: 1000px) { .course-body { grid-template-columns: 1fr; } }

.lessons {
  border-top: 1px solid var(--outline);
}
.lesson-section-h {
  display: flex; align-items: baseline; gap: 14px;
  padding: 24px 0 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--on-surface-var);
}
.lesson-section-h::after {
  content: ''; flex: 1; height: 1px; background: var(--outline);
}

.lesson-row {
  display: grid;
  grid-template-columns: 50px 28px 1fr auto 32px;
  align-items: center;
  gap: 14px;
  padding: 14px 12px;
  border-radius: var(--radius-md);
  transition: background .15s;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  background: transparent;
  color: inherit;
  font: inherit;
}
.lesson-row:hover { background: var(--surface-low); }
.lesson-row.current {
  background: color-mix(in oklab, var(--primary), transparent 92%);
  border-color: color-mix(in oklab, var(--primary), transparent 70%);
}
.lesson-row.locked { color: var(--on-surface-var); cursor: pointer; }
.lesson-row.locked:hover { background: rgba(217, 119, 6, .06); }
.lesson-row.done { color: var(--on-surface-var); }
.lesson-row.done .lesson-title { text-decoration: line-through; text-decoration-color: var(--outline); }

.lesson-num {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--on-surface-var);
  font-variant-numeric: tabular-nums;
}
.lesson-icon {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--surface);
  color: var(--on-surface);
  flex-shrink: 0;
}
.lesson-icon svg { width: 14px; height: 14px; }
.lesson-icon.video { background: color-mix(in oklab, var(--primary), transparent 88%); color: var(--primary-deep); }
.lesson-icon.text  { background: color-mix(in oklab, var(--accent), transparent 88%);  color: var(--accent); }
.lesson-icon.quiz  { background: color-mix(in oklab, var(--done), transparent 88%);    color: var(--done); }
.lesson-icon.lock  { background: var(--surface); color: var(--on-surface-var); }

.lesson-title { font-weight: 500; font-size: 15px; line-height: 1.3; }
.lesson-duration { font-size: 12.5px; color: var(--on-surface-var); font-variant-numeric: tabular-nums; }
.lesson-status {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--on-surface-var);
}
.lesson-status.done { background: var(--done); color: white; }
.lesson-status.locked { background: transparent; color: var(--accent); }
.lesson-status svg { width: 13px; height: 13px; }

/* ===== Sidebar ===== */
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 88px; align-self: start; }
.side-card {
  background: var(--glass-deep);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--outline);
  border-radius: var(--radius-card);
  padding: 24px;
}
.side-card h4 {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--on-surface-var);
  margin: 0 0 14px; font-weight: 500;
}
.side-card ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.side-card li { font-size: 14px; line-height: 1.45; padding-left: 22px; position: relative; }
.side-card li::before {
  content: ''; position: absolute; left: 0; top: 8px;
  width: 12px; height: 1px; background: var(--on-surface);
}
.side-card.dark { background: var(--inverse-bg); color: var(--inverse-on); border-color: transparent; }
.side-card.dark h4 { color: rgba(243, 234, 218, .55); }
.side-card.dark p { color: rgba(243, 234, 218, .75); margin: 0 0 18px; font-size: 14px; line-height: 1.5; }

/* ===== Lesson page ===== */
.lesson-bar {
  position: relative; z-index: 10;
  background: color-mix(in oklab, var(--bg), transparent 15%);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--outline);
}
@media (max-width: 600px) {
  .lesson-bar { position: relative; top: auto; }
}
.lesson-bar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  .lesson-bar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 0;
  }
  .lesson-bar-inner .crumbs { font-size: 12px; flex-wrap: wrap; gap: 4px 8px; }
  .lesson-prev-next { width: 100%; justify-content: space-between; }
}
.lesson-prev-next { display: flex; gap: 8px; align-items: center; }
.lesson-pn-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--outline);
  background: var(--surface-low);
  font-size: 13px; font-weight: 500;
  color: var(--on-surface);
}
.lesson-pn-btn:hover { background: var(--surface); }
.lesson-pn-btn.disabled { opacity: 0.4; cursor: not-allowed; }
.lesson-counter { font-size: 13px; color: var(--on-surface-var); padding: 0 8px; font-family: var(--mono); }

.thin-progress { height: 3px; background: var(--surface); }
.thin-progress .fill { height: 100%; background: var(--primary); transition: width .4s; }

.lesson-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  padding: 32px 0 80px;
}
@media (max-width: 1000px) {
  .lesson-layout { grid-template-columns: 1fr; }
  .toc-side { display: none; }
  .toc-side.toc-open { display: block; }
}
.toc-toggle {
  display: none;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--surface-low);
  border: 1px solid var(--outline);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--on-surface);
  cursor: pointer;
  text-align: center;
}
.toc-toggle:hover { background: var(--surface); }
@media (max-width: 1000px) { .toc-toggle { display: block; } }

.toc-side { position: sticky; top: 130px; align-self: start; }
.toc-card {
  background: var(--surface-low);
  border: 1px solid var(--outline);
  border-radius: var(--radius-card);
  padding: 18px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}
.toc-card h5 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-surface-var); margin: 4px 8px 12px; font-weight: 500; }
.toc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.toc-list li button {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  width: 100%; text-align: left;
  border: 0; background: transparent; color: inherit; font: inherit;
  font-size: 13.5px;
}
.toc-list li button:hover { background: var(--surface); }
.toc-list li button.active { background: var(--on-surface); color: var(--bg); font-weight: 500; }
.toc-list .toc-num { font-family: var(--mono); font-size: 11.5px; color: var(--on-surface-var); width: 22px; }
.toc-list li button.active .toc-num { color: rgba(245, 241, 235, 0.65); }
.toc-list .toc-done-mark { margin-left: auto; color: var(--done); }
.toc-list li button.active .toc-done-mark { color: var(--done-soft); }
.toc-section-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--on-surface-var);
  padding: 14px 10px 6px;
}

/* ===== Video inline (in article) ===== */
.video-inline {
  margin: 24px 0 32px;
}

.video-auth-gate {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card);
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f1b3d 0%, #1a3a5c 30%, #2d1b4e 60%, #1a0f2e 100%);
  border: 1px solid var(--outline);
}
.video-auth-gate-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(59, 130, 246, .15), transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, .12), transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(0,0,0,.2), transparent 70%);
  pointer-events: none;
}
.video-auth-gate-inner {
  position: relative;
  text-align: center;
  color: rgba(243, 234, 218, .9);
  font-family: var(--sans);
  padding: 32px;
  max-width: 480px;
}
.video-auth-gate-lesson-num {
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .5;
  margin-bottom: 8px;
}
.video-auth-gate-title {
  font-family: var(--serif);
  font-size: clamp(20px, 2.5vw, 32px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.video-auth-gate-divider {
  width: 48px;
  height: 2px;
  background: rgba(243, 234, 218, .2);
  margin: 20px auto;
}
.video-auth-gate-inner p {
  font-size: 15px;
  margin: 0 0 20px;
  opacity: .7;
}
.btn-login-gate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(8px);
  color: white;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  border: 1px solid rgba(255, 255, 255, .15);
  transition: background .15s, border-color .15s;
}
.btn-login-gate:hover {
  background: rgba(255, 255, 255, .2);
  border-color: rgba(255, 255, 255, .3);
}
.btn-login-gate svg {
  width: 16px;
  height: 16px;
}

/* ===== Video player ===== */
.video-frame {
  background: #050a18;
  border-radius: var(--radius-card);
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--outline);
}
.video-canvas {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 30%, #1a2747, #050a18 65%);
  display: grid; place-items: center;
  color: rgba(243, 234, 218, .9);
}
.video-mock {
  text-align: center;
  font-family: var(--serif);
  padding: 24px;
}
.video-mock-title { font-size: clamp(24px, 3vw, 38px); font-weight: 500; line-height: 1.1; letter-spacing: -0.02em; max-width: 18ch; margin: 0 auto; }
.video-mock-sub { font-family: var(--sans); font-size: 13px; color: rgba(243,234,218,.5); margin-top: 12px; letter-spacing: 0.04em; }

.video-cc {
  position: absolute;
  bottom: 80px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.65);
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 16px;
  max-width: 70%;
  text-align: center;
  font-family: var(--sans);
}

.video-cue {
  position: absolute;
  left: 10%; right: 10%; bottom: 80px;
  text-align: center;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1.4;
  text-shadow: 0 1px 4px rgba(0,0,0,.9), 0 0 2px rgba(0,0,0,.7);
  pointer-events: none;
  z-index: 2;
  white-space: pre-line;
}
.video-controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px;
  background: linear-gradient(to top, rgba(0,0,0,.85), transparent);
  display: flex; flex-direction: column; gap: 10px;
  color: white;
}
.video-scrub {
  height: 4px; background: rgba(255,255,255,.18);
  border-radius: var(--radius-pill);
  position: relative;
  cursor: pointer;
}
.video-scrub-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-pill);
  position: relative;
}
.video-scrub-fill::after {
  content: '';
  position: absolute;
  right: -6px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .25);
}
.video-row { display: flex; align-items: center; gap: 16px; }
.video-row-spacer { flex: 1; }
.video-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 0;
  color: white;
  display: grid; place-items: center;
}
.video-btn:hover { background: rgba(255,255,255,.22); }
.video-btn svg { width: 16px; height: 16px; }
.video-time { font-family: var(--mono); font-size: 12.5px; color: rgba(255,255,255,.85); font-variant-numeric: tabular-nums; }
.video-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,.12);
  font-size: 12px; font-weight: 500;
  border: 0; color: white;
}
.video-pill:hover { background: rgba(255,255,255,.22); }

/* ===== Lesson content ===== */
.lesson-h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(30px, 3.5vw, 42px);
  line-height: 1.1; letter-spacing: -0.02em;
  margin: 32px 0 12px;
}
.lesson-eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--on-surface-var);
}
.lesson-prose {
  font-size: 17px; line-height: 1.65;
  color: var(--on-surface);
  max-width: 68ch;
}
.lesson-prose p { margin: 16px 0; }
/* GitHub course images (Microsoft banners, diagrams) are wider than the text column */
.lesson-prose img { max-width: 100%; height: auto; }
.lesson-prose .embed-click {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 140px; margin: 20px 0; border-radius: 12px; overflow: hidden; cursor: pointer;
  background: var(--inverse-bg); color: var(--inverse-on); border: 1px solid var(--outline);
}
.lesson-prose .embed-click--video { aspect-ratio: 16 / 9; }
.lesson-prose .embed-click img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; margin: 0; }
.lesson-prose .embed-click-label {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; padding: 16px; font-weight: 600;
}
.lesson-prose .embed-click-label small { font-weight: 400; opacity: .8; font-size: 13px; }
.lesson-prose .embed-click-play {
  width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 26px; padding-left: 4px;
}
.lesson-prose .embed-click:hover .embed-click-play, .lesson-prose .embed-click:focus .embed-click-play { transform: scale(1.06); }
.lesson-prose .embed-frame { width: 100%; min-height: 420px; border: 0; border-radius: 12px; margin: 20px 0; }
.lesson-prose .embed-frame--video { min-height: 0; aspect-ratio: 16 / 9; }
.lesson-prose h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: 28px; line-height: 1.15;
  margin: 40px 0 12px; letter-spacing: -0.01em;
}
.lesson-prose h3 {
  font-family: var(--serif); font-weight: 600;
  font-size: 22px; line-height: 1.2;
  margin: 28px 0 8px;
}
.lesson-prose ul { padding-left: 20px; }
.lesson-prose li { margin: 6px 0; }
.lesson-prose code {
  font-family: var(--mono); font-size: 0.92em;
  background: var(--surface); padding: 2px 6px; border-radius: 4px;
}
.callout {
  border-left: 3px solid var(--primary);
  background: color-mix(in oklab, var(--primary), transparent 92%);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin: 24px 0;
  font-size: 15px;
}
.callout.tip { border-color: var(--accent); background: color-mix(in oklab, var(--accent), transparent 92%); }
.callout-title {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; font-weight: 600;
  color: var(--primary); margin-bottom: 6px;
}
.callout.tip .callout-title { color: var(--accent); }

/* ===== Quiz questions ===== */
.lesson-prose .quiz-question {
  background: var(--surface-low);
  border: 1px solid var(--outline);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 20px 0;
}
.lesson-prose .quiz-question p { margin: 8px 0; }
.lesson-prose .quiz-question ol {
  padding-left: 24px;
  margin: 12px 0;
}
.lesson-prose .quiz-question ol li {
  margin: 6px 0;
  padding-left: 4px;
}
.lesson-prose .quiz-question details {
  margin-top: 14px;
  border-top: 1px solid var(--outline);
  padding-top: 12px;
}
.lesson-prose .quiz-question details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--primary);
  user-select: none;
}
.lesson-prose .quiz-question details summary:hover {
  color: var(--primary-deep);
}
.lesson-prose .quiz-question details[open] summary {
  margin-bottom: 8px;
}
.lesson-prose .quiz-question details p {
  font-size: 15px;
  color: var(--on-surface-var);
  background: color-mix(in oklab, var(--done), transparent 92%);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--done);
}

.lesson-foot {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--outline);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.next-lesson {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px;
  background: var(--on-surface);
  color: var(--bg);
  border-radius: var(--radius-card);
  border: 0; font: inherit; cursor: pointer;
  transition: transform .15s, background .15s;
}
.next-lesson:hover { transform: translateX(4px); background: #0d1a35; }
.next-lesson .nl-label { font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.7; font-family: var(--mono); }
.next-lesson .nl-title { font-size: 16px; font-weight: 600; margin-top: 2px; }
.next-lesson .nl-arrow {
  width: 36px; height: 36px;
  border-radius: 50%; background: var(--bg); color: var(--on-surface);
  display: grid; place-items: center;
}

.mark-done {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--outline);
  background: var(--surface-low);
  font-size: 14px; font-weight: 500;
  color: var(--on-surface);
}
.mark-done:hover { background: var(--surface); }
.mark-done.done { background: var(--done); color: white; border-color: var(--done); }
.mark-done svg { width: 16px; height: 16px; }

/* ===== Paywall ===== */
.paywall-wrap { position: relative; }
.paywall-content {
  filter: blur(6px) brightness(0.95);
  pointer-events: none;
  user-select: none;
  mask-image: linear-gradient(to bottom, black 0%, black 30%, rgba(0,0,0,.4) 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 30%, rgba(0,0,0,.4) 70%, transparent 100%);
}
.paywall-card {
  position: absolute;
  top: 28%;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 90%);
  background: white;
  border-radius: var(--radius-card);
  padding: 36px 36px 32px;
  box-shadow: 0 20px 60px rgba(26, 43, 72, .25), 0 0 0 1px var(--outline);
  text-align: center;
}
.paywall-card .lock-icon {
  width: 56px; height: 56px;
  margin: 0 auto 20px;
  border-radius: 16px;
  background: linear-gradient(160deg, #FEF3C7, #FCD9A2);
  display: grid; place-items: center;
  color: var(--accent);
}
.paywall-card .lock-icon svg { width: 26px; height: 26px; }
.paywall-card h3 {
  font-family: var(--serif); font-weight: 600;
  font-size: 26px; line-height: 1.15;
  margin: 0 0 10px; letter-spacing: -0.01em;
}
.paywall-card p { color: var(--on-surface-var); margin: 0 0 24px; font-size: 15px; line-height: 1.5; }
.tg-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  background: #229ED9; color: white;
  border-radius: var(--radius-pill);
  font-weight: 600; font-size: 15px;
  border: 0; width: 100%;
  justify-content: center;
}
.tg-btn:hover { background: #1d8bbf; }
.tg-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.next-lesson .nl-arrow svg { width: 16px; height: 16px; }
.toc-list .toc-done-mark svg { width: 13px; height: 13px; }
.toc-list li button > span:last-child svg { width: 13px; height: 13px; }
.crumbs svg { width: 14px; height: 14px; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg svg { width: 18px; height: 18px; }
.card-action svg { width: 14px; height: 14px; }
.lesson-pn-btn svg { width: 14px; height: 14px; }
.video-pill svg { width: 13px; height: 13px; }
.hero-eyebrow svg { width: 14px; height: 14px; }
.paywall-foot { margin-top: 16px; font-size: 12.5px; color: var(--on-surface-var); }
.paywall-foot b { color: var(--on-surface); font-weight: 600; }

/* ===== Misc ===== */
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--surface-low); border: 1px solid var(--outline);
  display: inline-grid; place-items: center;
  color: var(--on-surface);
}
.icon-btn:hover { background: var(--surface); }
.icon-btn svg { width: 16px; height: 16px; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 500;
  color: var(--on-surface-var);
  letter-spacing: 0.02em;
}

.divider { height: 1px; background: var(--outline); margin: 32px 0; }

/* Login panel overlay */
.login-panel {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(26, 43, 72, 0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--surface-low);
  border: 1px solid var(--outline);
  border-radius: var(--radius-card);
  padding: 32px;
  max-width: 360px; width: 90%;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  gap: 8px;
}
.login-card h3 { margin: 0; font-family: var(--serif); font-size: 22px; }

/* Paywall */
.paywall {
  text-align: center;
  padding: 48px 24px 56px;
  margin: 32px 0;
  background: var(--surface-low);
  border: 1px solid var(--outline);
  border-radius: var(--radius-card);
}
.paywall-icon {
  width: 56px; height: 56px; margin: 0 auto 20px;
  display: grid; place-items: center;
  background: var(--surface-1); border-radius: 50%;
  color: var(--on-surface-var);
}
.paywall-icon svg { width: 24px; height: 24px; }
.paywall h2 { margin: 0 0 12px; font-family: var(--serif); font-size: 24px; }
.paywall-desc { max-width: 440px; margin: 0 auto 24px; color: var(--on-surface-var); font-size: 15px; line-height: 1.6; }
.paywall-price { font-size: 36px; font-weight: 700; color: var(--on-surface); }
.paywall-sub { font-size: 13px; color: var(--on-surface-var); margin-bottom: 16px; }
.paywall-features { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.paywall-feature {
  font-size: 13px; color: var(--done); font-weight: 500;
  padding: 4px 12px; background: var(--done-soft); border-radius: var(--radius-pill);
}
.paywall-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; border-radius: 10px;
  background: var(--primary); color: #fff;
  font-size: 16px; font-weight: 600;
  text-decoration: none; transition: opacity .15s;
}
.paywall-btn:hover { opacity: 0.9; }
.paywall-hint { margin-top: 16px; font-size: 13px; color: var(--on-surface-var); }
.paywall-promo { margin-bottom: 16px; }
.paywall-promo-row { display: flex; gap: 8px; justify-content: center; max-width: 320px; margin: 0 auto; }
.paywall-promo-input {
  flex: 1; padding: 8px 12px; border: 1px solid var(--outline); border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: 14px; background: var(--surface-low); color: var(--on-surface);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.paywall-promo-input::placeholder { text-transform: none; letter-spacing: normal; }
.paywall-promo-btn {
  padding: 8px 16px; border: 1px solid var(--outline); border-radius: var(--radius-sm);
  background: var(--surface); font-family: var(--sans); font-size: 13px; cursor: pointer;
  color: var(--on-surface); font-weight: 500;
}
.paywall-promo-btn:hover { background: var(--outline); }
.paywall-promo-btn:disabled { opacity: 0.5; cursor: default; }
.paywall-promo-msg { margin-top: 8px; font-size: 13px; }
.paywall-promo-msg.success { color: var(--done); }
.paywall-promo-msg.error { color: #dc2626; }

/* Paywall tiers */
.paywall-tiers {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  max-width: 560px; margin: 0 auto 24px; text-align: left;
}
@media (max-width: 600px) { .paywall-tiers { grid-template-columns: 1fr; } }
.paywall-tier {
  padding: 20px; border: 1px solid var(--outline); border-radius: var(--radius-card);
  background: var(--surface); position: relative;
}
.paywall-tier--best {
  border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary);
}
.paywall-tier-badge {
  position: absolute; top: -10px; right: 16px;
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 600; padding: 2px 10px;
  border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: 0.05em;
}
.paywall-tier-name { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.paywall-tier-desc { font-size: 13px; color: var(--on-surface-var); margin-bottom: 12px; }
.paywall-tier .paywall-price { font-size: 24px; margin-bottom: 4px; }
.paywall-tier .paywall-sub { font-size: 12px; margin-bottom: 12px; }
.paywall-tier .paywall-btn { width: 100%; justify-content: center; padding: 10px 16px; font-size: 14px; }
.paywall-btn--primary { background: var(--primary); }

/* Checkout upsell modal */
.upsell-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 27, 51, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.upsell-modal {
  background: var(--surface-low, #FAF8F4); color: var(--on-surface, #1A2B48);
  border-radius: var(--radius-card, 16px);
  max-width: 440px; width: 100%;
  padding: 32px 32px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  text-align: center;
}
.upsell-modal h3 {
  font-family: var(--serif, serif);
  font-size: 24px; margin: 0 0 10px; line-height: 1.15;
}
.upsell-modal p { font-size: 14.5px; line-height: 1.5; margin: 0 0 20px; opacity: 0.85; }
.upsell-modal .paywall-btn { width: 100%; margin-bottom: 10px; justify-content: center; }
.upsell-modal-decline {
  display: block; width: 100%;
  background: none; border: none; cursor: pointer;
  color: var(--on-surface-var, #4a5568);
  font-size: 13.5px; padding: 8px; text-decoration: underline;
}
.upsell-modal-decline:hover { color: var(--on-surface, #1A2B48); }

.paywall-savings {
  font-size: 12px; color: var(--done); font-weight: 500;
  margin-bottom: 12px; padding: 4px 8px;
  background: var(--done-soft); border-radius: var(--radius-sm);
}

/* Upgrade banner */
.upgrade-banner {
  display: flex; align-items: center; gap: 16px;
  margin: 24px 0; padding: 16px 20px;
  background: linear-gradient(135deg, var(--surface-1) 0%, var(--surface-low) 100%);
  border: 1px solid var(--primary); border-radius: var(--radius-card);
}
.upgrade-banner-text { flex: 1; font-size: 14px; line-height: 1.5; color: var(--on-surface); }
.upgrade-banner-btn {
  padding: 8px 20px; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff;
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.upgrade-banner-btn:hover { opacity: 0.9; }
@media (max-width: 600px) {
  .upgrade-banner { flex-direction: column; text-align: center; }
}

.toc-list button.locked { opacity: 0.55; }

/* Hide tweaks panel inputs default UI artifacts */
.twk-panel { font-family: var(--sans) !important; }

/* Checkout modal (EmailModal.jsx, redesign 01.10.2026): site tokens, so it follows light and dark themes */
.checkout-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(14, 26, 48, 0.55);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: checkout-fade .18s ease-out;
}
.checkout-modal {
  position: relative;
  width: 100%; max-width: 460px; max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--surface-low, #FAF8F4); color: var(--on-surface, #1A2B48);
  border: 1px solid var(--outline, #d0cdc7);
  border-radius: 20px;
  padding: 30px 30px 22px;
  box-shadow: 0 24px 70px rgba(14, 26, 48, 0.28);
  animation: checkout-rise .22s ease-out;
}
@keyframes checkout-fade { from { opacity: 0 } }
@keyframes checkout-rise { from { opacity: 0; transform: translateY(12px) } }
.checkout-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent, #D97706); margin-bottom: 8px;
}
.checkout-modal h3 {
  font-family: var(--serif, serif); font-weight: 600;
  font-size: 26px; line-height: 1.15; margin: 0 0 10px; padding-right: 28px;
}
.checkout-price {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px;
  padding-bottom: 18px; margin-bottom: 18px;
  border-bottom: 1px solid var(--outline, #d0cdc7);
}
.checkout-price strong { font-family: var(--serif, serif); font-size: 30px; font-weight: 600; }
.checkout-price s { font-size: 17px; color: var(--on-surface-var, #5a6478); }
.checkout-note {
  font-size: 12.5px; font-weight: 600; color: var(--done, #15803d);
  background: var(--done-soft, rgba(21,128,61,.1)); border-radius: 999px; padding: 3px 10px;
}
.checkout-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.checkout-input {
  width: 100%; box-sizing: border-box;
  padding: 13px 14px; font-size: 16px; font-family: inherit;
  border-radius: 12px; border: 1px solid var(--outline, #d0cdc7);
  background: var(--bg, #fff); color: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.checkout-input:focus { border-color: var(--primary, #3B82F6); box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); }
.checkout-hint { margin: 6px 0 16px; font-size: 12.5px; color: var(--on-surface-var, #5a6478); }
.checkout-check {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13.5px; line-height: 1.45; margin-bottom: 10px; cursor: pointer;
}
.checkout-check input {
  flex: none; width: 18px; height: 18px; margin: 1px 0 0;
  accent-color: var(--primary, #3B82F6); cursor: pointer;
}
.checkout-check a, .checkout-foot a { color: var(--primary, #3B82F6); text-decoration: underline; text-underline-offset: 2px; }
.checkout-err { color: #c2410c; font-size: 13px; margin: 4px 0 6px; }
.checkout-btn {
  width: 100%; margin-top: 10px;
  padding: 15px 20px; border: none; border-radius: 12px; cursor: pointer;
  background: var(--primary, #3B82F6); color: #fff;
  font-size: 16px; font-weight: 600; font-family: inherit;
  transition: opacity .15s, transform .1s;
}
.checkout-btn:hover { opacity: .92; }
.checkout-btn:active { transform: translateY(1px); }
.checkout-btn.is-off { opacity: .45; }
.checkout-btn:disabled { cursor: progress; }
.checkout-foot { margin: 12px 0 0; font-size: 12px; line-height: 1.45; color: var(--on-surface-var, #5a6478); text-align: center; }
.checkout-close {
  position: absolute; top: 12px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  background: none; border: none; color: inherit; opacity: .55;
  font-size: 24px; line-height: 1; cursor: pointer;
}
.checkout-close:hover { opacity: 1; background: var(--surface, #ebe7e0); }
@media (max-width: 480px) {
  .checkout-overlay { align-items: flex-end; padding: 0; }
  .checkout-modal { border-radius: 20px 20px 0 0; padding: 26px 20px 20px; max-height: 92vh; }
  .checkout-modal h3 { font-size: 22px; }
}

/* inputs of the certificate form (CourseCertificate.jsx), kept from the old e-mail modal */
.email-modal-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  outline: none;
  margin-bottom: 12px;
}
.email-modal-input:focus {
  border-color: rgba(124, 108, 255, 0.6);
}
.email-modal-err {
  color: #ff7a7a;
  font-size: 13px;
  margin: -6px 0 10px;
}

/* ===== Catalog: topics «Ещё темы», provider logo rail, search, «Показать ещё» (03.10.2026) ===== */
.filters .chip--extra { display: none; }
.filters--open .chip--extra { display: inline-flex; }
.chip-more {
  color: var(--on-surface);
  border: 1px dashed var(--outline);
  background: var(--bg);
}
.chip-more:hover { border-style: solid; }

.prov-rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 2px 6px;
  margin: 0 -2px;
}
.prov-rail::-webkit-scrollbar { display: none; }
.prov-card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex; align-items: center; gap: 10px;
  min-width: 150px;
  padding: 10px 14px 10px 10px;
  background: #fff;
  border: 1px solid var(--outline);
  border-radius: 14px;
  color: var(--on-surface);
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.prov-card:hover { border-color: var(--on-surface-var); box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.prov-card-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.prov-card-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prov-card-count { font-size: 12px; color: var(--on-surface-var); white-space: nowrap; font-variant-numeric: tabular-nums; }
.prov-card--all {
  background: var(--on-surface);
  border-color: var(--on-surface);
  color: var(--bg);
  min-width: 140px;
  padding-left: 16px;
}
.prov-card--all .prov-card-count { color: var(--bg); opacity: .75; }
.prov-card--all:hover { border-color: var(--on-surface); }
.prov-logo { display: block; flex: 0 0 auto; border-radius: 9px; object-fit: contain; }
.prov-logo--mono {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--inverse-bg); color: var(--inverse-on); font-weight: 700;
}
@media (min-width: 900px) {
  .prov-rail {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    overflow: visible;
  }
  .prov-card { min-width: 0; gap: 8px; padding: 10px 10px 10px 8px; }
  .prov-card .prov-logo { width: 28px !important; height: 28px !important; }
  .prov-card-name { font-size: 13.5px; }
  .prov-card--extra { display: none; }
}

.catalog-search {
  position: relative;
  display: flex; align-items: center;
  margin: 8px 0 20px;
  max-width: 560px;
}
.catalog-search > svg {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--on-surface-var); pointer-events: none;
}
.catalog-search-input {
  width: 100%;
  padding: 12px 44px 12px 44px;
  font: inherit; font-size: 15px;
  color: var(--on-surface);
  background: #fff;
  border: 1px solid var(--outline);
  border-radius: var(--radius-pill);
  outline: none;
  -webkit-appearance: none; appearance: none;
}
.catalog-search-input::-webkit-search-cancel-button { display: none; }
.catalog-search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, .15); }
.catalog-search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: var(--surface); color: var(--on-surface);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.catalog-search-status { margin: -8px 0 16px; font-size: 14px; color: var(--on-surface-var); }
.card.card--more { display: none; }
.grid-more { display: flex; justify-content: center; margin-top: 28px; }

/* ===== /providers/ page ===== */
.providers-page h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(30px, 4vw, 44px); line-height: 1.1; letter-spacing: -0.02em; margin: 0;
}
.crumbs { font-size: 13px; color: var(--on-surface-var); margin-bottom: 20px; }
.crumbs a { color: var(--on-surface-var); }
.crumbs a:hover { color: var(--on-surface); }
.prov-group { margin-top: 36px; }
.prov-group-title {
  font-family: var(--mono);
  font-size: 12px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--on-surface-var);
  margin: 0 0 14px;
}
.prov-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.prov-item {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--outline);
  border-radius: 18px;
  color: var(--on-surface);
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.prov-item:hover { border-color: var(--on-surface-var); box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.prov-item-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.prov-item-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.prov-item-name { font-size: 17px; font-weight: 700; }
.prov-item-count { font-size: 13px; color: var(--on-surface-var); font-variant-numeric: tabular-nums; }
.prov-item-learn { font-size: 14px; line-height: 1.5; color: var(--on-surface-var); }
.prov-item-cta { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--primary-deep); margin-top: 2px; }
.prov-item-cta svg { width: 14px; height: 14px; }
@media (max-width: 480px) {
  .prov-list { grid-template-columns: 1fr; }
  .prov-item { padding: 16px; gap: 14px; }
}

/* Phones: compact course cards, art as a square on the left, no description and footer.
   One card was ~530px tall and the home page ~18 000px (RMA/Jürgen 03.10: «мобильная версия страдает") */
@container cgrid (max-width: 640px) {
  .grid .card { display: grid; grid-template-columns: 92px 1fr; align-items: stretch; }
  .grid .card.card--more { display: none; }
  .grid .card:hover { transform: none; }
  .grid .card .card-art { aspect-ratio: auto; height: 100%; min-height: 92px; border-bottom: 0; border-right: 1px solid var(--outline); }
  .grid .card .card-cat, .grid .card .card-badge { display: none; }
  .grid .card .card-new { top: 6px; left: 6px; padding: 2px 6px; font-size: 9px; }
  .grid .card .card-body { padding: 12px 14px; gap: 6px; }
  .grid .card .card-title { font-size: 17px; }
  .grid .card .card-desc { display: none; }
  .grid .card .card-meta { font-size: 11.5px; gap: 10px; padding-top: 2px; }
  .grid .card .card-meta-item:nth-child(3) { display: none; }
  .grid .card .card-foot:not(.with-progress) { display: none; }
  .grid .card .card-foot.with-progress { grid-column: 1 / -1; padding: 10px 14px 12px; }
}

/* Header: burger whenever the links do not fit (6 links + «Уже оплатили?» + «Войти» need ~1080px),
   measured on the header container itself, so it also works on tablets and in «desktop website» mode */
.topnav > .container { container: topnav / inline-size; }
@container topnav (max-width: 1080px) {
  .topnav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--outline);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    padding: 8px 0;
  }
  .topnav-links.open { display: flex; }
  .topnav-links a { padding: 12px 24px; min-height: 44px; display: flex; align-items: center; }
  .topnav-links a:hover { background: var(--surface-1); }
  .topnav-right-desktop { display: none; }
  .topnav-right-mobile { display: block; padding: 8px 24px 12px; }
  .burger { display: flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
  .topnav-inner { position: relative; }
}
@container topnav (max-width: 640px) {
  .brand-sep, .brand-sub { display: none; }
  .brand-name { font-size: 16px; white-space: nowrap; }
}
