/* ==========================================================================
   Taghra — Design System
   A light, friendly, beginner-first learning platform for web security.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Surfaces */
  --bg:            #f5f8fd;
  --bg-2:          #eef3fb;
  --surface:       #ffffff;
  --surface-2:     #f7fafe;
  --surface-3:     #eef3fb;
  --line:          #e6ecf5;
  --line-strong:   #d7deea;

  /* Brand */
  --brand:         #1770ff;
  --brand-2:       #4a90ff;
  --brand-ink:     #0b52d6;
  --brand-soft:    #e9f1ff;
  --brand-soft-2:  #dbe8ff;

  /* Text */
  --ink:           #0f1b34;   /* headings */
  --text:          #1d2942;
  --text-2:        #55617a;
  --text-3:        #7d8aa3;
  --text-faint:    #a3adc2;

  /* Status */
  --green:         #10b981;
  --green-ink:     #0f9d76;
  --green-soft:    #e6f8f1;
  --amber:         #f59315;
  --amber-ink:     #d97e08;
  --amber-soft:    #fef3e2;
  --red:           #f0503a;
  --red-ink:       #e23c26;
  --red-soft:      #feece9;
  --purple:        #7c5cff;
  --purple-ink:    #6a45f5;
  --purple-soft:   #efeaff;

  /* Shape */
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 18px;
  --r-xl: 26px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 52, 0.05);
  --shadow:    0 2px 6px rgba(15, 27, 52, 0.05), 0 12px 28px -16px rgba(15, 27, 52, 0.16);
  --shadow-lg: 0 8px 20px -8px rgba(15, 27, 52, 0.10), 0 30px 60px -28px rgba(15, 27, 52, 0.22);
  --shadow-brand: 0 10px 24px -10px rgba(23, 112, 255, 0.5);

  /* Layout */
  --nav-h: 74px;
  --max:   1200px;

  --font:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 { font-family: var(--display); color: var(--ink); }

::selection { background: var(--brand-soft-2); color: var(--brand-ink); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid rgba(23, 112, 255, 0.4); outline-offset: 2px; border-radius: 8px; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.section { padding: 60px 0; }
.section-tight { padding: 34px 0; }
.stack > * + * { margin-top: 16px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.center { text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--brand-ink); background: var(--brand-soft);
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--brand-soft-2);
}
.eyebrow svg { width: 15px; height: 15px; flex: none; }
/* Sensible default size for inline stroke icons inside compact text elements */
.chip svg, .mi-status svg, .locked-note svg, .qt-label svg, .pg-dir svg { width: 15px; height: 15px; flex: none; }
.encourage span svg { width: 16px; height: 16px; }

.section-head { margin-bottom: 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(24px, 3vw, 33px); font-weight: 800; letter-spacing: -0.02em; }
.section-head p { color: var(--text-2); margin-top: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 700; font-size: 15px; padding: 12px 20px; border-radius: 12px;
  border: 1.5px solid transparent; transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-ink); transform: translateY(-2px); box-shadow: 0 14px 28px -10px rgba(23,112,255,0.55); }
.btn-ghost { background: var(--surface); color: var(--brand-ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--brand-soft); border-color: var(--brand-soft-2); transform: translateY(-2px); }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-soft-2); }
.btn-soft:hover { background: var(--brand-soft-2); }
.btn-lg { padding: 15px 26px; font-size: 16px; border-radius: 13px; }
.btn-sm { padding: 9px 15px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-block { width: 100%; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line);
}
.badge-beginner { color: var(--green-ink); background: var(--green-soft); border-color: rgba(16,185,129,0.2); }
.badge-intermediate { color: var(--brand-ink); background: var(--brand-soft); border-color: var(--brand-soft-2); }
.badge-advanced { color: var(--red-ink); background: var(--red-soft); border-color: rgba(240,80,58,0.2); }
.badge-neutral { color: var(--text-2); background: var(--surface-3); border-color: var(--line); }
.badge-done { color: var(--green-ink); background: var(--green-soft); border-color: rgba(16,185,129,0.2); }

