/* ==========================================================
   BITLAB Academy — stylesheet
   Light-first, tech-flavored theme with a dark mode variant.

   Brand colors:
     #0EC8D6  cyan     — primary accent / actions
     #002564  deep blue— secondary accent / gradient partner
     #171729  navy     — dark theme base / brand-dark text
     #3E4D59  slate    — helper / muted text
   ========================================================== */

:root {
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  --accent: #0EC8D6;
  --accent-2: #002564;
  --brand-dark: #171729;
  --muted: #3E4D59;
  --accent-rgb: 14, 200, 214;
  --kaspi: #ed3241;
  /* Every "red" accent (sale price, discount chip, Kaspi badge) shares this
     one value so they always match. */
  --discount: var(--kaspi);
  --ribbon: #17A554;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --container: 1240px;
}

/* ---------- Light theme (default) ---------- */
:root,
[data-theme="light"] {
  --bg: #f5f7f8;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef1f3;
  --border: #dde3e7;
  --text: #171729;
  --text-dim: #3E4D59;
  --text-faint: #74808a;
  --code-kw: #002564;
  --code-fn: #0a9aa6;
  --code-str: #17A554;
  --code-num: #b5541e;
  --code-ann: #9c6f00;
  --editor-bg: #fbfcfe;
  --editor-border: #c7ccd1;
  --shadow: 0 20px 50px -25px rgba(23, 23, 41, 0.18);
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --bg: #14141f;
  --bg-alt: #191a2a;
  --surface: #1e2033;
  --surface-2: #262943;
  --border: #34364f;
  --text: #eef1f7;
  --text-dim: #a7acc7;
  --text-faint: #7d84a5;
  --code-kw: #0EC8D6;
  --code-fn: #7fb8ff;
  --code-str: #8fd19e;
  --code-num: #d19a66;
  --code-ann: #d7ba3b;
  --editor-bg: #2b2b2b;
  --editor-border: #3c3f41;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
/* The sticky site header (72px, see .header-inner) sits on top of the page
   and would otherwise cover whatever an anchor jump or scrollIntoView()
   scrolls to — this tells both to stop short and leave room for it. */
html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; color: var(--text-dim); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.container.narrow { max-width: 760px; }

.accent { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
/* .btn's own `display` would otherwise win the cascade tie against the
   browser's default `[hidden] { display: none }` rule. */
.btn[hidden] { display: none; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(var(--accent-rgb), .5);
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, black);
  box-shadow: 0 14px 34px -10px rgba(var(--accent-rgb), .75);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }

/* A lighter-weight third action next to a primary/soft button pair —
   informational, no visual competition with the two real CTAs. */
.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 6px;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 15px;
}
.hero-link:hover { color: var(--accent); }
.hero-link svg { width: 15px; height: 15px; transition: transform .15s ease; }
.hero-link:hover svg { transform: translateY(2px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 72px;
  flex-wrap: nowrap;
}
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: .01em;
  color: var(--text);
  flex-shrink: 0;
}
.logo-icon {
  flex-shrink: 0;
  border-radius: 50%;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-right: auto;
  margin-left: 8px;
  flex-wrap: wrap;
  row-gap: 4px;
}
.main-nav a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 6px 1px;
  white-space: nowrap;
  transition: color .15s ease;
}
.main-nav a:hover { color: var(--text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.lang-switch {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}
.lang-btn {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--text-faint);
  white-space: nowrap;
}
.lang-btn.is-active {
  background: var(--accent);
  color: #fff;
}
.lang-btn:not(.is-active):hover { color: var(--text); }

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---------- Scroll-to-top button ---------- */
/* Hidden by default (not just faded) so it can never sit there catching
   clicks/tab-focus while invisible at the top of the page — main.js toggles
   .is-visible once scroll passes the threshold. */
.scroll-top-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px -10px rgba(var(--accent-rgb), .5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  z-index: 60;
}
.scroll-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top-btn:hover {
  background: color-mix(in srgb, var(--accent) 88%, black);
}
.scroll-top-btn svg { width: 20px; height: 20px; }
@media (max-width: 720px) {
  .scroll-top-btn { right: 16px; bottom: 16px; width: 42px; height: 42px; }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 90px 0 70px;
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  position: absolute;
  inset: 0;
  /* Purely decorative (aria-hidden) — must never intercept clicks. On
     index.php/course.php the content sits in .hero-inner, which has its
     own `position: relative` and happens to stack above this; trial.php's
     hero uses a plain .container with no position, so without this it
     silently swallowed clicks on the back-link and everything else. */
  pointer-events: none;
  background-image:
    linear-gradient(color-mix(in srgb, var(--border) 60%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--border) 60%, transparent) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 20%, black 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 30% 20%, black 30%, transparent 75%);
  opacity: .6;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 56px;
  align-items: center;
}
/* Grid items default to min-width:auto, so they refuse to shrink below the
   intrinsic width of their content. The unwrapped <pre> code snippet inside
   .hero-visual is wide enough to break that on phone-size viewports —
   without this, the column (and the code card's internal scrollbar) never
   gets a chance to kick in and content is clipped instead of scrollable. */
