@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;1,300&display=swap');

:root {
  --bg: #0d0f12;
  --bg2: #141720;
  --bg3: #1c2030;
  --border: #2a2f3d;
  --border2: #353d52;
  --text: #c8cfe0;
  --text-dim: #6b7592;
  --text-bright: #e8edf8;
  --accent: #00e5a0;
  --accent2: #00b8ff;
  --accent-dim: #00e5a022;
  --accent2-dim: #00b8ff18;
  --warn: #f59e0b;
  --danger: #ef4444;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
  --radius: 6px;
  --glow: 0 0 20px #00e5a030;
}

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

html { scroll-behavior: smooth; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
* { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}

/* ─── NOISE OVERLAY ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ─── TOPBAR ─── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0d0f12ee;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 2rem;
  height: 54px;
}

.topbar-brand {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 2.5rem;
}

.topbar-brand .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 #00e5a066; }
  50% { opacity: 0.7; box-shadow: 0 0 0 5px #00e5a000; }
}

.topbar-nav {
  display: flex;
  gap: 0;
  list-style: none;
  height: 100%;
}

.topbar-nav a {
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  height: 100%;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.topbar-nav a:hover { color: var(--text-bright); border-color: var(--border2); }
.topbar-nav a.active { color: var(--accent); border-color: var(--accent); }

/* ─── LAYOUT ─── */
.page-wrap {
  display: grid;
  grid-template-columns: 240px 1fr;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  gap: 3rem;
  position: relative;
  z-index: 1;
}

/* ─── SIDEBAR ─── */
.sidebar {
  position: sticky;
  top: 74px;
  align-self: start;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5a6480;
  margin-bottom: 0.5rem;
  padding-left: 0.75rem;
}

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

.sidebar-nav a {
  display: block;
  padding: 5px 0.75rem;
  color: #9aa3bc;
  text-decoration: none;
  font-size: 0.83rem;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.sidebar-nav a:hover {
  color: var(--text-bright);
  border-color: var(--border2);
  background: var(--bg2);
}

.sidebar-nav a.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.sidebar-nav .sub a {
  padding-left: 1.5rem;
  font-size: 0.78rem;
}

/* ─── CONTENT ─── */
.content { min-width: 0; }

/* ─── HERO ─── */
.hero {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2.5rem 2.5rem 2rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, #00e5a015 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

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

.hero p {
  color: var(--text);
  max-width: 620px;
  font-size: 0.95rem;
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1.25rem;
}

.badge {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.badge.green { border-color: #00e5a044; color: var(--accent); background: var(--accent-dim); }
.badge.blue  { border-color: #00b8ff44; color: var(--accent2); background: var(--accent2-dim); }

/* ─── SECTIONS ─── */
.doc-section { margin-bottom: 3rem; }

h2 {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-bright);
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin-bottom: 1.25rem;
  padding-top: 2.5rem;
  margin-top: -1rem;
}

h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-bright);
  margin: 1.5rem 0 0.75rem;
  letter-spacing: 0.02em;
}

p { margin-bottom: 0.85rem; color: var(--text); }
p:last-child { margin-bottom: 0; }

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--accent); }

/* ─── CARDS ─── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.card.green-border { border-color: #00e5a033; }
.card.blue-border  { border-color: #00b8ff33; }
.card.warn-border  { border-color: #f59e0b44; }

.card-title {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.card-title.blue { color: var(--accent2); }
.card-title.warn { color: var(--warn); }

/* ─── STEPS ─── */
.steps { list-style: none; counter-reset: step; }

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0.75rem 0 0.75rem 3rem;
  border-left: 1px solid var(--border2);
  margin-left: 1rem;
  margin-bottom: 0;
}

.steps li ul,
.steps li ol {
  border-left: none;
  margin-left: 0;
  padding-left: 0;
  margin-top: 0.5rem;
}

.steps li ul li,
.steps li ol li {
  border-left: none;
  margin-left: 0;
  counter-increment: none;
}

.steps li ul li::before,
.steps li ol li::before {
  content: none;
}

.steps li ul.bullets li {
  padding-left: 2rem;
}

.steps li ul.bullets li::before {
  content: '▸';
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: -1rem;
  top: 0.85rem;
  width: 2rem; height: 2rem;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps li:last-child { border-left: 1px solid transparent; }

/* ─── BULLETS ─── */
.bullets { list-style: none; }

.bullets li {
  padding: 0.3rem 0 0.3rem 1.5rem;
  position: relative;
  color: var(--text);
}

.bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
  top: 0.45rem;
}

/* ─── CODE / MONO ─── */
code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--accent2);
}

pre {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  color: var(--text-bright);
  margin: 0.75rem 0;
  line-height: 1.6;
}

/* ─── TABLE ─── */
.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 0.75rem 0;
}

.param-table th {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: left;
  padding: 0.5rem 1rem;
  background: var(--bg3);
  border: 1px solid var(--border);
}

.param-table td {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  vertical-align: top;
}

.param-table tr:hover td { background: var(--bg2); }

.param-table td:first-child {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent2);
  white-space: nowrap;
}

/* ─── NOTICE BOXES ─── */
.notice {
  display: flex;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  margin: 1rem 0;
  font-size: 0.88rem;
  align-items: flex-start;
}

.notice.info {
  background: var(--accent2-dim);
  border: 1px solid #00b8ff33;
  color: #a0d4f5;
}

.notice.warn {
  background: #f59e0b0f;
  border: 1px solid #f59e0b33;
  color: #fcd47b;
}

.notice.tip {
  background: var(--accent-dim);
  border: 1px solid #00e5a033;
  color: #7eefd0;
}

.notice-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ─── COMMAND GRID ─── */
.cmd-grid { display: flex; flex-direction: column; gap: 8px; }

.cmd-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  align-items: start;
}

.cmd-row:hover { border-color: var(--border2); }

.cmd-name {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
}

.cmd-desc {
  font-size: 0.83rem;
  color: var(--text);
  line-height: 1.5;
}

/* ─── EMOJI STATUS ─── */
.status-grid { display: flex; flex-direction: column; gap: 6px; }

.status-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.85rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}

.status-emoji { font-size: 1.2rem; width: 1.8rem; flex-shrink: 0; }
.status-label { color: var(--text-bright); font-family: var(--mono); font-size: 0.75rem; min-width: 80px; }
.status-desc { color: var(--text); }

/* ─── SECTION ANCHOR OFFSET ─── */
.anchor-target { scroll-margin-top: 74px; }

/* ─── FOOTER ─── */
footer {
  margin-top: 4rem;
  padding: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  position: relative;
  z-index: 1;
}

footer a { color: var(--text-dim); }
footer a:hover { color: var(--accent); }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .page-wrap { grid-template-columns: 1fr; padding: 1.5rem 1rem; }
  .sidebar { display: none; }
  .hero { padding: 1.5rem; }
  .hero h1 { font-size: 1.4rem; }
  .cmd-row { grid-template-columns: 1fr; gap: 0.25rem; }
}
