@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --bg: #09090B;
  --surface: #111113;
  --surface-2: #18181B;
  --border: #27272A;
  --border-subtle: #1E1E21;
  --text: #FAFAFA;
  --text-90: rgba(255,255,255,0.92);
  --text-60: rgba(255,255,255,0.6);
  --text-45: rgba(255,255,255,0.45);
  --text-25: rgba(255,255,255,0.25);
  --accent: #3B82F6;
  --accent-dim: rgba(59,130,246,0.15);
  --green: #22C55E;
  --green-dim: rgba(34,197,94,0.12);
  --amber: #F59E0B;
  --amber-dim: rgba(245,158,11,0.12);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.08) transparent; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── Layout ─── */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 60px 32px;
}

/* ─── Navigation ─── */
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-45);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  margin-bottom: 40px;
  transition: color 0.15s;
}
.back:hover { color: var(--text-90); }

/* ─── Header ─── */
.lesson-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 16px;
}

h1 {
  font-weight: 200;
  font-size: 36px;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.subtitle {
  color: var(--text-45);
  font-size: 16px;
  font-weight: 300;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-subtle);
}

/* ─── Sections ─── */
h2 {
  font-weight: 500;
  font-size: 20px;
  margin-top: 48px;
  margin-bottom: 16px;
  color: var(--text-90);
}

h3 {
  font-weight: 500;
  font-size: 16px;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text-90);
}

p {
  color: var(--text-60);
  font-size: 15px;
  font-weight: 300;
  margin-bottom: 16px;
}

/* ─── Code Blocks ─── */
pre {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 20px 24px;
  margin: 16px 0 24px 0;
  overflow-x: auto;
  position: relative;
}

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
}

p code {
  background: var(--surface);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-90);
}

.comment { color: var(--text-25); }

/* ─── Copy Button ─── */
.code-wrap { position: relative; }

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-25);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.copy-btn:hover { color: var(--text-60); background: rgba(255,255,255,0.05); }
.copy-btn.copied { color: var(--green); }
.copy-btn svg { width: 16px; height: 16px; }

/* ─── Tree Diagram ─── */
.tree {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 20px 24px;
  margin: 16px 0 24px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-60);
}
.tree .folder { color: var(--accent); }
.tree .note { color: var(--text-25); }

/* ─── Lists ─── */
ol, ul {
  color: var(--text-60);
  font-size: 15px;
  font-weight: 300;
  padding-left: 20px;
  margin-bottom: 16px;
}
ol li, ul li { margin-bottom: 10px; }
ol li strong, ul li strong { color: var(--text-90); font-weight: 500; }

/* ─── Callout ─── */
.callout {
  border-left: 2px solid var(--accent);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--surface);
  border-radius: 0 8px 8px 0;
}
.callout p {
  color: var(--text-90);
  font-size: 15px;
  font-weight: 300;
  font-style: italic;
  margin-bottom: 0;
}

.callout-amber {
  border-left: 2px solid var(--amber);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--surface);
  border-radius: 0 8px 8px 0;
}
.callout-amber p {
  color: var(--text-90);
  font-size: 15px;
  font-weight: 300;
  font-style: italic;
  margin-bottom: 0;
}

/* ─── Tables ─── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}
th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-90);
  font-weight: 500;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
}
td {
  padding: 12px 16px;
  color: var(--text-60);
  font-size: 14px;
  font-weight: 300;
  border-bottom: 1px solid var(--border-subtle);
}

/* ─── Summary Box ─── */
.summary {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 24px 28px;
  margin: 32px 0;
}
.summary ul {
  list-style: none;
  padding: 0;
}
.summary li {
  color: var(--text-60);
  font-size: 14px;
  font-weight: 300;
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
}
.summary li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

/* ─── Homework ─── */
.homework {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
}
.homework h2 { color: var(--green); }

/* ─── Separator ─── */
hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 48px 0;
}

/* ─── Links & Strong ─── */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: var(--text-90); font-weight: 500; }

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .container { padding: 48px 20px; }
}
