:root {
  --bg: #0d1117;
  --surface: #161b22;
  --accent: #00e5a0;
  --accent2: #00b8ff;
  --accent3: #ff6b35;
  --text: #e6edf3;
  --text-body: #c9d1d9;
  --muted: #7d8590;
  --border: #30363d;
  --grid-color: rgba(0,229,160,0.04);
  --prereq-bg: rgba(255,107,53,0.06);
  --prereq-border: rgba(255,107,53,0.25);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

[data-theme="light"] {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --accent: #009966;
  --accent2: #0077bb;
  --accent3: #cc4400;
  --text: #1a2030;
  --text-body: #374151;
  --muted: #6b7280;
  --border: #d1d9e0;
  --grid-color: rgba(0,153,102,0.05);
  --prereq-bg: rgba(204,68,0,0.05);
  --prereq-border: rgba(204,68,0,0.2);
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 5px 6px;
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, background 0.3s;
}

.theme-toggle:hover { border-color: var(--accent); }

.toggle-option {
  font-size: 15px;
  width: 32px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 30px;
  transition: background 0.25s;
}

[data-theme="light"] .toggle-option.light-opt { background: rgba(0,153,102,0.14); }
[data-theme="dark"] .toggle-option.dark-opt { background: rgba(0,229,160,0.18); }

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 24px;
  right: 120px;
  z-index: 100;
  display: flex;
  gap: 6px;
}

nav a {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

nav a:hover, nav a.active { border-color: var(--accent); color: var(--accent); }

/* ===== HEADER ===== */
header { padding: 48px 0 8px; margin-bottom: 0; }

.header-badge {
  display: inline-block;
  font-size: 11px;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 3px 10px;
  border-radius: 2px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.5s ease 0.1s forwards;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -2px;
  opacity: 0;
  animation: fadeUp 0.5s ease 0.2s forwards;
}

h1 span { color: var(--accent); }

.header-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  opacity: 0;
  animation: fadeUp 0.5s ease 0.3s forwards;
}

/* ===== TOC ===== */
.toc {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0;
  opacity: 0;
  animation: fadeUp 0.4s ease 0.4s forwards;
}

.toc a {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  padding: 3px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  transition: all 0.2s;
}

.toc a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0,229,160,0.05);
}

/* ===== SECTION LABEL ===== */
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
  margin-top: 60px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-label .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.section-label.muted .dot { background: var(--muted); }
.section-label.muted::after { background: linear-gradient(90deg, var(--muted), transparent); }

/* ===== GRID ===== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===== HERO GRID ===== */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 56px;
  margin-bottom: 40px;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 36px 36px 32px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.hero-card:nth-child(1) { animation: fadeUp 0.4s ease 0.3s forwards; }
.hero-card:nth-child(2) { animation: fadeUp 0.4s ease 0.4s forwards; }
.hero-card:nth-child(3) { animation: fadeUp 0.4s ease 0.5s forwards; }
.hero-card:nth-child(4) { animation: fadeUp 0.4s ease 0.6s forwards; }

.hero-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
}

.hero-card.blue::before { background: var(--accent2); }
.hero-card.orange::before { background: var(--accent3); }
.hero-card.grey::before { background: var(--muted); }

.hero-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.hero-card.blue:hover { border-color: var(--accent2); }
.hero-card.orange:hover { border-color: var(--accent3); }
.hero-card.grey:hover { border-color: var(--muted); }

.hero-icon { font-size: 32px; margin-bottom: 4px; }

.hero-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.hero-card.blue .hero-title { color: var(--accent2); }
.hero-card.orange .hero-title { color: var(--accent3); }
.hero-card.grey .hero-title { color: var(--muted); }

.hero-desc {
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.6;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.hero-arrow {
  margin-top: auto;
  font-size: 20px;
  color: var(--muted);
  transition: transform 0.2s, color 0.2s;
}

.hero-card:hover .hero-arrow { transform: translateX(5px); color: var(--accent); }
.hero-card.blue:hover .hero-arrow { color: var(--accent2); }
.hero-card.orange:hover .hero-arrow { color: var(--accent3); }

/* ===== LANG GRID ===== */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 40px;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.4s ease 0.8s forwards;
}

