/* ============================================================
   AGENT ATLAS — Clean Minimal Design
   Inspired by Linear, Vercel, Stripe
   ============================================================ */

:root {
  --black:      #111111;
  --gray-900:   #1a1a1a;
  --gray-800:   #2a2a2a;
  --gray-700:   #444444;
  --gray-500:   #888888;
  --gray-400:   #aaaaaa;
  --gray-200:   #e5e5e5;
  --gray-100:   #f5f5f5;
  --gray-50:    #fafafa;
  --white:      #ffffff;
  --accent:     #666666;
  --link:       #111111;
  --link-hover: #555555;
  --success:    #22c55e;
  --warning:    #eab308;
  --danger:     #ef4444;
  --radius:     8px;
  --radius-lg:  12px;
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.04);
  --shadow:     0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg:  0 4px 12px rgba(0,0,0,0.08);
  --font:       -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
  --mono:       'SF Mono', 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --transition: 150ms ease;
}

/* ---- DARK MODE VARIABLES ---- */
[data-theme="dark"] {
  --black:      #f0f0f0;
  --gray-900:   #e8e8e8;
  --gray-800:   #d0d0d0;
  --gray-700:   #b0b0b0;
  --gray-500:   #888888;
  --gray-400:   #666666;
  --gray-200:   #2a2a2a;
  --gray-100:   #1e1e1e;
  --gray-50:    #181818;
  --white:      #111111;
  --accent:     #aaaaaa;
  --link:       #f0f0f0;
  --link-hover: #cccccc;
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.3);
  --shadow:     0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-lg:  0 4px 12px rgba(0,0,0,0.5);
}

/* Match system preference when no explicit choice is stored */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --black:      #f0f0f0;
    --gray-900:   #e8e8e8;
    --gray-800:   #d0d0d0;
    --gray-700:   #b0b0b0;
    --gray-500:   #888888;
    --gray-400:   #666666;
    --gray-200:   #2a2a2a;
    --gray-100:   #1e1e1e;
    --gray-50:    #181818;
    --white:      #111111;
    --accent:     #aaaaaa;
    --link:       #f0f0f0;
    --link-hover: #cccccc;
    --shadow-sm:  0 1px 2px rgba(0,0,0,0.3);
    --shadow:     0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
    --shadow-lg:  0 4px 12px rgba(0,0,0,0.5);
  }
}

/* Nav backdrop in dark mode */
[data-theme="dark"] nav { background: rgba(17,17,17,0.92) !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) nav { background: rgba(17,17,17,0.92) !important; }
}

/* ---- THEME TOGGLE BUTTON ---- */
.theme-toggle {
  margin-left: 12px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  /* Light mode: white surface, visible border */
  border: 1px solid #d4d4d4;
  background: #ffffff;
  color: #555555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: #888888;
  color: #111111;
}
.theme-toggle svg { display: block; }

/* Dark mode: lift the button off the dark nav with a lighter surface */
[data-theme="dark"] .theme-toggle {
  background: #2a2a2a;
  border-color: #444444;
  color: #d0d0d0;
}
[data-theme="dark"] .theme-toggle:hover {
  background: #333333;
  border-color: #666666;
  color: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle {
    background: #2a2a2a;
    border-color: #444444;
    color: #d0d0d0;
  }
  :root:not([data-theme="light"]) .theme-toggle:hover {
    background: #333333;
    border-color: #666666;
    color: #ffffff;
  }
}

/* show sun icon in dark mode, moon icon in light mode */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--gray-700);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); }
a:hover { color: var(--link-hover); }
code { font-family: var(--mono); font-size: 0.85em; background: var(--gray-100); padding: 2px 5px; border-radius: 4px; }

/* ---- NAV ---- */
nav {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.92);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
}

