/* WatchDog Tools — dark cybersecurity-meets-developer-tooling */

:root {
  --bg: #0A0A0A;
  --bg-2: #121212;
  --bg-3: #1A1A1A;
  --panel: #141414;
  --line: #262626;
  --line-bright: #3F3F46;
  --ink: #F4F4F5;
  --ink-soft: #A1A1AA;
  --ink-mute: #6B7280;
  --accent: #EF4444;
  --accent-2: #F87171;
  --accent-deep: #B91C1C;
  --accent-highlight: #FCA5A5;
  --warn: #FBBF24;
  --danger: #F87171;

  --glass: rgba(10, 10, 10, .7);
  --soft-overlay: rgba(20, 20, 20, .6);
  --grid-line: rgba(255, 255, 255, .05);
  --eco-panel: linear-gradient(135deg, rgba(18, 18, 18, .9), rgba(10, 10, 10, .9));
  --tool-replaces-bg: rgba(239, 68, 68, .05);
  --shadow-hover: 0 24px 50px -28px rgba(239, 68, 68, .28);
  --chip-bg: rgba(255, 255, 255, .055);
  --chip-border: rgba(255, 255, 255, .09);

  --display: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --container: 1180px;
  --gutter: clamp(20px, 4vw, 48px);
  --ease: cubic-bezier(.2,.7,.2,1);
}

:root[data-theme="light"] {
  --bg: #FFFFFF;
  --bg-2: #F5F5F5;
  --bg-3: #E5E5E5;
  --panel: #FAFAFA;
  --line: #E5E5E5;
  --line-bright: #D4D4D8;
  --ink: #0A0A0A;
  --ink-soft: #525252;
  --ink-mute: #737373;
  --accent: #DC2626;
  --accent-2: #EF4444;
  --accent-deep: #991B1B;
  --accent-highlight: #FCA5A5;

  --glass: rgba(255, 255, 255, .82);
  --soft-overlay: rgba(245, 245, 245, .7);
  --grid-line: rgba(0, 0, 0, .055);
  --eco-panel: linear-gradient(135deg, rgba(255, 255, 255, .9), rgba(245, 245, 245, .9));
  --tool-replaces-bg: rgba(220, 38, 38, .06);
  --shadow-hover: 0 18px 40px -22px rgba(220, 38, 38, .35);
  --chip-bg: #F1F1F3;
  --chip-border: #DADADF;
}

html, body { transition: background-color .35s ease, color .35s ease; }
html { max-width: 100vw; overflow-x: hidden; }
body { max-width: 100vw; overflow-x: clip; }
*, *::before, *::after { min-width: 0; }
img, svg, video { max-width: 100%; height: auto; }
pre, code { max-width: 100%; }

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--display);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 2;
}

.mono { font-family: var(--mono); }

/* Backdrop grid + glow */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 30%, transparent 80%);
}

.bg-glow {
  position: fixed;
  inset: -20vh -20vw auto auto;
  width: 80vw;
  height: 80vh;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at center, rgba(239,68,68,.12), transparent 60%);
  filter: blur(20px);
}

/* ===== Nav ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  flex: none;
}
.brand-logo {
  height: 72px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 18px rgba(239, 68, 68, .25));
  transition: opacity .25s ease, filter .25s ease;
}
:root[data-theme="light"] .brand-logo {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .12));
}
:root[data-theme="light"] .brand-logo-dark,
:root:not([data-theme="light"]) .brand-logo-light {
  display: none;
}
@media (max-width: 540px) {
  .brand-logo { height: 56px; }
}
.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-links a {
  font-size: .9rem;
  color: var(--ink-soft);
  padding: 8px 12px;
  border-radius: 8px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-links a:hover {
  color: var(--accent);
  background: rgba(239,68,68,.08);
}

/* ===== Hero ===== */
.hero {
  padding: clamp(80px, 14vh, 160px) 0 80px;
  position: relative;
}

.prompt {
  display: block;
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--ink-soft);
  margin-bottom: 40px;
  padding: 10px 0 10px 14px;
  border-left: 2px solid var(--accent);
  max-width: 720px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.prompt-sigil { color: var(--accent); margin-right: 0; user-select: none; }
