/* Design System */
:root {
  --brand-primary: #6d5ef5; /* royal violet */
  --brand-accent: #19d3da;  /* aqua accent */
  --brand-dark: #0b0d12;
  --brand-darker: #07080b;
  --brand-light: #f6f7fb;
  --text-primary: #0f1222;
  --text-secondary: #576071;
  --text-on-dark: #e9ecf7;
  --border: #e6e8f0;
  --success: #18b87a;
  --warning: #ffb020;
  --danger: #f54e5e;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 10px 30px rgba(13, 16, 35, 0.12);
  --shadow-2: 0 18px 50px rgba(13, 16, 35, 0.18);

  --maxw: 1180px;
}

/* Dark theme overrides */
.theme-dark {
  --brand-light: #0f1220;
  --text-primary: #e7eafd;
  --text-secondary: #a3acc4;
  --border: #1f2433;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, Helvetica, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text-primary);
  background: linear-gradient(180deg, var(--brand-darker), var(--brand-dark) 30%, #0e1017 100%);
}

/* Layout */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(140%) blur(10px);
  background: rgba(10,12,20,0.7);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav { display: flex; align-items: center; gap: 22px; padding: 14px 0; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-img { height: 28px; display:block; }
.logo-text { display:none; }
.nav a { color: #bfc8ea; text-decoration: none; font-weight: 600; font-size: 14px; }
.nav a:hover { color: white; }
.spacer { flex: 1; }
.search-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; color: var(--text-on-dark);
  padding: 8px 12px; width: 240px;
}
.lang-select { background: rgba(255,255,255,0.06); color: #e7ecff; border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; padding: 8px 8px; }
.theme-toggle { min-width: 40px; }

/* Hero */
.hero {
  background: radial-gradient(1200px 400px at 20% -10%, rgba(109,94,245,0.35), transparent),
              radial-gradient(900px 300px at 80% 0%, rgba(25,211,218,0.25), transparent);
  padding: 64px 0 28px;
}
.hero h1 { color: white; font-size: 44px; line-height: 1.08; margin: 0 0 14px; }
.hero p { color: #cdd6ff; margin: 0 0 26px; max-width: 760px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  background: white; color: var(--text-primary); padding: 10px 16px; border-radius: 12px;
  border: 0; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.btn.primary { background: linear-gradient(135deg, var(--brand-primary), #8e7df7); color: white; }
.btn.ghost { background: rgba(255,255,255,0.06); color: #dfe6ff; border: 1px solid rgba(255,255,255,0.12); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 30px 0 0; }
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  padding: 18px;
}
.card h3 { color: white; margin: 6px 0 6px; }
.card p { color: #bfc8ea; margin: 0 0 10px; min-height: 48px; }
.card a { color: var(--brand-accent); font-weight: 700; text-decoration: none; }

/* Content */
.content-wrap { background: white; border-radius: 22px 22px 0 0; padding: 34px 0 60px; margin-top: 26px; }
.theme-dark .content-wrap { background: #0f1220; }
.theme-dark .content h1, .theme-dark .content h2, .theme-dark .content h3, .theme-dark .prose p { color: var(--text-primary); }
.theme-dark .video-card, .theme-dark .graph-col, .theme-dark .pill, .theme-dark .node, .theme-dark table, .theme-dark th, .theme-dark td {
  background: #0f1220; border-color: var(--border); color: var(--text-primary);
}
.theme-dark thead th { background: #14182a; }
.theme-dark .chip { background: #14182a; color: #c7d2ff; }
.content { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.content h1, .content h2, .content h3 { color: var(--text-primary); }
.lead { color: var(--text-secondary); }
.prose p { line-height: 1.7; color: #303648; }
.muted { color: var(--text-secondary); }
.video-grid { display:grid; grid-template-columns: repeat(3,1fr); gap:16px; }
.video-card { background:#fff; border:1px solid var(--border); border-radius:12px; box-shadow: var(--shadow-1); overflow:hidden; }
.video-card .player { position:relative; padding-top:56.25%; background:#000; }
.video-card .player iframe, .video-card .player video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.video-card .vt { padding:10px 12px; font-weight:700; }

.mini-map { margin:24px 0 32px; padding:16px; background:#fff; border:1px solid var(--border); border-radius:12px; box-shadow: var(--shadow-1); }
.mini-map svg { width:100%; height:auto; display:block; }
.mini-map figcaption { margin-top:12px; font-size:13px; color:var(--text-secondary); text-align:center; }
.mini-map svg .map-text { fill:#1f274a; }
.theme-dark .mini-map { background:#0f1220; border-color:var(--border); }
.theme-dark .mini-map figcaption { color:var(--text-secondary); }
.theme-dark .mini-map svg .map-text { fill:var(--text-primary); }
.mini-map svg .map-node { fill:#f3f4ff; stroke:#6d5ef5; stroke-width:2; }
.mini-map svg .map-node--alt { fill:#fff5d6; stroke:#f59f00; stroke-width:2; }
.mini-map svg .map-line { stroke:#c7d3ff; stroke-width:4; stroke-linecap:round; fill:none; }
.mini-map svg .map-line--optional { stroke-dasharray:6 8; }
.mini-map svg .map-text--small { font-size:12px; }
@media (max-width: 1000px) { .video-grid { grid-template-columns: repeat(2,1fr);} }
@media (max-width: 640px) { .video-grid { grid-template-columns: 1fr;} }

/* Evolution Tree */
.graph-grid { display:grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap:16px; align-items:start; }
.graph-col { background:#fff; border:1px solid var(--border); border-radius:12px; padding:10px; box-shadow: var(--shadow-1); min-height: 120px; }
.node { padding:6px 8px; border:1px solid var(--border); border-radius:8px; margin:6px 0; background:#f9fafb; cursor:pointer; }
.node:hover { background:#eef2ff; }
.edge { color:#888; font-size:12px; }

/* Skill Planner */
.pill { display:inline-block; padding:6px 10px; border:1px dashed var(--border); border-radius:999px; background:#fff; margin:4px; }

/* Tables */
table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
thead th { background: #f2f4fb; }

/* Footer */
.site-footer { color: #bfc8ea; background: #0c0f17; border-top: 1px solid rgba(255,255,255,0.06); }
.site-footer .row { display: flex; gap: 18px; align-items: center; padding: 20px 0; }
.site-footer a { color: #dbe4ff; text-decoration: none; }

/* Chips */
.chip { display:inline-block; padding:6px 10px; border-radius: 999px; background:#eef2ff; color:#3640a7; font-weight:700; font-size:12px; }

/* Utilities */
.stack-s { display:flex; gap:8px; flex-wrap:wrap; }
.stack-m { display:flex; gap:14px; flex-wrap:wrap; }
.grid-3 { display:grid; grid-template-columns: repeat(3,1fr); gap:16px; }

/* Responsive */
@media (max-width: 1000px) { .cards { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px) {
  .nav { gap: 12px; }
  .cards { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
  .search-input { width: 160px; }
}
