/* ==========================================================================
   WebeXcello — Shared Stylesheet
   Used by every page. Edit here, every page updates.
   ========================================================================== */

/* --- 1. Design tokens ---------------------------------------------------- */
:root {
  --bg:            #ffffff;
  --bg-soft:       #f7fafc;
  --bg-card:       #ffffff;
  --text:          #2d3748;
  --text-muted:    #718096;
  --heading:       #1a365d;
  --accent:        #E63562;
  --accent-soft:   #fdeaf0;
  --border:        #e2e8f0;
  --border-strong: #cbd5e0;
  --code-bg:       #1e293b;
  --code-text:     #f8fafc;
  --inline-bg:     #edf2f7;
  --inline-text:   #c53030;
  --good:          #2f855a;
  --bad:           #c53030;
  --warn:          #b7791f;
  --shadow:        0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
  --radius:        8px;
  --maxw:          1000px;
  --font:          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:          'Fira Code', Consolas, Monaco, 'Courier New', monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #0f172a;
    --bg-soft:       #1e293b;
    --bg-card:       #1e293b;
    --text:          #e2e8f0;
    --text-muted:    #94a3b8;
    --heading:       #ffa8bf;
    --accent:        #ff6f92;
    --accent-soft:   #4a1526;
    --border:        #334155;
    --border-strong: #475569;
    --code-bg:       #020617;
    --code-text:     #e2e8f0;
    --inline-bg:     #334155;
    --inline-text:   #fca5a5;
    --good:          #6ee7b7;
    --bad:           #fca5a5;
    --warn:          #fcd34d;
    --shadow:        0 1px 3px rgba(0,0,0,.4);
  }
}

/* --- 2. Base ------------------------------------------------------------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--font);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* --- 3. Site header / navigation ---------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(8px);
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
}

.nav-brand {
  font-weight: 700;
  font-size: 17px;
  color: var(--heading);
  text-decoration: none;
  margin-right: auto;
  letter-spacing: -.3px;
}
.nav-brand span { color: var(--accent); }

.nav a.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
}
.nav a.nav-link:hover { background: var(--bg-soft); color: var(--accent); }
.nav a.nav-link.active { background: var(--accent-soft); color: var(--accent); }

/* --- 3b. Grouped dropdown menus (CSS only, no JavaScript) ---------------- */
.nav-group { position: relative; }

.nav-group > .nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  background: none;
  border: 0;
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.nav-group > .nav-toggle::after {
  content: "";
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: .6;
}
.nav-group:hover > .nav-toggle,
.nav-group:focus-within > .nav-toggle { background: var(--bg-soft); color: var(--accent); }
.nav-group.active > .nav-toggle { background: var(--accent-soft); color: var(--accent); }

.nav-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 250px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0,0,0,.14);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .13s ease, transform .13s ease, visibility .13s;
  z-index: 60;
}
.nav-group:hover .nav-menu,
.nav-group:focus-within .nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
/* invisible bridge so the menu does not close while the pointer travels to it */
.nav-group::after {
  content: "";
  position: absolute;
  top: 100%; left: 0; right: 0;
  height: 10px;
}

.nav-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 14.5px;
  line-height: 1.35;
}
.nav-menu a small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 1px;
}
.nav-menu a:hover { background: var(--bg-soft); color: var(--accent); }
.nav-menu a.current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

@media (max-width: 720px) {
  /* On small screens dropdowns become always-visible stacked sections */
  .nav { flex-direction: column; align-items: stretch; }
  .nav-brand { margin: 0 0 8px; }
  .nav-group { position: static; }
  .nav-group > .nav-toggle { width: 100%; justify-content: space-between; }
  .nav-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    border-left: 2px solid var(--border);
    border-radius: 0;
    margin: 2px 0 6px 12px;
    padding: 0 0 0 6px;
    min-width: 0;
    display: none;
  }
  .nav-group:hover .nav-menu,
  .nav-group:focus-within .nav-menu,
  .nav-group.active .nav-menu { display: block; }
  .nav-menu a small { display: none; }
}

/* --- 4. Page hero -------------------------------------------------------- */
.hero {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.hero h1 { border: 0; margin: 0 0 10px; font-size: 34px; }
.hero .subtitle {
  color: var(--text-muted);
  font-size: 17px;
  margin: 0;
  max-width: 70ch;
}
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
}

/* --- 5. Typography ------------------------------------------------------- */
h1 { color: var(--heading); font-size: 30px; margin-top: 36px; letter-spacing: -.5px; }
h2 {
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  font-size: 24px;
  margin-top: 52px;
  letter-spacing: -.3px;
}
h3 { color: var(--heading); font-size: 19px; margin-top: 32px; }
h4 { color: var(--text-muted); font-size: 15px; margin-top: 22px; text-transform: none; }
p  { margin: 12px 0; }
a  { color: var(--accent); }
ul, ol { margin: 12px 0; padding-left: 24px; }
li { margin-bottom: 7px; }
hr { border: 0; height: 1px; background: var(--border); margin: 48px 0; }
strong { color: var(--heading); }

/* --- 6. Cards (homepage) ------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 28px 0;
}

.card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card .card-icon { font-size: 26px; line-height: 1; display: block; margin-bottom: 12px; }
.card h3 { margin: 0 0 8px; color: var(--accent); font-size: 18px; }
.card p  { margin: 0; color: var(--text-muted); font-size: 14.5px; line-height: 1.6; }
.card .card-meta {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

/* --- 7. Code blocks ------------------------------------------------------ */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 13.5px;
  overflow-x: auto;
  margin: 14px 0;
  line-height: 1.6;
  tab-size: 4;
}
code {
  font-family: var(--mono);
  background: var(--inline-bg);
  color: var(--inline-text);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .88em;
}
pre code { background: transparent; color: inherit; padding: 0; font-size: inherit; }

/* --- 8. Multi-language comparison block ---------------------------------- */
.langs { margin: 18px 0 26px; }

.lang-block { margin: 0 0 12px; }