.prompt-cmd { color: var(--ink); font-weight: 600; }
.prompt-arg { color: var(--ink-soft); }
.prompt-arrow { color: var(--ink-mute); margin: 0 8px; }
.prompt-out { color: var(--ink); }
.prompt-caret {
  display: inline-block;
  width: .55em;
  height: 1em;
  margin-left: 4px;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 1.05s steps(2) infinite;
  color: transparent;
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
/* Kicker retained as alias for the eyebrow-style text used in other sections */
.kicker {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 1;
  letter-spacing: -.03em;
  margin-bottom: 28px;
  max-width: 18ch;
}
.grad {
  background: linear-gradient(120deg, var(--accent), #FECACA 50%, var(--accent-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 100%;
  animation: gradShift 6s ease-in-out infinite;
}
@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-lede {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 60ch;
  margin-bottom: 40px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: .92rem;
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
  border: 1px solid transparent;
  line-height: 1;
  white-space: nowrap;
}
.btn svg { transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 0 1px rgba(239,68,68,.4), 0 12px 30px -12px rgba(239,68,68,.6);
}
.btn-primary:hover {
  background: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(239,68,68,.55), 0 16px 36px -10px rgba(239,68,68,.7);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line-bright);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(239,68,68,.06);
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.hero-stats > div:not(.rule) { display: flex; flex-direction: column; gap: 4px; }
.stat-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--ink);
}
.stat-lab {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.hero-stats .rule { width: 1px; height: 38px; background: var(--line); }

/* ===== Section heads ===== */
section { padding: clamp(72px, 12vw, 130px) 0; }
.section-head {
  margin-bottom: 56px;
  max-width: 700px;
}
.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.section-head h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  margin-bottom: 18px;
  color: var(--ink);
}
.section-head p {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.section-head p a {
  color: var(--accent);
  border-bottom: 1px dashed rgba(239,68,68,.5);
}

/* ===== Catalog ===== */
.catalog { background: linear-gradient(180deg, transparent, var(--soft-overlay) 30%, transparent); }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}

.tool-loading {
  font-family: var(--mono);
  color: var(--ink-mute);
  font-size: .85rem;
  padding: 40px 0;
}

.tool-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 26px 24px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
  overflow: hidden;
}
.tool-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), transparent);
  transition: width .5s var(--ease);
}
.tool-card:hover {
  border-color: var(--line-bright);
  transform: translateY(-3px);
  box-shadow: 0 24px 50px -28px rgba(239,68,68,.25);
}
.tool-card:hover::before { width: 100%; }

.tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.tool-id {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .12em;
  color: var(--ink-mute);
}
.status-pill {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 0;
  border: 1px solid currentColor;
}
.status-live { color: var(--accent); background: rgba(239,68,68,.08); }
.status-beta { color: var(--warn); background: rgba(251,191,36,.08); }

.tool-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: -.015em;
  color: var(--ink);
}
.tool-tagline {
  font-size: .95rem;
  color: var(--ink-soft);
  line-height: 1.45;
}
.tool-replaces {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--tool-replaces-bg);
  border: 1px solid rgba(239,68,68,.18);
  border-radius: 0;
  margin-top: auto;
  position: relative;
}
.tool-replaces::before {
  content: "↳";
  position: absolute;
  top: 8px;
  right: 12px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: .9rem;
  opacity: .6;
}
.replaces-key {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}
.replaces-val {
  font-size: .92rem;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.35;
}
.tool-summary {
  font-size: .85rem;
  color: var(--ink-mute);
  line-height: 1.5;
  padding-top: 4px;
}
/* + more tile and ecosystem section */
.tool-card-more {
  border-style: dashed;
  border-color: rgba(239,68,68,.4);
  background: linear-gradient(165deg, var(--tool-replaces-bg), var(--soft-overlay));
  align-items: flex-start;
  text-decoration: none;
  position: relative;
}
.tool-card-more:hover {
  border-color: var(--accent);
  background: linear-gradient(165deg, rgba(239,68,68,.08), var(--soft-overlay));
}
.tool-card-more::before { display: none; }
.more-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 0;
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.4);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 6px;
}
.more-foot {
  margin-top: auto;
  font-size: .8rem;
  color: var(--accent);
  letter-spacing: .04em;
}
.tool-card-more:hover .more-foot { color: var(--accent-2); }