.hero-copy,
.hero-visual {
  min-width: 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--code-kw);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.hero h1 {
  font-size: clamp(32px, 4.4vw, 54px);
  margin-bottom: 20px;
}
/* The trial hero's title sits in a full-width .container (to match the
   header/chapters below) rather than the narrow reading-width one the
   marketing heroes use, so it gets its own, slightly smaller scale. */
.trial-hero h1 { font-size: clamp(26px, 3.2vw, 40px); }
/* It's also just a back-link + title + subtitle — no price card or meta
   chips — so the marketing heroes' generous 90px/70px padding leaves it
   looking oddly empty; a plain page header needs a lot less room. */
.trial-hero { padding: 48px 0 36px; }
.hero-sub {
  font-size: 17px;
  max-width: 52ch;
  margin-bottom: 30px;
}
/* The 52ch cap above assumes .hero-sub sits in the marketing heroes'
   already-narrow .hero-copy grid column. The trial hero has no such column
   — it's a single line of text directly in the full-width .container next
   to a full-width h1 — so that same cap made it wrap noticeably short of
   the title above it. Give it room to match instead. */
.trial-hero .hero-sub { max-width: 70ch; }
.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 46px;
}
/* Forces a flex item onto its own new row within a wrapping flex row,
   without needing a separate wrapper around the buttons before it — used
   to push .hero-link (the lighter-weight "view syllabus" link) below the
   real CTA buttons on the course page, while leaving index.php's simpler
   two-button .hero-actions (no .hero-link inside it) unaffected. */
.hero-actions > .hero-link { flex-basis: 100%; margin-top: 2px; }
.hero-stats {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
}
.stat-label {
  font-size: 13px;
  color: var(--text-faint);
}

.hero-visual { position: relative; }
.code-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: rotate(1.2deg);
}
.code-card-head {
  display: flex;
  gap: 6px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.code-card-head span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border);
}
.code-card-head span:nth-child(1) { background: #ff6159; }
.code-card-head span:nth-child(2) { background: #ffbd2e; }
.code-card-head span:nth-child(3) { background: #29ca42; }
.code-lines {
  margin: 0;
  padding: 22px 22px 26px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-dim);
  overflow-x: auto;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}
.tok-kw { color: var(--code-kw); }
.tok-fn { color: var(--code-fn); }
.tok-str { color: var(--code-str); }
.tok-num { color: var(--code-num); }
.tok-ann { color: var(--code-ann); }
.tok-com { color: var(--text-faint); font-style: italic; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); }
.section-head {
  margin: 0 0 44px;
}
.section-head h2 { font-size: clamp(26px, 3vw, 36px); }
.section-head p { font-size: 16px; margin: 0; }

/* ---------- Courses ---------- */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.course-card {
  position: relative;
  overflow: hidden;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  isolation: isolate;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.course-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--accent);
  z-index: 1;
}
.course-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: var(--shadow);
}
/* Watermark icon anchored to the card's right edge, bleeding slightly past
   it — swap the SVG paths in bitlab_course_icon() any time, this sizing/
   opacity treatment stays the same. */
.course-icon-bg {
  position: absolute;
  z-index: 0;
  width: clamp(140px, 20vw, 190px);
  height: clamp(140px, 20vw, 190px);
  right: -34px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: .07;
  pointer-events: none;
  transition: opacity .25s ease, transform .3s ease;
}
.course-icon-bg svg {
  width: 100%;
  height: 100%;
}
/* Keep the linework hairline-thin even though the icon is stretched large —
   without this the strokes scale up with it and end up as heavy as the
   text, fighting for attention instead of sitting behind it. */
