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

/* ── Design tokens ── */
:root {
  --sidebar-w: 260px;
  --header-h: 56px;
  --brand:    #4338ca;
  --brand-dk: #1e1b4b;
  --accent:   #6366f1;
  --bg:       #f8f9fc;
  --surface:  #ffffff;
  --border:   #e5e7eb;
  --text:     #111827;
  --muted:    #6b7280;
  --sidebar-text: rgba(255,255,255,0.75);
  --sidebar-text-active: #ffffff;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active: rgba(255,255,255,0.15);
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ── Top header ── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--brand-dk);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 100;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: #fff;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.topbar-logo .logo-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
}

.topbar-sep   { color: rgba(255,255,255,0.2); font-size: 1.25rem; margin-left: 0.25rem; }
.topbar-label { color: #a5b4fc; font-size: 0.8125rem; font-weight: 500; }

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: var(--sidebar-w);
  bottom: 0;
  background: var(--brand-dk);
  overflow-y: auto;
  padding: 1.5rem 0 2rem;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-section {
  padding: 0 1rem;
  margin-bottom: 1.5rem;
}

.sidebar-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  padding: 0 0.5rem;
  margin-bottom: 0.375rem;
}

.sidebar-nav { list-style: none; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover  { background: var(--sidebar-hover);  color: var(--sidebar-text-active); }
.sidebar-nav a.active { background: var(--sidebar-active); color: var(--sidebar-text-active); }
.sidebar-nav i { font-size: 1rem; opacity: 0.8; }

/* ── Main layout ── */
.layout {
  margin-top: var(--header-h);
  margin-left: var(--sidebar-w);
  min-height: calc(100vh - var(--header-h));
}

/* ── Page content ── */
.page {
  padding: 3.5rem 3rem;
  max-width: 860px;
}

.page-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.page h1 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.page-lead {
  font-size: 1.0625rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: 640px;
  margin-bottom: 2.5rem;
}

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ── Section heading ── */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title i { font-size: 1.1rem; color: var(--accent); }

/* ── Prose ── */
.prose p {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 1rem;
}

.prose p:last-child { margin-bottom: 0; }

/* ── Field table ── */
.field-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  overflow: hidden;
}

.field-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.field-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.625rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.field-table th:first-child { border-radius: 0.5rem 0 0 0; }
.field-table th:last-child  { border-radius: 0 0.5rem 0 0; }

.field-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}

.field-table td:first-child { font-weight: 600; white-space: nowrap; }
.field-table td .desc       { color: var(--muted); font-size: 0.8125rem; line-height: 1.6; }
.field-table tr:last-child td { border-bottom: none; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 9999px;
  background: currentColor;
}

/* ── Callout ── */
.callout {
  display: flex;
  gap: 0.75rem;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 0.625rem;
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: #3730a3;
  line-height: 1.6;
}

.callout i { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.05rem; }

/* ── Video ── */
.video-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
}

.video-placeholder {
  position: relative;
  background: #1e1b4b;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: #a5b4fc;
}

.video-placeholder i { font-size: 3rem; opacity: 0.6; }
.video-placeholder p { font-size: 0.875rem; opacity: 0.5; }

.video-info { padding: 1.25rem 1.5rem; }

.video-info h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.video-info p { font-size: 0.8125rem; color: var(--muted); line-height: 1.6; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .layout  { margin-left: 0; }
  .page    { padding: 2rem 1.25rem; }
}
