/* Enigma Wiki — Shared Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

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

:root {
  --bg:           #0e1117;
  --bg-card:      #161c27;
  --bg-card-2:    #1c2436;
  --border:       #2a3348;
  --accent:       #6c63ff;
  --accent-2:     #00d4aa;
  --accent-glow:  rgba(108,99,255,.18);
  --text:         #e8eaf2;
  --text-muted:   #7b8499;
  --text-dim:     #a0a8bc;
  --sidebar-w:    260px;
  --header-h:     60px;
  --radius:       12px;
  --radius-sm:    8px;
  --font-ui:      'Inter', sans-serif;
  --font-head:    'Space Grotesk', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* ── Topbar ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: #080c12;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px;
  gap: 16px;
}
.topbar-logo {
  font-family: var(--font-head);
  font-size: 15px; font-weight: 700; letter-spacing: .04em;
  color: #fff; text-decoration: none;
  display: flex; align-items: center; gap: 8px;
}
.topbar-logo span { color: var(--accent); }
.topbar-sep { flex: 1; }
.topbar-breadcrumb {
  font-size: 13px; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.topbar-breadcrumb a { color: var(--text-dim); text-decoration: none; }
.topbar-breadcrumb a:hover { color: var(--accent); }
.topbar-breadcrumb .sep { opacity: .4; }

/* ── Layout ── */
.layout {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #0b0f18;
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--header-h); bottom: 0; left: 0;
  overflow-y: auto;
  padding: 24px 0 40px;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-section {
  padding: 0 16px 8px;
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-muted);
  margin-top: 20px;
}
.sidebar-section:first-child { margin-top: 0; }

.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  font-size: 13.5px; color: var(--text-dim);
  text-decoration: none; border-radius: 0;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.sidebar-link:hover { background: var(--accent-glow); color: var(--text); }
.sidebar-link.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}
.sidebar-link .icon {
  width: 16px; height: 16px; flex-shrink: 0; opacity: .7;
}
.sidebar-link.active .icon { opacity: 1; }

.sidebar-tag {
  margin-left: auto;
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 20px;
  background: var(--accent-glow); color: var(--accent);
}

/* ── Main content ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  max-width: 900px;
  padding: 48px 56px 80px;
}

/* ── Page header ── */
.page-header { margin-bottom: 40px; }
.page-tag {
  display: inline-block;
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-glow); padding: 4px 10px;
  border-radius: 20px; margin-bottom: 14px;
}
.page-title {
  font-family: var(--font-head);
  font-size: 32px; font-weight: 700;
  color: #fff; line-height: 1.2;
  margin-bottom: 12px;
}
.page-desc {
  font-size: 16px; color: var(--text-dim);
  max-width: 680px; line-height: 1.7;
}

/* ── Section headings ── */
.section-title {
  font-family: var(--font-head);
  font-size: 18px; font-weight: 600;
  color: #fff; margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: '';
  display: block; width: 3px; height: 18px;
  background: var(--accent); border-radius: 2px; flex-shrink: 0;
}

/* ── Video embed ── */
.video-wrap {
  position: relative; padding-bottom: 56.25%; height: 0;
  border-radius: var(--radius); overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  margin-bottom: 32px;
}
.video-wrap iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; border: 0;
}

/* ── Description block ── */
.desc-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 32px;
  font-size: 15px; color: var(--text-dim); line-height: 1.75;
}
.desc-block p + p { margin-top: 12px; }

/* ── Screenshot ── */
.screenshot-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 32px;
}
.screenshot-wrap img {
  width: 100%; display: block;
}
.screenshot-caption {
  background: var(--bg-card-2);
  font-size: 12px; color: var(--text-muted);
  padding: 8px 14px;
  border-top: 1px solid var(--border);
}

/* ── Multi-screenshot grid ── */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.screenshots-grid .screenshot-wrap { margin-bottom: 0; }

/* ── Tips / info boxes ── */
.tip-box {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 12px;
  font-size: 14px; color: var(--text-dim); line-height: 1.65;
}
.tip-box .tip-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ── Stage cards grid (index) ── */
.stages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.stage-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.stage-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(108,99,255,.15);
}
.stage-card-icon {
  width: 36px; height: 36px;
  background: var(--accent-glow);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 4px;
}
.stage-card-name {
  font-family: var(--font-head);
  font-size: 14px; font-weight: 600; color: #fff;
}
.stage-card-desc {
  font-size: 12.5px; color: var(--text-muted);
  line-height: 1.55;
}

/* ── Section video cards (index) ── */
.section-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.section-card-video {
  position: relative; padding-bottom: 56.25%; height: 0;
  background: #000;
}
.section-card-video iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; border: 0;
}
.section-card-body { padding: 16px 20px; }
.section-card-title {
  font-family: var(--font-head);
  font-size: 15px; font-weight: 600; color: #fff;
  margin-bottom: 6px;
}
.section-card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.55; }

/* ── Prev / Next nav ── */
.page-nav {
  display: flex; gap: 12px;
  margin-top: 48px; padding-top: 32px;
  border-top: 1px solid var(--border);
}
.page-nav-btn {
  flex: 1; display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  text-decoration: none; color: var(--text-dim);
  transition: border-color .2s, color .2s;
}
.page-nav-btn:hover { border-color: var(--accent); color: var(--text); }
.page-nav-btn.next { flex-direction: row-reverse; text-align: right; }
.page-nav-btn .nav-label { font-size: 11px; color: var(--text-muted); display: block; }
.page-nav-btn .nav-title { font-size: 14px; font-weight: 600; color: #fff; display: block; }
.page-nav-btn .nav-arrow { font-size: 20px; color: var(--accent); flex-shrink: 0; }
.page-nav-btn.empty { pointer-events: none; opacity: 0; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 32px 24px 60px; }
}
