
:root{
  --bg: #F7F4EF;
  --panel: #FFFFFF;
  --sunken: #EFE9DF;
  --ink: #08415C;
  --muted: #4A6675;
  --faint: #87979F;
  --line: #DCE3E6;
  --accent: #CC2936;
  --accent-ink: #CC2936;

  /* Rotating phase-accent palette, assigned by phase index (not by name) so
     any course with any number/naming of phases can use it. */
  --c-phase-0: #0d9488;  --c-phase-0-bg: #eafaf7;
  --c-phase-1: #4f46e5;  --c-phase-1-bg: #eeecfd;
  --c-phase-2: #b45309;  --c-phase-2-bg: #fbf1de;
  --c-phase-3: #be123c;  --c-phase-3-bg: #fdeaef;
  --c-phase-4: #7c3aed;  --c-phase-4-bg: #f3ecfe;
  --c-phase-5: #0e7490;  --c-phase-5-bg: #e5f7fb;
  --c-phase-6: #a16207;  --c-phase-6-bg: #fdf3d6;
  --c-phase-7: #be185d;  --c-phase-7-bg: #fce7f0;
  --c-phase-8: #15803d;  --c-phase-8-bg: #e6f7ea;
  --c-phase-9: #1d4ed8;  --c-phase-9-bg: #e8effe;

  --code-bg: #062130;
  --code-line: #0E3648;
  --code-ink: #DCE7EC;
  --radius: 14px;
  --sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --body-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', 'Consolas', 'SFMono-Regular', Menlo, Monaco, monospace;
  --topbar-h: 66px;
  --drawer-w: 320px;
  --content-scale: 1;
}

html{ --content-max: 1040px; --home-max: 960px; }

html.dark{
  --bg: #04161F;
  --panel: #08283A;
  --sunken: #0B2230;
  --ink: #EAF2F5;
  --muted: #9FB4BD;
  --faint: #748C97;
  --line: #134055;
  --accent: #CC2936;
  --accent-ink: #F07A84;
  --code-bg: #02101A;
  --code-line: #0D3245;
  --code-ink: #DCE7EC;
  --c-phase-0-bg: #132824;
  --c-phase-1-bg: #1e1c34;
  --c-phase-2-bg: #2a2010;
  --c-phase-3-bg: #2a1420;
  --c-phase-4-bg: #241c3a;
  --c-phase-5-bg: #132a30;
  --c-phase-6-bg: #2a2210;
  --c-phase-7-bg: #2a1622;
  --c-phase-8-bg: #142a1c;
  --c-phase-9-bg: #16223a;
}