.ecosystem { padding: clamp(60px, 9vw, 100px) 0; background: var(--bg); }
.ecosystem-panel {
  position: relative;
  border: 1px solid rgba(239,68,68,.3);
  border-radius: 0;
  padding: clamp(40px, 6vw, 72px) clamp(28px, 5vw, 64px);
  background:
    radial-gradient(ellipse at top right, rgba(239,68,68,.14), transparent 60%),
    var(--eco-panel);
  overflow: hidden;
}
.ecosystem-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(239,68,68,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239,68,68,.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 80% 20%, black, transparent 70%);
  pointer-events: none;
}
.ecosystem-panel > * { position: relative; }
.eyebrow.on-accent { color: var(--accent); margin-bottom: 20px; }
.ecosystem-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.8rem, 4.4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -.025em;
  color: var(--ink);
  margin-bottom: 22px;
  max-width: 20ch;
}
.ecosystem-lede {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 60ch;
  margin-bottom: 36px;
}
.ecosystem-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}
.ecosystem-tiles {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  padding-top: 28px;
  border-top: 1px solid rgba(239,68,68,.15);
}
.eco-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.eco-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--accent);
}
.eco-lab {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.mcp-clients {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  padding: 18px 22px;
  margin-bottom: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--ink-soft);
}
.mcp-client { color: var(--ink); font-weight: 500; }
.mcp-dot { color: var(--ink-mute); }

.tool-caps {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}
.cap {
  font-family: var(--mono);
  font-size: .65rem;
  color: var(--ink);
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
}

.tool-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--ink-mute);
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.tool-foot .mcp-tag {
  color: var(--accent);
  letter-spacing: .1em;
}

/* ===== MCP ===== */
.mcp { background: var(--soft-overlay); }

.mcp-endpoint {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 14px 14px 18px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.mcp-label {
  font-size: .68rem;
  letter-spacing: .16em;
  color: var(--ink-mute);
  flex: none;
}
.mcp-url {
  flex: 1 1 0;
  min-width: 0;
  font-family: var(--mono);
  font-size: clamp(.78rem, 1.4vw, 1.05rem);
  color: var(--accent);
  background: transparent;
  user-select: all;
  word-break: break-all;
  overflow-wrap: anywhere;
  letter-spacing: 0;
}
.mcp-copy {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  font-size: .82rem;
  padding: 10px 18px;
  border-radius: 9px;
  border: none;
  transition: background .25s var(--ease);
}
.mcp-copy:hover { background: var(--accent-2); }
.mcp-copy.is-copied { background: var(--accent-deep); color: #fff; }

.mcp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}
.mcp-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mcp-card header { display: flex; align-items: center; gap: 12px; }
.mcp-num {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--ink-mute);
  letter-spacing: .14em;
}
.mcp-card h3 {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -.01em;
}
.mcp-card p { font-size: .9rem; color: var(--ink-soft); line-height: 1.5; }
.snippet {
  font-family: var(--mono);
  font-size: .8rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 14px;
  color: var(--ink-soft);
  overflow-x: auto;
  white-space: pre;
  max-width: 100%;
}
.snippet-full { white-space: pre-wrap; }
.tok-key { color: var(--accent); }
.tok-str { color: #FBBF24; }

.mcp-config {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  overflow: hidden;
}
.mcp-config summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: .9rem;
  color: var(--ink);
}
.mcp-config summary::-webkit-details-marker { display: none; }
.mcp-config-chev {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 1.1rem;
  transition: transform .3s var(--ease);
}
.mcp-config[open] .mcp-config-chev { transform: rotate(45deg); }
.mcp-config pre {
  margin: 0 22px 22px;
  font-size: .85rem;
}
.mcp-config-note {
  padding: 0 22px 22px;
  font-size: .82rem;
  color: var(--ink-mute);
  line-height: 1.5;
}

/* ===== Stack ===== */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.stack-cell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 26px 24px;
  position: relative;
  overflow: hidden;
}

/* ===== Corner brackets (industrial / HUD accent) ===== */
.corner {
  position: absolute;
  width: 44px;
  height: 44px;
  pointer-events: none;
  z-index: 3;
}
.corner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-left: 2px solid var(--accent);
  border-top: 2px solid var(--accent);
}
.corner::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0 3px,
    var(--accent) 3px 4px
  );
  opacity: .45;
}
.corner-tl { top: 12px; left: 12px; }
.corner-tr { top: 12px; right: 12px; transform: rotate(90deg); }
.corner-br { bottom: 12px; right: 12px; transform: rotate(180deg); }
.corner-bl { bottom: 12px; left: 12px; transform: rotate(270deg); }