.lang-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px 6px 0 0;
  color: #fff;
}
.lang-label.php    { background: #6b7ab0; }
.lang-label.js     { background: #b59a2b; }
.lang-label.python { background: #3b6ea5; }
.lang-label.sql    { background: #4a7c59; }
.lang-label.mysql  { background: #00758f; }
.lang-label.pgsql  { background: #336791; }
.lang-label.mongo  { background: #4a9d5f; }
.lang-label.redis  { background: #a33; }
.lang-label.sqlite { background: #7a5c9e; }

.lang-block pre { margin-top: 0; border-top-left-radius: 0; }

/* --- 9. Callout boxes ---------------------------------------------------- */
.note {
  border-left: 4px solid var(--accent);
  background: var(--bg-soft);
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 18px 0;
  font-size: 15px;
}
.note.laravel { border-left-color: #e74430; }
.note.warn    { border-left-color: var(--warn); }
.note.good    { border-left-color: var(--good); }
.note strong:first-child { display: block; margin-bottom: 4px; }

/* --- 9b. Tutorial helpers ------------------------------------------------ */

/* "In simple words" box - the plain-language definition */
.simple {
  background: linear-gradient(0deg, var(--accent-soft), var(--accent-soft));
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 15.5px;
}
.simple::before {
  content: "In simple words";
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.simple p:first-of-type { margin-top: 0; }
.simple p:last-child { margin-bottom: 0; }

/* Real-life analogy box */
.analogy {
  border-left: 4px solid var(--warn);
  background: var(--bg-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 15px;
}
.analogy::before {
  content: "Real-life example";
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--warn);
  margin-bottom: 6px;
}

/* Level badges - beginner / advanced */
.lv {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 8px;
  white-space: nowrap;
}
.lv-basic { background: #d1fae5; color: #065f46; }
.lv-adv   { background: #fee2e2; color: #991b1b; }
.lv-both  { background: #e0e7ff; color: #3730a3; }

@media (prefers-color-scheme: dark) {
  .lv-basic { background: #064e3b; color: #6ee7b7; }
  .lv-adv   { background: #7f1d1d; color: #fca5a5; }
  .lv-both  { background: #312e81; color: #a5b4fc; }
}

/* Deeper-dive section, visually set apart from the beginner text */
.deeper {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 4px 20px 16px;
  margin: 24px 0;
  background: var(--bg-soft);
}
.deeper > h4:first-child { margin-top: 16px; }

/* Numbered step list for tutorials */
.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin-bottom: 16px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- 9c. Inline SVG figures --------------------------------------------- */
figure.fig {
  margin: 24px 0;
  padding: 0;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
figure.fig .fig-scroll { overflow-x: auto; padding: 18px; }
figure.fig svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
figure.fig figcaption {
  border-top: 1px solid var(--border);
  padding: 10px 18px;
  font-size: 13.5px;
  color: var(--text-muted);
  background: var(--bg-card);
}

/* SVG palette - follows the page theme automatically */
svg .s-box   { fill: var(--bg-card);   stroke: var(--border-strong); stroke-width: 1.5; }
svg .s-accent{ fill: var(--accent-soft); stroke: var(--accent);      stroke-width: 1.5; }
svg .s-good  { fill: #d1fae5; stroke: #059669; stroke-width: 1.5; }
svg .s-bad   { fill: #fee2e2; stroke: #dc2626; stroke-width: 1.5; }
svg .s-warn  { fill: #fef3c7; stroke: #d97706; stroke-width: 1.5; }
svg .s-line  { stroke: var(--text-muted); stroke-width: 1.8; fill: none; }
svg .s-txt   { fill: var(--text); font-family: var(--font); font-size: 13px; }
svg .s-txt-sm{ fill: var(--text-muted); font-family: var(--font); font-size: 11px; }
svg .s-txt-b { fill: var(--heading); font-family: var(--font); font-size: 13px; font-weight: 700; }
svg .s-mono  { fill: var(--text); font-family: var(--mono); font-size: 12px; }
svg .s-fill-accent { fill: var(--accent); }

@media (prefers-color-scheme: dark) {
  svg .s-good { fill: #064e3b; stroke: #34d399; }
  svg .s-bad  { fill: #7f1d1d; stroke: #f87171; }
  svg .s-warn { fill: #78350f; stroke: #fbbf24; }
}

/* --- 10. Tables ---------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 20px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  font-size: 14.5px;
}
th, td { border: 1px solid var(--border-strong); padding: 10px 14px; text-align: left; vertical-align: top; }
th { background: var(--accent-soft); color: var(--accent); font-weight: 600; white-space: nowrap; }
tbody tr:nth-child(even) { background: var(--bg-soft); }

/* --- 11. ASCII diagrams -------------------------------------------------- */
.diagram {
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre;
  margin: 18px 0;
  color: var(--text);
  overflow-x: auto;
}

/* --- 12. Table of contents ----------------------------------------------- */
.toc {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0 40px;
}
.toc h2 { margin: 0 0 12px; border: 0; padding: 0; font-size: 17px; }
.toc ol { columns: 2; column-gap: 32px; margin: 0; padding-left: 20px; font-size: 14.5px; }
.toc li { margin-bottom: 5px; break-inside: avoid; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* --- 13. Utilities ------------------------------------------------------- */
.ok  { color: var(--good); font-weight: 600; }
.no  { color: var(--bad);  font-weight: 600; }
.muted { color: var(--text-muted); }
.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  vertical-align: middle;
}

/* --- 14. Footer ---------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 28px 0 44px;
  color: var(--text-muted);
  font-size: 14px;
}
.site-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); }

/* --- 15. Responsive ------------------------------------------------------ */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .hero { padding: 32px 0 24px; }
  .hero h1 { font-size: 26px; }
  h2 { font-size: 20px; margin-top: 40px; }
  .toc ol { columns: 1; }
  .nav { gap: 2px; padding: 10px 16px; }
  .nav a.nav-link { padding: 5px 8px; font-size: 13.5px; }
  .nav-brand { width: 100%; margin-bottom: 6px; }
}

/* ==========================================================================
   17. Bootstrap 5 bridge
   The site keeps its own look; these rules restyle Bootstrap's navbar,
   dropdowns and grid so they match the tokens above instead of fighting them.
   ========================================================================== */

.skip-link {
  position: absolute; top: 8px; left: 8px; z-index: 999;
  background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 6px;
}

.nav-shell { max-width: var(--maxw); margin: 0 auto; padding: 6px 20px; }

.navbar-toggler:focus { box-shadow: none; }
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%232b6cb0' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-nav .nav-link {
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14.5px;
  font-weight: 500;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus { background: var(--bg-soft); color: var(--accent); }
.navbar-nav .nav-link.active { background: var(--accent-soft); color: var(--accent); }

.dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0,0,0,.14);
  padding: 6px;
  --bs-dropdown-link-color: var(--text);
}
.dropdown-item {
  border-radius: 6px;
  padding: 8px 12px;
  white-space: normal;
  color: var(--text);
}
.dropdown-item:hover,
.dropdown-item:focus { background: var(--bg-soft); color: var(--accent); }
.dropdown-item.active,
.dropdown-item:active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.dropdown-item small { font-size: 12px; line-height: 1.3; }

@media (min-width: 992px) { .dropdown-menu { min-width: 280px; } }
@media (max-width: 991.98px) {
  .dropdown-menu { border: 0; box-shadow: none; border-left: 2px solid var(--border);
                   border-radius: 0; margin: 2px 0 6px 12px; }
  .navbar-collapse { padding-bottom: 10px; }
}

/* --- 18. Breadcrumb strip ------------------------------------------------ */
.crumb {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.crumb .container { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-block: 9px; }
.crumb a { text-decoration: none; color: var(--text-muted); }
.crumb a:hover { color: var(--accent); }
.crumb span[aria-hidden] { color: var(--border-strong); }
.crumb-group { color: var(--text-muted); }
.crumb-current { color: var(--heading); font-weight: 600; }

/* --- 19. Cards + hero stats (homepage) ----------------------------------- */
.card-photo {
  display: flex; flex-direction: column; height: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.card-photo:hover { transform: translateY(-3px); border-color: var(--accent); color: inherit; }
.card-photo .body { padding: 20px 22px; display: flex; flex-direction: column; flex: 1; }
.card-photo .card-icon { font-size: 24px; line-height: 1; display: block; margin-bottom: 10px; }
.card-photo h3 { margin: 0 0 8px; color: var(--accent); font-size: 18px; }
.card-photo p  { margin: 0; color: var(--text-muted); font-size: 14.5px; }
.card-photo .card-meta {
  margin-top: auto; padding-top: 12px;
  font-size: 12.5px; color: var(--text-muted);
  border-top: 1px dashed var(--border);
}

.stat-panel {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.stat { background: var(--bg-card); padding: 20px 18px; }
.stat-num { display: block; font-size: 30px; font-weight: 700; color: var(--accent); line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* --- 19b. Real photographs ----------------------------------------------- */
figure.photo {
  margin: 24px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
figure.photo img {
  display: block; width: 100%; height: auto;
  max-height: 460px; object-fit: cover;
  background: var(--bg-soft);
}
figure.photo figcaption {
  border-top: 1px solid var(--border);
  padding: 12px 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
figure.photo figcaption .credit {
  display: block; margin-top: 6px;
  font-size: 11.5px; color: var(--text-muted); text-decoration: none;
}
figure.photo figcaption .credit:hover { text-decoration: underline; }
figure.photo.photo-portrait img { max-height: 380px; object-fit: contain; padding: 12px 0; }

.photo-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.photo-row figure.photo { margin: 24px 0 0; }
.photo-row figure.photo img { max-height: 240px; }
.photo-row figure.photo figcaption { font-size: 13.5px; padding: 10px 14px; }

/* --- 20. Prev / next pager ----------------------------------------------- */
.pager { margin: 48px 0 0; }
.pager-link {
  display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; text-decoration: none; background: var(--bg-card);
}
.pager-link:hover { border-color: var(--accent); background: var(--bg-soft); }
.pager-dir { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.pager-title { color: var(--accent); font-weight: 600; }

/* --- 21. Footer + back to top -------------------------------------------- */
.footer-head { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--heading); }
.site-footer ul a { text-decoration: none; font-size: 14px; }
.site-footer ul a:hover { color: var(--accent); text-decoration: underline; }
.site-footer hr { margin: 24px 0 16px; }

.back-to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 100;
  width: 44px; height: 44px; border-radius: 50%;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.back-to-top.show { opacity: .92; pointer-events: auto; }

/* Keep long code and tables inside the viewport on phones */
@media (max-width: 640px) {
  pre { font-size: 12px; padding: 12px; }
  .diagram { font-size: 10.5px; }
}

/* --- 16. Print ----------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .toc,
  .crumb, .pager, .back-to-top { display: none; }
  body { color: #000; background: #fff; }
  pre { border: 1px solid #999; background: #f5f5f5; color: #000; }
  a { color: #000; text-decoration: none; }
}

/* ==========================================================================
   22. Lesson platform — sidebar, sections, code cards, callouts, quiz,
       exercises, flowcharts, modals. Shared by every lesson page.
   ========================================================================== */

/* --- 22.1 Shell: 300px sticky sidebar + 900px centred content ------------ */
.lesson-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.lesson-main {
  max-width: 900px;
  margin: 0 auto;
  min-width: 0;
  outline: none;
}
@media (max-width: 1199.98px) { .lesson-shell { grid-template-columns: 260px minmax(0, 1fr); gap: 32px; } }
@media (max-width: 991.98px)  { .lesson-shell { grid-template-columns: 1fr; gap: 0; } }

.lesson-sidebar { position: sticky; top: 74px; align-self: start; }
.lesson-sidebar-inner {
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding: 18px 4px 24px 0;
  scrollbar-width: thin;
}
@media (max-width: 991.98px) {
  .lesson-sidebar { position: static; }
  .lesson-sidebar-inner { max-height: none; overflow: visible; padding: 18px 0 0; }
  .side-updown { display: none; }
}

/* --- 22.2 Sidebar cards -------------------------------------------------- */
.side-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.side-label {
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-muted);
}
.side-label i { color: var(--accent); }
.side-pct { font-size: 13px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.side-progress .progress { height: 6px; background: var(--border); }
.side-progress .progress-bar { background: var(--accent); transition: width .15s linear; }
.side-meta-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-top: 10px; font-size: 12px; color: var(--text-muted);
}
.side-meta-row i { color: var(--text-muted); }

.badge-diff {
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 20px; background: var(--accent-soft); color: var(--accent);
}
.badge-diff-beginner { background: #d1fae5; color: #065f46; }
.badge-diff-advanced { background: #fee2e2; color: #991b1b; }
@media (prefers-color-scheme: dark) {
  .badge-diff-beginner { background: #064e3b; color: #6ee7b7; }
  .badge-diff-advanced { background: #7f1d1d; color: #fca5a5; }
}

/* Bookmarks */
.bookmark-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.bookmark-list li { margin-bottom: 4px; }
.bookmark-list a { text-decoration: none; display: flex; gap: 6px; align-items: baseline; }
.bookmark-list a:hover { text-decoration: underline; }
.bookmark-empty { color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.bookmark-clear { font-size: 12px; }

.side-nav-link { display: block; text-decoration: none; padding: 8px 0; }
.side-nav-link + .side-nav-link { border-top: 1px solid var(--border); }
.side-dir { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.side-title { color: var(--accent); font-weight: 600; font-size: 13.5px; }

/* --- 22.3 Section headings ---------------------------------------------- */
.lesson-section { scroll-margin-top: 84px; }
.lesson-section + .lesson-section { margin-top: 8px; }

h2.lesson-h2 {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-top: 56px;
}
.lesson-h2-n {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.lesson-h2-ico { font-size: 18px; }
.lesson-h2-t { flex: 1 1 auto; }
.lesson-h2-tools { display: inline-flex; gap: 2px; margin-left: auto; }

.icon-btn {
  background: none; border: 0; padding: 5px 7px; border-radius: 6px; line-height: 1;
  color: var(--text-muted); font-size: 14px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
}
.icon-btn:hover, .icon-btn:focus-visible { background: var(--bg-soft); color: var(--accent); }
.icon-btn[aria-pressed="true"] { color: var(--warn); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- 22.4 Lesson hero + meta strip -------------------------------------- */
.lesson-hero { padding: 34px 0 22px; }
.lesson-hero h1 { margin: 8px 0 12px; font-size: 34px; }
.lesson-hero .subtitle { color: var(--text-muted); font-size: 17px; max-width: 68ch; }
@media (max-width: 640px) { .lesson-hero h1 { font-size: 26px; } }

.lesson-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin: 22px 0 8px;
}
.lesson-meta-item { background: var(--bg-card); padding: 13px 16px; }
.lesson-meta-item .k {
  display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 3px;
}
.lesson-meta-item .k i { color: var(--accent); }
.lesson-meta-item .v { font-size: 14px; }

/* --- 22.5 Code cards ----------------------------------------------------- */
.code-card {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 18px 0;
  background: var(--code-bg);
}
.code-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 7px 12px;
  font-size: 12.5px;
}
.code-lang {
  font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 4px; color: #fff; background: #6b7ab0;
}
.code-lang.lang-js     { background: #b59a2b; }
.code-lang.lang-python { background: #3b6ea5; }
.code-lang.lang-sql    { background: #4a7c59; }
.code-lang.lang-bash   { background: #4a5568; }
.code-lang.lang-json   { background: #7a5c9e; }
.code-file { color: var(--text-muted); font-family: var(--mono); font-size: 12px; }
.code-actions { margin-left: auto; display: inline-flex; gap: 2px; }
.copy-btn .copy-text { font-size: 11.5px; }
.copy-btn.copied { color: var(--good); }
.code-card pre { margin: 0; border-radius: 0; }

.code-compare { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 992px) { .code-compare { grid-template-columns: 1fr 1fr; } }
.code-compare .code-card { margin: 0; height: 100%; }

/* --- 22.6 Callouts (Bootstrap alerts, restyled) -------------------------- */
.callout {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bg-soft);
  color: var(--text);
  padding: 14px 18px;
  margin: 18px 0;
  font-size: 15px;
}
.callout-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.callout-head i { font-size: 16px; color: var(--accent); }
.callout-kind {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent);
}
.callout-title { font-weight: 700; color: var(--heading); }
.callout-body > :first-child { margin-top: 0; }
.callout-body > :last-child { margin-bottom: 0; }

.callout.alert-tip       { border-left-color: var(--good); }
.callout.alert-tip .callout-head i, .callout.alert-tip .callout-kind { color: var(--good); }
.callout.alert-warning   { border-left-color: var(--warn); }
.callout.alert-warning .callout-head i, .callout.alert-warning .callout-kind { color: var(--warn); }
.callout.alert-important { border-left-color: var(--bad); }
.callout.alert-important .callout-head i, .callout.alert-important .callout-kind { color: var(--bad); }
.callout.alert-best      { border-left-color: var(--good); background: var(--accent-soft); }
.callout.alert-best .callout-head i, .callout.alert-best .callout-kind { color: var(--good); }
.callout.alert-laravel   { border-left-color: #e74430; }
.callout.alert-laravel .callout-head i, .callout.alert-laravel .callout-kind { color: #e74430; }
.callout.alert-memory    { border-left-color: #8b5cf6; }
.callout.alert-memory .callout-head i, .callout.alert-memory .callout-kind { color: #8b5cf6; }

/* --- 22.7 Flowcharts ----------------------------------------------------- */
.flow-figure {
  margin: 22px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}
.flow-head {
  background: var(--bg-soft); border-bottom: 1px solid var(--border);
  padding: 8px 14px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
}
.flow-head i { color: var(--accent); }
.flow-figure pre.mermaid {
  background: transparent; color: inherit;
  padding: 18px; margin: 0; text-align: center; overflow-x: auto;
}
.flow-ascii { border-top: 1px solid var(--border); }
.flow-ascii summary {
  cursor: pointer; padding: 9px 14px; font-size: 13px; color: var(--text-muted);
}
.flow-ascii summary:hover { color: var(--accent); background: var(--bg-soft); }
.flow-ascii .diagram { margin: 0; border: 0; border-radius: 0; border-top: 1px solid var(--border); }
.flow-figure figcaption {
  border-top: 1px solid var(--border); padding: 10px 14px;
  font-size: 13.5px; color: var(--text-muted); background: var(--bg-soft);
}

/* --- 22.8 Screenshots / images ------------------------------------------ */
.shot { margin: 22px auto; max-width: 300px; text-align: center; }
.shot-btn {
  display: block; padding: 0; border: 0; background: none; cursor: zoom-in; position: relative; width: 100%;
}
.shot-btn img { width: 100%; height: auto; border: 1px solid var(--border); }
.shot-zoom {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(15,23,42,.78); color: #fff;
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.shot figcaption { font-size: 13px; color: var(--text-muted); margin-top: 8px; text-align: left; }
.shot .credit { display: block; font-size: 11.5px; margin-top: 4px; }
.modal-content { background: var(--bg-card); color: var(--text); }
.modal-header { border-bottom-color: var(--border); }

/* --- 22.9 Execution table ------------------------------------------------ */
.exec-table code { white-space: nowrap; }
.table { --bs-table-bg: transparent; color: var(--text); font-size: 14.5px; }
.table > :not(caption) > * > * { background: transparent; color: var(--text); }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: var(--bg-soft); background: var(--bg-soft); }
.table-hover > tbody > tr:hover > * { background: var(--accent-soft); }
.table > thead th { background: var(--accent-soft); color: var(--accent); border-color: var(--border-strong); }
.table td, .table th { border-color: var(--border-strong); }

/* --- 22.10 Quiz ---------------------------------------------------------- */
.quiz-accordion { margin: 18px 0; }
.quiz-accordion .accordion-item {
  background: var(--bg-card); border-color: var(--border); margin-bottom: 8px; border-radius: var(--radius);
}
.quiz-accordion .accordion-button {
  background: var(--bg-card); color: var(--text); font-weight: 500;
  border-radius: var(--radius); gap: 10px; font-size: 15px;
}
.quiz-accordion .accordion-button:not(.collapsed) { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.quiz-accordion .accordion-button:focus { box-shadow: none; border-color: var(--accent); }
.quiz-n {
  flex: 0 0 auto; font-family: var(--mono); font-size: 11.5px; font-weight: 700;
  background: var(--accent); color: #fff; padding: 2px 8px; border-radius: 20px;
}
.quiz-options { list-style: none; margin: 0 0 12px; padding: 0; }
.quiz-options li {
  display: flex; gap: 10px; align-items: baseline;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 6px;
}
.quiz-options li.is-right { border-color: var(--good); background: var(--bg-soft); }
.quiz-options li.is-right i { color: var(--good); }
.quiz-key {
  flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--bg-soft);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; color: var(--text-muted);
}
.quiz-options li.is-right .quiz-key { background: var(--good); color: #fff; }
.quiz-why { font-size: 14.5px; border-top: 1px dashed var(--border); padding-top: 10px; }

/* --- 22.11 Interview cards ---------------------------------------------- */
.qa-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; }
.qa-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; text-align: left; padding: 12px 16px; color: var(--text);
  font-size: 15px; border-radius: var(--radius); cursor: pointer;
}
.qa-head:hover { background: var(--bg-soft); }
.qa-q { flex: 1 1 auto; }
.qa-toggle { color: var(--text-muted); transition: transform .18s ease; }
.qa-head[aria-expanded="true"] .qa-toggle { transform: rotate(180deg); color: var(--accent); }
.qa-level {
  flex: 0 0 auto; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 20px; background: var(--accent-soft); color: var(--accent);
}
.qa-intermediate .qa-level { background: #fef3c7; color: #92400e; }
.qa-advanced .qa-level     { background: #fee2e2; color: #991b1b; }
@media (prefers-color-scheme: dark) {
  .qa-intermediate .qa-level { background: #78350f; color: #fcd34d; }
  .qa-advanced .qa-level     { background: #7f1d1d; color: #fca5a5; }
}
.qa-answer { padding: 2px 16px 14px; border-top: 1px dashed var(--border); font-size: 15px; }
.qa-answer > :first-child { margin-top: 12px; }

/* --- 22.12 Practice exercises ------------------------------------------- */
.exercise-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin: 16px 0; }
.exercise-card .card-header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--bg-soft); border-bottom: 1px solid var(--border);
}
.ex-level {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 20px;
}
.ex-easy   .ex-level { background: #d1fae5; color: #065f46; }
.ex-medium .ex-level { background: #fef3c7; color: #92400e; }
.ex-hard   .ex-level { background: #fee2e2; color: #991b1b; }
@media (prefers-color-scheme: dark) {
  .ex-easy   .ex-level { background: #064e3b; color: #6ee7b7; }
  .ex-medium .ex-level { background: #78350f; color: #fcd34d; }
  .ex-hard   .ex-level { background: #7f1d1d; color: #fca5a5; }
}
.ex-easy   { border-left: 4px solid var(--good); }
.ex-medium { border-left: 4px solid var(--warn); }
.ex-hard   { border-left: 4px solid var(--bad); }
.ex-time { font-size: 12px; color: var(--text-muted); }
.ex-title { font-weight: 600; color: var(--heading); }
.ex-done { margin-left: auto; font-size: 12.5px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ex-sub { font-weight: 600; margin-bottom: 4px; }
.ex-sub i { color: var(--accent); }
.ex-expected { font-size: 12.5px; }
.ex-hint { margin-top: 10px; padding: 12px 14px; border-left: 3px solid var(--warn); background: var(--bg-soft); border-radius: 0 6px 6px 0; font-size: 14.5px; }

/* --- 22.13 End of lesson ------------------------------------------------- */
.lesson-end { margin: 56px 0 0; }
.end-card {
  height: 100%; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card); padding: 20px 22px;
}
.end-card h3 { margin-top: 0; font-size: 18px; }
.end-card p { color: var(--text-muted); font-size: 14.5px; }
.end-next { border-color: var(--accent); }
.end-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }

/* Revision + cheat sheet + hinglish keep their own light framing */
.revision { border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 6px 20px 16px; background: var(--bg-card); }
.hinglish { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 6px 20px 16px; background: var(--bg-soft); }

/* --- 22.14 Print --------------------------------------------------------- */
@media print {
  .lesson-shell { display: block; }
  .lesson-sidebar, .lesson-h2-tools, .code-actions, .flow-ascii summary,
  .shot-zoom, .ex-done, .end-card .btn, .site-header, .site-footer,
  .crumb, .back-to-top, .pager { display: none !important; }
  .lesson-main { max-width: 100%; }
  .lesson-section { page-break-inside: auto; }
  h2.lesson-h2 { page-break-after: avoid; }
  .code-card, .callout, .exercise-card, .qa-card, .flow-figure { page-break-inside: avoid; }
  pre { border: 1px solid #999; background: #f5f5f5 !important; color: #000 !important; white-space: pre-wrap; }
  .mermaid { display: none !important; }
  .flow-ascii[open] .diagram, .flow-ascii .diagram { display: block !important; }
  .collapse { display: block !important; height: auto !important; }
  .qa-answer, .accordion-collapse { display: block !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 10px; color: #555; }
}

/* --- 22.15 Motion preference -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Lesson pages use the full width; reading column stays at 900px */
.lesson-page { max-width: 1440px; padding-inline: 24px; }
@media (max-width: 991.98px) { .lesson-page { padding-inline: 16px; } }

/* Legacy pages upgraded at runtime: language blocks become code cards */
.lang-block.code-card { background: var(--code-bg); border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; margin: 18px 0; }
.lang-block.code-card > pre { margin: 0; border-radius: 0; }
.code-card-bare .code-head { justify-content: flex-end; }
.code-card-bare > pre { margin: 0; border-radius: 0; }

/* Auto-generated section headings on upgraded pages */
h2.auto-h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2.auto-h2 .lesson-h2-t { flex: 1 1 auto; }

/* The sidebar is the table of contents now — hide the old in-page Contents box */
.lesson-main > nav.toc, .lesson-main > .toc { display: none; }

/* ==========================================================================
   23. Query results and stored-data tables (database lessons)
   ========================================================================== */
.result {
  border: 1px solid var(--good);
  border-radius: var(--radius);
  background: var(--bg-card);
  margin: -6px 0 20px;
  overflow: hidden;
}
.result-head {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 7px 14px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--good);
}
.result-head i { margin-right: 4px; }
.result .table-wrap { margin: 0; }
.result table { font-size: 14px; }
.result table th { background: var(--bg-soft); color: var(--text-muted); }
.result td { font-family: var(--mono); font-size: 13px; }
.result pre { margin: 0; border-radius: 0; }
.result-note {
  border-top: 1px dashed var(--border);
  padding: 9px 14px; font-size: 13.5px; color: var(--text-muted);
}
.result-empty { padding: 14px; margin: 0; color: var(--text-muted); font-style: italic; }

/* "What is actually stored" table cards */
.stored {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  margin: 20px 0;
  overflow: hidden;
  background: var(--bg-card);
}
.stored-head {
  background: var(--accent-soft); color: var(--accent);
  padding: 9px 14px; font-family: var(--mono); font-size: 13.5px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.stored-head span { margin-left: auto; font-family: var(--font); font-size: 11.5px; font-weight: 500; opacity: .85; }
.stored .table-wrap { margin: 0; }
.stored table { font-size: 14px; }
.stored td { font-family: var(--mono); font-size: 13px; }
.stored tr.row-note td { background: #fef3c7; }
@media (prefers-color-scheme: dark) { .stored tr.row-note td { background: #78350f; } }
.stored-note {
  border-top: 1px dashed var(--border);
  padding: 9px 14px; font-size: 13.5px; color: var(--text-muted);
}
.key {
  display: inline-block; margin-left: 5px;
  font-family: var(--font); font-size: 9.5px; font-weight: 700; letter-spacing: .04em;
  padding: 1px 5px; border-radius: 3px; vertical-align: middle;
}
.key.pk { background: var(--accent); color: #fff; }
.key.uq { background: var(--good); color: #fff; }
.key.fk { background: var(--warn); color: #fff; }

/* ==========================================================================
   24. "On this page" — the lesson table of contents
   A vertical rail the reader travels down: passed sections stay marked, the
   current one is anchored, and a filter appears once a lesson gets long.
   ========================================================================== */
.side-toc { padding-bottom: 8px; }

.toc-bar { display: flex; align-items: center; gap: 8px; }
.toc-counter {
  margin-left: auto;
  font-family: var(--mono); font-size: 11px; color: var(--text-muted);
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 1px 7px; border-radius: 20px; font-variant-numeric: tabular-nums;
}
.toc-counter b { color: var(--accent); }
.toc-counter span { opacity: .5; margin: 0 1px; }

.toc-trigger {
  background: none; border: 0; padding: 2px 4px; color: var(--accent);
  font-size: 14px; line-height: 1; border-radius: 6px;
}
.toc-trigger[aria-expanded="true"] i { transform: rotate(180deg); display: inline-block; }

/* filter box */
.toc-filter { position: relative; margin: 10px 0 4px; }
.toc-filter i {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--text-muted); pointer-events: none;
}
.toc-filter input {
  padding-left: 28px; font-size: 12.5px; height: 30px;
  background: var(--bg-soft); border-color: var(--border); color: var(--text);
}
.toc-filter input::placeholder { color: var(--text-muted); }
.toc-filter input:focus {
  background: var(--bg-card); border-color: var(--accent); box-shadow: none; color: var(--text);
}

/* the scrolling area, with a soft fade at the bottom edge */
.toc-scroll {
  position: relative;
  max-height: 42vh; overflow-y: auto;
  margin-top: 6px; padding-right: 2px;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 22px), transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 22px), transparent 100%);
}
.toc-scroll::-webkit-scrollbar { width: 5px; }
.toc-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.toc-list { margin: 0; padding: 0; list-style: none; }

/* group labels — Learn / Apply / Revise */
.toc-group {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 0 5px; padding-left: 2px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted);
}
.toc-group:first-child { margin-top: 2px; }
.toc-group::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* one entry = rail + number + icon + title */
.toc-list .nav-link {
  position: relative;
  display: grid;
  grid-template-columns: 14px 16px 16px 1fr;
  align-items: baseline;
  gap: 7px;
  padding: 6px 8px 6px 0;
  font-size: 13.5px; line-height: 1.35;
  color: var(--text-muted); text-decoration: none;
  border-radius: 0 6px 6px 0;
  transition: color .12s ease, background .12s ease;
}

/* the vertical rail, drawn per item so it joins into one line */
.toc-rail { position: relative; align-self: stretch; }
.toc-rail::before {
  content: ""; position: absolute; left: 6px; top: -8px; bottom: -8px;
  width: 2px; background: var(--border);
}
.toc-list .nav-item:first-of-type .toc-rail::before { top: 8px; }
.toc-list .nav-item:last-child   .toc-rail::before { bottom: calc(100% - 8px); }
.toc-dot {
  position: absolute; left: 2px; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg-card); border: 2px solid var(--border-strong);
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.toc-n {
  font-family: var(--mono); font-size: 10.5px; text-align: right;
  color: var(--text-muted); opacity: .75;
}
.toc-ico  { font-size: 12.5px; }
.toc-t    { min-width: 0; }

.toc-list .nav-link:hover { background: var(--bg-soft); color: var(--accent); }
.toc-list .nav-link:hover .toc-dot { border-color: var(--accent); }

/* already read */
.toc-list .nav-link.is-done { color: var(--text); }
.toc-list .nav-link.is-done .toc-dot { background: var(--accent); border-color: var(--accent); }
.toc-list .nav-link.is-done .toc-rail::before { background: var(--accent); opacity: .45; }

/* currently reading */
.toc-list .nav-link.active {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
.toc-list .nav-link.active .toc-n { color: var(--accent); opacity: 1; }
.toc-list .nav-link.active .toc-dot {
  background: var(--accent); border-color: var(--accent); transform: scale(1.25);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.toc-empty { font-size: 12.5px; color: var(--text-muted); padding: 10px 4px 2px; margin: 0; }

/* tablet and phone: collapsed by default, no inner scroll area */
@media (max-width: 991.98px) {
  .toc-scroll { max-height: none; -webkit-mask-image: none; mask-image: none; }
  #tocCollapse.collapse:not(.show) { display: none; }
  .toc-bar { cursor: default; }
}
@media (min-width: 992px) { .toc-trigger { display: none; } }

/* ==========================================================================
   25. Homepage — hero, paths, roadmap, journey, FAQ
   Minimal and premium: one accent colour, a lot of white space, soft shadows.
   ========================================================================== */

/* --- 25.1 Hero ----------------------------------------------------------- */
.home-hero { padding: 56px 0 40px; }
@media (max-width: 991.98px) { .home-hero { padding: 32px 0 24px; } }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  padding: 5px 13px; border-radius: 20px; margin-bottom: 20px;
}

.home-hero h1 {
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.12; letter-spacing: -1px;
  margin: 0 0 18px; color: var(--heading);
}
.home-hero h1 .grad {
  background: linear-gradient(100deg, var(--accent), #7c3aed 65%, #db2777);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead-sub { font-size: 17.5px; color: var(--text-muted); max-width: 56ch; line-height: 1.65; }
.lead-sub strong, .lead-sub em { color: var(--text); }

.hero-facts {
  display: flex; flex-wrap: wrap; gap: 28px;
  list-style: none; margin: 30px 0 0; padding: 22px 0 0;
  border-top: 1px solid var(--border);
}
.hero-facts li { font-size: 13px; color: var(--text-muted); margin: 0; }
.hero-facts b {
  display: block; font-size: 24px; font-weight: 700;
  color: var(--heading); line-height: 1.1;
}

/* the code editor drawn in HTML */
.editor {
  border: 1px solid var(--border-strong); border-radius: 12px;
  overflow: hidden; background: var(--code-bg);
  box-shadow: 0 18px 50px rgba(15, 23, 42, .18), 0 2px 8px rgba(15, 23, 42, .08);
}
.editor-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; background: #0f172a; border-bottom: 1px solid #1e293b;
}
.editor-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.editor-bar .dot.r { background: #ef4444; }
.editor-bar .dot.y { background: #f59e0b; }
.editor-bar .dot.g { background: #22c55e; }
.editor-file {
  margin-left: 10px; font-family: var(--mono); font-size: 12px; color: #94a3b8;
  display: inline-flex; align-items: center; gap: 6px;
}
.editor-code {
  margin: 0; padding: 18px 20px; background: var(--code-bg);
  font-family: var(--mono); font-size: 13px; line-height: 1.75; color: #cbd5e1;
  overflow-x: auto; border-radius: 0;
}
.editor-code .l { display: block; }
.editor-code .k  { color: #c084fc; }
.editor-code .t  { color: #7dd3fc; }
.editor-code .v  { color: #fca5a5; }
.editor-code .f  { color: #86efac; }
.editor-code .s  { color: #fcd34d; }
.editor-code .n  { color: #fdba74; }
.editor-code .c1 { color: #64748b; }
.editor-tip {
  border-top: 1px solid #1e293b; background: #0f172a;
  padding: 12px 18px; font-size: 13px; color: #cbd5e1;
}
.editor-tip i { color: #fbbf24; }
.editor-tip b { color: #e2e8f0; }
.editor-tip code { background: #1e293b; color: #fca5a5; }

/* --- 25.2 Two-column shell ---------------------------------------------- */
/* The <aside> comes first in the markup, so the narrow column must come first too. */
.home-shell { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 48px; align-items: start; }
@media (max-width: 1199.98px) { .home-shell { grid-template-columns: 250px minmax(0, 1fr); gap: 32px; } }
@media (max-width: 991.98px)  { .home-shell { grid-template-columns: 1fr; gap: 0; } }

.home-side { position: sticky; top: 78px; }
.home-side-inner { max-height: calc(100vh - 100px); overflow-y: auto; padding-bottom: 20px; scrollbar-width: thin; }
@media (max-width: 991.98px) {
  .home-side { position: static; order: 2; margin-top: 32px; }
  .home-side-inner { max-height: none; overflow: visible; }
}

.side-roadmap { list-style: none; margin: 0; padding: 0; counter-reset: rm; }
.side-roadmap li {
  counter-increment: rm; position: relative;
  padding: 5px 0 5px 26px; font-size: 13.5px; margin: 0;
}
.side-roadmap li::before {
  content: counter(rm); position: absolute; left: 0; top: 6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg-soft); border: 1px solid var(--border);
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}
.side-roadmap a { text-decoration: none; }
.side-roadmap a:hover { text-decoration: underline; }
.side-roadmap .soon { color: var(--text-muted); }
.side-roadmap .soon i { font-size: 10px; opacity: .6; }
.side-more { display: inline-block; margin-top: 10px; font-size: 12.5px; text-decoration: none; }
.side-more:hover { text-decoration: underline; }

.side-links { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.side-links li { margin-bottom: 4px; }
.side-links a { text-decoration: none; display: flex; gap: 8px; align-items: center; }
.side-links a:hover { text-decoration: underline; }
.side-links i { color: var(--text-muted); }

.continue-link {
  display: block; text-decoration: none;
  border: 1px solid var(--accent); border-radius: 8px;
  padding: 10px 12px; background: var(--accent-soft);
}
.continue-title { display: block; font-weight: 600; color: var(--accent); font-size: 14px; }
.continue-meta  { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* --- 25.3 Section framing ----------------------------------------------- */
.home-section { padding: 56px 0; border-top: 1px solid var(--border); }
.home-section:first-child { border-top: 0; padding-top: 8px; }
.section-head { max-width: 62ch; margin-bottom: 28px; }
.section-head h2 {
  border: 0; padding: 0; margin: 6px 0 10px;
  font-size: clamp(24px, 2.6vw, 32px); color: var(--heading); letter-spacing: -.6px;
}
.section-head p { color: var(--text-muted); margin: 0; font-size: 16px; }

/* fade in as the reader arrives */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* --- 25.4 Path cards ----------------------------------------------------- */
.path-card {
  display: flex; flex-direction: column; height: 100%;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
  text-decoration: none; color: inherit;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.path-card:hover {
  transform: translateY(-4px); border-color: var(--accent); color: inherit;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .10);
}
.path-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.path-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px;
}
.path-card h3 { margin: 0 0 8px; font-size: 17px; color: var(--heading); }
.path-card p  { margin: 0 0 14px; font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.path-meta {
  margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: 12px; color: var(--text-muted);
  padding-top: 12px; border-top: 1px solid var(--border);
}
.path-card.is-featured { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.path-card.is-soon { opacity: .62; }
.path-card.is-soon .path-icon { background: var(--bg-soft); color: var(--text-muted); }

.chip {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 20px; white-space: nowrap;
}
.chip-soon { background: var(--bg-soft); color: var(--text-muted); border: 1px solid var(--border); }
.chip-star { background: #fef3c7; color: #92400e; }
@media (prefers-color-scheme: dark) { .chip-star { background: #78350f; color: #fcd34d; } }

.path-progress { height: 3px; background: var(--border); border-radius: 3px; margin-top: 12px; overflow: hidden; }
.path-progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .4s ease; }

/* --- 25.5 Roadmap — compact, two columns on desktop ---------------------- */
.roadmap {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr; gap: 6px;
  max-width: 820px;                 /* keep the rows readable, not page-wide */
}
@media (min-width: 992px) {
  .roadmap { grid-template-columns: repeat(2, minmax(0, 340px)); column-gap: 16px; }
}
.roadmap-step { margin: 0; }

.roadmap-body {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 14px; background: var(--bg-card);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
a.roadmap-body:hover {
  border-color: var(--accent); background: var(--accent-soft); transform: translateX(3px);
}
a.roadmap-body:hover > .bi-arrow-right { transform: translateX(3px); }

.roadmap-n {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700;
}
.roadmap-text { flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.roadmap-text b { display: block; font-size: 14.5px; color: var(--heading); }
.roadmap-note {
  display: block; font-size: 12px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.roadmap-body > .bi-arrow-right { color: var(--accent); font-size: 12px; transition: transform .15s ease; }
.roadmap-body > .bi-lock-fill  { color: var(--border-strong); font-size: 11px; }

.roadmap-step.is-soon .roadmap-body { background: var(--bg-soft); border-style: dashed; }
.roadmap-step.is-soon .roadmap-n { background: var(--bg-soft); color: var(--text-muted); border-color: var(--border); }
.roadmap-step.is-soon .roadmap-text b { color: var(--text-muted); font-weight: 500; }

/* "being written next" strip under the path cards */
.planned {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 20px; padding: 14px 16px;
  border: 1px dashed var(--border-strong); border-radius: 10px; background: var(--bg-soft);
}
.planned-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); margin-right: 4px;
}
.planned-label i { color: var(--warn); }
.planned-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 4px 11px; border-radius: 20px;
}
.planned-chip i { font-size: 13px; opacity: .75; }

/* --- 25.6 CTA bands ------------------------------------------------------ */
.cta-band {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 14px; padding: 26px 30px;
}
.cta-band p { color: var(--text-muted); max-width: 62ch; }
.cta-final { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

/* --- 25.7 Why cards ------------------------------------------------------ */
.why-card {
  height: 100%; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 12px; padding: 22px;
  transition: border-color .18s ease, transform .18s ease;
}
.why-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.why-icon {
  width: 40px; height: 40px; border-radius: 10px; margin-bottom: 14px;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 19px;
}
.why-card h3 { font-size: 16px; margin: 0 0 8px; color: var(--heading); }
.why-card p  { font-size: 14px; color: var(--text-muted); margin: 0; line-height: 1.65; }

/* --- 25.8 Lesson anatomy ------------------------------------------------- */
.anatomy {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.anatomy-item {
  background: var(--bg-card); padding: 15px 16px;
  display: flex; gap: 12px; align-items: flex-start;
}
.anatomy-item i { color: var(--accent); font-size: 17px; margin-top: 2px; }
.anatomy-item b { display: block; font-size: 14px; color: var(--heading); }
.anatomy-item span { font-size: 12.5px; color: var(--text-muted); }

.shot-strip { display: grid; gap: 14px; }
.shot-strip .shot { max-width: 300px; margin: 0 auto; }

/* --- 25.9 Journey -------------------------------------------------------- */
.journey {
  display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px 18px;
}
.journey-step { flex: 1 1 120px; text-align: center; padding: 6px 4px; }
.journey-icon {
  width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 10px;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.journey-step b { display: block; font-size: 14px; color: var(--heading); }
.journey-note { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.journey-arrow { align-self: center; color: var(--border-strong); font-size: 14px; }
@media (max-width: 767.98px) { .journey-arrow { display: none; } }

/* --- 25.10 Promise columns ---------------------------------------------- */
.promise { height: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; background: var(--bg-card); }
.promise h3 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.promise ul { margin: 0; padding-left: 20px; }
.promise li { font-size: 14.5px; color: var(--text); margin-bottom: 8px; }
.promise-yes { border-left: 3px solid var(--good); }
.promise-yes h3 { color: var(--good); }
.promise-no  { border-left: 3px solid var(--text-muted); }
.promise-no h3 { color: var(--text-muted); }

/* --- 25.11 Brand in the navbar ------------------------------------------ */
.nav-brand small {
  display: block; font-size: 10px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted); margin-top: -3px;
}
.text-accent { color: var(--accent); }
.footer-social { display: flex; gap: 10px; margin-top: 4px; }
.footer-social a {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.footer-social a:hover { border-color: var(--accent); color: var(--accent); }

/* --- 26. WebeXcello brand ------------------------------------------------ */
/* Bootstrap ships blue; re-point its primary at the brand colour. */
:root,
[data-bs-theme] {
  --bs-primary:          #E63562;
  --bs-primary-rgb:      230, 53, 98;
  --bs-link-color:       var(--accent);
  --bs-link-color-rgb:   230, 53, 98;
  --bs-link-hover-color: #c22a51;
}

.btn-primary {
  --bs-btn-bg:             #E63562;
  --bs-btn-border-color:   #E63562;
  --bs-btn-hover-bg:       #c72b52;
  --bs-btn-hover-border-color: #c72b52;
  --bs-btn-active-bg:      #ad2445;
  --bs-btn-active-border-color: #ad2445;
  --bs-btn-disabled-bg:    #E63562;
  --bs-btn-disabled-border-color: #E63562;
}
.btn-outline-primary {
  --bs-btn-color:          #E63562;
  --bs-btn-border-color:   #E63562;
  --bs-btn-hover-bg:       #E63562;
  --bs-btn-hover-border-color: #E63562;
  --bs-btn-active-bg:      #c72b52;
  --bs-btn-active-border-color: #c72b52;
}
.dropdown-menu {
  --bs-dropdown-link-active-bg:    var(--accent-soft);
  --bs-dropdown-link-active-color: var(--accent);
}
.btn:focus-visible, .form-control:focus, .nav-link:focus-visible {
  box-shadow: 0 0 0 .2rem rgba(230, 53, 98, .25);
  border-color: var(--accent);
}

/* Logo lockup — the SVG wordmark replaces the old text brand. */
.nav-brand.brand-logo,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-logo img,
.footer-brand img {
  height: 32px;
  width: auto;
  max-width: 100%;
  display: block;
}
.footer-brand img { height: 28px; }
.brand-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
@media (max-width: 400px) {
  .brand-logo img { height: 26px; }
  .brand-tag { display: none; }
}

/* The wordmark is near-black; swap in the light variant for dark mode. */
.brand-logo .logo-dark, .footer-brand .logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .brand-logo .logo-light, .footer-brand .logo-light { display: none; }
  .brand-logo .logo-dark, .footer-brand .logo-dark { display: block; }
}
