:root {
  --bg: #0e0e10;
  --surface: #18181c;
  --surface2: #222228;
  --border: #2e2e38;
  --text: #f0eee8;
  --muted: #8a8896;
  --hint: #5a5a68;

  --purple: #a78bfa;
  --purple-bg: #1e1830;
  --purple-border: #3d2f72;

  --teal: #34d399;
  --teal-bg: #0d2420;
  --teal-border: #1a4a3a;

  --coral: #fb923c;
  --coral-bg: #261508;
  --coral-border: #4a2810;

  --blue: #60a5fa;
  --blue-bg: #0d1d30;
  --blue-border: #1a3858;

  --amber: #fbbf24;
  --amber-bg: #221800;
  --amber-border: #4a3800;

  --green: #86efac;
  --green-bg: #0a1f10;
  --green-border: #143a1e;

  --pink: #f472b6;
  --pink-bg: #220d18;
  --pink-border: #441530;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}

/* HERO */
.hero {
  padding: 60px 40px 48px;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple), var(--teal), transparent);
}

.hero-label {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--purple);
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-label::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--purple);
  display: inline-block;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--purple) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  color: var(--muted);
  font-size: 15px;
  max-width: 560px;
  line-height: 1.8;
  margin-bottom: 28px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid;
}

/* LAYOUT */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

/* SECTION */
.section {
  margin-bottom: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.2s;
}

.section:hover {
  border-color: var(--hint);
}

.section.open {
  border-color: var(--border);
}

.section-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.section-header:hover {
  background: var(--surface2);
}

.num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  letter-spacing: -0.01em;
}

.arrow {
  color: var(--hint);
  font-size: 10px;
  transition: transform 0.25s;
  flex-shrink: 0;
}

.section.open .arrow {
  transform: rotate(90deg);
}

.section-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
}

.section.open .section-body {
  display: block;
}

.body-inner {
  padding-top: 18px;
}

/* CONTENT ELEMENTS */
.desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 14px;
}

.desc strong {
  color: var(--text);
  font-weight: 600;
}

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text);
}

.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: #c9c2d1;
  line-height: 1.8;
  margin-bottom: 14px;
  white-space: pre-wrap;
  word-break: break-all;
  position: relative;
  overflow-x: auto;
}

.code-block .kw  { color: #c792ea; }
.code-block .str { color: #c3e88d; }
.code-block .num { color: #f78c6c; background: none; border: none; padding: 0; width: auto; height: auto; border-radius: 0; display: inline; font-family: inherit; font-size: inherit; }
.code-block .fn  { color: #82aaff; }
.code-block .cm  { color: #546e7a; font-style: italic; }
.code-block .var { color: #ffcb6b; }

.analogy {
  border-left: 2px solid var(--purple);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  background: var(--purple-bg);
  color: #c4b5fd;
  font-size: 13px;
  line-height: 1.7;
  margin-top: 12px;
  font-style: italic;
}

.analogy::before {
  content: '💡 ';
  font-style: normal;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 99px;
  border: 1px solid;
  letter-spacing: 0.03em;
}

.var-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.var-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color 0.2s;
}

.var-card:hover {
  border-color: var(--hint);
}

.var-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--amber);
  margin-bottom: 4px;
}

.var-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.class-card {
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid;
  font-size: 13px;
}

.class-card .class-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}

.class-card .stat {
  font-size: 11px;
  opacity: 0.75;
  font-family: 'JetBrains Mono', monospace;
}

.step-list {
  list-style: none;
  counter-reset: s;
  margin-bottom: 14px;
}

.step-list li {
  counter-increment: s;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
}

.step-list li::before {
  content: counter(s);
  min-width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--hint);
  flex-shrink: 0;
  margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* COLOR VARIANTS */
.c-purple { color: var(--purple); border-color: var(--purple-border); background: var(--purple-bg); }
.c-teal   { color: var(--teal);   border-color: var(--teal-border);   background: var(--teal-bg); }
.c-coral  { color: var(--coral);  border-color: var(--coral-border);  background: var(--coral-bg); }
.c-blue   { color: var(--blue);   border-color: var(--blue-border);   background: var(--blue-bg); }
.c-amber  { color: var(--amber);  border-color: var(--amber-border);  background: var(--amber-bg); }
.c-green  { color: var(--green);  border-color: var(--green-border);  background: var(--green-bg); }
.c-pink   { color: var(--pink);   border-color: var(--pink-border);   background: var(--pink-bg); }

.t-purple { color: var(--purple); }
.t-teal   { color: var(--teal); }
.t-coral  { color: var(--coral); }
.t-blue   { color: var(--blue); }
.t-amber  { color: var(--amber); }
.t-green  { color: var(--green); }
.t-pink   { color: var(--pink); }

/* FOOTER */
.footer {
  text-align: center;
  padding: 40px;
  border-top: 1px solid var(--border);
  color: var(--hint);
  font-size: 12px;
  letter-spacing: 0.05em;
  max-width: 900px;
  margin: 0 auto;
}

/* SCROLL REVEAL */
.section {
  opacity: 0;
  transform: translateY(12px);
  animation: reveal 0.4s ease forwards;
}

@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

.section:nth-child(1) { animation-delay: 0.05s; }
.section:nth-child(2) { animation-delay: 0.10s; }
.section:nth-child(3) { animation-delay: 0.15s; }
.section:nth-child(4) { animation-delay: 0.20s; }
.section:nth-child(5) { animation-delay: 0.25s; }
.section:nth-child(6) { animation-delay: 0.30s; }
.section:nth-child(7) { animation-delay: 0.35s; }
.section:nth-child(8) { animation-delay: 0.40s; }
.section:nth-child(9) { animation-delay: 0.45s; }