.lang-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.lang-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.lang-flag {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.lang-flag svg {
  width: 100%;
  height: 100%;
  display: block;
}

.lang-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.lang-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.lang-arrow {
  margin-left: auto;
  color: var(--muted);
  font-size: 18px;
  transition: transform 0.2s, color 0.2s;
}

.lang-card:hover .lang-arrow {
  transform: translateX(4px);
  color: var(--accent);
}

/* ===== CARD ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px 32px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.4s ease forwards;
  transition: border-color 0.2s, transform 0.2s, background 0.3s, box-shadow 0.2s;
}

.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.card.accent2:hover { border-color: var(--accent2); }
.card.accent3:hover { border-color: var(--accent3); }
.card.accent4:hover { border-color: var(--muted); }
.card.orange:hover { border-color: var(--accent3); }
.card.muted-card:hover { border-color: var(--muted); }

.card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
}

.card.accent2::before { background: var(--accent2); }
.card.accent3::before { background: var(--accent3); }
.card.accent4::before { background: var(--muted); }
.card.orange::before { background: var(--accent3); }
.card.muted-card::before { background: var(--muted); }
.card.accent4 { border-color: var(--muted); }
.card.muted-card { border-color: var(--muted); }

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.card-icon {
  width: 40px; height: 40px;
  border-radius: 6px;
  background: rgba(0,229,160,0.1);
  border: 1px solid rgba(0,229,160,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.card.accent2 .card-icon { background: rgba(0,184,255,0.1); border-color: rgba(0,184,255,0.2); }
.card.accent3 .card-icon,
.card.orange .card-icon { background: rgba(255,107,53,0.1); border-color: rgba(255,107,53,0.2); }
.card.accent4 .card-icon,
.card.muted-card .card-icon { background: rgba(125,133,144,0.1); border-color: rgba(125,133,144,0.3); }

[data-theme="light"] .card-icon { background: rgba(0,153,102,0.08); border-color: rgba(0,153,102,0.2); }
[data-theme="light"] .card.accent2 .card-icon { background: rgba(0,119,187,0.08); border-color: rgba(0,119,187,0.2); }
[data-theme="light"] .card.accent3 .card-icon,
[data-theme="light"] .card.orange .card-icon { background: rgba(204,68,0,0.08); border-color: rgba(204,68,0,0.2); }
[data-theme="light"] .card.accent4 .card-icon,
[data-theme="light"] .card.muted-card .card-icon { background: rgba(107,114,128,0.08); border-color: rgba(107,114,128,0.2); }

.card h2 { font-size: 1.25rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.card h3 { font-size: 1rem; font-weight: 600; color: var(--accent); margin: 18px 0 8px; }
.card.accent2 h3 { color: var(--accent2); }
.card.accent3 h3 { color: var(--accent3); }
.card.accent4 h2, .card.accent4 h3 { color: var(--muted); }
.card.orange h3 { color: var(--accent3); }
.card.muted-card h2, .card.muted-card h3 { color: var(--muted); }

.card p { font-size: 16px; color: var(--text-body); margin-bottom: 10px; }
.card-subtitle { font-size: 11px; color: var(--muted); }

/* ===== FEATURE LIST ===== */
.feature-list { list-style: none; margin: 10px 0 16px; }

.feature-list li {
  font-size: 15.5px;
  color: var(--text-body);
  padding: 7px 0 7px 22px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.feature-list li:last-child { border-bottom: none; }

.feature-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.card.accent2 .feature-list li::before { color: var(--accent2); }
.card.accent3 .feature-list li::before { color: var(--accent3); }
.card.accent4 .feature-list li::before { color: var(--muted); }
.card.orange .feature-list li::before { color: var(--accent3); }
.card.muted-card .feature-list li::before { color: var(--muted); }

/* ===== PREREQ BOX ===== */
.prereq-box {
  background: var(--prereq-bg);
  border: 1px solid var(--prereq-border);
  border-radius: 6px;
  padding: 14px 18px;
  margin: 14px 0;
}

.prereq-title {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent3);
  margin-bottom: 8px;
}

.prereq-box ul { list-style: none; font-size: 15.5px; color: var(--text-body); }
.prereq-box ul li { padding: 3px 0 3px 16px; position: relative; }
.prereq-box ul li::before { content: '!'; position: absolute; left: 0; color: var(--accent3); font-weight: bold; font-size: 12px; }

/* ===== TAGS ===== */
.tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 2px;
  background: rgba(0,229,160,0.12);
  color: var(--accent);
  margin-right: 6px;
  margin-bottom: 4px;
}

.tag.blue { background: rgba(0,184,255,0.12); color: var(--accent2); }
.tag.orange { background: rgba(255,107,53,0.12); color: var(--accent3); }
.tag.grey { background: rgba(125,133,144,0.12); color: var(--muted); }

/* ===== URL PILL ===== */
.url-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(0,184,255,0.08);
  border: 1px solid rgba(0,184,255,0.25);
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--accent2);
  text-decoration: none;
  margin: 4px 4px 4px 0;
  transition: background 0.2s;
}

.url-pill:hover { background: rgba(0,184,255,0.15); }

/* ===== FOOTER ===== */
footer {
  margin-top: 80px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

footer a { color: var(--accent); text-decoration: none; }
footer a.blue { color: var(--accent2); }

/* ===== ANIMATION ===== */
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.10s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.20s; }
.card:nth-child(5) { animation-delay: 0.25s; }

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

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .lang-grid { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
  .container { padding: 0 16px; }
  nav { top: 14px; right: 110px; }
  .theme-toggle { top: 14px; right: 14px; }
}