.nav-logo {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--black);
  text-decoration: none;
  margin-right: auto;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo .logo-icon {
  width: 26px; height: 26px;
  /* Always dark so the white SVG stroke stays visible in both themes */
  background: #111111;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
[data-theme="dark"] .nav-logo .logo-icon { border-color: rgba(255,255,255,0.18); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-logo .logo-icon { border-color: rgba(255,255,255,0.18); }
}

.nav-logo span { color: var(--gray-500); font-weight: 400; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 0;
}

.nav-links a {
  color: var(--gray-500);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  transition: color var(--transition);
}

.nav-links a:hover { color: var(--black); }
.nav-links a.active { color: var(--black); font-weight: 600; }

/* ---- HERO ---- */
.hero {
  background: var(--white);
  color: var(--black);
  padding: 80px 24px 72px;
  text-align: center;
  border-bottom: 1px solid var(--gray-200);
}

.hero::before { display: none; }
.hero-inner { position: relative; max-width: 640px; margin: 0 auto; }

.hero-badge {
  display: inline-block;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--gray-500);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -1.5px;
  color: var(--black);
}

.hero h1 .accent {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background-clip: unset;
  color: var(--gray-500);
}

.hero p {
  font-size: 1.1rem;
  color: var(--gray-500);
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--black);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--gray-800);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--gray-200);
}
.btn-outline:hover {
  border-color: var(--gray-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* ---- PAGE HEADER (non-home pages) ---- */
.page-header {
  background: var(--white);
  color: var(--black);
  padding: 48px 24px;
  border-bottom: 1px solid var(--gray-200);
}
.page-header::before { display: none; }

.page-header-inner { max-width: 1100px; margin: 0 auto; position: relative; }

.page-header .breadcrumb {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-bottom: 8px;
}
.page-header .breadcrumb a { color: var(--gray-500); text-decoration: none; }
.page-header .breadcrumb a:hover { color: var(--black); }

.page-header h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  color: var(--black);
}

.page-header p { color: var(--gray-500); font-size: 1rem; max-width: 600px; }

/* ---- LAYOUT ---- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 24px;
}

.section { margin-bottom: 56px; }

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.section-subtitle {
  color: var(--gray-500);
  font-size: 0.92rem;
  margin-bottom: 28px;
}

/* ---- CARDS ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--gray-700);
  box-shadow: var(--shadow);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(0,212,240,0.12) 0%, rgba(124,58,237,0.08) 100%);
  border: 1px solid rgba(0,212,240,0.2);
  flex-shrink: 0;
}

.card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--black);
}

.card p {
  font-size: 0.88rem;
  color: var(--gray-500);
  line-height: 1.55;
}

.card a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--black);
  text-decoration: none;
}
.card a:hover { color: var(--gray-500); }

/* ---- VIDEO CARDS ---- */
.video-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
}
.video-card:hover { border-color: var(--gray-700); }

.video-thumb {
  background: var(--gray-100);
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  position: relative;
  color: var(--gray-400);
  background-color: #1a1a1a;
}

.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--black);
  color: var(--white);
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.video-body { padding: 16px; }
.video-body h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; color: var(--black); }
.video-body p { font-size: 0.82rem; color: var(--gray-500); margin-bottom: 10px; }
.video-body .channel { font-size: 0.78rem; color: var(--gray-400); font-weight: 500; }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--gray-200); }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.86rem;
}

thead tr { background: var(--gray-50); }
thead th { padding: 12px 16px; text-align: left; font-weight: 600; font-size: 0.8rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 1px solid var(--gray-200); }

tbody tr { border-bottom: 1px solid var(--gray-100); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }
tbody td { padding: 12px 16px; vertical-align: top; }
tbody td:first-child { font-weight: 600; color: var(--black); }

/* ---- CODE BLOCKS ----
   Always use hardcoded dark-editor colours so they stay readable in
   both light and dark page themes. */
.code-block {
  background: #1e1e1e;
  border-radius: var(--radius-lg);
  margin: 20px 0;
  overflow: hidden;
  border: 1px solid #333;
}

.code-header {
  background: #2d2d2d;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #3a3a3a;
}