.course-icon-bg svg :is(path, circle, rect, ellipse, line, polyline, polygon) {
  vector-effect: non-scaling-stroke;
}
.course-card:hover .course-icon-bg {
  opacity: .14;
  transform: translateY(-50%) scale(1.08);
}
.course-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.course-discount {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: color-mix(in srgb, var(--discount) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--discount) 40%, transparent);
  color: var(--discount);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12.5px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
}
.course-discount svg { width: 12px; height: 12px; flex-shrink: 0; }
/* Diagonal corner ribbon for the course-card grid — flat, slightly
   translucent color + a soft shadow/highlight for a bit of depth, no
   gradients and no corner fold notches. */
.course-ribbon {
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}
.course-ribbon span {
  position: absolute;
  top: 26px;
  right: -38px;
  width: 160px;
  transform: rotate(45deg);
  background: var(--ribbon);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .02em;
  text-align: center;
  padding: 6px 0;
  box-shadow: 0 4px 10px -2px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .35);
}
/* Modifier that drops the corner-badge positioning so .course-discount can
   sit inline wherever it's used (course-facts tiles, the price card, etc.). */
.course-discount-inline {
  position: static;
  display: inline-flex;
  margin-left: 0;
  vertical-align: middle;
}
.course-card h3 { font-size: 22px; margin-bottom: 8px; max-width: 80%; }
/* Fixed to exactly 2 lines (not just capped) so the divider below it sits at
   the same height whether the description is one short line or wraps to
   two — otherwise a one-line description pulls everything below it up. */
.course-card p {
  font-size: 14.5px;
  line-height: 1.5;
  height: 43.5px;
  margin-bottom: 18px;
  max-width: 84%;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.course-meta {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  min-height: 90px;
  padding-top: 16px;
  margin-top: auto;
  border-top: 1px solid var(--border);
}
.course-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
}
.course-meta-chip svg { width: 13px; height: 13px; color: var(--text-faint); flex-shrink: 0; }
.course-price-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
}
.course-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  /* Matches the taller discounted variant (price + unit line, then a
     savings line) so discounted and non-discounted cards reserve identical
     height here — otherwise the flex auto-margin above .course-meta
     compensates for the difference and the divider line shifts. Keep this
     in sync with the price font sizes above. */
  min-height: 69px;
}
.course-price-old {
  font-size: 16px;
  color: var(--text-faint);
  text-decoration: line-through;
  text-decoration-color: var(--discount);
  text-decoration-thickness: 1.5px;
}
.course-price-new,
.course-price-current {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
}
.course-price-new { color: var(--discount); }
.course-price-current { color: var(--text); }
.course-price-unit {
  font-size: 13.5px;
  color: var(--text-faint);
}
.course-savings {
  width: 100%;
  font-size: 14px;
  font-weight: 700;
  color: var(--ribbon);
}
.course-kaspi {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--kaspi);
  border: 1px solid var(--kaspi);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.course-kaspi svg { width: 14px; height: 14px; flex-shrink: 0; }
/* Kept in the DOM and layout (not display:none) so cards without Kaspi
   installments still reserve the same vertical space as ones that have it. */
.course-kaspi.is-invisible { visibility: hidden; }
.course-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.course-card:hover .course-link {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: start;
}
.about-copy h2 { font-size: clamp(26px, 3vw, 36px); }
.about-copy p { font-size: 16px; }
.about-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.about-points li { display: flex; align-items: flex-start; gap: 12px; }
.about-points svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.about-points span { font-size: 15.5px; color: var(--text); }

/* ---------- Why us ---------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.why-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.why-num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  display: block;
  margin-bottom: 14px;
}
.why-card h3 { font-size: 16.5px; margin-bottom: 8px; }
.why-card p { font-size: 14px; margin: 0; }

/* ---------- History / timeline ---------- */
.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.timeline-item { position: relative; padding-top: 44px; }
.timeline-item::before {
  content: "";
  position: absolute;
  top: 15px; left: 0;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 2px solid var(--accent);
}
.timeline-year {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}
.timeline-item p { font-size: 14.5px; margin: 0; }