.chip { display: inline-flex; align-items:center; gap:6px; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line); padding: 5px 11px; border-radius: 9px; }
.chip svg { color: var(--brand); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card-hover { transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.card-hover:hover { transform: translateY(-4px); border-color: var(--brand-soft-2); box-shadow: var(--shadow-lg); }

/* Flat colorful icon tile (used on path/lab/stat cards) */
/* Icons sit on their own — no coloured tile behind them — so they stand out. */
.icon-tile { width: 52px; height: 52px; display: grid; place-items: center; flex: none; background: transparent; }
.icon-tile svg { width: 78%; height: 78%; }
.icon-tile .tile-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.icon-tile.tile-blue, .icon-tile.tile-green, .icon-tile.tile-amber,
.icon-tile.tile-red, .icon-tile.tile-purple { background: transparent; }

/* ==========================================================================
   HEADER / NAV
   ========================================================================== */
.nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { height: 100%; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-logo { width: 40px; height: 40px; display: grid; place-items: center; flex: none; }
.brand-logo svg { width: 100%; height: 100%; }
.brand-text b { font-family: var(--display); font-size: 19px; font-weight: 800; letter-spacing: 0.01em; color: var(--ink); display: block; line-height: 1.05; }
.brand-text span { font-size: 10.5px; color: var(--text-3); letter-spacing: 0.04em; font-weight: 600; }

.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.nav-link {
  position: relative; font-size: 14.5px; font-weight: 600; color: var(--text-2);
  padding: 9px 13px; border-radius: 10px; transition: color .15s ease, background .15s ease;
}
.nav-link:hover { color: var(--ink); background: var(--surface-3); }
.nav-link.active { color: var(--brand-ink); background: var(--brand-soft); }
.nav-spacer { flex: 1; }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
  transition: color .15s, background .15s, border-color .15s;
}
.icon-btn:hover { color: var(--brand-ink); background: var(--brand-soft); border-color: var(--brand-soft-2); }
.icon-btn svg { width: 19px; height: 19px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
  display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff;
  border: 2px solid #fff; box-shadow: var(--shadow-sm);
}
.nav-toggle { display: none; }

/* Mobile nav */
.mobile-menu { display: none; }

@media (max-width: 940px) {
  .nav-links { display: none; }
  .nav-toggle { display: grid; }
  .nav-search-inline { display: none; }
  .mobile-menu {
    display: block; position: fixed; inset: var(--nav-h) 0 0 0; z-index: 99;
    background: rgba(255,255,255,0.98); backdrop-filter: blur(10px);
    padding: 20px 24px; transform: translateY(-6px); opacity: 0; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease; overflow-y: auto;
  }
  .mobile-menu.open { opacity: 1; transform: none; pointer-events: auto; }
  .mobile-menu a { display: block; padding: 15px 8px; font-size: 17px; font-weight: 700;
    color: var(--ink); border-bottom: 1px solid var(--line); }
  .mobile-menu a.active { color: var(--brand-ink); }
}

/* ==========================================================================
   HOME / HERO
   ========================================================================== */
.hero { position: relative; padding: 52px 0 34px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background:
    radial-gradient(680px 380px at 82% 4%, rgba(23,112,255,0.09), transparent 62%),
    radial-gradient(520px 340px at 4% 30%, rgba(124,92,255,0.05), transparent 60%);
}
.hero-grid { display: grid; grid-template-columns: 1.02fr 0.98fr; gap: 44px; align-items: center; }
.hero h1 {
  font-size: clamp(38px, 5.2vw, 60px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.04;
  margin: 20px 0 0; color: var(--ink);
}
.hero h1 .grad { color: var(--brand); }
.hero-sub { font-size: clamp(16px, 1.55vw, 18.5px); color: var(--text-2); max-width: 40ch; margin-top: 20px; }
.hero-cta { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero-feats { display: flex; gap: 12px 24px; margin-top: 30px; flex-wrap: wrap; }
.hero-feat { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.hero-feat svg { width: 20px; height: 20px; flex: none; }

/* Hero illustration */
.hero-art { position: relative; width: 100%; }
.hero-art svg { width: 100%; height: auto; display: block; overflow: visible; }
.hero-art .hero-img { width: 100%; height: auto; display: block; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 26px; }
  .hero-art { order: -1; max-width: 460px; margin: 0 auto; }
  .hero-sub { max-width: none; }
}

/* Path / lab horizontal scroll rows (used when >3 items) */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 1fr); gap: 20px;
  overflow-x: auto; padding: 4px 4px 14px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.rail > * { scroll-snap-align: start; }
.rail::-webkit-scrollbar { height: 8px; }
.rail::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 940px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-3 { grid-template-columns: 1fr; } }
@media (min-width: 1000px) { .grid-paths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; } .grid-paths.rail { grid-auto-flow: row; overflow: visible; } }

/* Learning-path listing: four steps side by side on wide screens, 2x2 below. */
.grid-paths-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1180px) { .grid-paths-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-paths-4 { grid-template-columns: 1fr; } }