.code-lang {
  font-size: 0.72rem;
  font-weight: 600;
  color: #aaaaaa;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.copy-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #aaaaaa;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition);
}
.copy-btn:hover { background: rgba(255,255,255,0.16); color: #ffffff; }

pre { padding: 18px; overflow-x: auto; font-size: 0.84rem; line-height: 1.6; background: #1e1e1e; }
pre code { color: #d4d4d4; font-family: var(--mono); background: none; padding: 0; }

.kw  { color: #c586c0; }
.str { color: #ce9178; }
.cm  { color: #6a9955; font-style: italic; }
.fn  { color: #dcdcaa; }
.num { color: #b5cea8; }

/* ---- STEP LIST ---- */
.steps { list-style: none; counter-reset: steps; }

.step {
  counter-increment: steps;
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}

.step-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  background: var(--black);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  margin-top: 2px;
}

.step-content h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; color: var(--black); }
.step-content p { font-size: 0.88rem; color: var(--gray-500); }
.step-content a { color: var(--black); font-weight: 500; }

/* ---- STAT CARDS ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 48px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.stat-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--black);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--gray-500);
  font-weight: 400;
}

/* ---- CALLOUT ---- */
.callout {
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 16px 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.88rem;
}

.callout-tip { background: var(--gray-50); border-left: 3px solid var(--gray-700); }
.callout-info { background: var(--gray-50); border-left: 3px solid var(--gray-400); }
.callout-warning { background: #fffbeb; border-left: 3px solid var(--warning); }

.callout-icon { font-size: 0.95rem; flex-shrink: 0; margin-top: 1px; }
.callout p { font-size: 0.88rem; color: var(--gray-700); margin: 0; }
.callout strong { color: var(--black); }

/* ---- TABS ---- */
.tabs { margin-bottom: 28px; }

.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tab-btn {
  background: none;
  border: none;
  padding: 8px 16px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--gray-400);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition);
}

.tab-btn:hover { color: var(--black); }
.tab-btn.active { color: var(--black); font-weight: 600; border-bottom-color: var(--black); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- CHECKLIST ---- */
.checklist { list-style: none; }
.checklist li {
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
  content: '☐';
  font-size: 1rem;
  flex-shrink: 0;
  color: var(--gray-400);
  margin-top: 1px;
}

/* ---- COMPARISON BLOCKS ---- */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .compare-grid { grid-template-columns: 1fr; } }

.compare-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.compare-card.featured { border-color: var(--black); }

.compare-header {
  padding: 16px 20px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.compare-header.teal { background: var(--gray-900); color: var(--white); }
.compare-header h3 { font-size: 1rem; font-weight: 700; margin-bottom: 2px; color: var(--black); }
.compare-header p { font-size: 0.8rem; color: var(--gray-500); }

.compare-body { padding: 16px 20px; }
.compare-body li {
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.compare-body li:last-child { border-bottom: none; }
.compare-body li::before { content: ''; width: 6px; height: 6px; background: var(--black); border-radius: 50%; flex-shrink: 0; }

/* ---- FOOTER ---- */
footer {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  color: var(--gray-400);
  padding: 24px 32px;
  font-size: 0.82rem;
  margin-top: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
footer .footer-left { text-align: left; }
footer .footer-right { display: flex; align-items: center; gap: 16px; }
footer .footer-right a { display: flex; align-items: center; color: var(--gray-400); transition: color 0.2s; }
footer .footer-right a:hover { color: var(--black); }
footer .footer-right svg { width: 18px; height: 18px; fill: currentColor; }
footer a { color: var(--gray-500); text-decoration: none; }
footer a:hover { color: var(--black); }
footer .heart { color: #e53e3e; }

/* ---- CONVERSATION DEMO ---- */
.convo {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 20px 0;
}
.convo-header {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  color: var(--black);
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.convo-header::before { content: ''; width: 8px; height: 8px; background: var(--success); border-radius: 50%; }
.convo-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }

.msg {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.5;
}
.msg-agent {
  background: var(--gray-100);
  color: var(--gray-700);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.msg-user {
  background: var(--black);
  color: var(--white);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

/* ---- TAG ---- */
.tag {
  display: inline-block;
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 4px;
  margin-bottom: 4px;
}

/* ---- DIFFICULTY BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-beginner     { background: #f0fdf4; color: #15803d; }
.badge-intermediate { background: #fefce8; color: #a16207; }
.badge-advanced     { background: #fdf2f8; color: #9d174d; }
.badge-nocode       { background: var(--gray-100); color: var(--gray-700); }
.badge-business     { background: var(--gray-100); color: var(--gray-700); }

/* ---- SOURCE BADGE ---- */
.source-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: var(--gray-100);
  color: var(--gray-500);
}

/* ---- EXAMPLE CARD ---- */
.example-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
  display: flex;
  flex-direction: column;
}
.example-card:hover { border-color: var(--gray-700); }

.example-card-top { padding: 18px 20px 12px; flex: 1; }
.example-card-top h3 { font-size: 0.92rem; font-weight: 600; color: var(--black); margin: 8px 0 4px; }
.example-card-top p  { font-size: 0.84rem; color: var(--gray-500); line-height: 1.5; }

.example-card-meta {
  padding: 12px 20px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--gray-400);
}
.example-card-meta a { font-size: 0.82rem; font-weight: 600; color: var(--black); text-decoration: none; }
.example-card-meta a:hover { color: var(--gray-500); }

.example-bar { height: 3px; }
.bar-beginner     { background: var(--gray-200); }
.bar-intermediate { background: var(--gray-400); }
.bar-advanced     { background: var(--black); }

/* ---- RESOURCE CARD ---- */
.resource-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color var(--transition);
}
.resource-card:hover { border-color: var(--gray-700); }
.resource-card h3 { font-size: 0.9rem; font-weight: 600; color: var(--black); margin: 6px 0 4px; }
.resource-card p  { font-size: 0.82rem; color: var(--gray-500); line-height: 1.5; margin-bottom: 8px; }
.resource-card a  { font-size: 0.82rem; font-weight: 600; color: var(--black); text-decoration: none; }
.resource-card a:hover { color: var(--gray-500); }

/* ---- TOOL ROW ---- */
.tool-grid { display: flex; flex-direction: column; gap: 8px; }
.tool-row {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 190px 1fr auto;
  gap: 14px;
  align-items: center;
  transition: border-color var(--transition);
}
.tool-row:hover { border-color: var(--gray-700); }
.tool-name { font-weight: 600; color: var(--black); font-size: 0.9rem; }
.tool-desc { font-size: 0.84rem; color: var(--gray-500); }
.tool-price { font-size: 0.78rem; font-weight: 500; white-space: nowrap; }
.price-free    { color: var(--success); }
.price-paid    { color: var(--gray-500); }
.price-freemium { color: var(--gray-700); }

@media (max-width: 640px) { .tool-row { grid-template-columns: 1fr; } }

/* ---- TOPIC MATRIX ---- */
.topic-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
}
.topic-card:hover { border-color: var(--gray-700); }

.topic-card-header {
  padding: 12px 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 8px;
}
.topic-card-header h3 { font-size: 0.9rem; font-weight: 600; margin: 0; color: var(--black); }
.topic-card-header span { font-size: 1rem; }

.topic-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.topic-cell {
  padding: 14px 16px;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--gray-500);
}
.topic-cell:first-child { border-right: 1px solid var(--gray-100); }
.topic-cell-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  color: var(--gray-400);
}

/* ---- AUDIENCE CARD ---- */
.audience-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color var(--transition);
}
.audience-card:hover { border-color: var(--gray-700); }
.audience-label {
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.audience-layman { background: var(--gray-100); color: var(--gray-700); }
.audience-techie  { background: var(--gray-900); color: var(--white); }

/* ---- GLOSSARY ---- */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.glossary-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  border-left: 3px solid var(--black);
}
.glossary-term { font-size: 0.9rem; font-weight: 700; color: var(--black); margin-bottom: 4px; }
.glossary-def { font-size: 0.82rem; color: var(--gray-500); line-height: 1.55; }

/* ---- COST CALCULATOR ---- */
.calc-box {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  max-width: 720px;
}
.calc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 600px) { .calc-row { grid-template-columns: 1fr; } }
.calc-field label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--black); margin-bottom: 4px; }
.calc-field select, .calc-field input[type="range"] { width: 100%; }
.calc-field select { padding: 7px 10px; border: 1px solid var(--gray-200); border-radius: 6px; font-size: 0.84rem; color: var(--gray-700); background: var(--white); }
input[type="range"] { accent-color: var(--black); }

