@import url("../brand.css");

/* AMC Docs — Dark green on black design system */

:root {
  /* Palette */
  --bg: var(--amc-bg);
  --bg-alt: var(--amc-panel);
  --bg-card: var(--amc-card);
  --dark: #141414;
  --dark-soft: #1E1E1E;
  --green: var(--amc-accent);
  --green2: var(--amc-accent-muted);
  --green3: var(--amc-accent-deep);
  --green-glow: rgba(74,239,121,0.12);
  --teal: var(--green);
  --orange: var(--amc-warning);
  --orange-light: #fbbf24;
  --orange-pale: rgba(245,158,11,0.08);
  --text: var(--amc-text);
  --text-muted: var(--amc-muted);
  --text-light: var(--amc-dim);
  --border: var(--amc-border);
  --border-green: var(--amc-border-accent);
  --code-bg: rgba(255,255,255,0.05);

  /* Typography */
  --sans: var(--amc-font-sans);
  --mono: var(--amc-font-mono);

  /* Layout */
  --sidebar-w: 280px;
  --topbar-h: 56px;
  --max-content: 780px;
}

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

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

a { color: var(--green); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--green2); text-decoration: none; }

:where(a, button, input, select, textarea, [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: -9999px;
  top: 12px;
  z-index: 10000;
  padding: 8px 14px;
  background: var(--green);
  color: var(--bg);
  font-family: var(--mono);
  font-weight: 700;
}
.skip-link:focus,
.skip-link:focus-visible {
  left: 12px;
}

/* ─── Topbar ─── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 20px; z-index: 100;
}
.topbar-logo {
  font-family: var(--mono);
  font-weight: 700; font-size: 1rem;
  color: var(--text); display: flex; align-items: center; gap: 8px;
  white-space: nowrap; text-decoration: none; letter-spacing: 0;
}
.topbar-logo:hover { text-decoration: none; color: var(--green); }
.brand-cursor { color: var(--green); }
.topbar-tagline {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.65rem;
  white-space: nowrap;
}
.topbar-logo .logo-icon {
  width: 28px; height: 28px; background: var(--green);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  color: #000; font-size: 14px; font-family: var(--mono); font-weight: 700;
}
.topbar-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.topbar-nav a {
  color: var(--text-muted); font-size: 0.82rem; font-weight: 500;
  padding: 6px 12px; border-radius: 4px; transition: all 0.15s;
  text-decoration: none; font-family: var(--mono); text-transform: lowercase; letter-spacing: 0.04em;
}
.topbar-nav a:hover { color: var(--green); background: rgba(74,239,121,0.06); text-decoration: none; }
.topbar-nav a.active { color: var(--green); background: rgba(74,239,121,0.08); }
.menu-btn {
  display: none; background: none; border: none;
  color: var(--green); font-size: 1.5rem; cursor: pointer; padding: 4px;
}

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

/* ─── Sidebar ─── */
.sidebar {
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w); background: var(--bg-alt);
  border-right: 1px solid var(--border);
  overflow-y: auto; z-index: 90;
  padding: 20px 0 40px;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.sidebar-section { padding: 0 16px; margin-bottom: 24px; }
.sidebar-section h4 {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-light); font-weight: 600; margin-bottom: 6px;
  padding: 0 8px; font-family: var(--mono);
}
.sidebar-section a {
  display: block; padding: 5px 12px; border-radius: 4px;
  color: var(--text-muted); font-size: 0.86rem; font-weight: 450;
  transition: all 0.12s; text-decoration: none;
  border-left: 2px solid transparent; margin-left: -2px;
}
.sidebar-section a:hover {
  color: var(--green); background: rgba(74,239,121,0.06);
  text-decoration: none;
}
.sidebar-section a.active {
  color: var(--green); background: rgba(74,239,121,0.08);
  border-left-color: var(--green); font-weight: 600;
  text-decoration: none;
}
.sidebar-section a.sub {
  padding-left: 24px; font-size: 0.82rem;
}

/* ─── Main Content ─── */
.main {
  margin-left: var(--sidebar-w); flex: 1;
  min-width: 0;
  padding: 40px 48px 80px;
  max-width: calc(var(--max-content) + var(--sidebar-w) + 96px);
}
.content { width: 100%; min-width: 0; max-width: var(--max-content); }

/* ─── Typography ─── */
h1 {
  font-family: var(--sans); font-size: 2.2rem; font-weight: 700;
  color: var(--text); line-height: 1.25; margin-bottom: 12px;
  letter-spacing: 0;
}
h2 {
  font-family: var(--sans); font-size: 1.55rem; font-weight: 700;
  color: var(--text); line-height: 1.3; margin: 48px 0 16px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
  letter-spacing: 0;
}
h3 {
  font-family: var(--sans); font-size: 1.15rem; font-weight: 700;
  color: var(--text); margin: 32px 0 10px;
}
h4 {
  font-family: var(--sans); font-size: 0.95rem; font-weight: 600;
  color: var(--text); margin: 24px 0 8px;
}
.subtitle {
  font-size: 1.1rem; color: var(--text-muted); line-height: 1.65;
  margin-bottom: 32px;
}
p { margin-bottom: 16px; }
ul, ol { margin-bottom: 16px; padding-left: 24px; }
li { margin-bottom: 6px; }
li::marker { color: var(--green); }
hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }
strong { color: var(--text); font-weight: 600; }