/* Path card */
.path-card { display: flex; flex-direction: column; min-height: 100%; position: relative; overflow: hidden; }
.path-card .pc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; min-height: 52px; }
.path-card .pc-badges { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.path-card h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 8px; color: var(--ink); }
.path-card .pc-desc { color: var(--text-2); font-size: 14px; flex: 1; }
.path-card .pc-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); margin: 16px 0 14px; font-weight: 600; }
.path-card .pc-meta .dot { color: var(--line-strong); }
.path-card .pc-meta b { color: var(--text); }
.path-soon { background: linear-gradient(180deg, var(--surface), var(--surface-2)); }

/* Progress bar */
.progress { --v: 0%; }
.progress-track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress-fill { height: 100%; width: var(--v); border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.progress-fill.done { background: linear-gradient(90deg, var(--green-ink), var(--green)); }
.progress-row { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; font-size: 12.5px; color: var(--text-3); }
.progress-row .pct { font-weight: 800; color: var(--ink); }

/* Coming-soon note on a path card */
.soon-note { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-3);
  background: var(--surface-3); border: 1px solid var(--line); padding: 9px 13px; border-radius: 10px; margin-top: 4px; }
.soon-note svg { width: 15px; height: 15px; color: var(--text-3); }

/* Lab card */
.lab-card h3 { font-size: 18px; font-weight: 800; margin: 14px 0 8px; color: var(--ink); }
.lab-card .lc-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }

/* Stats strip */
.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 24px 20px; box-shadow: var(--shadow-sm); }
.stat { display: flex; align-items: center; gap: 14px; justify-content: center; }
.stat .icon-tile { width: 48px; height: 48px; }
.stat .icon-tile svg { width: 78%; height: 78%; }
.stat .num { font-family: var(--display); font-size: 25px; font-weight: 800; line-height: 1; color: var(--ink); letter-spacing: -0.02em; }
.stat .lbl { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
@media (max-width: 720px){ .stats-strip { grid-template-columns: repeat(2,1fr); gap: 22px 8px; } }

/* "Real-world by design" band */
.why { display: grid; grid-template-columns: 1.08fr 1fr; gap: 34px; align-items: center; padding: 34px 36px;
  background: linear-gradient(120deg, var(--brand-soft), #eef4ff 58%, #eafaf3); border-color: var(--brand-soft-2); }
.why-head h2 { font-size: clamp(23px, 2.6vw, 31px); font-weight: 800; letter-spacing: -0.02em; margin: 12px 0 12px; }
.why-head p { color: var(--text-2); font-size: 15.5px; max-width: 52ch; }
.why-head p + p { margin-top: 12px; }
.why-points { display: flex; flex-direction: column; gap: 12px; }
.why-point { display: flex; gap: 14px; align-items: flex-start; background: rgba(255,255,255,0.72);
  border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.why-point .icon-tile { width: 44px; height: 44px; }
.why-point .icon-tile svg { width: 78%; height: 78%; }
.why-point h4 { font-size: 15px; font-weight: 800; margin-bottom: 2px; color: var(--ink); }
.why-point p { font-size: 13.5px; color: var(--text-2); margin: 0; }
@media (max-width: 820px){ .why { grid-template-columns: 1fr; gap: 24px; padding: 26px; } }

/* ==========================================================================
   PATH DETAIL PAGE
   ========================================================================== */
.path-hero { padding: 40px 0 8px; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); margin-bottom: 18px; flex-wrap: wrap; font-weight: 500; }
.breadcrumbs a:hover { color: var(--brand-ink); }
.breadcrumbs svg { width: 14px; height: 14px; opacity: .5; }

.path-hero-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; align-items: start; }
.path-hero h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; letter-spacing: -0.025em; margin: 14px 0; color: var(--ink); }
.path-hero .lead { font-size: 17px; color: var(--text-2); max-width: 56ch; }
.path-meta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

.progress-card { position: sticky; top: calc(var(--nav-h) + 20px); }
.progress-card .big-pct { font-family: var(--display); font-size: 46px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--ink); }
.progress-card .big-pct span { font-size: 18px; color: var(--text-3); font-weight: 700; }
.encourage { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 12px 14px;
  background: var(--brand-soft); border: 1px solid var(--brand-soft-2); border-radius: 12px;
  font-size: 13.5px; color: var(--brand-ink); font-weight: 600; }