/* ---------- Partners ---------- */
.partners-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.partner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.partner-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: var(--shadow);
}
.partner-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  margin-bottom: 18px;
}
.partner-logo svg {
  width: 100%;
  height: 100%;
  max-width: 170px;
  max-height: 60px;
}
.partner-name {
  padding: 0 4px;
  color: var(--text-faint);
  font-weight: 600;
  font-size: 14px;
}
.partner-title { font-size: 16px; margin-bottom: 8px; }
.partner-desc {
  font-size: 13.5px;
  margin-bottom: 18px;
  flex: 1;
}
.partner-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
  margin-top: auto;
}
.partner-link:hover { text-decoration: underline; }
.placeholder-note {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--text-faint);
  font-style: italic;
}

/* ---------- Graduates ---------- */
.graduates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.graduate-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
}
.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-bottom: 16px;
}
.graduate-card blockquote {
  margin: 0 0 18px;
  font-size: 15px;
  color: var(--text);
  font-style: normal;
}
.graduate-card figcaption { display: flex; flex-direction: column; margin-top: auto; }
.graduate-card figcaption strong { font-size: 14.5px; }
.graduate-card figcaption span { font-size: 13px; color: var(--text-faint); }

/* ---------- Team ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.team-card {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 22px;
}
.team-avatar {
  display: block;
  width: 96px; height: 96px;
  margin: 0 auto 18px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  background: var(--surface-2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.team-avatar-fallback {
  width: 96px; height: 96px;
  font-size: 30px;
  margin: 0 auto 18px;
}
.team-card h3 { font-size: 16.5px; margin-bottom: 4px; }
.team-role {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
}
.team-card p { font-size: 13.5px; margin: 0; }

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 20px;
}
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary svg { flex-shrink: 0; color: var(--text-faint); transition: transform .2s ease; }
.faq-item[open] summary svg { transform: rotate(180deg); color: var(--accent); }
.faq-item p { padding-bottom: 18px; margin: 0; font-size: 14.5px; }

/* ---------- Contact / leave a request ---------- */
.contact-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px;
}
.contact-box .section-head { margin-bottom: 28px; }
.form-row { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 13.5px; font-weight: 600; color: var(--text-dim); }
.form-row input,
.form-row select {
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.form-privacy {
  font-size: 12.5px;
  color: var(--text-faint);
  margin: 14px 0 0;
  text-align: center;
}
.form-alert {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 14.5px;
  margin-bottom: 22px;
}
.form-alert-success {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--text);
}
.form-alert-error {
  background: color-mix(in srgb, #ff6159 15%, transparent);
  border: 1px solid color-mix(in srgb, #ff6159 40%, transparent);
  color: var(--text);
}

/* ---------- Course detail page ---------- */
.back-link {
  display: inline-block;
  font-size: 14px;
  color: var(--text-faint);
  margin-bottom: 24px;
}
.back-link:hover { color: var(--accent); }
.course-detail-desc { font-size: 15.5px; margin: 0; }

/* Reuses .hero / .hero-inner / .hero-copy / .hero-visual from the homepage
   hero for the outer layout — only the bits unique to this page live here. */
.course-hero-meta { margin: 22px 0 32px; }

.course-price-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px;
}
.course-price-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--accent);
  z-index: 1;
}
.course-fee-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.course-price-card .course-price-row { margin-top: 0; margin-bottom: 24px; }
.course-price-cta { margin-top: 4px; }
/* Courses with several fixed-price tracks (pricing_tiers) show a "From X ₸"
   teaser here instead of one monthly price, plus a link down to the full
   breakdown in #pricing (see .pricing-grid below) instead of a CTA. */
.course-view-plans-link { margin-top: -6px; margin-bottom: 20px; }

/* ---------- Pricing plans (course.php, courses with pricing_tiers) ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: stretch;
}
.pricing-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.pricing-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.pricing-card-title {
  font-size: 16px;
  line-height: 1.35;
  /* Reserves room for 2 lines regardless of how long a given plan's label
     is, so every card's price/features start at the same height instead of
     drifting card to card (e.g. "Corporate group" vs "Individual — with a
     team lead & code review"). Scales with font-size via em, not a fixed px. */
  min-height: 2.7em;
  margin: 0 0 14px;
}
.pricing-card-price {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 20px;
}
.pricing-card-features {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.pricing-card-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.4;
}
.pricing-card-features svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--accent);
}
.pricing-card-cta { margin-top: auto; }