*{ margin:0; padding:0; box-sizing:border-box; }
html{ scroll-behavior: smooth; }
body{
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---- thin scrollbars ---- */
*{ scrollbar-width: thin; scrollbar-color: var(--faint) transparent; }
*::-webkit-scrollbar{ width: 8px; height: 8px; }
*::-webkit-scrollbar-track{ background: transparent; }
*::-webkit-scrollbar-thumb{ background: var(--line); border-radius: 100px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover{ background: var(--faint); background-clip: padding-box; }
a{ color: inherit; text-decoration: none; text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); }
button{ font-family: inherit; }
::selection{ background: var(--accent); color: #fff; }

/* ============ Top bar ============ */
.topbar{
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar-inner{
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 22px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar-left, .topbar-right{
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.topbar-left{ justify-content: flex-start; }
.topbar-right{ justify-content: flex-end; }
.topbar-spacer{ flex: 1; }
.hub-link{
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.hub-link:hover{ color: var(--accent); }
.site-link{
  font-size: 0.8rem;
  color: var(--faint);
  text-decoration: none;
  white-space: nowrap;
}
.site-link:hover{ color: var(--accent); }
@media (max-width: 640px){ .site-link{ display: none; } }
.topbar-divider{ width: 1px; height: 16px; background: var(--line); flex-shrink: 0; }
@media (max-width: 640px){ .topbar-divider{ display: none; } }

/* ============ Brand logo + Courses menu (shared across hub + course pages) ============ */
.brand-logo{
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 40px;
}
.brand-logo-text{ display: flex; flex-direction: column; line-height: 1.2; }
.brand-logo-title{ font-weight: 700; font-size: 1.5rem; font-family: var(--sans); letter-spacing: -0.01em; }
.brand-logo-byline{ font-size: 0.66rem; font-weight: 500; color: var(--faint); }
.brand-logo:hover .brand-logo-title{ color: var(--accent); }
.brand-logo + .nav-menu-trigger{ margin-right: 14px; }
@media (max-width: 640px){ .brand-logo-byline{ display: none; } }
.brand-logo svg{
  width: 25px; height: 25px;
  padding: 5px;
  box-sizing: border-box;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  flex-shrink: 0;
}
.brand-logo:hover{ color: var(--accent); }
@media (max-width: 640px){ .brand-logo span{ display: none; } }

.nav-menu{ position: relative; flex-shrink: 0; }
.nav-menu-trigger{
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.nav-menu-trigger:hover, .nav-menu-trigger.open{ color: var(--ink); background: var(--panel); }
.nav-menu-trigger .chev{ width: 13px; height: 13px; opacity: .6; transition: transform 0.15s ease; flex-shrink: 0; }
.nav-menu-trigger.open .chev{ transform: rotate(180deg); }
.nav-soon-tag{
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--faint); border: 1px solid var(--line); border-radius: 100px; padding: 1px 6px;
}

/* ============ Coming-soon placeholder page (e.g. blog.html) ============ */
.coming-soon-main{
  max-width: 640px; width: 100%; margin: 0 auto;
  padding: 120px 22px 140px; text-align: center;
}
.coming-soon-icon{
  width: 64px; height: 64px; margin: 0 auto 26px;
  border-radius: 50%; background: var(--panel); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--accent);
}
.coming-soon-icon svg{ width: 28px; height: 28px; }
.coming-soon-main .tag{
  display: inline-flex; margin-bottom: 18px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint); border: 1px solid var(--line); border-radius: 100px; padding: 5px 14px;
}
.coming-soon-main h1{
  font-family: var(--sans); font-weight: 700; font-size: 2.4rem; line-height: 1.15;
  margin: 0 0 14px; letter-spacing: -0.02em;
}
.coming-soon-main p{ color: var(--muted); font-size: 1.05rem; line-height: 1.6; margin: 0 0 32px; }
.coming-soon-main .resume-line{ margin-bottom: 0; display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; }

/* ============ Blog index page ============ */
.blog-index-main{
  max-width: var(--content-max); width: 100%; margin: 0 auto;
  padding: 60px 36px 110px;
}
.blog-index-main .tag{
  display: inline-flex; margin-bottom: 18px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint); border: 1px solid var(--line); border-radius: 100px; padding: 5px 14px;
}
.blog-index-intro{ color: var(--muted); font-size: 1.05rem; line-height: 1.6; margin: 14px 0 48px; max-width: 640px; }

.blog-index-section-label{
  font-family: var(--sans); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint); margin: 0 0 18px;
}

/* Featured post */
.blog-featured{
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--panel);
  margin-bottom: 56px; transition: border-color 0.15s ease;
}
.blog-featured:hover{ border-color: var(--accent); }
.blog-featured:hover h2{ color: var(--accent); }
.blog-featured-img{ width: 100%; height: 360px; object-fit: cover; display: block; background: #fff; }
.blog-featured-body{ padding: 30px 36px 34px; }
.blog-featured-tag{
  display: inline-flex; margin-bottom: 14px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--accent); border: 1px solid currentColor; border-radius: 100px; padding: 4px 12px;
}
.blog-featured-body h2{
  font-family: var(--sans); font-weight: 700; font-size: 1.7rem; letter-spacing: -0.02em; line-height: 1.2;
  margin: 0 0 12px; transition: color 0.15s ease;
}
.blog-featured-body p{ color: var(--muted); font-size: 1.02rem; line-height: 1.6; margin: 0 0 18px; max-width: 640px; }
.blog-featured-meta{ font-size: 0.85rem; color: var(--faint); }
.blog-featured-meta strong{ color: var(--ink); font-weight: 600; }
@media (max-width: 640px){
  .blog-featured-img{ height: 200px; }
  .blog-featured-body{ padding: 22px 20px 26px; }
  .blog-featured-body h2{ font-size: 1.35rem; }
}

/* Post grid */
.blog-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.blog-card{
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--panel);
  transition: border-color 0.15s ease;
}
.blog-card:hover{ border-color: var(--accent); }
.blog-card:hover h2{ color: var(--accent); }
.blog-card-img{ width: 100%; height: 150px; object-fit: cover; display: block; background: #fff; }
.blog-card-body{ padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.blog-card-body h2{
  font-family: var(--sans); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; line-height: 1.3;
  margin: 0 0 8px; transition: color 0.15s ease;
}
.blog-card-body p{ color: var(--muted); font-size: 0.87rem; line-height: 1.55; margin: 0 0 14px; flex: 1; }
.blog-card-meta{ font-size: 0.78rem; color: var(--faint); }
@media (max-width: 900px){
  .blog-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px){
  .blog-grid{ grid-template-columns: 1fr; }
}

/* ============ Blog post page ============ */
.blog-post-byline{
  display: flex; align-items: center; gap: 10px; margin: -8px 0 28px;
  font-size: 0.88rem; color: var(--muted);
}
.blog-post-byline a{ color: var(--ink); font-weight: 600; text-decoration: none; }
.blog-post-byline a:hover{ color: var(--accent); }
.blog-cover{ margin: 0 0 32px; }
.blog-cover img{ max-height: 460px; object-fit: cover; }
.blog-related{ margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }
.blog-related h2{ margin-bottom: 22px; }
.blog-related-list{ display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.blog-related-item{
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel);
  transition: border-color 0.15s ease;
}
.blog-related-item:hover{ border-color: var(--accent); }
.blog-related-item img{ width: 100%; height: 120px; object-fit: cover; display: block; }
.blog-related-item-body{ padding: 14px 16px 18px; }
.blog-related-item h3{
  font-family: var(--sans); font-weight: 700; font-size: 0.98rem; margin: 0 0 6px; letter-spacing: -0.01em;
}
.blog-related-item p{ color: var(--muted); font-size: 0.85rem; line-height: 1.5; margin: 0; }
@media (max-width: 640px){
  .blog-related-list{ grid-template-columns: 1fr; }
}

.courses-menu{
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  max-width: 92vw;
  max-height: 76vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 26px 60px -22px rgba(8,65,92,0.28);
  padding: 18px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 80;
}
.courses-menu.open{ display: flex; }
.courses-menu-columns{ column-count: 3; column-gap: 36px; margin-bottom: 4px; }
.courses-menu-group{ break-inside: avoid; margin-bottom: 26px; }
.courses-menu-label{ font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 0 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.courses-menu-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  text-decoration: none;
  color: var(--muted);
}
.courses-menu-item:hover .cmi-title{ color: var(--accent); }
.courses-menu-item:hover .cmi-icon{ color: var(--accent); }
.courses-menu-item.current .cmi-title{ color: var(--ink); font-weight: 700; }
.courses-menu-item.current .cmi-icon{ color: var(--ink); }
.courses-menu-item[aria-disabled="true"]{ cursor: default; }
.courses-menu-item[aria-disabled="true"] .cmi-title{ color: var(--faint); }
.cmi-icon{ width: 16px; height: 16px; flex-shrink: 0; color: var(--faint); transition: color 0.15s ease; }
.cmi-icon svg{ width: 100%; height: 100%; display: block; }
.cmi-title{ flex: 1; font-size: 13.5px; font-weight: 500; line-height: 1.4; min-width: 0; color: var(--ink); transition: color 0.15s ease; }
.cmi-count{ display: none; }
.cmi-count{ font-size: 11.5px; color: var(--faint); flex-shrink: 0; font-family: var(--sans); }
.cmi-soon{ font-size: 0.64rem; font-weight: 700; color: var(--faint); border: 1px solid var(--line); padding: 1px 7px; border-radius: 100px; flex-shrink: 0; }
.courses-menu-footer{ margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.courses-menu-footer a{ display: block; padding: 9px 10px; border-radius: 12px; text-decoration: none; color: var(--accent); font-size: 0.85rem; font-weight: 700; }
.courses-menu-footer a:hover{ background: var(--bg); }

/* Quick links shown inside the Courses dropdown only below the nav-collapse
   breakpoint, where Catalog/My learning fold into this one menu (see the
   mobile nav rules below) instead of sitting as separate topbar links. */
.courses-menu-quicklinks{ display: none; flex-direction: column; gap: 2px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.courses-menu-quicklinks a{ display: block; padding: 9px 10px; border-radius: 12px; text-decoration: none; color: var(--ink); font-size: 0.92rem; font-weight: 600; }
.courses-menu-quicklinks a:hover{ background: var(--bg); }

/* Brand logo: lives only inside the mobile hamburger menu, since the
   topbar's own logo is hidden below the same breakpoint that folds
   Catalog/My learning/Blog into this menu. */
.courses-menu-brand{
  display: none; align-items: center; gap: 9px;
  padding: 4px 10px 14px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
}
.courses-menu-brand svg{
  width: 25px; height: 25px; padding: 5px; box-sizing: border-box;
  border-radius: 999px; background: var(--accent); color: #fff; flex-shrink: 0;
}
.courses-menu-brand-text{ display: flex; flex-direction: column; line-height: 1.2; }
.courses-menu-brand-title{ font-weight: 700; font-size: 1.15rem; font-family: var(--sans); letter-spacing: -0.01em; }
.courses-menu-brand-byline{ font-size: 0.7rem; font-weight: 500; color: var(--faint); }

/* Content-width picker: lives only inside the mobile hamburger menu (the
   topbar's own #widthToggle icon is hidden below the same breakpoint that
   folds Catalog/My learning/Blog into this menu). */
.courses-menu-width{ display: none; padding: 4px 10px 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.courses-menu-width-label{ display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.courses-menu-width-options{ display: flex; gap: 6px; }
.cmw-btn{
  flex: 1; border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  font-family: inherit; font-size: 0.82rem; font-weight: 600; padding: 8px 6px; border-radius: 10px; cursor: pointer;
}
.cmw-btn:hover{ border-color: var(--ink); color: var(--ink); }
.cmw-btn.active{ background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ============ Text size stepper (A / A pill, always visible - no dropdown) ============ */
.text-scale{
  display: flex;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  flex-shrink: 0;
}
.text-scale button{
  border: 0;
  background: none;
  width: 29px;
  height: 27px;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
}
.text-scale button:hover{ background: var(--bg); color: var(--ink); }
.text-scale button:first-child{ font-size: 11px; }
.text-scale button:last-child{ font-size: 15px; font-weight: 700; }

#widthToggle svg{ width: 16px; height: 16px; }

/* ============ Reading progress ============ */
.reading-progress{
  position: fixed;
  top: var(--topbar-h);
  left: 0; right: 0;
  height: 3px;
  z-index: 59;
  background: transparent;
  pointer-events: none;
}
.reading-progress-fill{
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.08s linear;
}

.text-btn{
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 14px;
  cursor: pointer;
  color: var(--ink);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.text-btn:hover{ border-color: var(--ink); }

/* ============ Course Contents left-edge tab ============ */
.modules-tab{
  position: fixed;
  top: calc(var(--topbar-h) + 24px);
  left: 0;
  z-index: 58;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: none;
  border-radius: 0 14px 14px 0;
  padding: 10px 8px 10px 10px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 10px 24px -14px rgba(8,65,92,0.3);
  transition: padding-left 0.15s ease, color 0.15s ease;
}
.modules-tab:hover{ border-color: var(--ink); color: var(--ink); padding-left: 14px; }
.modules-tab .hamb{ font-size: 1rem; }
.modules-tab .progress-chip{
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 1px 7px;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--sans);
  color: var(--accent);
  writing-mode: vertical-lr;
}
body.drawer-pinned .modules-tab{ display: none; }

/* ============ Edge hover navigation ============ */
.edge-zone{
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  width: 90px;
  z-index: 40;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.edge-zone.left{ left: 0; justify-content: flex-start; }
.edge-zone.right{ right: 0; justify-content: flex-end; }
.edge-nav{
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.15s ease;
  box-shadow: 0 10px 24px -12px rgba(8,65,92,0.35);
  margin: 0 14px;
}
.edge-zone.right .edge-nav{ transform: translateX(10px); }
.edge-zone:hover .edge-nav{ opacity: 1; transform: translateX(0); }
.edge-nav:hover{ border-color: var(--ink); }
.edge-nav[disabled]{ display: none; }
@media (max-width: 860px){ .edge-zone{ display: none; } }

/* ============ Scroll to top ============ */
.scroll-top-btn{
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 10px 24px -12px rgba(8,65,92,0.35);
  z-index: 45;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.15s ease;
}
.scroll-top-btn.show{ opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top-btn:hover{ border-color: var(--ink); color: var(--ink); }

.icon-btn{
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 34px; height: 34px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.92rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.icon-btn:hover{ border-color: var(--ink); color: var(--ink); }

.search-trigger{
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 9px 15px;
  width: 246px;
  background: var(--panel);
  color: var(--faint);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease;
}
.search-trigger svg{ width: 15px; height: 15px; flex-shrink: 0; }
.search-trigger span{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trigger input{
  border: 0; background: none; outline: none; font: inherit; color: inherit;
  width: 100%; padding: 0;
}
.search-trigger kbd{
  margin-left: auto;
  font-family: var(--sans);
  font-size: 0.68rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--faint);
  white-space: nowrap;
  flex-shrink: 0;
}
.search-trigger:hover,
.search-trigger:focus-within{ border-color: var(--ink); }
@media (max-width: 1040px){ .search-trigger{ width: 38px; min-width: 38px; height: 38px; padding: 0; justify-content: center; flex: 0 0 auto; margin-left: auto; } .search-trigger span{ display: none; } }

/* ============ Article column ============ */
.content-col{
  display: flex;
  justify-content: center;
  min-width: 0;
}
.content-col > main{ min-width: 0; width: 100%; }
article{ max-width: var(--content-max); width: 100%; min-width: 0; margin: 0 auto; padding: 60px 36px 110px; transition: max-width 0.15s ease; }

.lesson-eyebrow-row{ display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; margin-bottom: 18px; }
.lesson-actions{ display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eyebrow-sep{ margin: 0 2px; }
.eyebrow{ font-family: var(--sans); font-size: 12px; color: var(--faint); }
.eyebrow-course{ color: inherit; text-decoration: none; }
.eyebrow-course:hover{ color: var(--accent, currentColor); text-decoration: underline; }
.eyebrow-dot{ width: 4px; height: 4px; border-radius: 999px; background: var(--faint); flex-shrink: 0; }
.eyebrow-time{ font-size: 12px; color: var(--faint); }
.eyebrow-spacer{ flex: 1; }

.lesson-title{ font-family: var(--sans); font-weight: 700; font-size: calc(2.7rem * var(--content-scale)); line-height: 1.06; margin-bottom: 18px; letter-spacing: -0.02em; }

.bookmark-btn{
  border: 1px solid var(--line);
  background: none;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.bookmark-btn:hover{ border-color: var(--ink); color: var(--ink); }
.bookmark-btn.active{ border-color: var(--accent); color: var(--accent); }

.mark-complete{
  border: 1px solid var(--line);
  background: none;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.mark-complete:hover{ border-color: var(--ink); color: var(--ink); }
.mark-complete.done{ border-color: var(--accent); background: var(--accent); color: #fff; }

/* ---- lesson body blocks ---- */
.b-h1{ font-family: var(--sans); font-size: calc(1.85rem * var(--content-scale)); font-weight: 700; margin: 48px 0 18px; scroll-margin-top: 90px; letter-spacing: -0.01em; }
.b-h2{ font-family: var(--sans); font-size: calc(1.34rem * var(--content-scale)); font-weight: 700; margin: 32px 0 14px; scroll-margin-top: 90px; }
.b-h3{ font-family: var(--sans); font-size: calc(1.14rem * var(--content-scale)); font-weight: 700; color: var(--accent); margin: 26px 0 10px; }
.b-p{ margin-bottom: 18px; font-size: calc(1.1rem * var(--content-scale)); line-height: 1.72; overflow-wrap: break-word; font-family: var(--body-sans); }
.b-list{ margin: 0 0 20px 0; padding-left: 24px; }
.b-list li{ margin-bottom: 9px; font-size: calc(1.1rem * var(--content-scale)); line-height: 1.65; overflow-wrap: break-word; font-family: var(--body-sans); }

.b-code{
  position: relative;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 16px;
  margin-bottom: 20px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: calc(0.93rem * var(--content-scale));
  line-height: 1.7;
  border-top: 3px solid var(--code-line);
}
.code-bar{ display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px 0 18px; min-height: 34px; }
.code-lang{ font-family: var(--sans); font-size: 0.68rem; letter-spacing: .08em; text-transform: uppercase; color: #8fa5b3; }
.code-actions{ display: flex; gap: 6px; }
.b-code pre{
  margin: 0; padding: 6px 22px 18px; overflow-x: auto; white-space: pre; tab-size: 4;
  font: inherit; line-height: inherit; color: inherit;
  scrollbar-width: thin; scrollbar-color: #2b5468 transparent;
}
.b-code pre code{ font: inherit; }
.b-code pre::-webkit-scrollbar{ height: 10px; }
.b-code pre::-webkit-scrollbar-thumb{ background: #2b5468; border-radius: 6px; }
.b-code.wrap pre{ white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-btn, .code-wrap-btn{
  background: rgba(255,255,255,0.08);
  color: #c9d1db;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 3px 11px;
  font-family: var(--sans);
  font-size: 0.7rem;
  cursor: pointer;
}
.copy-btn:hover, .code-wrap-btn:hover{ background: rgba(255,255,255,0.16); }
.code-wrap-btn[aria-pressed="true"]{ background: rgba(255,255,255,0.22); color: #fff; }
/* Syntax tokens (code blocks are dark in both themes) */
.tok-c{ color: #7d93a3; font-style: italic; }
.tok-s{ color: #a5d6a7; }
.tok-k{ color: #d7a8ff; }
.tok-n{ color: #ffcc80; }
.tok-f{ color: #82b4ff; }
.tok-t{ color: #7fdbca; }

.b-callout{
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: var(--panel);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 20px;
  font-size: 0.94rem;
  line-height: 1.62;
  font-family: var(--body-sans);
}
.b-callout .kind{ font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); display: block; margin-bottom: 7px; }
/* Fixed palette for well-known callout kinds (independent of phase colors,
   since a callout's kind has nothing to do with which phase it's in).
   Any other free-form kind string falls back to the base .b-callout style above. */
.b-callout.kind-Common-Pitfall{ border-left-color: #b45309; }
.b-callout.kind-Common-Pitfall .kind{ color: #b45309; }
.b-callout.kind-Best-Practice{ border-left-color: #0d9488; }
.b-callout.kind-Best-Practice .kind{ color: #0d9488; }
.b-callout.kind-Key-Takeaways{ border-left-color: #4f46e5; }
.b-callout.kind-Key-Takeaways .kind{ color: #4f46e5; }
.b-callout.kind-Warning{ border-left-color: #be123c; }
.b-callout.kind-Warning .kind{ color: #be123c; }

.diagram-gallery{ display: grid; gap: 18px; margin-bottom: 20px; }
.diagram-card{ border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--panel); }
.diagram-card img{ width: 100%; display: block; background: #fff; }
.diagram-card figcaption{ padding: 13px 18px; border-top: 1px solid var(--line); }
.diagram-card .cap-title{ font-weight: 700; font-size: 0.88rem; margin-bottom: 3px; font-family: var(--body-sans); }
.diagram-card .cap-desc{ color: var(--muted); font-size: 0.83rem; font-family: var(--body-sans); }
.diagram-card.standalone-image{ margin-bottom: 20px; }

.b-table-wrap{ overflow-x: auto; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 16px; }
.b-table{ width: 100%; border-collapse: collapse; font-size: calc(0.92rem * var(--content-scale)); font-family: var(--body-sans); }
.b-table th, .b-table td{ padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.b-table th{ background: var(--panel); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.b-table tr:last-child td{ border-bottom: none; }

/* ---- Review Questions & Answers accordion ---- */
.qa-accordion{ margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.qa-item{ border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); }
.qa-question{
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 18px; background: none; border: none; text-align: left; cursor: pointer;
  font-family: var(--body-sans); font-weight: 600; font-size: calc(0.98rem * var(--content-scale)); color: var(--ink);
}
.qa-question:hover{ background: var(--bg); }
.qa-chev{ width: 16px; height: 16px; flex-shrink: 0; color: var(--faint); transition: transform 0.2s ease; }
.qa-item.open .qa-chev{ transform: rotate(180deg); }
.qa-answer{ max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.qa-item.open .qa-answer{ max-height: 800px; }
.qa-answer-inner{ padding: 0 18px 16px; border-top: 1px solid var(--line); margin-top: 2px; }
.qa-answer-inner p{ margin: 14px 0 0; color: var(--muted); font-size: calc(0.94rem * var(--content-scale)); line-height: 1.65; font-family: var(--body-sans); }

.lesson-app-cta{ text-align: center; margin-top: 44px; font-size: 0.9rem; }
.lesson-app-cta a{ color: var(--accent); font-weight: 600; text-decoration: none; }
.lesson-app-cta a:hover{ text-decoration: underline; }

/* ---- lesson footer: mark-complete on its own row, pager below it ---- */
.lesson-footer{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  margin-top: 50px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.pager{
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.9rem;
  width: 100%;
}
.pager-link{ text-decoration: none; color: var(--muted); flex: 1 1 280px; border: 1px solid var(--line); border-radius: 16px; padding: 14px 20px; }
.pager-link:hover{ border-color: var(--ink); color: var(--ink); }
.pager-link.next{ text-align: right; }
.pager-dir{ font-family: var(--sans); font-size: 0.7rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.pager-title{ font-weight: 600; }

/* ============ Modules drawer ============ */
.drawer-backdrop{
  position: fixed; inset: 0;
  background: rgba(4,22,31,0.5);
  backdrop-filter: blur(2px);
  z-index: 90;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.drawer-backdrop.open{ display: block; opacity: 1; }
.drawer{
  position: fixed;
  top: 0; bottom: 0; left: 0;
  width: var(--drawer-w);
  max-width: 88vw;
  background: var(--panel);
  border-right: 1px solid var(--line);
  border-radius: 0 20px 20px 0;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  z-index: 91;
  transform: translateX(-100%);
  transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.24s ease;
  display: flex;
  flex-direction: column;
}
.drawer.open{ transform: translateX(0); box-shadow: 16px 0 50px rgba(8,65,92,0.18); }

/* pinned = persistent sidebar instead of overlay drawer */
body.drawer-pinned .drawer{
  transform: translateX(0);
  box-shadow: none;
  border-radius: 0;
  border-right: 1px solid var(--line);
  top: var(--topbar-h);
  transition: none;
}
body.drawer-pinned .drawer-backdrop{ display: none !important; }
body.drawer-pinned .content-col,
body.drawer-pinned .app-footer{ margin-left: var(--drawer-w); }
@media (max-width: 960px){
  body.drawer-pinned .drawer{ box-shadow: 16px 0 50px rgba(8,65,92,0.18); border-radius: 0 20px 20px 0; top: 0; }
  body.drawer-pinned .content-col,
  body.drawer-pinned .app-footer{ margin-left: 0; }
}

/* The course-overview screen's own body *is* the table of contents, so the
   SPA hides the lesson sidebar there instead of showing a duplicate copy of
   the same list. (The static overview pages don't emit the drawer markup at
   all; this covers course.html, which reuses one shell for every screen.) */
body.no-sidebar .drawer,
body.no-sidebar .drawer-backdrop,
body.no-sidebar .modules-tab{ display: none !important; }
body.no-sidebar.drawer-pinned .content-col,
body.no-sidebar.drawer-pinned .app-footer{ margin-left: 0 !important; }
.drawer-head{
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  border-radius: 0 20px 0 0;
}
.drawer-head-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.drawer-head .title{ font-family: var(--sans); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.drawer-head-actions{ display: flex; gap: 6px; }
#drawerClose{ border-radius: 50%; }
#drawerPin{ border-radius: 50%; font-size: 0.85rem; }
.pin-icon{ width: 15px; height: 15px; }
#drawerPin.active{ border-color: var(--accent); color: var(--accent); }
.drawer-progress{
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin-bottom: 8px;
}
.drawer-progress-fill{ height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s ease; }
.drawer-progress-label{ font-size: 0.76rem; color: var(--faint); margin-bottom: 14px; font-family: var(--sans); }
.drawer-search-trigger{
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 9px 14px;
  background: var(--panel);
  color: var(--faint);
  font-size: 0.85rem;
  cursor: pointer;
}
.drawer-search-trigger svg{ width: 15px; height: 15px; flex-shrink: 0; }
.drawer-search-trigger:hover{ border-color: var(--ink); color: var(--muted); }
.drawer-search input{
  display: none;
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.drawer-search input:focus{ outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.drawer-search.open .drawer-search-trigger{ display: none; }
.drawer-search.open input{ display: block; }
.drawer-list{ overflow-y: auto; flex: 1; padding: 10px 0 24px; }

.phase-group{ margin-bottom: 6px; padding-bottom: 6px; }
.phase-group + .phase-group{ border-top: 1px solid var(--line); padding-top: 6px; }
.phase-label{
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 18px 8px;
  font-weight: 700;
  color: var(--faint);
}

.nav-item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 22px;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  border-left: 3px solid transparent;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}
.nav-item:hover{ background: var(--bg); color: var(--ink); padding-left: 26px; }
.nav-item.active{ font-weight: 700; color: var(--ink); }
.phase-group .nav-item.active{ background: var(--phase-bg, var(--bg)); color: var(--ink); border-left-color: var(--phase-c, var(--accent)); }
.nav-item .n{ font-family: var(--sans); font-size: 0.76rem; color: var(--faint); min-width: 20px; }
.nav-item.active .n{ color: inherit; }
.nav-item .check{ margin-left: auto; width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid var(--line); flex-shrink: 0; transition: all 0.15s ease; }
.nav-item .check:hover{ border-color: var(--accent); transform: scale(1.15); }
.nav-item .check.done{ background: var(--accent); border-color: var(--accent); position: relative; }
.nav-item .check.done::after{
  content: '✓';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: white; line-height: 1;
}
.nav-item.hidden{ display: none; }

/* ============ Command palette ============ */
.palette-overlay{ position: fixed; inset: 0; background: rgba(4,22,31,0.5); z-index: 200; display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.palette-overlay.open{ display: flex; }
.palette{ width: 560px; max-width: 90vw; max-height: 60vh; background: var(--panel); border-radius: 20px; box-shadow: 0 30px 70px -20px rgba(8,65,92,0.4); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); }
.palette input{ border: none; border-bottom: 1px solid var(--line); padding: 18px 22px; font-size: 1rem; font-family: var(--sans); background: var(--panel); color: var(--ink); }
.palette input:focus{ outline: none; }
.palette-results{ overflow-y: auto; padding: 8px; }
.palette-item{ padding: 11px 13px; border-radius: 12px; cursor: pointer; }
.palette-item:hover, .palette-item.sel{ background: var(--bg); }
.palette-item .pt{ font-size: 0.9rem; font-weight: 600; margin-bottom: 2px; }
.palette-item .pt .n{ color: var(--accent); font-family: var(--sans); font-weight: 400; margin-right: 6px; }
.palette-item .snippet{ font-size: 0.8rem; color: var(--muted); }
.palette-item .snippet mark, .palette-item .pt mark{ background: none; color: var(--accent); font-weight: 700; }
.palette-empty{ padding: 22px 20px; text-align: center; color: var(--faint); font-size: 0.9rem; }
.palette-label{ font-family: var(--sans); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 10px 13px 4px; text-align: left; }
.palette-empty .palette-label{ padding-left: 0; }
.palette-hint{ font-size: 0.8rem; color: var(--muted); padding: 8px 13px; text-align: left; }
.palette-empty .palette-hint{ text-align: center; }
.palette-chips{ display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; padding: 2px 0 6px; }
.palette-empty .palette-chips{ justify-content: center; }
.palette-chip{ font: inherit; font-size: 0.82rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.palette-chip:hover, .palette-chip:focus-visible{ border-color: var(--accent); color: var(--accent); }
.palette-foot{ display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--faint); font-family: var(--sans); }
.palette-foot kbd{ font: inherit; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-right: 4px; background: var(--bg); }
html.palette-open{ overflow: hidden; }
@media (max-width: 640px){ .palette-foot{ display: none; } .palette-overlay{ padding-top: 6vh; } .palette{ max-height: 80vh; } }

@media (max-width: 980px) and (min-width: 681px){
  .courses-menu{ width: 640px; }
  .courses-menu-columns{ column-count: 2; }
}

/* ============ Mobile ============ */

/* Below this width, "Catalog" and "My learning" no longer fit as inline
   topbar links alongside the Courses trigger, text-scale stepper, and theme
   toggle - fold them into the Courses dropdown (now a plain hamburger) so
   the topbar never forces the page wider than the viewport. */
@media (max-width: 680px){
  .topbar-inner{ gap: 8px; padding: 0 14px; }
  .topbar-inner > .brand-logo{ display: none; }
  a.nav-menu-trigger[href="/learn/index.html"],
  a.nav-menu-trigger[href="/learn/dashboard.html"],
  a.nav-menu-trigger[href="/learn/blog.html"]{ display: none; }
  #coursesMenuTrigger{ padding: 12px; gap: 0; min-width: 52px; min-height: 52px; justify-content: center; }
  #coursesMenuTrigger .nav-menu-trigger-label{ display: none; }
  #coursesMenuTrigger::before{ content: '☰'; font-size: 1.7rem; line-height: 1; }
  #coursesMenuTrigger .chev{ display: none; }
  #widthToggle{ display: none; }
  .courses-menu-brand{ display: flex; }
  .courses-menu-quicklinks{ display: flex; }
  .courses-menu-width{ display: block; }
  /* Anchor to the viewport instead of the trigger button so the panel can
     never extend past the right edge of a narrow screen. */
  .courses-menu{ position: fixed; top: calc(var(--topbar-h) + 8px); left: 14px; right: 14px; width: auto; max-width: none; transform: none; }
  .courses-menu-columns{ column-count: 1; }
}

@media (max-width: 640px){
  .lesson-title{ font-size: 1.85rem; }
  article{ padding: 36px 18px 80px; }
  .hub-link span{ display: none; }
  .modules-tab{ top: calc(var(--topbar-h) + 12px); padding: 8px 6px 8px 8px; }
  .modules-tab .progress-chip{ display: none; }
}

/* ============ Home ============ */
.home{ max-width: var(--home-max); width: 100%; min-width: 0; padding: 68px 36px 110px; margin: 0 auto; transition: max-width 0.15s ease; }
.home h1{ font-family: var(--sans); font-weight: 700; font-size: 2.5rem; line-height: 1.1; margin-bottom: 20px; text-align: center; letter-spacing: -0.02em; }
.home .lead{ color: var(--muted); font-size: 1.16rem; text-align: center; margin-bottom: 32px; }
.home .progress-line{ text-align: center; font-family: var(--sans); font-size: 0.85rem; color: var(--faint); margin-bottom: 40px; }
.home .progress-line strong{ color: var(--accent); font-family: var(--sans); }

.resume-line{
  display: block;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 40px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9rem;
}
.resume-line:hover{ border-color: var(--ink); }
.resume-line .label{ font-family: var(--sans); font-size: 0.72rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; display: block; margin-bottom: 5px; }
.resume-line .title{ font-weight: 700; }

.index-phase{ margin-bottom: 30px; }
.index-phase-head{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.index-phase-head h2{ font-family: var(--sans); font-size: 1.5rem; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.index-phase-head .range{ font-family: var(--sans); font-size: 0.76rem; color: var(--faint); }

.index-row{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 10px;
  margin: 0 -10px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  font-size: 1.02rem;
  font-weight: 500;
  transition: background 0.12s ease;
}
.index-row:last-child{ border-bottom: none; }
.index-row:hover{ background: var(--panel); }
.index-row .n{ font-family: var(--sans); color: var(--faint); font-size: 0.78rem; min-width: 22px; }
.index-row .t{ flex: 1; }
.index-row .mins{ font-family: var(--sans); font-size: 0.76rem; color: var(--faint); }
.index-row .check{ width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); flex-shrink: 0; position: relative; }
.index-row .check.done{ background: var(--accent); border-color: var(--accent); }
.index-row .check.done::after{
  content: '✓';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; line-height: 1;
}

/* ============ Hub home (index.html - course list) ============ */
.hub-main{ max-width: 1340px; margin: 0 auto; padding: 0 22px 90px; }

.hub-hero{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 60px;
  flex-wrap: wrap;
  text-align: left;
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--line);
}
.hub-hero-copy{ flex: 1 1 460px; max-width: 860px; }
.hub-badges{ display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.hub-badge{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
}
.hub-badge.outline{ background: none; border: 1px solid var(--line); color: var(--muted); }
.hub-badge .dot{ width: 6px; height: 6px; border-radius: 50%; background: #fff; }

.hub-main h1{ font-family: var(--sans); font-weight: 700; font-size: 58px; line-height: 1.05; margin-bottom: 20px; text-align: left; letter-spacing: -0.02em; }
.hub-main .lead{ color: var(--muted); font-size: 18px; line-height: 1.6; text-align: left; margin: 0; max-width: 52ch; }
@media (max-width: 640px){
  .hub-hero{ padding: 44px 0 32px; }
  .hub-main h1{ font-size: 2.3rem; }
}

/* ---- resume card (right column of the hero) ---- */
.hub-resume-card{
  flex: 1 1 380px;
  max-width: 450px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
@media (max-width: 520px){ .hub-resume-card{ max-width: 100%; padding: 22px; } }
.resume-card-label{ display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.resume-card-tag{ font-family: var(--sans); font-size: 12px; color: var(--faint); }
.resume-card-row{ display: flex; gap: 13px; align-items: flex-start; }
.resume-card-mono{
  width: 40px; height: 40px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-weight: 700; font-size: 20px; color: #fff;
}
.resume-card-course{ font-size: 11.5px; color: var(--faint); margin-bottom: 3px; }
.resume-card-lesson{ font-family: var(--sans); font-size: 23px; line-height: 1.15; }
.resume-card-bar{ height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.resume-card-bar-fill{ height: 100%; background: var(--accent); border-radius: 999px; }
.resume-card-cta{
  display: flex; align-items: center; justify-content: center; gap: 9px;
  border: 0; border-radius: 100px; background: var(--ink); color: var(--bg);
  padding: 14px 22px; font-size: 14.5px; font-weight: 600; text-decoration: none;
}
.resume-card-cta:hover{ opacity: 0.9; }
.resume-card-stats{ display: flex; gap: 20px; font-size: 12.5px; color: var(--faint); }

/* ---- category filter chips ---- */
.chip-row{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 26px 0 22px;
}
.chip{
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover{ border-color: var(--ink); color: var(--ink); }
.chip.active{ background: var(--ink); border-color: var(--ink); color: var(--bg); }
html.dark .chip.active{ background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip-row-spacer{ flex: 1; }
.chip-result-label{ font-size: 12.5px; color: var(--faint); white-space: nowrap; }

.courses-section{ margin-bottom: 48px; }
.catalog-empty{ text-align: center; color: var(--faint); padding: 60px 20px; font-size: 0.95rem; }

.card-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr));
  gap: 14px;
}

.course-card{
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--panel);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.course-card.filtered-out{ display: none; }
.course-card.available:hover{ transform: translateY(-3px); border-color: var(--ink); }
.course-card.soon{ opacity: 0.68; }
.course-card.started{ border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }

.thumb{
  position: relative;
  width: 84px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,0.09) 0 1px, transparent 1px 14px);
}
.thumb-mono{ font-family: var(--sans); font-weight: 700; font-size: 30px; color: #fff; opacity: 0.95; line-height: 1; }
.thumb-icon{ color: #fff; opacity: 0.95; display: flex; }
.thumb-icon svg{ width: 30px; height: 30px; }
.thumb[data-color="violet"]{ background-color: #4e5fc4; }
.thumb[data-color="teal"]{ background-color: #0d8f74; }
.thumb[data-color="rose"]{ background-color: #c2410c; }
.thumb[data-color="indigo"]{ background-color: #3651d4; }
.thumb[data-color="amber"]{ background-color: #b45309; }
.thumb[data-color="slate"]{ background-color: #334155; }
.thumb[data-color="crimson"]{ background-color: #c0273c; }
.thumb[data-color="cyan"]{ background-color: #0891b2; }
.thumb[data-color="emerald"]{ background-color: #059669; }
.thumb[data-color="purple"]{ background-color: #7c3aed; }
.thumb[data-color="gold"]{ background-color: #ca8a04; }
.thumb[data-color="brown"]{ background-color: #78350f; }
.thumb[data-color="pink"]{ background-color: #db2777; }
.thumb[data-color="navy"]{ background-color: #1e3a5f; }
.thumb[data-color="lime"]{ background-color: #65a30d; }
.thumb[data-color="maroon"]{ background-color: #7f1d1d; }
.thumb[data-color="sky"]{ background-color: #0284c7; }
.thumb[data-color="plum"]{ background-color: #a21caf; }
.thumb[data-color="orange"]{ background-color: #ea580c; }
.thumb[data-color="fuchsia"]{ background-color: #c026d3; }
.thumb[data-color="red"]{ background-color: #dc2626; }
.thumb[data-color="yellow"]{ background-color: #eab308; }
.thumb[data-color="mint"]{ background-color: #34d399; }
.thumb[data-color="denim"]{ background-color: #1d4ed8; }
.thumb[data-color="coral"]{ background-color: #f0603a; }
.thumb[data-color="grape"]{ background-color: #6b21a8; }
.thumb[data-color="forest"]{ background-color: #166534; }
.thumb[data-color="ink"]{ background-color: #312e81; }
.thumb[data-color="sienna"]{ background-color: #9c4221; }
.thumb[data-color="ocean"]{ background-color: #155e75; }

.card-body{ padding: 14px 18px; flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 7px; }
.card-body .title{
  font-family: var(--sans); font-weight: 700; font-size: 16px; line-height: 1.3; margin: 0; letter-spacing: -0.005em;
  min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.thumb-category{
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: #2563eb; flex-shrink: 0;
  background: var(--bg);
  border-radius: 100px; padding: 4px 11px;
}
html.dark .thumb-category{ color: #7ba7f7; }
.card-body .meta-row{
  display: flex; align-items: center; gap: 12px;
  font-family: var(--sans);
  font-size: 12px; color: var(--faint);
}
.card-bottom-row{ display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-level{
  font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; font-family: var(--sans);
  background: var(--bg); border-radius: 100px; padding: 4px 11px;
}
.card-status{
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
}
.card-status.done{ color: var(--accent); }
.card-status.soon{ color: var(--faint); }
.card-progress-row{ display: flex; align-items: center; gap: 11px; margin-top: 2px; }
.card-progress{ display: block; flex: 1; height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.card-progress-fill{ display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.card-progress-label{ font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--muted); }

@media (max-width: 480px){
  .card-grid{ grid-template-columns: 1fr; }
}

/* ============ Course overview hero (colored band on a course's index page) ============ */
.course-hero{
  position: relative;
  color: #fff;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 15px);
}
.course-hero[data-color="violet"]{ background-color: #4e5fc4; }
.course-hero[data-color="teal"]{ background-color: #0d8f74; }
.course-hero[data-color="rose"]{ background-color: #c2410c; }
.course-hero[data-color="indigo"]{ background-color: #3651d4; }
.course-hero[data-color="amber"]{ background-color: #b45309; }
.course-hero[data-color="slate"]{ background-color: #334155; }
.course-hero[data-color="crimson"]{ background-color: #c0273c; }
.course-hero[data-color="cyan"]{ background-color: #0891b2; }
.course-hero[data-color="emerald"]{ background-color: #059669; }
.course-hero[data-color="purple"]{ background-color: #7c3aed; }
.course-hero[data-color="gold"]{ background-color: #ca8a04; }
.course-hero[data-color="brown"]{ background-color: #78350f; }
.course-hero[data-color="pink"]{ background-color: #db2777; }
.course-hero[data-color="navy"]{ background-color: #1e3a5f; }
.course-hero[data-color="lime"]{ background-color: #65a30d; }
.course-hero[data-color="maroon"]{ background-color: #7f1d1d; }
.course-hero[data-color="sky"]{ background-color: #0284c7; }
.course-hero[data-color="plum"]{ background-color: #a21caf; }
.course-hero[data-color="orange"]{ background-color: #ea580c; }
.course-hero[data-color="fuchsia"]{ background-color: #c026d3; }
.course-hero[data-color="red"]{ background-color: #dc2626; }
.course-hero[data-color="yellow"]{ background-color: #eab308; }
.course-hero[data-color="mint"]{ background-color: #34d399; }
.course-hero[data-color="denim"]{ background-color: #1d4ed8; }
.course-hero[data-color="coral"]{ background-color: #f0603a; }
.course-hero[data-color="grape"]{ background-color: #6b21a8; }
.course-hero[data-color="forest"]{ background-color: #166534; }
.course-hero[data-color="ink"]{ background-color: #312e81; }
.course-hero[data-color="sienna"]{ background-color: #9c4221; }
.course-hero[data-color="ocean"]{ background-color: #155e75; }

.course-hero-inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 44px 22px 40px;
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.course-hero-copy{ flex: 1 1 420px; }
.course-hero-back{
  display: inline-flex; align-items: center; gap: 6px;
  color: #fff; opacity: 0.75; font-size: 13px;
  text-decoration: none; margin-bottom: 22px;
}
.course-hero-back:hover{ opacity: 1; }
.course-hero-eyebrow{
  font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.8; margin-bottom: 12px;
}
.course-hero-title{
  font-family: var(--sans); font-weight: 700; font-size: 3.4rem; line-height: 1.03;
  margin: 0 0 16px; letter-spacing: -0.02em; color: #fff;
}
.course-hero-desc{ margin: 0; font-size: 17px; line-height: 1.6; opacity: 0.86; max-width: 56ch; color: #fff; }

.course-progress-card{
  flex: 1 1 220px;
  max-width: 260px;
  background: var(--panel);
  border-radius: 20px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--ink);
}
.course-progress-top{ display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.course-progress-pct{ font-family: var(--sans); font-weight: 700; font-size: 2rem; line-height: 1; }
.course-progress-label{ font-family: var(--sans); font-size: 0.76rem; color: var(--faint); text-align: right; }
.course-progress-bar{ height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.course-progress-bar-fill{ height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s ease; }
.course-progress-cta{
  display: block; text-align: center; border: 0; border-radius: 100px;
  background: var(--ink); color: var(--bg); padding: 13px 18px;
  font-size: 0.92rem; font-weight: 700; text-decoration: none;
}
.course-progress-cta:hover{ opacity: 0.9; }
@media (max-width: 640px){
  .course-hero-inner{ padding: 32px 18px 28px; gap: 24px; }
  .course-hero-title{ font-size: 2.2rem; }
  .course-progress-card{ flex-basis: 100%; }
}

.home-phases{ max-width: 1100px; width: 100%; min-width: 0; padding: 40px 22px 110px; margin: 0 auto; }

/* ============ App footer (shared across every learn page) ============ */
.app-footer{
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 48px 28px 30px;
}
.footer-inner{
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 32px;
}
.footer-brand .brand-logo{ margin-bottom: 12px; }
.footer-brand p{ color: var(--faint); font-size: 0.86rem; max-width: 320px; line-height: 1.55; }
.footer-heading{ font-family: var(--sans); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.footer-links{ display: flex; flex-direction: column; gap: 10px; }
.footer-links-browse{ display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: row; column-gap: 20px; row-gap: 10px; }
.footer-links a{ color: var(--muted); text-decoration: none; font-size: 0.88rem; }
.footer-links a:hover{ color: var(--accent); }
.footer-bottom{
  max-width: 1160px;
  margin: 34px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 0.76rem;
}
@media (max-width: 720px){
  .footer-inner{ grid-template-columns: 1fr 1fr; }
  .footer-brand{ grid-column: 1 / -1; }
}
@media (max-width: 460px){
  .footer-inner{ grid-template-columns: 1fr; }
}



/* ============ Lesson template: outline, focus, zoom, print, small screens ============ */
.skip-link{ position: absolute; left: 12px; top: -60px; z-index: 300; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-family: var(--sans); font-size: 0.9rem; text-decoration: none; transition: top .15s; }
.skip-link:focus{ top: 10px; }
#main:focus{ outline: none; }
:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.b-code :focus-visible, .code-bar :focus-visible{ outline-color: #82b4ff; }
button:focus-visible, a:focus-visible, summary:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }

/* "On this page": a right rail when there is room beside the article, otherwise a collapsible list under the title */
.toc-rail{ display: none; position: fixed; top: 130px; width: 184px; max-height: calc(100vh - 170px); overflow-y: auto; font-family: var(--sans); font-size: 0.8rem; z-index: 40; }
html.toc-fits .toc-rail{ display: block; }
html.toc-fits .toc-inline{ display: none; }
.toc-title{ font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.toc-rail ol, .toc-inline ol{ list-style: none; margin: 0; padding: 0; }
.toc-rail li a{ display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc-rail li.toc-l3 a{ padding-left: 24px; font-size: 0.76rem; }
.toc-rail li a:hover{ color: var(--ink); }
.toc-rail li a.active{ color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc-inline{ margin: 0 0 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); font-family: var(--sans); }
.toc-inline summary{ cursor: pointer; padding: 12px 16px; font-size: 0.86rem; font-weight: 600; color: var(--ink); }
.toc-inline ol{ padding: 0 16px 12px; }
.toc-inline li a{ display: block; padding: 6px 0; color: var(--muted); text-decoration: none; font-size: 0.86rem; }
.toc-inline li.toc-l3 a{ padding-left: 14px; font-size: 0.8rem; }

.diagram-card img[data-zoom]{ cursor: zoom-in; }
.img-lightbox{ position: fixed; inset: 0; z-index: 250; background: rgba(4,22,31,.86); display: flex; align-items: center; justify-content: center; padding: 3vh 3vw; cursor: zoom-out; }
.img-lightbox img{ max-width: min(96vw, 1500px); max-height: 92vh; background: #fff; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.img-lightbox button{ position: absolute; top: 14px; right: 18px; font: 1.6rem/1 var(--sans); color: #fff; background: rgba(255,255,255,.12); border: 0; border-radius: 999px; width: 42px; height: 42px; cursor: pointer; }

@media (max-width: 640px){
  .eyebrow{ flex: 1 1 100%; line-height: 1.5; }
  .eyebrow-spacer{ display: none; }
  .lesson-actions{ width: 100%; }
  .bookmark-btn .bm-label{ display: none; }
  .lesson-title{ font-size: calc(2rem * var(--content-scale)); }
  .b-code pre{ padding-left: 16px; padding-right: 16px; }
  /* the floating contents tab sat on top of the text at phone width: dock it to the bottom-left instead */
  .modules-tab{ top: auto; bottom: 16px; left: 12px; border: 1px solid var(--line); border-radius: 999px; flex-direction: row; padding: 9px 14px; box-shadow: 0 8px 22px -8px rgba(8,65,92,.4); }
  .modules-tab .progress-chip{ display: inline-block; writing-mode: horizontal-tb; transform: none; }
  .modules-tab .tab-label{ display: inline; }
}
.modules-tab .tab-label{ display: none; }

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

@media print{
  .topbar, .drawer, .drawer-backdrop, .modules-tab, .scroll-top-btn, .reading-progress, .toc-rail, .toc-inline, .lesson-actions, .pager, .skip-link, footer, .site-footer, .copy-btn, .code-wrap-btn{ display: none !important; }
  body{ background: #fff !important; color: #000 !important; }
  .content-col{ margin: 0 !important; max-width: none !important; }
  .b-code{ background: #f5f5f5 !important; color: #000 !important; border: 1px solid #ccc; break-inside: avoid; }
  .b-code pre{ white-space: pre-wrap !important; overflow: visible !important; }
  .tok-c, .tok-s, .tok-k, .tok-n, .tok-f, .tok-t{ color: #000 !important; }
  .qa-answer{ display: block !important; max-height: none !important; }
  a{ color: inherit; text-decoration: underline; }
}

/* ============ Catalog: paths, filters, goal picker ============ */
.hub-paths{ margin: 8px 0 28px; }
.section-head h2{ font-family: var(--sans); font-size: 1.25rem; margin: 0 0 4px; }
.section-head p{ color: var(--muted); margin: 0 0 14px; font-size: 0.95rem; }
.path-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.path-card{ display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.path-card:hover{ border-color: var(--accent); transform: translateY(-2px); }
.path-title{ font-family: var(--sans); font-weight: 700; font-size: 1.02rem; color: var(--ink); }
.path-blurb{ font-size: 0.88rem; color: var(--muted); line-height: 1.45; }
.path-meta{ font-size: 0.78rem; color: var(--faint); margin-top: auto; padding-top: 4px; }
.path-card .card-progress-row{ display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.path-banner{ display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 22px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.path-banner h2{ margin: 2px 0 4px; font-family: var(--sans); font-size: 1.5rem; }
.path-banner p{ margin: 0; color: var(--muted); max-width: 62ch; font-size: 0.92rem; }
.path-banner-label{ font-family: var(--sans); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.path-banner-clear{ font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }
.step-badge{ position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.95); color: #0f2a36; font: 700 12px/24px var(--sans); text-align: center; z-index: 2; }
.thumb{ position: relative; }
.card-status.new{ color: #fff; background: var(--accent); border-radius: 999px; padding: 1px 8px; }
.filter-controls{ display: flex; gap: 14px; flex-wrap: wrap; }
.filter-controls label{ display: flex; align-items: center; gap: 6px; font-family: var(--sans); font-size: 12.5px; color: var(--faint); }
.filter-controls select{ max-width: 170px; font: inherit; font-size: 12.5px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; cursor: pointer; }
.goal-pills{ display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.goal-pill{ font: inherit; font-size: 0.8rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.goal-pill:hover{ border-color: var(--accent); }
.goal-pill.active{ background: var(--ink); color: var(--bg); border-color: var(--ink); }
.resume-card-link{ display: inline-block; margin-top: 8px; font-size: 0.82rem; color: var(--muted); }

/* ============ Course overview additions ============ */
.course-hero-desc.clamped{ display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.desc-toggle{ background: none; border: 0; padding: 0; margin: -6px 0 10px; color: inherit; opacity: .85; text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.9rem; }
.course-hero-context{ margin: 0 0 10px; font-size: 0.9rem; opacity: .95; line-height: 1.6; }
.course-hero-context a{ color: inherit; text-decoration: underline; }
.cert-link{ display: none; margin-top: 8px; font-family: var(--sans); font-size: 0.85rem; text-align: center; color: var(--ink); }
.cert-link.show{ display: block; }

/* ============ Shared soft button (certificate page) ============ */
.btn-soft{ font: inherit; font-family: var(--sans); font-size: 0.85rem; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn-soft:hover{ border-color: var(--accent); }

/* Byline, "in brief" summary, and reserved image space */
.lesson-byline{ margin: -6px 0 20px; font-family: var(--sans); font-size: 0.82rem; color: var(--faint); }
.lesson-byline a{ color: inherit; }
.lesson-brief{ margin: 0 0 26px; padding: 14px 18px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; background: var(--panel); }
.lesson-brief strong{ display: block; font-family: var(--sans); font-size: 0.72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.lesson-brief p{ margin: 0; font-size: calc(1.02rem * var(--content-scale)); line-height: 1.6; }
.diagram-card img{ height: auto; }
.related-courses{ margin: 40px 0 8px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.related-courses h2{ font-family: var(--sans); font-size: 1.15rem; margin: 0 0 10px; }
.related-courses ul{ margin: 0; padding-left: 20px; }
.related-courses li{ margin: 6px 0; }

/* ============ Quiet UI ============
 * Neutral surfaces, one accent color, plain labels instead of pills, smaller radii and no hover
 * lift. This block deliberately comes last and overrides the per-course colors above
 * (.thumb[data-color], .course-hero[data-color]); delete it to restore the old look. */

/* Labels: sentence case, no letter-spaced uppercase */
.resume-card-label, .course-hero-eyebrow, .footer-heading, .toc-title, .path-banner-label,
.lesson-brief strong, .pager-dir, .courses-menu-label, .courses-menu-width-label, .palette-label,
.resume-line .label, .b-callout .kind, .card-status, .thumb-category, .phase-label,
.blog-index-section-label, .coming-soon-main .tag, .blog-index-main .tag, .blog-featured-tag, .nav-soon-tag{
  text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 12.5px;
}
.b-table th, .code-lang{ text-transform: none; letter-spacing: 0; }

/* Badges and tags: plain text with a hairline, no filled pills */
.hub-badge{ background: none; color: var(--muted); border: 1px solid var(--line); text-transform: none;
  letter-spacing: 0; font-size: 12.5px; font-weight: 500; padding: 4px 10px; border-radius: 6px; }
.hub-badge .dot{ background: var(--accent); }
.coming-soon-main .tag, .blog-index-main .tag, .blog-featured-tag, .nav-soon-tag{ border-radius: 6px; padding: 3px 9px; }
.blog-featured-tag{ color: var(--muted); border-color: var(--line); }

/* Radii: 12px for surfaces, 8px for controls */
.course-card, .path-card, .blog-card, .lesson-brief, .path-banner{ border-radius: 12px; }
.hub-resume-card, .course-progress-card, .blog-featured{ border-radius: 14px; }
.resume-card-cta, .course-progress-cta, .btn-soft, .chip{ border-radius: 8px; }

/* No hover lift; a quiet border change instead */
.course-card.available:hover, .path-card:hover{ transform: none; border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.blog-card:hover, .blog-featured:hover{ border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.course-card.started{ border-color: var(--line); }

/* Course cards: neutral icon column instead of colored stripes */
.thumb, .thumb[data-color]{ width: 64px; background-color: var(--sunken); background-image: none; border-right: 1px solid var(--line); }
.thumb-icon, .thumb-mono{ color: var(--muted); opacity: 1; }
.thumb-icon svg{ width: 22px; height: 22px; }
.thumb-mono{ font-size: 22px; }
.thumb-category, html.dark .thumb-category{ background: none; padding: 0; color: var(--faint); font-weight: 500; }
.card-level{ background: none; padding: 0; font-weight: 500; font-size: 12px; color: var(--faint); }
.card-status{ font-size: 12px; }

/* Home resume card: neutral icon tile instead of a colored letter */
.resume-card-mono{ background: var(--sunken) !important; color: var(--muted); border: 1px solid var(--line); }
.resume-card-mono svg{ width: 20px; height: 20px; }

/* Course overview: plain header instead of a colored band */
.course-hero, .course-hero[data-color]{ background-color: var(--bg); background-image: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.course-hero-title{ color: var(--ink); font-size: 2.8rem; }
.course-hero-desc{ color: var(--muted); opacity: 1; }
.course-hero-back{ color: var(--muted); opacity: 1; }
.course-hero-back:hover{ color: var(--ink); }
.course-hero-eyebrow{ color: var(--faint); opacity: 1; }
.course-hero-context{ color: var(--muted); }
.course-progress-card{ border: 1px solid var(--line); }
@media (max-width: 640px){ .course-hero-title{ font-size: 2.1rem; } }

/* Lesson sidebar: one accent for the current lesson, not a color per phase */
.phase-group .nav-item.active{ background: var(--sunken); border-left-color: var(--accent); }
.nav-item:hover{ padding-left: 22px; }

/* In brief: a calm note, not an alert */
.lesson-brief{ border-left-width: 1px; border-left-color: var(--line); background: var(--sunken); }
.lesson-brief strong{ color: var(--ink); }

/* ============ Category hues ============
 * One muted hue per category, used only on small surfaces (icon tiles, category labels,
 * a thin accent line), so color carries meaning without making pages loud. */
[data-cat="databases"]{ --hue: #2f6fb0; }
[data-cat="system-design"]{ --hue: #6a5cc4; }
[data-cat="cloud-devops"]{ --hue: #0f877d; }
[data-cat="apis-messaging"]{ --hue: #b5741c; }
[data-cat="distributed-systems"]{ --hue: #9a5a7a; }
[data-cat="security"]{ --hue: #bf434e; }
[data-cat="full-stack"]{ --hue: #c05f2a; }
[data-cat="frontend"]{ --hue: #9b4f9a; }
[data-cat="ai-engineering"]{ --hue: #2e8a55; }
:root{ --hue-tile: 12%; --hue-text-mix: 100%; }
html.dark{ --hue-tile: 20%; --hue-text-mix: 72%; }

/* tinted icon tiles */
.thumb[data-cat], .resume-card-mono[data-cat], .dash-icon-tile[data-cat], .path-icon[data-cat]{
  background-color: color-mix(in srgb, var(--hue) var(--hue-tile), var(--panel)) !important;
  color: color-mix(in srgb, var(--hue) var(--hue-text-mix), #fff);
  border-color: color-mix(in srgb, var(--hue) 22%, var(--line));
}
.thumb[data-cat] .thumb-icon{ color: inherit; }
.thumb-category[data-cat], html.dark .thumb-category[data-cat]{ color: color-mix(in srgb, var(--hue) var(--hue-text-mix), #fff); }
.course-card[data-cat].available:hover{ border-color: color-mix(in srgb, var(--hue) 55%, var(--line)); }

/* course overview: thin hue line and hue-colored category in the eyebrow */
.course-hero[data-cat]{ border-top: 3px solid var(--hue); }
.course-hero[data-cat] .course-hero-eyebrow{ color: color-mix(in srgb, var(--hue) var(--hue-text-mix), #fff); }

/* ============ Learning paths ============ */
.path-grid{ gap: 16px; }
.path-card{ position: relative; gap: 10px; padding: 18px 18px 16px; overflow: hidden; }
.path-card[data-cat]::before{ content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--hue); opacity: .85; }
.path-card[data-cat]:hover{ border-color: color-mix(in srgb, var(--hue) 55%, var(--line)); }
.path-head{ display: flex; align-items: center; gap: 11px; }
.path-icon{ width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.path-icon svg{ width: 19px; height: 19px; }
.path-steps{ display: flex; align-items: center; gap: 0; margin-top: 2px; }
.path-step{ width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  border: 1px solid var(--line); background: var(--sunken); color: var(--faint); }
.path-step svg{ width: 14px; height: 14px; }
.path-step.started{ border-color: color-mix(in srgb, var(--hue) 50%, var(--line)); color: color-mix(in srgb, var(--hue) var(--hue-text-mix), #fff); }
.path-step.done{ background: color-mix(in srgb, var(--hue) var(--hue-tile), var(--panel)); border-color: color-mix(in srgb, var(--hue) 50%, var(--line)); color: color-mix(in srgb, var(--hue) var(--hue-text-mix), #fff); }
.path-step-link{ width: 10px; height: 1px; background: var(--line); flex-shrink: 0; }
.path-card .card-progress-fill{ background: var(--hue, var(--accent)); }

/* ============ Dark theme for reading ============
 * Neutral charcoal instead of saturated navy, softer white for long text, and a red that
 * keeps contrast on dark surfaces. */
html.dark{
  --bg: #131518;
  --panel: #1a1d21;
  --sunken: #16191c;
  --ink: #e6e4df;
  --muted: #b0b4b9;
  --faint: #868c93;
  --line: #2a2f35;
  --accent: #e0525c;
  --accent-ink: #f08a91;
  --code-bg: #0e1013;
  --code-line: #24282d;
  --code-ink: #dcdfe3;
}

/* ============ Inline formatting in lesson prose ============ */
.b-p code, .b-list code, .b-table td code, .b-callout code, .qa-item code, .lesson-brief code{
  font-family: var(--mono); font-size: 0.86em; background: var(--sunken); border: 1px solid var(--line);
  border-radius: 5px; padding: 0.06em 0.36em; white-space: nowrap;
}
.b-p a, .b-list a, .b-callout a, .qa-item a{ color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
ol.b-list{ padding-left: 1.4em; }
ol.b-list li{ padding-left: 0.2em; }

/* Smaller lesson diagrams: capped and centered; click-to-enlarge shows full size */
.diagram-card.standalone-image{ max-width: 620px; margin-left: auto; margin-right: auto; }
.diagram-card.standalone-image img{ width: auto; max-width: 100%; max-height: 380px; margin: 0 auto; object-fit: contain; padding: 10px; box-sizing: border-box; }
@media (max-width: 640px){ .diagram-card.standalone-image img{ max-height: 300px; padding: 6px; } }

/* ============ My learning (dashboard.html) ============
 * One calm column: a short header, a continue card with the totals beside it, then plain
 * lists. Every number appears once; color only on icon tiles and progress bars. */
.dash-main{ max-width: 1120px; padding-top: 48px; }
.dash-header{ display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 28px; }
.dash-main h1{ font-size: 40px; margin: 0 0 6px; }
.dash-sub{ margin: 0; color: var(--faint); font-size: 14.5px; }
.dash-backup{ display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.dash-link-btn{ display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13.5px; color: var(--muted);
  background: none; border: 0; border-radius: 8px; padding: 7px 10px; cursor: pointer; }
.dash-link-btn svg{ width: 15px; height: 15px; }
.dash-link-btn:hover{ color: var(--ink); background: var(--sunken); }
.dash-note{ font-size: 13px; color: var(--muted); margin-left: 6px; }
.dash-note:empty{ display: none; }

.dash-top{ display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; }
.dash-resume, .dash-stats, .dash-panel, .dash-list{ background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }

.dash-resume{ padding: 26px 28px; display: flex; flex-direction: column; }
.dash-resume-course{ display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.dash-resume-kicker{ margin: 22px 0 4px; font-size: 13px; color: var(--faint); }
.dash-resume-lesson{ margin: 0; font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); }
.dash-resume-progress{ display: flex; align-items: center; gap: 14px; margin: 22px 0 22px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.dash-resume-progress .dash-bar{ flex: 1; }
.dash-cta{ align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 10px;
  background: var(--ink); color: var(--bg); font-size: 14.5px; font-weight: 600; text-decoration: none; margin-top: auto; }
.dash-cta:hover{ opacity: .9; }
.dash-resume.is-empty .dash-resume-kicker{ margin-top: 0; }
.dash-resume.is-empty .dash-resume-lesson{ margin-bottom: 22px; font-size: 22px; }

.dash-stats{ display: grid; grid-template-columns: 1fr 1fr; }
.dash-stat{ display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 20px 22px; }
.dash-stat:nth-child(odd){ border-right: 1px solid var(--line); }
.dash-stat:nth-child(-n+2){ border-bottom: 1px solid var(--line); }
.dash-stat-value{ font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.dash-stat-label{ font-size: 13px; color: var(--faint); }

.dash-bar{ display: block; height: 6px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.dash-bar > span{ display: block; height: 100%; border-radius: 999px; background: var(--accent); }
[data-cat] > .dash-bar > span{ background: var(--hue, var(--accent)); }

.dash-section{ margin-top: 40px; }
.dash-h2{ display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; margin: 0 0 12px; }
.dash-count{ font-size: 12px; font-weight: 600; color: var(--muted); background: var(--sunken); border-radius: 999px; padding: 2px 8px; }

.dash-list{ overflow: hidden; }
.dash-row{ display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.dash-row:first-child{ border-top: 0; }
a.dash-row:hover{ background: var(--sunken); }
.dash-row-main{ display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.dash-row-title{ font-size: 14.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-row-sub{ font-size: 12.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-row-progress{ display: flex; align-items: center; gap: 10px; flex: 0 0 180px; }
.dash-row-progress .dash-bar{ flex: 1; }
.dash-row-pct{ font-size: 12.5px; color: var(--muted); min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.dash-row-end{ color: var(--faint); flex-shrink: 0; }
.dash-cert{ flex-shrink: 0; font-size: 13px; font-weight: 600; color: var(--accent-ink); text-decoration: none; padding: 6px 10px; border-radius: 8px; }
.dash-cert:hover{ background: var(--sunken); }
.dash-empty{ margin: 0; padding: 18px; font-size: 14px; color: var(--faint); }

.dash-icon-tile{ width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--sunken); color: var(--muted); border: 1px solid var(--line); }
.dash-icon-tile svg{ width: 18px; height: 18px; }
.dash-icon-tile.small{ width: 30px; height: 30px; border-radius: 9px; }
.dash-icon-tile.small svg{ width: 16px; height: 16px; }

.dash-activity{ display: flex; align-items: center; gap: 28px; padding: 22px 24px; }
.dash-heat-wrap{ flex: 1; min-width: 0; overflow-x: auto; }
.dash-heat{ --gap: 3px; width: 100%; min-width: calc(var(--cols) * 13px); }
.dash-heat-months{ display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: var(--gap); height: 18px;
  font-size: 11px; color: var(--faint); }
.dash-heat-months span{ white-space: nowrap; }
.dash-heat .heatmap{ display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, auto); grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--gap); }
.dash-heat .heatmap i{ width: 100%; height: auto; aspect-ratio: 1; max-width: 16px; }
.heatmap i, .heatmap-legend i{ display: block; width: 11px; height: 11px; border-radius: 3px; background: var(--sunken); }
html.dark .heatmap i[data-l="0"], html.dark .heatmap-legend i[data-l="0"]{ background: #24282e; }
.heatmap i[data-l="1"], .heatmap-legend i[data-l="1"]{ background: color-mix(in srgb, var(--accent) 30%, var(--sunken)); }
.heatmap i[data-l="2"], .heatmap-legend i[data-l="2"]{ background: color-mix(in srgb, var(--accent) 62%, var(--sunken)); }
.heatmap i[data-l="3"], .heatmap-legend i[data-l="3"]{ background: var(--accent); }
.dash-facts{ display: flex; flex-direction: column; gap: 14px; flex: 0 0 auto; padding-left: 28px; border-left: 1px solid var(--line); }
.dash-fact{ display: flex; align-items: baseline; gap: 8px; }
.dash-fact strong{ font-size: 20px; font-weight: 700; color: var(--ink); min-width: 34px; font-variant-numeric: tabular-nums; }
.dash-fact span{ font-size: 13px; color: var(--faint); }
.heatmap-legend{ display: flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--faint); }
.heatmap-legend span:first-child{ margin-right: 4px; } .heatmap-legend span:last-child{ margin-left: 4px; }

.dash-two-col{ display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; }

@media (max-width: 900px){
  .dash-top{ grid-template-columns: 1fr; }
  .dash-activity{ flex-direction: column; align-items: stretch; gap: 18px; }
  .dash-facts{ flex-direction: row; flex-wrap: wrap; gap: 10px 22px; padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .dash-two-col{ grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px){
  .dash-main{ padding-top: 28px; }
  .dash-main h1{ font-size: 30px; }
  .dash-resume{ padding: 20px; }
  .dash-resume-lesson{ font-size: 21px; }
  .dash-cta{ align-self: stretch; justify-content: center; }
  .dash-stat{ padding: 16px 18px; }
  .dash-stat-value{ font-size: 24px; }
  .dash-row{ padding: 13px 14px; gap: 12px; }
  .dash-row-progress{ flex-basis: 64px; }
  .dash-row-progress .dash-bar{ display: none; }
}

/* ============ Calm home (index.html) ============
 * Fewer things per card: a small icon, the title and one meta line. Learning paths are
 * compact rows, category chips sit on one scrolling line, and filters share the heading. */
.hub-hero{ padding: 56px 0 40px; }
.hub-main .hub-hero h1{ font-size: 52px; }
@media (max-width: 640px){ .hub-hero{ padding: 32px 0 28px; } .hub-main .hub-hero h1{ font-size: 2.1rem; } }

.home-head{ display: flex; align-items: baseline; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; margin: 0 0 14px; }
.home-head h2{ display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; margin: 0; }
.home-head-note{ font-size: 13.5px; color: var(--faint); }

.hub-paths{ margin-top: 40px; }
.lp-grid{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lp-card{ display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); color: inherit; text-decoration: none; transition: border-color .15s; }
.lp-card:hover{ border-color: color-mix(in srgb, var(--hue, var(--ink)) 55%, var(--line)); }
.lp-icon{ width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.lp-icon svg{ width: 19px; height: 19px; }
.lp-main{ display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.lp-title{ font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-meta{ font-size: 12.5px; color: var(--faint); }
.lp-bar{ margin-top: 5px; }
.lp-arrow{ color: var(--faint); flex-shrink: 0; transition: transform .15s, color .15s; }
.lp-card:hover .lp-arrow{ color: var(--ink); transform: translateX(2px); }
.lp-icon[data-cat]{
  background-color: color-mix(in srgb, var(--hue) var(--hue-tile), var(--panel));
  color: color-mix(in srgb, var(--hue) var(--hue-text-mix), #fff);
  border-color: color-mix(in srgb, var(--hue) 22%, var(--line));
}

.catalog-filters{ padding: 48px 0 18px; }
.catalog-count{ font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--sunken); border-radius: 999px; padding: 2px 9px; }
.catalog-head{ align-items: center; }
.chip-scroll{ display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0;
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.chip-scroll::-webkit-scrollbar{ display: none; }
.chip-scroll .chip{ flex-shrink: 0; padding: 7px 14px; font-size: 13.5px; white-space: nowrap; }
@media (min-width: 1200px){ .chip-scroll{ -webkit-mask-image: none; mask-image: none; flex-wrap: wrap; } }

#catalogGrid{ grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
#catalogGrid .course-card{ flex-direction: column; align-items: stretch; gap: 10px; padding: 18px; border-radius: 12px; }
#catalogGrid .course-card.started{ border-color: var(--line); }
.cc-head{ display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cc-icon{ width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line);
  background: var(--sunken); color: var(--muted); }
.cc-icon svg{ width: 17px; height: 17px; }
.cc-icon[data-cat]{
  background-color: color-mix(in srgb, var(--hue) var(--hue-tile), var(--panel));
  color: color-mix(in srgb, var(--hue) var(--hue-text-mix), #fff);
  border-color: color-mix(in srgb, var(--hue) 22%, var(--line));
}
.cc-step{ font-size: 14px; font-weight: 700; }
.cc-status{ font-size: 12px; font-weight: 600; color: var(--faint); }
.cc-status.new{ color: var(--accent-ink); }
.cc-status.done{ color: #2e8a55; }
html.dark .cc-status.done{ color: #6cc492; }
#catalogGrid .course-card .title{ font-size: 15.5px; font-weight: 600; line-height: 1.35; color: var(--ink); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-meta{ display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font-size: 12.5px; color: var(--faint); }
.cc-meta > span + span::before{ content: "·"; margin: 0 7px; color: var(--line); }
html.dark .cc-meta > span + span::before{ color: var(--faint); }
.cc-cat{ font-weight: 600; color: color-mix(in srgb, var(--hue, var(--muted)) var(--hue-text-mix), #fff); }
.cc-progress{ margin-top: auto; padding-top: 4px; display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cc-progress .cc-bar{ flex: 1; }
.cc-bar{ display: block; height: 5px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.cc-bar > span{ display: block; height: 100%; border-radius: 999px; background: var(--hue, var(--accent)); }

@media (max-width: 1000px){ .lp-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px){
  .hub-paths{ margin-top: 28px; }
  .lp-grid{ display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 -22px; padding: 0 22px 4px; scroll-padding: 0 22px; }
  .lp-grid::-webkit-scrollbar{ display: none; }
  .lp-card{ flex: 0 0 78%; scroll-snap-align: start; padding: 12px 14px; }
  .home-head-note{ font-size: 12.5px; }
  .catalog-filters{ padding-top: 36px; }
  .catalog-head .filter-controls{ width: 100%; flex-wrap: nowrap; gap: 10px; }
  .catalog-head .filter-controls label{ flex: 1; min-width: 0; }
  .catalog-head .filter-controls select{ flex: 1; min-width: 0; max-width: none; }
  #catalogGrid .course-card{ padding: 14px 16px; }
}

/* ============ Resource pages: MCP config generator, cheat sheets, newsletter ============ */
.visually-hidden{ position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.gen-page{ max-width: 1100px; }
.gen-lead{ color: var(--muted); font-size: 1.05rem; line-height: 1.6; margin: 0 0 26px; max-width: 64ch; }
.gen-layout{ display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 40px; }
.gen-controls{ background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; position: sticky; top: calc(var(--topbar-h) + 16px); }
.gen-label{ display: block; font-size: 13px; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.gen-controls .gen-label + .gen-select{ margin-bottom: 18px; }
.gen-select, .gen-variant{ width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.gen-servers{ display: flex; flex-direction: column; gap: 8px; }
.gen-server{ border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.gen-server.on{ border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.gen-server-head{ display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.gen-server-head input{ width: 16px; height: 16px; accent-color: var(--accent); }
.gen-server-body{ display: none; flex-direction: column; gap: 7px; margin: 10px 0 2px 25px; }
.gen-server.on .gen-server-body{ display: flex; }
.gen-variant-label{ font-size: 12.5px; color: var(--faint); }
.gen-opt{ display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.gen-opt input[type="checkbox"]{ accent-color: var(--accent); }
.gen-opt-text{ flex-direction: column; align-items: stretch; gap: 4px; }
.gen-opt-text input{ font: inherit; font-family: var(--mono); font-size: 13px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.gen-result .b-code{ margin-bottom: 14px; }
.gen-result .b-code pre{ white-space: pre-wrap; overflow-wrap: anywhere; }
.gen-where{ font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.gen-notes{ margin: 0 0 14px; padding-left: 18px; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.gen-notes li{ margin: 4px 0; }
.gen-guides{ font-size: 13.5px; color: var(--faint); margin: 0; line-height: 1.8; }
.gen-guides a, .gen-page .b-p a, .cs-page .b-p a, .cs-page td a{ color: var(--accent-ink); }
.gen-empty{ color: var(--faint); padding: 30px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; }
@media (max-width: 860px){ .gen-layout{ grid-template-columns: minmax(0, 1fr); } .gen-controls{ position: static; } }

.cs-page{ max-width: 1100px; }
.cs-lead{ color: var(--muted); font-size: 1.05rem; line-height: 1.6; margin: 0 0 10px; max-width: 70ch; }
.cs-meta{ font-size: 13px; color: var(--faint); margin: 0 0 24px; }
.cs-page .b-table td, .cs-page .b-table th{ vertical-align: top; }
.cs-page .b-table td code{ white-space: nowrap; }
.cs-jump{ display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.cs-jump a{ font-size: 13px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); text-decoration: none; background: var(--panel); }
.cs-jump a:hover{ color: var(--ink); border-color: var(--ink); }
.cs-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; margin: 10px 0 30px; }
.cs-card{ display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: inherit; text-decoration: none; }
.cs-card:hover{ border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.cs-card h2{ font-size: 16px; margin: 0; }
.cs-card p{ font-size: 13.5px; color: var(--muted); margin: 0; line-height: 1.5; }
.cs-card span{ font-size: 12.5px; color: var(--accent-ink); font-weight: 600; margin-top: auto; }
@media print{ .topbar, .app-footer, .newsletter-slot, .cs-jump{ display: none !important; } .cs-page .b-table{ font-size: 11px; } }

.newsletter-slot:empty{ display: none; }
.newsletter{ display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; margin: 40px 0 10px; padding: 22px 24px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.newsletter-copy{ flex: 1 1 280px; }
.newsletter h2{ font-size: 17px; margin: 0 0 4px; }
.newsletter p{ margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.newsletter-form{ display: flex; gap: 8px; flex: 1 1 320px; }
.newsletter-form input{ flex: 1; min-width: 0; font: inherit; font-size: 14.5px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.newsletter-form button{ font: inherit; font-size: 14.5px; font-weight: 600; color: var(--bg); background: var(--ink); border: 0; border-radius: 8px; padding: 10px 18px; cursor: pointer; }
.newsletter-form button:hover{ opacity: .9; }
.newsletter-done{ flex-basis: 100%; font-weight: 600; color: var(--ink) !important; }

/* footer: brand, browse, free tools */
@media (min-width: 721px){ .footer-inner{ grid-template-columns: 1.4fr 1.4fr 1.1fr; } }

/* home: free tools strip */
.home-tools{ margin-top: 40px; }
.home-tools-grid{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.home-tool{ display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: inherit; text-decoration: none; }
.home-tool:hover{ border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.home-tool-icon{ width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--sunken); color: var(--muted); border: 1px solid var(--line); }
.home-tool-icon svg{ width: 19px; height: 19px; }
.home-tool-main{ display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.home-tool-title{ font-size: 15px; font-weight: 600; color: var(--ink); }
.home-tool-meta{ font-size: 12.5px; color: var(--faint); }
@media (max-width: 1000px){ .home-tools-grid{ grid-template-columns: minmax(0, 1fr); gap: 8px; } }
