/* ═══════════════════════════════════════════════
   Maximus Documentation — Shared Styles
   ═══════════════════════════════════════════════ */

:root {
  --bg:           #06060a;
  --dominant:     #0a0a0f;
  --surface:      #111118;
  --elevated:     #1a1a24;
  --border:       #222233;
  --border-dim:   #1a1a28;

  --gold:         #d4a020;
  --gold-bright:  #f0c040;
  --gold-dim:     #8a6a10;
  --gold-ring:    rgba(212,160,32,0.08);
  --amber:        #ff9800;
  --orange-dark:  #e65100;

  --success:      #00ff88;
  --warn:         #ffaa00;
  --danger:       #ff4466;
  --blue:         #4488ff;

  --text:         #e0e0e8;
  --text-sec:     #8888a0;
  --text-dim:     #555570;

  --glow:         0 0 12px rgba(212,160,32,0.3);
  --glow-strong:  0 0 24px rgba(212,160,32,0.5);

  --sidebar-w: 220px;
}

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

body {
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

/* ── Layout with sidebar ── */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  text-decoration: none;
}
.sidebar-logo svg { width: 28px; height: 28px; flex-shrink: 0; }
.sidebar-logo span {
  font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-section {
  padding: 0 12px;
  margin-bottom: 8px;
}
.sidebar-section-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-dim);
  padding: 0 8px; margin-bottom: 6px;
}

.sidebar a {
  display: block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-sec);
  text-decoration: none;
  transition: all 0.15s ease;
  margin-bottom: 1px;
}
.sidebar a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}
.sidebar a.active {
  color: var(--gold);
  background: rgba(212,160,32,0.08);
  font-weight: 600;
}

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 48px 40px;
  max-width: calc(880px + var(--sidebar-w) + 80px);
}
.page { max-width: 880px; }

/* ── Mobile: collapse sidebar ── */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-sec);
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

@media (max-width: 800px) {
  .sidebar-toggle { display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 48px 20px; }
  .page { max-width: 100%; }
}

/* ── Hero (index page only) ── */
.hero {
  text-align: center;
  padding: 56px 40px 52px;
  background: radial-gradient(ellipse at 50% 0%, rgba(212,160,32,0.1) 0%, transparent 65%), var(--surface);
  border: 1px solid rgba(212,160,32,0.25);
  border-radius: 20px;
  margin-bottom: 56px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.hero-logo { width: 72px; height: 72px; margin: 0 auto 24px; display: block; }
.hero-badge {
  display: inline-block;
  background: rgba(212,160,32,0.12); border: 1px solid rgba(212,160,32,0.3);
  color: var(--gold); font-size: 10px; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
  padding: 4px 16px; border-radius: 100px; margin-bottom: 22px;
}
.hero h1 {
  font-size: 52px; font-weight: 800; letter-spacing: -0.03em;
  background: linear-gradient(160deg, var(--gold-bright) 0%, var(--gold) 50%, var(--amber) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 18px; line-height: 1.1;
}
.hero p { color: var(--text-sec); font-size: 16px; max-width: 580px; margin: 0 auto 32px; line-height: 1.7; }
.hero-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 26px; border-radius: 10px; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: all 0.2s ease;
}
.btn-primary { background: linear-gradient(135deg, var(--gold) 0%, var(--amber) 100%); color: #000; border: none; }
.btn-primary:hover { box-shadow: var(--glow-strong); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-sec); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--gold); border-color: rgba(212,160,32,0.3); }

/* ── Page hero (subpages) ── */
.page-hero {
  padding: 40px 32px 36px;
  background: radial-gradient(ellipse at 50% 0%, rgba(212,160,32,0.08) 0%, transparent 65%), var(--surface);
  border: 1px solid rgba(212,160,32,0.2);
  border-radius: 16px;
  margin-bottom: 48px;
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}
.page-hero h1 {
  font-size: 32px; font-weight: 800; letter-spacing: -0.02em;
  background: linear-gradient(160deg, var(--gold-bright), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 10px; line-height: 1.15;
}
.page-hero p { color: var(--text-sec); font-size: 14px; max-width: 600px; line-height: 1.7; }

/* ── Section ── */
section { margin-bottom: 56px; }
h2 {
  font-size: 22px; font-weight: 700; letter-spacing: -0.01em;
  margin-bottom: 18px; display: flex; align-items: center; gap: 10px; color: var(--text);
}
h2 .tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase;
  background: rgba(212,160,32,0.12); color: var(--gold);
  padding: 2px 10px; border-radius: 100px; border: 1px solid rgba(212,160,32,0.2);
}
h3 { font-size: 16px; font-weight: 700; margin: 20px 0 12px; color: var(--text); }