/* Smaller, minimal variant — bracket only, no crosshatch fill */
.corner-sm {
  width: 22px;
  height: 22px;
}
.corner-sm::before {
  border-width: 1.5px;
}
.corner-sm::after {
  display: none;
}
.corner-sm.corner-tl,
.corner-sm.corner-tr,
.corner-sm.corner-bl,
.corner-sm.corner-br {
  /* tighter to the edge for the smaller stack cells */
}
.corner-sm.corner-tl { top: 8px; left: 8px; }
.corner-sm.corner-tr { top: 8px; right: 8px; }
.corner-sm.corner-bl { bottom: 8px; left: 8px; }
.corner-sm.corner-br { bottom: 8px; right: 8px; }
.stack-key {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 12px;
}
.stack-cell p { font-size: .95rem; line-height: 1.55; color: var(--ink-soft); }
.stack-cell code {
  font-family: var(--mono);
  font-size: .85rem;
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
  border: 1px solid var(--line);
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .72rem;
  color: var(--ink-mute);
  letter-spacing: .04em;
}
.footer a { color: var(--accent); }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .mcp-grid, .stack-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 20px; flex-wrap: wrap; }
  .hero-stats .rule { display: none; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 8px 8px; font-size: .82rem; }
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .ecosystem-panel { padding: 36px 24px; }
  .ecosystem-tiles { gap: 18px 24px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { justify-content: center; }
}

@media (max-width: 680px) {
  /* Collapse nav: hide the link list, show only logo + theme toggle */
  .nav-links a { display: none; }
  .nav-inner { gap: 12px; padding: 12px var(--gutter); }
  .nav-links { gap: 6px; }
  /* Keep theme toggle visible — it's the only nav control on mobile */
  .nav-links .theme-toggle { display: inline-flex; }

  .container { padding: 0 18px; }
  .brand-logo { height: 52px; }

  /* Hero prompt: wrap, smaller text */
  .prompt {
    font-size: .72rem;
    padding: 10px 0 10px 10px;
    line-height: 1.6;
    word-break: break-word;
  }
  .prompt-arrow { display: inline; }

  .hero-title { font-size: clamp(2rem, 9vw, 3rem); }
  .hero-lede { font-size: 1rem; }
  section { padding: 64px 0; }
  .hero { padding-top: 56px; }
  .section-head { margin-bottom: 36px; }

  /* Single-column tool grid, smaller cards */
  .tool-grid { grid-template-columns: 1fr; gap: 14px; }
  .tool-card { padding: 22px 20px; }
  .tool-name { font-size: 1.2rem; }

  /* MCP endpoint chip: stack the URL+copy button, allow URL wrap */
  .mcp-endpoint { flex-direction: column; align-items: stretch; gap: 10px; }
  .mcp-url { font-size: .78rem; padding: 4px 0; }
  .mcp-copy { width: 100%; }

  .mcp-clients { padding: 14px 16px; font-size: .72rem; gap: 8px; }
  .snippet { font-size: .72rem; }
  .snippet-full { white-space: pre-wrap; word-break: break-word; }

  /* Ecosystem panel: dial down corner brackets so they don't crowd content */
  .ecosystem-panel { padding: 28px 20px; }
  .corner { width: 28px; height: 28px; }
  .corner::after { width: 14px; height: 14px; top: 4px; left: 4px; }
  .corner-tl, .corner-bl { left: 8px; }
  .corner-tr, .corner-br { right: 8px; }
  .corner-tl, .corner-tr { top: 8px; }
  .corner-bl, .corner-br { bottom: 8px; }

  .ecosystem-cta { flex-direction: column; align-items: stretch; }
  .ecosystem-cta .btn { justify-content: center; }
  .ecosystem-tiles { gap: 14px; }
  .ecosystem-tiles .eco-tile { flex: 1 1 calc(50% - 14px); }

  .stack-cell { padding: 22px 20px; }

  /* Footer: stack rows */
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ===== Theme toggle ===== */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  margin-left: 8px;
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--tool-replaces-bg);
}
.theme-toggle svg {
  position: absolute;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity .25s ease, transform .35s ease;
}
:root[data-theme="dark"] .theme-icon-sun,
:root:not([data-theme="light"]) .theme-icon-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}
:root[data-theme="dark"] .theme-icon-moon,
:root:not([data-theme="light"]) .theme-icon-moon {
  opacity: 0;
  transform: rotate(-45deg) scale(.7);
}
:root[data-theme="light"] .theme-icon-sun {
  opacity: 0;
  transform: rotate(45deg) scale(.7);
}
:root[data-theme="light"] .theme-icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

@media (max-width: 540px) {
  .theme-toggle { margin-left: 4px; }
}