.encourage svg { width: 18px; height: 18px; color: var(--brand); flex: none; }
.encourage.win { background: var(--green-soft); border-color: rgba(16,185,129,0.22); color: var(--green-ink); }
.encourage.win svg { color: var(--green); }

/* Module list */
.module-list { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.module-item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 18px 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm);
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.module-item:hover { border-color: var(--brand-soft-2); transform: translateX(3px); box-shadow: var(--shadow); }
.mi-index {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none;
  font-family: var(--display); font-weight: 800; font-size: 16px; background: var(--surface-3); border: 1px solid var(--line);
  color: var(--text-3);
}
.mi-index.done { background: var(--green-soft); border-color: rgba(16,185,129,0.28); color: var(--green-ink); }
.mi-index.current { background: var(--brand-soft); border-color: var(--brand-soft-2); color: var(--brand-ink); }
.mi-index svg { width: 20px; height: 20px; }
.mi-body h4 { font-size: 16px; font-weight: 700; color: var(--ink); }
.mi-body p { font-size: 13.5px; color: var(--text-3); margin-top: 2px; }
.mi-body .mi-tags { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.mi-right { display: flex; align-items: center; gap: 14px; }
.mi-status { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.mi-status.done { color: var(--green-ink); }
.mi-status.locked { color: var(--text-faint); }
.mi-cta { color: var(--text-faint); }
.mi-cta svg { width: 20px; height: 20px; }
@media (max-width: 760px) {
  .path-hero-grid { grid-template-columns: 1fr; }
  .progress-card { position: static; }
  .module-item { grid-template-columns: auto 1fr; }
  .mi-right { grid-column: 1 / -1; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
}

/* Assessment banner */
.assessment-banner {
  position: relative; overflow: hidden; margin-top: 40px;
  background: linear-gradient(115deg, #f2eeff, #eef4ff 55%, #eafaf3);
  border: 1px solid var(--purple-soft); border-radius: var(--r-xl); padding: 40px;
}
.assessment-banner .ab-tag { color: var(--purple-ink); background: #fff; border-color: var(--purple-soft); }
.assessment-banner h2 { font-size: clamp(24px, 3.2vw, 33px); font-weight: 800; letter-spacing: -0.02em; margin: 14px 0 10px; color: var(--ink); }
.assessment-banner p { color: var(--text-2); max-width: 62ch; }
.assessment-banner .ab-icon { position: absolute; right: 26px; top: 50%; transform: translateY(-50%);
  width: 132px; height: 132px; opacity: .9; }
.assessment-banner .locked-note { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--text-3); font-weight: 600; }
.assessment-banner.disabled { opacity: 1; }
@media (max-width: 720px){ .assessment-banner .ab-icon { display: none; } }

/* ==========================================================================
   MODULE (LESSON) PAGE
   ========================================================================== */
.lesson-layout { display: grid; grid-template-columns: 288px 1fr; gap: 44px; align-items: start; padding-top: 26px; }

.lesson-sidebar { position: sticky; top: calc(var(--nav-h) + 20px); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.lesson-sidebar .ls-head { font-size: 11.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-3); margin-bottom: 5px; }
.lesson-sidebar .ls-title { font-family: var(--display); font-size: 16px; font-weight: 800; margin-bottom: 14px; color: var(--ink); }
.ls-progress { margin-bottom: 16px; }
.ls-list { display: flex; flex-direction: column; gap: 2px; }
.ls-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; font-size: 13.5px;
  color: var(--text-2); font-weight: 500; transition: background .15s, color .15s; }
.ls-item:hover { background: var(--surface-3); color: var(--ink); }
.ls-item.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }
.ls-mark { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); font-size: 11px; font-weight: 700; color: var(--text-3); background: var(--surface); }
.ls-mark.done { background: var(--green); border-color: var(--green); color: #fff; }
.ls-mark svg { width: 12px; height: 12px; }
.ls-item.active .ls-mark { border-color: var(--brand); color: var(--brand); }

.lesson-content { min-width: 0; max-width: 760px; }
.lesson-head h1 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 800; letter-spacing: -0.025em; color: var(--ink); }
.lesson-head .lead { font-size: 17.5px; color: var(--text-2); margin-top: 12px; }
.lesson-head .lh-meta { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

.objectives { margin: 26px 0; padding: 20px 22px; border-radius: var(--r); background: var(--brand-soft); border: 1px solid var(--brand-soft-2); }
.objectives h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--brand-ink); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; font-weight: 800; }
.objectives h3 svg { width: 16px; height: 16px; color: var(--brand); }
.objectives li { display: flex; gap: 10px; padding: 5px 0; color: var(--text); font-size: 14.5px; }
.objectives li svg { width: 18px; height: 18px; color: var(--brand); flex: none; margin-top: 2px; }