/* Briefly pulses every card's border/glow when a visitor lands here via an
   in-page link (the hero's "View all plans" link) — main.js adds/removes
   .is-highlighted on #pricing around the smooth-scroll. */
#pricing.is-highlighted .pricing-card { animation: pricing-highlight-pulse 1.4s ease; }
@keyframes pricing-highlight-pulse {
  0%   { border-color: var(--accent); box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .45); }
  60%  { border-color: var(--accent); box-shadow: 0 0 0 10px rgba(var(--accent-rgb), 0); }
  100% { border-color: var(--border); box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
}

/* ---------- Course syllabus ---------- */
.syllabus-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.syllabus-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.syllabus-num {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
}
.syllabus-item p { margin: 0; padding-top: 6px; font-size: 14.5px; color: var(--text-dim); }

/* ---------- Modular syllabus (module → week → topics) ----------
   A plain button + .is-open class (toggled in main.js) instead of native
   <details>/<summary> — a <details> element can't animate its own close,
   it just snaps to display:none the instant `open` is removed. Only the
   first module starts open (see course.php); the rest collapse so a
   24-week curriculum doesn't dump a wall of text on the page at once. */
.syllabus-modules { display: flex; flex-direction: column; gap: 12px; }
.syllabus-module {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.syllabus-module-summary {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 16px;
  padding: 18px 22px;
  border: 0;
  background: none;
  font-family: inherit;
  /* <button> defaults to the platform's own text color (effectively black)
     regardless of theme — without this, the title silently ignored dark
     mode and rendered unreadable black-on-dark. */
  color: var(--text);
  text-align: left;
  cursor: pointer;
  user-select: none;
}
/* A module with no week-by-week content yet (most courses, for now) —
   same card look as the interactive ones, just not clickable and without
   the toggle icon, since there's nothing underneath to reveal. */
.syllabus-module-summary-static { cursor: default; user-select: text; }
.syllabus-module-num {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
}
.syllabus-module-title { flex: 1; font-weight: 700; font-size: 16px; }
.syllabus-module-toggle {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  position: relative;
}
.syllabus-module-toggle::before,
.syllabus-module-toggle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--text-faint);
  transform: translate(-50%, -50%);
}
.syllabus-module-toggle::before { width: 12px; height: 2px; }
.syllabus-module-toggle::after { width: 2px; height: 12px; transition: transform .2s ease; }
.syllabus-module.is-open .syllabus-module-toggle::after { transform: translate(-50%, -50%) scaleY(0); }
/* The 0fr/1fr grid-row trick animates smoothly to "auto" height without
   JS measuring scrollHeight — supported in every current browser. The
   inner .syllabus-weeks needs min-height:0 so the grid track can actually
   shrink to 0 while collapsed instead of clipping mid-content. */
.syllabus-weeks-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .25s ease;
}
.syllabus-module.is-open .syllabus-weeks-wrap { grid-template-rows: 1fr; }
/* Weeks share the summary's own 22px side padding (instead of the previous
   nested rail + extra indent, which drifted out of alignment with the
   module number above it and read as lopsided). The container itself
   carries no vertical padding — each week's own top+bottom padding is
   what creates the spacing, so the gap above the first week, below the
   last week, and on both sides of every divider line all end up equal. */
.syllabus-weeks {
  min-height: 0;
  overflow: hidden;
  padding: 0 22px;
  display: flex;
  flex-direction: column;
}
.syllabus-week { padding: 14px 0; }
.syllabus-week + .syllabus-week { border-top: 1px solid var(--border); }
.syllabus-week-label {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--accent);
}
.syllabus-week-topics { margin: 0; padding-left: 20px; color: var(--text-dim); font-size: 14px; }
.syllabus-week-topics li { margin-bottom: 4px; }
.syllabus-week-topics li:last-child { margin-bottom: 0; }

.course-not-found { padding: 70px 0; text-align: center; }
.course-not-found p { max-width: 48ch; margin: 0 auto 24px; }