/* ─── Code ─── */
code {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--code-bg); padding: 2px 7px; border-radius: 4px;
  color: var(--green);
}
pre {
  background: var(--dark); color: #E8E8E8;
  border-radius: 10px; padding: 20px 24px; overflow-x: auto;
  margin-bottom: 20px; font-size: 0.84rem; line-height: 1.7;
  position: relative; border: 1px solid var(--border);
}
pre code {
  background: none; padding: 0; color: inherit; font-size: inherit;
}
pre .comment { color: #6A9955; }
pre .keyword { color: #C586C0; }
pre .string { color: #CE9178; }
pre .cmd { color: #DCDCAA; }
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5); padding: 4px 10px; border-radius: 5px;
  font-size: 0.72rem; cursor: pointer; font-family: var(--mono);
  transition: all 0.15s;
}
.copy-btn:hover { color: #fff; background: rgba(255,255,255,0.15); }

/* ─── Tables ─── */
table {
  width: 100%; border-collapse: collapse; margin-bottom: 24px;
  font-size: 0.88rem;
}
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th {
  background: var(--bg-card); color: var(--green); font-weight: 600;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  font-family: var(--mono);
}
td { color: var(--text-muted); }
td code { font-size: 0.84em; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ─── Cards ─── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  min-width: 0;
  border-radius: 8px; padding: 24px; margin-bottom: 16px;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-green); }
.card h4 { margin-top: 0; margin-bottom: 8px; color: var(--green); font-family: var(--mono); font-size: 0.95rem; }
.card p { margin-bottom: 0; color: var(--text-muted); font-size: 0.9rem; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }

/* ─── Badges / Tags ─── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.02em;
  font-family: var(--mono);
}
.badge-green { background: rgba(74,239,121,0.12); color: var(--green); }
.badge-teal { background: rgba(74,239,121,0.12); color: var(--green); }
.badge-orange { background: rgba(255,255,255,0.08); color: var(--text-muted); }
.badge-dark { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }

/* ─── Callout boxes ─── */
.callout {
  border-radius: 8px; padding: 18px 22px; margin-bottom: 20px;
  font-size: 0.92rem; line-height: 1.65;
}
.callout-teal { background: rgba(74,239,121,0.06); border-left: 4px solid var(--green); }
.callout-green { background: rgba(74,239,121,0.06); border-left: 4px solid var(--green); }
.callout-orange { background: rgba(255,255,255,0.04); border-left: 4px solid var(--text-muted); }
.callout-cream { background: var(--bg-card); border-left: 4px solid var(--border-green); }
.callout strong { display: block; margin-bottom: 4px; color: var(--text); }

/* ─── Steps ─── */
.step {
  display: flex; gap: 16px; margin-bottom: 24px; align-items: flex-start;
}
.step-num {
  flex-shrink: 0; width: 36px; height: 36px; background: var(--green);
  color: #000; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 0.9rem;
  font-family: var(--mono); margin-top: 2px;
}
.step-content { flex: 1; min-width: 0; }
.step-content h4 { margin-top: 0; margin-bottom: 4px; }

/* ─── Dimension bars ─── */
.dim-bar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.dim-bar-label { width: 180px; font-size: 0.85rem; font-weight: 500; color: var(--text); }
.dim-bar-track {
  flex: 1; height: 8px; background: var(--bg-card); border-radius: 4px; overflow: hidden;
}
.dim-bar-fill { height: 100%; background: var(--green); border-radius: 4px; transition: width 0.5s ease; }
.dim-bar-count { font-size: 0.8rem; color: var(--text-muted); font-family: var(--mono); width: 60px; text-align: right; }

/* ─── Level scale ─── */
.level-scale { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.level-item {
  flex: 1; min-width: 110px; padding: 14px; border-radius: 8px;
  text-align: center; background: var(--bg-card); border: 1px solid var(--border);
}
.level-item.highlight { border-color: var(--green); background: rgba(74,239,121,0.08); }
.level-num { font-family: var(--mono); font-weight: 700; font-size: 1.3rem; color: var(--green); }
.level-name { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* ─── Adapter cards ─── */
.adapter-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  min-width: 0;
  padding: 20px 24px; margin-bottom: 12px;
}
.adapter-card h4 { margin: 0 0 6px; font-family: var(--mono); color: var(--text); font-size: 0.95rem; }
.adapter-card .meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; }

/* ─── Footer ─── */
.doc-footer {
  margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--border);
  font-size: 0.82rem; color: var(--text-muted);
  display: flex; justify-content: space-between; align-items: center;
}
.doc-footer a { color: var(--green); }

/* ─── Mobile ─── */
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .topbar-tagline { display: none; }
  .sidebar {
    transform: translateX(-100%); transition: transform 0.25s ease;
    width: 280px; box-shadow: 4px 0 20px rgba(0,0,0,0.3);
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 24px 20px 60px; }
  .topbar-nav a:not(.active) { display: none; }
  .card-grid, .card-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .level-scale { flex-direction: column; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.3rem; }
  table { display: block; max-width: 100%; overflow-x: auto; font-size: 0.82rem; }
  th, td { padding: 8px 10px; }
}

@media (max-width: 480px) {
  .topbar { padding: 0 12px; gap: 10px; }
  .main { padding: 16px 14px 40px; }
}