/* Prose */
.prose { font-size: 16px; }
.prose h2 { font-size: 25px; font-weight: 800; letter-spacing: -0.015em; margin: 40px 0 14px; scroll-margin-top: 96px; color: var(--ink); }
.prose h3 { font-size: 19px; font-weight: 700; margin: 28px 0 10px; color: var(--ink); }
.prose p { color: var(--text-2); margin: 14px 0; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose code:not(pre code) { font-family: var(--mono); font-size: 13.5px; background: var(--brand-soft);
  color: var(--brand-ink); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--brand-soft-2); }
.prose a.link { color: var(--brand-ink); border-bottom: 1px solid var(--brand-soft-2); }
.prose ul.bullets { margin: 14px 0; display: flex; flex-direction: column; gap: 9px; }
.prose ul.bullets li { position: relative; padding-left: 24px; color: var(--text-2); }
.prose ul.bullets li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 8px; height: 8px;
  border-radius: 3px; background: var(--brand); transform: rotate(45deg); }

/* Code block — stays dark as a friendly "terminal" accent */
.codeblock { margin: 22px 0; border-radius: var(--r); overflow: hidden; border: 1px solid #1c2740;
  background: #0f1a30; box-shadow: var(--shadow); }
.codeblock .cb-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.07); }
.codeblock .cb-dots { display: flex; gap: 6px; }
.codeblock .cb-dots i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.codeblock .cb-label { font-family: var(--mono); font-size: 12px; color: #8593b3; margin-left: 4px; }
.codeblock .cb-tag { margin-left: auto; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 6px; }
.cb-tag.req { color: #7aa7ff; background: rgba(23,112,255,0.16); }
.cb-tag.res { color: #4fd6a0; background: rgba(16,185,129,0.16); }
.codeblock pre { margin: 0; padding: 16px 18px; overflow-x: auto; }
.codeblock code { font-family: var(--mono); font-size: 13px; line-height: 1.65; color: #cdd6ea; white-space: pre; }
.codeblock .k { color: #7aa7ff; } /* method/keyword */
.codeblock .h { color: #9ad1a4; } /* header name */
.codeblock .s { color: #e6b980; } /* string/value */
.codeblock .c { color: #62708f; font-style: italic; } /* comment */
.codeblock .u { color: #f0a3c0; } /* url/attack */
.copy-btn { margin-left: 10px; background: transparent; border: 0; color: #8593b3; display: grid; place-items: center; }
.copy-btn:hover { color: #fff; }
.copy-btn svg { width: 15px; height: 15px; }

/* Callout boxes */
.callout { margin: 22px 0; padding: 16px 18px 16px 16px; border-radius: var(--r); display: flex; gap: 14px;
  border: 1px solid var(--line); background: var(--surface); }
.callout .ic { width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center; }
.callout .ic svg { width: 19px; height: 19px; }
.callout .co-body { min-width: 0; }
.callout .co-title { font-weight: 800; font-size: 14.5px; margin-bottom: 3px; font-family: var(--display); }
.callout .co-body p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.callout-tip { border-color: rgba(16,185,129,0.28); background: var(--green-soft); }
.callout-tip .ic { background: #fff; color: var(--green); }
.callout-tip .co-title { color: var(--green-ink); }
.callout-warning { border-color: rgba(245,147,21,0.3); background: var(--amber-soft); }
.callout-warning .ic { background: #fff; color: var(--amber); }
.callout-warning .co-title { color: var(--amber-ink); }
.callout-note { border-color: var(--brand-soft-2); background: var(--brand-soft); }
.callout-note .ic { background: #fff; color: var(--brand); }
.callout-note .co-title { color: var(--brand-ink); }

/* Figure / screenshot with lightbox */
figure.shot { margin: 26px 0; }
figure.shot .shot-frame { position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-strong);
  background: var(--surface); cursor: zoom-in; transition: border-color .2s; box-shadow: var(--shadow-sm); }
figure.shot .shot-frame:hover { border-color: var(--brand); }
figure.shot .shot-frame:hover .zoom-hint { opacity: 1; }
.zoom-hint { position: absolute; right: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,0.92);
  border: 1px solid var(--line-strong); color: var(--text-2); opacity: 0; transition: opacity .2s; backdrop-filter: blur(4px); }
.zoom-hint svg { width: 14px; height: 14px; }
figure.shot figcaption { font-size: 13px; color: var(--text-3); margin-top: 10px; text-align: center; }
/* placeholder screenshot */
.shot-placeholder { aspect-ratio: 16 / 9; display: grid; place-items: center;
  background:
    repeating-linear-gradient(45deg, rgba(23,112,255,0.03) 0 12px, transparent 12px 24px),
    var(--surface-2);
  color: var(--text-faint); }
.shot-placeholder .ph-inner { text-align: center; }
.shot-placeholder svg { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--text-faint); }
.shot-placeholder .ph-t { font-weight: 700; color: var(--text-3); font-size: 14px; }
.shot-placeholder .ph-s { font-size: 12px; margin-top: 4px; font-family: var(--mono); }

/* Checklist */
.checklist { margin: 24px 0; padding: 20px 22px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.checklist h3 { font-size: 16px; font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; gap: 9px; color: var(--ink); }
.checklist h3 svg { width: 19px; height: 19px; color: var(--brand); }
.checklist .cl-item { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; cursor: pointer; user-select: none; }
.checklist .cl-box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-strong); flex: none;
  display: grid; place-items: center; margin-top: 1px; transition: background .15s, border-color .15s; }
.checklist .cl-box svg { width: 13px; height: 13px; color: #fff; opacity: 0; }
.checklist .cl-item.checked .cl-box { background: var(--green); border-color: var(--green); }
.checklist .cl-item.checked .cl-box svg { opacity: 1; }
.checklist .cl-item.checked .cl-text { color: var(--text-3); text-decoration: line-through; }
.checklist .cl-text { color: var(--text); font-size: 14.5px; }

/* Key takeaway */
.takeaway { margin: 28px 0; padding: 22px 24px; border-radius: var(--r-lg);
  background: linear-gradient(120deg, var(--brand-soft), #eef4ff);
  border: 1px solid var(--brand-soft-2); }
.takeaway h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--brand-ink);
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-weight: 800; }
.takeaway h3 svg { width: 17px; height: 17px; }
.takeaway p { color: var(--text); font-size: 16px; margin: 0; }
.takeaway ul { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.takeaway ul li { display: flex; gap: 10px; color: var(--text); font-size: 15px; }
.takeaway ul li svg { width: 17px; height: 17px; color: var(--brand); flex: none; margin-top: 3px; }

/* Lesson footer nav + complete */
.lesson-actions { margin: 40px 0 10px; padding: 26px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); text-align: center; box-shadow: var(--shadow-sm); }
.lesson-actions h3 { font-size: 20px; font-weight: 800; color: var(--ink); }
.lesson-actions p { color: var(--text-2); margin: 6px 0 18px; }

.pager { display: flex; justify-content: space-between; gap: 14px; margin: 32px 0 20px; }
.pager a, .pager span { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); flex: 1; max-width: 48%; transition: border-color .18s, transform .18s, box-shadow .18s; box-shadow: var(--shadow-sm); }
.pager a:hover { border-color: var(--brand-soft-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.pager .pg-dir { font-size: 12px; color: var(--text-3); font-weight: 600; }
.pager .pg-title { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.pager .next { flex-direction: row-reverse; text-align: right; margin-left: auto; }
.pager svg { width: 20px; height: 20px; color: var(--text-faint); flex: none; }
.pager .disabled { opacity: .5; }
@media (max-width: 900px) {
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-sidebar { position: static; order: 2; margin-top: 30px; }
}

/* ==========================================================================
   QUIZ
   ========================================================================== */
.quiz { margin-top: 20px; }
.quiz-card { padding: 28px; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.quiz-top .qt-label { font-size: 12px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--brand-ink); }
.quiz-progress-track { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 14px 0 22px; }
.quiz-progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 999px; transition: width .35s; }
.quiz-q { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 20px; line-height: 1.4; color: var(--ink); }
.quiz-options { display: flex; flex-direction: column; gap: 11px; }
.quiz-opt { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; padding: 16px 18px;
  border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 15.5px; font-weight: 500; transition: border-color .15s, background .15s, transform .1s; }
.quiz-opt:not(:disabled):hover { border-color: var(--brand-soft-2); background: var(--brand-soft); transform: translateX(2px); }
.quiz-opt .qo-key { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; background: var(--surface-3); border: 1px solid var(--line); color: var(--text-2); }
.quiz-opt.selected { border-color: var(--brand); background: var(--brand-soft); }
.quiz-opt.correct { border-color: var(--green); background: var(--green-soft); }
.quiz-opt.correct .qo-key { background: var(--green); color: #fff; border-color: var(--green); }
.quiz-opt.wrong { border-color: var(--red); background: var(--red-soft); }
.quiz-opt.wrong .qo-key { background: var(--red); color: #fff; border-color: var(--red); }
.quiz-opt .qo-mark { margin-left: auto; }
.quiz-opt .qo-mark svg { width: 20px; height: 20px; }
.quiz-opt:disabled { cursor: default; }

.quiz-explain { margin-top: 16px; padding: 16px 18px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface-2); animation: fadeUp .3s ease; }
.quiz-explain.ok { border-color: rgba(16,185,129,0.3); background: var(--green-soft); }
.quiz-explain.no { border-color: rgba(240,80,58,0.3); background: var(--red-soft); }
.quiz-explain .qe-head { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 15px; margin-bottom: 6px; font-family: var(--display); }
.quiz-explain .qe-head svg { width: 19px; height: 19px; }
.quiz-explain.ok .qe-head { color: var(--green-ink); }
.quiz-explain.no .qe-head { color: var(--red-ink); }
.quiz-explain p { color: var(--text-2); font-size: 14.5px; margin: 0; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px);} to { opacity:1; transform:none; } }

.quiz-foot { display: flex; justify-content: flex-end; margin-top: 22px; }

/* Quiz result */
.quiz-result { text-align: center; padding: 34px 28px; }
.result-ring { width: 132px; height: 132px; margin: 0 auto 18px; position: relative; }
.result-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.result-ring .track { stroke: var(--surface-3); }
.result-ring .val { stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.result-ring .center { position: absolute; inset: 0; display: grid; place-items: center; }
.result-ring .center .score { font-family: var(--display); font-size: 30px; font-weight: 800; line-height: 1; color: var(--ink); }
.result-ring .center .total { font-size: 13px; color: var(--text-3); }
.quiz-result h3 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.quiz-result .rs-msg { color: var(--text-2); margin: 8px auto 0; max-width: 42ch; }
.quiz-result .rs-actions { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }

/* ==========================================================================
   GENERIC / PLACEHOLDER PAGES
   ========================================================================== */
.page-hero { padding: 52px 0 20px; }
.page-hero h1 { font-size: clamp(30px, 4vw, 46px); font-weight: 800; letter-spacing: -0.025em; margin: 14px 0; color: var(--ink); }
.page-hero p { font-size: 17px; color: var(--text-2); max-width: 60ch; }

.coming-soon { display: grid; place-items: center; text-align: center; padding: 56px 24px; }
.coming-soon .cs-icon { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center;
  background: var(--brand-soft); border: 1px solid var(--brand-soft-2); margin-bottom: 22px; }
.coming-soon .cs-icon svg { width: 42px; height: 42px; }
.coming-soon h2 { font-size: 28px; font-weight: 800; color: var(--ink); }
.coming-soon p { color: var(--text-2); max-width: 48ch; margin: 12px auto 0; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; }
.feature-grid .fc { text-align: left; }
.feature-grid .fc .icon-tile { margin-bottom: 14px; }
.feature-grid .fc h3 { font-size: 17px; font-weight: 800; margin-bottom: 6px; color: var(--ink); }
.feature-grid .fc p { font-size: 14px; color: var(--text-2); }
@media (max-width: 800px){ .feature-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   LIGHTBOX / MODAL
   ========================================================================== */
.lightbox { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 30px;
  background: rgba(15,27,52,0.55); backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .2s; }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img, .lightbox .lb-fake { max-width: 92vw; max-height: 86vh; border-radius: var(--r);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); }
.lightbox .lb-close { position: absolute; top: 22px; right: 26px; background: #fff; }
.lightbox .lb-cap { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; }

.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px;
  background: rgba(15,27,52,0.5); backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal.open { opacity: 1; pointer-events: auto; }
.modal-card { max-width: 480px; width: 100%; text-align: center; padding: 38px 32px; transform: translateY(10px); transition: transform .25s; box-shadow: var(--shadow-lg); }
.modal.open .modal-card { transform: none; }
.modal-card .m-icon { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; margin: 0 auto 20px;
  background: var(--purple-soft); border: 1px solid rgba(124,92,255,0.2); }
.modal-card .m-icon svg { width: 38px; height: 38px; color: var(--purple); }
.modal-card h3 { font-size: 24px; font-weight: 800; color: var(--ink); }
.modal-card p { color: var(--text-2); margin: 10px 0 24px; }
.modal-card .m-sub { font-size: 13px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; margin-bottom: 22px; font-family: var(--mono); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer { border-top: 1px solid var(--line); padding: 48px 0 34px; margin-top: 48px; background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 34px; }
.footer .brand { margin-bottom: 14px; }
.footer .f-about { color: var(--text-3); font-size: 14px; max-width: 34ch; }
.footer h4 { font-size: 12.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-2); margin-bottom: 14px; }
.footer li { margin: 9px 0; }
.footer li a { color: var(--text-3); font-size: 14px; }
.footer li a:hover { color: var(--brand-ink); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--text-faint); font-size: 13px; flex-wrap: wrap; }
@media (max-width: 800px){ .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; } }

/* Toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); z-index: 400;
  background: var(--ink); border: 1px solid var(--ink); border-radius: 12px; padding: 13px 18px;
  display: flex; align-items: center; gap: 11px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; font-size: 14.5px; font-weight: 600; color: #fff; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 20px; height: 20px; color: var(--green); }

/* Utility */
.hide { display: none !important; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

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

/* Fade-in on route change */
.route-fade { animation: routeIn .3s ease; }
@keyframes routeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Gentle float for hero illustration accents */
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes floaty2 { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
.hero-art .float-a { animation: floaty 5s ease-in-out infinite; }
.hero-art .float-b { animation: floaty2 6s ease-in-out infinite; }