/* ---------- Thank-you page ---------- */
.thank-you { padding: 90px 0; text-align: center; }
.thank-you-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin-bottom: 24px;
  background: color-mix(in srgb, var(--ribbon) 14%, transparent);
  color: var(--ribbon);
}
.thank-you-icon svg { width: 30px; height: 30px; }
.thank-you p { max-width: 48ch; margin: 0 auto 28px; font-size: 16px; }

/* ---------- Course trial page ---------- */
.trial-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 760px);
  gap: 48px;
  align-items: start;
}

.trial-sidebar {
  position: sticky;
  top: 92px;
}
.trial-sidebar-heading {
  display: block;
  margin-bottom: 14px;
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.trial-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.trial-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.3;
}
.trial-nav-item:hover { background: var(--surface-2); color: var(--text); }
.trial-nav-item.is-active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text);
  font-weight: 600;
}
.trial-nav-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
}
.trial-nav-item.is-active .trial-nav-num { background: var(--accent); color: var(--brand-dark); }
.trial-nav-label { min-width: 0; }

.trial-nav-cta {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--accent);
  font-weight: 600;
}
.trial-nav-cta:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.trial-nav-cta .trial-nav-num { background: none; color: var(--accent); }
.trial-nav-cta .trial-nav-num svg { width: 15px; height: 15px; }

@media (max-width: 860px) {
  /* Bare `1fr` has an implicit min-width of auto, so a long unwrapped line
     inside a <pre class="trial-code"> (or a code-runner box) can force this
     single track — and the whole page with it — wider than the viewport.
     minmax(0, 1fr) clamps it back to the container's width; the long line
     then just scrolls inside its own box instead, same as on desktop. */
  .trial-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .trial-sidebar { position: static; }
  /* Chapter links used to become a horizontally-scrolling pill row here —
     easy to miss on a phone and it broke as chapter titles/count grew.
     Just keep the same vertical, one-per-line list the desktop sidebar
     already uses (.trial-nav's un-overridden column layout) instead. */
}

.trial-chapter {
  /* No top padding on any chapter, not just the DOM's first one — the
     sidebar nav shows exactly one chapter at a time (trial-nav.js), so
     whichever one that is should start flush at the top, not just #1. */
  padding: 0 0 32px;
  border-bottom: 1px solid var(--border);
}
.trial-chapter:last-child { border-bottom: none; padding-bottom: 0; }
.trial-chapter-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.trial-chapter-head h2 { margin: 0; font-size: 20px; }

.trial-subheading { margin: 28px 0 10px; font-size: 17px; color: var(--text); }
.trial-chapter > .trial-subheading:first-of-type { margin-top: 0; }

.trial-list { margin: 0 0 18px; padding-left: 20px; color: var(--text-dim); }
.trial-list li { margin-bottom: 6px; }
.trial-list li:last-child { margin-bottom: 0; }

.trial-chapter p code,
.trial-list code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--code-fn);
  white-space: nowrap;
}

.trial-code-block { margin: 18px 0; }
.trial-code-block .trial-code { margin: 0; }
.trial-code-label {
  display: block;
  padding: 6px 18px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-faint);
}
.trial-code-label + .trial-code { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }

.trial-code-io {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 10px;
  padding: 10px 18px;
  font-size: 13px;
}
.trial-code-io-pair + .trial-code-io-pair {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.trial-code-io-row + .trial-code-io-row { margin-top: 10px; }
.trial-code-io-row span {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .04em;
}
.trial-code-io-row code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  white-space: pre-wrap;
  background: none;
  border: none;
  padding: 0;
}

.trial-table-wrap { margin: 18px 0; overflow-x: auto; }
.trial-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.trial-table th,
.trial-table td {
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--border);
  vertical-align: top;
}
.trial-table th {
  background: var(--surface-2);
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.trial-table td code,
.trial-table th code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--code-fn);
  white-space: nowrap;
}
.trial-table td:nth-child(3) code { white-space: pre-wrap; }

.trial-code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 18px 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-dim);
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}
.trial-task {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-top: 18px;
}
.trial-task strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.trial-task p { margin: 0; }

