:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #eef4ff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe3ef;
  --brand: #2563eb;
  --brand-2: #06b6d4;
  --ok: #15803d;
  --warn: #b45309;
  --shadow: 0 18px 45px rgba(15, 23, 42, .10);
}

html[data-theme="dark"] {
  --bg: #07111f;
  --surface: #0f1c2e;
  --surface-2: #13243b;
  --text: #e8eef8;
  --muted: #9eb0c6;
  --line: #243951;
  --brand: #60a5fa;
  --brand-2: #22d3ee;
  --shadow: 0 18px 45px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top right, rgba(37,99,235,.10), transparent 28%), var(--bg);
  color: var(--text);
  line-height: 1.65;
}
a { color: inherit; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.logo { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: white; font-weight: 900; background: linear-gradient(135deg, #2563eb, #06b6d4); box-shadow: var(--shadow); }
.nav-links { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.nav-links a { text-decoration: none; color: var(--muted); font-weight: 650; }
.nav-links a:hover { color: var(--brand); }
.icon-btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px; padding: 9px 12px; cursor: pointer; }

.hero { padding: 78px 0 44px; }
.badge { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 12px; color: var(--brand); font-weight: 800; font-size: .86rem; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 5.2rem); line-height: .98; max-width: 900px; letter-spacing: -.055em; margin: 20px 0; }
.hero h1 span { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; color: transparent; }
.hero p { font-size: clamp(1.05rem, 2vw, 1.28rem); max-width: 780px; color: var(--muted); margin: 0 0 26px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; border-radius: 13px; padding: 12px 17px; font-weight: 800; border: 1px solid var(--line); background: var(--surface); }
.btn.primary { border: 0; color: white; background: linear-gradient(135deg, #2563eb, #0891b2); }

.section { padding: 34px 0 64px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin: 0; letter-spacing: -.035em; }
.section-head p { max-width: 650px; color: var(--muted); margin: 0; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); }
.card .num { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); font-weight: 900; margin-bottom: 18px; }
.card h3 { margin: 0 0 8px; font-size: 1.18rem; }
.card p { color: var(--muted); margin: 0 0 16px; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { font-size: .78rem; border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; color: var(--muted); }
.pill.live { color: var(--ok); background: color-mix(in srgb, var(--ok) 8%, transparent); }

.path { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.step { text-align: center; padding: 16px 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.step strong { display: block; color: var(--brand); font-size: 1.1rem; }
.step span { color: var(--muted); font-size: .85rem; }

.lesson-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; padding: 36px 0 70px; }
.sidebar { position: sticky; top: 92px; align-self: start; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.sidebar a { display: block; text-decoration: none; padding: 8px 10px; color: var(--muted); border-radius: 10px; font-size: .93rem; }
.sidebar a:hover { background: var(--surface-2); color: var(--brand); }
.lesson { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(22px, 4vw, 42px); box-shadow: var(--shadow); }
.lesson h1 { font-size: clamp(2rem, 5vw, 3.7rem); line-height: 1.05; letter-spacing: -.045em; margin: 0 0 12px; }
.lesson h2 { margin-top: 36px; letter-spacing: -.025em; }
.lesson p, .lesson li { color: color-mix(in srgb, var(--text) 82%, var(--muted)); }
.code { position: relative; background: #0b1220; color: #dbeafe; border-radius: 16px; padding: 18px; overflow-x: auto; font: 14px/1.6 Consolas, Monaco, monospace; white-space: pre; }
.note { border-left: 4px solid var(--brand); background: var(--surface-2); padding: 14px 16px; border-radius: 10px; margin: 18px 0; }
.checklist { padding-left: 0; list-style: none; }
.checklist li { margin: 8px 0; }
.checklist li::before { content: "✓"; color: var(--ok); font-weight: 900; margin-right: 9px; }

footer { border-top: 1px solid var(--line); color: var(--muted); padding: 30px 0 42px; }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 850px) {
  .grid { grid-template-columns: 1fr; }
  .path { grid-template-columns: 1fr 1fr; }
  .lesson-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .nav-links a { display: none; }
}