.calc-result {
  background: var(--gray-900);
  color: var(--white);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.calc-result-item .result-label { font-size: 0.72rem; color: var(--gray-400); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
.calc-result-item .result-val   { font-size: 1.4rem; font-weight: 700; color: var(--white); line-height: 1; }
.calc-result-item .result-sub   { font-size: 0.72rem; color: var(--gray-500); margin-top: 2px; }

/* ---- BENCHMARK TABLE ---- */
.bench-table th:nth-child(n+2) { text-align: center; }
.bench-table td:nth-child(n+2) { text-align: center; }
.bench-score-high  { color: var(--success); font-weight: 600; }
.bench-score-mid   { color: var(--gray-700); font-weight: 600; }
.bench-score-low   { color: var(--danger); font-weight: 600; }
.bench-badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 0.7rem; font-weight: 600; }
.bench-best { background: var(--gray-100); color: var(--gray-700); }

/* ---- INDUSTRY ROW ---- */
.industry-row {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 14px;
  align-items: start;
  transition: border-color var(--transition);
}
.industry-row:hover { border-color: var(--gray-700); }
.industry-name { font-weight: 600; color: var(--black); font-size: 0.9rem; }
.industry-desc { font-size: 0.84rem; color: var(--gray-500); line-height: 1.55; }
@media (max-width: 640px) { .industry-row { grid-template-columns: 1fr; } }

/* ---- RESPONSIBLE AI ---- */
.rai-list { list-style: none; }
.rai-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: start;
  gap: 10px;
  font-size: 0.88rem;
}
.rai-item:last-child { border-bottom: none; }
.rai-num {
  width: 24px; height: 24px;
  background: var(--black);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 700; flex-shrink: 0;
}
.rai-text strong { color: var(--black); }
.rai-text p { font-size: 0.8rem; color: var(--gray-500); margin-top: 2px; }
.rai-category {
  font-size: 0.66rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.rai-cat-governance { background: var(--gray-100); color: var(--gray-700); }
.rai-cat-safety     { background: #fdf2f8; color: #9d174d; }
.rai-cat-privacy    { background: #f0fdf4; color: #15803d; }
.rai-cat-ops        { background: #fefce8; color: #a16207; }

/* ---- DARK MODE OVERRIDES for hardcoded colors ---- */
[data-theme="dark"] .source-badge,
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .source-badge {} }

[data-theme="dark"] code { background: #2a2a2a; color: #d0d0d0; }
/* .code-block/.code-header use hardcoded dark colours — no dark-mode override needed */
[data-theme="dark"] .resource-card,
[data-theme="dark"] .paper-card,
[data-theme="dark"] .concept-card,
[data-theme="dark"] .blog-card { background: #161616; border-color: #2a2a2a; }
[data-theme="dark"] .resource-card:hover,
[data-theme="dark"] .paper-card:hover,
[data-theme="dark"] .blog-card:hover { border-color: #444; }
[data-theme="dark"] .video-card { background: #161616; border-color: #2a2a2a; }
[data-theme="dark"] .tab-btn { background: #1e1e1e; border-color: #2a2a2a; color: #888; }
[data-theme="dark"] .tab-btn.active { background: #111; color: #f0f0f0; border-color: #444; }
[data-theme="dark"] .tabs { background: transparent; }
[data-theme="dark"] .callout { background: #161616; border-color: #2a2a2a; }
[data-theme="dark"] .callout-info { background: #0d1a1e; border-color: #1a3a44; }
[data-theme="dark"] .callout-warning { background: #1a1500; border-color: #3a2e00; }
[data-theme="dark"] .topic-card { background: #161616; border-color: #2a2a2a; }
[data-theme="dark"] .topic-cell:first-child { border-right-color: #2a2a2a; }
[data-theme="dark"] .topic-card-header { background: #1a1a1a; border-bottom-color: #2a2a2a; }
[data-theme="dark"] .benchmark-table th { background: #1e1e1e; }
[data-theme="dark"] .benchmark-table td { border-color: #2a2a2a; }
[data-theme="dark"] .benchmark-table tr:hover td { background: #1a1a1a; }
[data-theme="dark"] footer { background: #0d0d0d; border-top-color: #2a2a2a; }
[data-theme="dark"] .hero,
[data-theme="dark"] .page-header { border-bottom-color: #2a2a2a; }
[data-theme="dark"] .leaderboard-card { background: #161616; border-color: #2a2a2a; }
[data-theme="dark"] .leaderboard-card h3 { color: #d0d0d0; }
[data-theme="dark"] .leaderboard-card p { color: #888; }
[data-theme="dark"] .leaderboard-card a { color: #aaa; border-color: #444; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) code { background: #2a2a2a; color: #d0d0d0; }
  /* .code-block/.code-header use hardcoded dark colours — no dark-mode override needed */
  :root:not([data-theme="light"]) .resource-card,
  :root:not([data-theme="light"]) .paper-card,
  :root:not([data-theme="light"]) .concept-card,
  :root:not([data-theme="light"]) .blog-card { background: #161616; border-color: #2a2a2a; }
  :root:not([data-theme="light"]) .resource-card:hover,
  :root:not([data-theme="light"]) .paper-card:hover,
  :root:not([data-theme="light"]) .blog-card:hover { border-color: #444; }
  :root:not([data-theme="light"]) .video-card { background: #161616; border-color: #2a2a2a; }
  :root:not([data-theme="light"]) .tab-btn { background: #1e1e1e; border-color: #2a2a2a; color: #888; }
  :root:not([data-theme="light"]) .tab-btn.active { background: #111; color: #f0f0f0; border-color: #444; }
  :root:not([data-theme="light"]) .callout { background: #161616; border-color: #2a2a2a; }
  :root:not([data-theme="light"]) .callout-info { background: #0d1a1e; border-color: #1a3a44; }
  :root:not([data-theme="light"]) .callout-warning { background: #1a1500; border-color: #3a2e00; }
  :root:not([data-theme="light"]) .topic-card { background: #161616; border-color: #2a2a2a; }
  :root:not([data-theme="light"]) .topic-cell:first-child { border-right-color: #2a2a2a; }
  :root:not([data-theme="light"]) .topic-card-header { background: #1a1a1a; border-bottom-color: #2a2a2a; }
  :root:not([data-theme="light"]) .benchmark-table th { background: #1e1e1e; }
  :root:not([data-theme="light"]) .benchmark-table td { border-color: #2a2a2a; }
  :root:not([data-theme="light"]) .benchmark-table tr:hover td { background: #1a1a1a; }
  :root:not([data-theme="light"]) footer { background: #0d0d0d; border-top-color: #2a2a2a; }
  :root:not([data-theme="light"]) .hero,
  :root:not([data-theme="light"]) .page-header { border-bottom-color: #2a2a2a; }
  :root:not([data-theme="light"]) .leaderboard-card { background: #161616; border-color: #2a2a2a; }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .nav-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 4px 8px; font-size: 0.78rem; }
  .hero { padding: 48px 16px; }
  .container { padding: 36px 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .topic-card-body { grid-template-columns: 1fr; }
  .topic-cell:first-child { border-right: none; border-bottom: 1px solid var(--gray-100); }
}