/* ── Cards ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px; margin-bottom: 14px;
}
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card-grid.three { grid-template-columns: 1fr 1fr 1fr; }

.card-sm {
  background: var(--elevated); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px;
}
.card-sm .label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 7px;
}
.card-sm .value { font-size: 13px; color: var(--text-sec); line-height: 1.65; }

/* ── Topic cards ── */
.topic-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.topic-card {
  display: block; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px; transition: all 0.2s ease;
  position: relative; overflow: hidden;
}
.topic-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  opacity: 0; transition: opacity 0.2s;
}
.topic-card:hover { border-color: rgba(212,160,32,0.3); transform: translateY(-2px); }
.topic-card:hover::before { opacity: 1; }
.topic-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 14px;
}
.topic-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.topic-card p { font-size: 12px; color: var(--text-dim); line-height: 1.6; }
.topic-arrow { color: var(--gold-dim); font-size: 12px; margin-top: 10px; display: block; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 10px 16px; background: var(--elevated);
  color: var(--text-dim); font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; border-bottom: 1px solid var(--border);
}
td {
  padding: 11px 16px; border-bottom: 1px solid var(--border-dim);
  color: var(--text-sec); vertical-align: top;
}
tr:last-child td { border-bottom: none; }
td strong { color: var(--text); }
td code, code {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 4px; font-size: 11px;
  font-family: 'SF Mono','Fira Code',monospace; color: var(--gold);
}

/* ── Code ── */
pre {
  background: var(--dominant); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px;
  font-family: 'SF Mono','Fira Code','Consolas',monospace;
  font-size: 12.5px; color: #9090b0; overflow-x: auto; line-height: 1.65;
  margin-bottom: 14px;
}
.kw  { color: var(--gold); }
.str { color: var(--success); }
.cm  { color: var(--text-dim); font-style: italic; }
.fn  { color: var(--blue); }

/* ── Pills ── */
.pill {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 9px; border-radius: 100px; letter-spacing: 0.06em;
}
.pill-gold   { background: rgba(212,160,32,0.15);  color: var(--gold); border: 1px solid rgba(212,160,32,0.25); }
.pill-amber  { background: rgba(255,152,0,0.12);   color: var(--amber); border: 1px solid rgba(255,152,0,0.2); }
.pill-green  { background: rgba(0,255,136,0.1);    color: var(--success); border: 1px solid rgba(0,255,136,0.2); }
.pill-danger { background: rgba(255,68,102,0.1);   color: var(--danger); border: 1px solid rgba(255,68,102,0.2); }
.pill-dim    { background: rgba(136,136,160,0.1);  color: var(--text-sec); border: 1px solid var(--border); }
.pill-blue   { background: rgba(68,136,255,0.1);   color: var(--blue); border: 1px solid rgba(68,136,255,0.2); }

/* ── Prose ── */
.prose { font-size: 14px; color: var(--text-sec); line-height: 1.8; }
.prose strong { color: var(--text); }
.prose-sm { font-size: 13px; color: var(--text-sec); line-height: 1.75; }

/* ── Component list ── */
.component-item { border-left: 3px solid var(--gold); padding-left: 16px; margin-bottom: 16px; }
.component-item.green  { border-left-color: var(--success); }
.component-item.amber  { border-left-color: var(--amber); }
.component-item.dim    { border-left-color: var(--text-dim); }
.component-item.blue   { border-left-color: var(--blue); }
.component-item.danger { border-left-color: var(--danger); }
.component-name {
  font-size: 13px; font-weight: 700; margin-bottom: 4px;
  font-family: 'SF Mono','Fira Code',monospace;
}

/* ── Step list ── */
.step-list { counter-reset: step; }
.step-item { position: relative; padding-left: 56px; margin-bottom: 28px; }
.step-item::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 38px; height: 38px;
  border-radius: 10px; background: rgba(212,160,32,0.1);
  border: 1px solid rgba(212,160,32,0.25); color: var(--gold);
  font-size: 14px; font-weight: 700; text-align: center; line-height: 38px;
}
.step-item h4 { font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--text); }

/* ── Doc links grid ── */
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.doc-link {
  display: block; padding: 18px 20px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  text-decoration: none; transition: all 0.2s ease;
}
.doc-link:hover { border-color: rgba(212,160,32,0.3); background: rgba(212,160,32,0.04); }
.doc-link .doc-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.doc-link .doc-desc { font-size: 12px; color: var(--text-dim); }

/* ── Footer ── */
footer {
  text-align: center; color: var(--text-dim); font-size: 12px;
  padding-top: 32px; border-top: 1px solid var(--border); letter-spacing: 0.05em;
  margin-top: 40px;
}
footer a { color: var(--gold-dim); text-decoration: none; }
footer a:hover { color: var(--gold); }

/* ── Responsive ── */
@media (max-width: 800px) {
  .card-grid, .card-grid.three, .topic-grid { grid-template-columns: 1fr; }
  .doc-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
  .hero { padding: 36px 24px 32px; }
  .page-hero h1 { font-size: 24px; }
}