.code-runner,
.task-runner {
  margin-top: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.code-runner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.code-runner-titlebar { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* Same three colors as the hero section's .code-card-head mockup window. */
.code-runner-dots { display: flex; gap: 6px; flex-shrink: 0; }
.code-runner-dots span { width: 10px; height: 10px; border-radius: 50%; }
.code-runner-dots span:nth-child(1) { background: #ff6159; }
.code-runner-dots span:nth-child(2) { background: #ffbd2e; }
.code-runner-dots span:nth-child(3) { background: #29ca42; }
.code-runner-lang {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text-faint);
}
.code-runner-buttons { display: flex; gap: 8px; }

/* Editable code box: a transparent textarea sits on top of a highlighted
   <pre>, sharing identical font metrics/padding so the two stay pixel-
   aligned. The textarea renders only its (invisible) text + caret; the
   <pre> underneath, kept in sync by code-runner.js, shows the color. */
.code-editor {
  position: relative;
  background: var(--editor-bg);
  border-top: 1px solid var(--editor-border);
  border-bottom: 1px solid var(--editor-border);
  box-shadow: inset 0 2px 6px -4px rgba(0, 0, 0, .35);
}
.code-editor:focus-within {
  box-shadow: inset 0 2px 6px -4px rgba(0, 0, 0, .35), inset 3px 0 0 var(--accent);
}
.code-editor-highlight,
.code-runner-input {
  margin: 0;
  padding: 16px 18px;
  border: 0;
  box-sizing: border-box;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  /* Matches TAB_SIZE in assets/js/code-highlight.js, so a pasted literal
     tab character renders at the same width as pressing Tab does. */
  tab-size: 4;
  /* JetBrains Mono renders "<=", ">=", "!=", etc. as single ligature
     glyphs by default — fine for prose, confusing for a code sample the
     student is meant to type character-for-character. */
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}
.code-editor-highlight {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: var(--text-dim);
  pointer-events: none;
}
.code-editor-highlight code { font: inherit; }
.code-runner-input {
  position: relative;
  display: block;
  width: 100%;
  min-height: 60px;
  max-height: 480px;
  background: transparent;
  color: transparent;
  caret-color: var(--text);
  resize: none;
  overflow-y: auto;
}
.code-runner-input:focus { outline: none; }
/* Practice solutions tend to run longer than the tiny inline lecture demos,
   so give them more room to start instead of opening at the 60px floor. */
.task-runner .code-runner-input { min-height: 140px; }
/* A real terminal doesn't switch to a light background in light mode, so
   this whole block stays dark regardless of the site's own theme. */
.code-runner-output-wrap {
  background: #14141f;
}
.code-runner-output-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.code-runner-output-label {
  flex: 1;
  color: rgba(255, 255, 255, .4);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.code-runner-output-head .code-runner-terminate {
  border-color: rgba(255, 255, 255, .22);
  color: rgba(255, 255, 255, .75);
}
.code-runner-output-head .code-runner-terminate:hover {
  border-color: var(--discount);
  color: var(--discount);
}
.code-runner-output {
  margin: 0;
  min-height: 1.6em;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  color: #d7dce2;
  white-space: pre-wrap;
  word-break: break-word;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}
.code-runner-output.is-error { color: #ff8080; }
.code-runner-output.is-compiling {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5fe0a0;
  font-style: italic;
}
.code-runner-spinner {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: code-runner-spin .6s linear infinite;
}
@keyframes code-runner-spin { to { transform: rotate(360deg); } }
.code-runner-run:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* ---------- Terminal-style Scanner input ---------- */
.code-runner-console-line {
  white-space: pre-wrap;
  word-break: break-word;
}
.code-runner-console-line + .code-runner-console-line { margin-top: 2px; }
.code-runner-console-caret {
  color: #5fe0a0;
  font-weight: 700;
}
.code-runner-console-input {
  width: calc(100% - 16px);
  border: none;
  outline: none;
  background: transparent;
  padding: 0;
  margin-left: 4px;
  font: inherit;
  color: inherit;
  caret-color: #d7dce2;
}
.code-runner-console-result {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, .12);
  white-space: pre-wrap;
  word-break: break-word;
}
.code-runner-console-result.is-error { color: #ff8080; }

/* ---------- Trial lecture/practice tabs & practice tasks ---------- */
.trial-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.trial-tab {
  padding: 10px 4px;
  margin-right: 20px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-faint);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.trial-tab:hover { color: var(--text); }
.trial-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* Shared by both the lecture-part pager (one page per topic within a
   chapter) and the practice-task pager (one task per page) — see
   trial-nav.js. Sticky to the bottom of the viewport (not `fixed`) so it
   stays reachable while reading/scrolling a long page without following
   you across an entire chapter switch — same idea as .site-header's sticky
   top, mirrored to the bottom. Only one of these is ever actually on
   screen at a time (everything else is inside a hidden chapter/tab/step),
   so there's no risk of several stacking on top of each other. */
.trial-stepper-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding: 16px 4px;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
}
.trial-stepper-counter {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-faint);
}
.trial-stepper-prev:disabled,
.trial-stepper-next:disabled {
  opacity: .4;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.task-card { margin-bottom: 28px; }
.task-card:last-child { margin-bottom: 0; }
.task-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.task-card-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-faint);
}
.task-card-title { margin: 0; font-size: 16.5px; }
.task-card-prompt { color: var(--text-dim); margin-bottom: 14px; }
.task-card .trial-code-io { margin-bottom: 14px; }

.task-results { padding: 14px 16px; }
.task-summary {
  margin: 0 0 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-faint);
}
.task-summary.is-pass { color: var(--ribbon); }
.task-summary.is-fail { color: var(--discount); }
.task-summary.is-error { color: var(--discount); font-weight: 500; }
.task-summary.is-compiling {
  display: flex;
  align-items: center;
  gap: 8px;
}
.task-summary.is-compiling::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: code-runner-spin .7s linear infinite;
}

.task-test-list { margin: 0; padding: 0; list-style: none; }
.task-test {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px dashed var(--border);
  font-size: 13px;
}
.task-test:first-child { border-top: none; }
.task-test-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--border);
  margin-top: 3px;
}
.task-test.is-pass .task-test-icon { background: var(--ribbon); }
.task-test.is-fail .task-test-icon { background: var(--discount); }
.task-test-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.task-test-input { color: var(--text-dim); }
.task-test-input code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: none;
  border: none;
  padding: 0;
  color: var(--code-fn);
}
.task-test-detail {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  white-space: pre-wrap;
}
.task-test.is-pass .task-test-detail { color: var(--ribbon); }
.task-test.is-fail .task-test-detail { color: var(--discount); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 64px 0 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 44px;
}
.footer-brand p { font-size: 14px; margin-top: 14px; max-width: 34ch; }
.footer-col h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); margin-bottom: 16px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col ul a, .footer-contact li { font-size: 14.5px; color: var(--text-dim); }
.footer-col ul a:hover { color: var(--accent); }
.footer-contact { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
}
.footer-social a svg { width: 18px; height: 18px; }
.footer-social a:hover { color: var(--accent); border-color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .timeline { grid-template-columns: repeat(2, 1fr); }
  .timeline::before { display: none; }
  .partners-grid { grid-template-columns: repeat(2, 1fr); }
  .graduates-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .main-nav {
    position: absolute;
    top: 72px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px 24px 20px;
    display: none;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { width: 100%; padding: 10px 0; }
  .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .courses-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .partners-grid { grid-template-columns: 1fr; }
  .graduates-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .contact-box { padding: 28px 22px; }
  .hero { padding: 56px 0 46px; }
  .section { padding: 64px 0; }
  .syllabus-grid { grid-template-columns: 1fr; }
  .syllabus-module-summary { padding: 16px; gap: 12px; }
  .syllabus-module-title { font-size: 14.5px; }
  .syllabus-weeks { padding: 0 16px; }
  .syllabus-week { padding: 12px 0; }
  /* The decorative code snippet's longest line doesn't fit on phone widths.
     overflow-x:auto just leaves it cut off mid-line with no scroll affordance,
     which reads as broken — wrap it instead so nothing gets clipped. */
  .code-lines {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: visible;
    font-size: 12.5px;
  }

  /* The code-runner titlebar (traffic-light dots + language label) and its
     Reset/Run buttons are two independent flex groups spaced with
     justify-content:space-between on one row — fine on desktop, but on a
     phone that row has no room to breathe and either squeezes the buttons
     illegibly or pushes the box wider than the page. Stack the two groups
     as full-width rows instead, and let the buttons split that width
     evenly so they stay easy to tap. */
  .code-runner-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .code-runner-buttons { width: 100%; }
  .code-runner-buttons .btn { flex: 1; }
}
