/* Agent Monitor marketing site — dark, neon-on-near-black, tokens lifted
   verbatim from the app (agent_monitor/static/css/app.css). */

:root {
  --bg: #0a0c10;
  --bg-panel: #0e1218;
  --bg-raise: #141a23;
  --border: #1c2430;
  --border-soft: #161d26;
  --text: #e6edf3;
  --text-dim: #8b95a3;
  --text-faint: #5b6673;
  --added: #3ddc84;
  --modified: #f5a623;
  --signature: #ff5fa2;
  --removed: #ff4d5e;
  --external: #a06bff;
  --entry: #38bdf8;
  --unchanged: #3a4354;
  --sans: ui-sans-serif, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.9, 0.3, 1);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

:focus-visible {
  outline: 2px solid var(--entry);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -48px; left: 12px;
  z-index: 100;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 14px;
  transition: top 0.15s;
}
.skip-link:focus { top: 12px; }

/* ── shared bits ─────────────────────────────────────────────────────── */

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-faint);
  margin-bottom: 14px;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.brand-mark {
  width: 13px; height: 13px;
  border-radius: 3px;
  background: conic-gradient(from 210deg, var(--added), var(--entry), var(--external), var(--modified), var(--added));
  box-shadow: 0 0 12px rgba(61, 220, 132, 0.5);
  flex: none;
}

.brand-name {
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: 0.3px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 650;
  font-family: var(--sans);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.15s var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--entry);
  color: #06121b;
}
.btn-primary:hover { background: #5ecbfa; }

.btn-ghost {
  background: var(--bg-raise);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: #2b3543; background: #182029; }

.btn-small { padding: 7px 14px; font-size: 13px; }

/* ── topbar ──────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(16, 21, 29, 0.85), rgba(12, 16, 22, 0.85));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}
.topbar.scrolled { border-bottom-color: var(--border); }

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-links .text-link {
  color: var(--text-dim);
  font-size: 13.5px;
}
.topbar-links .text-link:hover { color: var(--text); }

/* ── hero ────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: -20% -10%;
  background:
    radial-gradient(ellipse 640px 420px at 78% 42%, rgba(56, 189, 248, 0.07), transparent 70%),
    radial-gradient(ellipse 520px 380px at 70% 70%, rgba(160, 107, 255, 0.05), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 32px;
  align-items: center;
  width: 100%;
  padding-top: 40px;
  padding-bottom: 60px;
}

.hero h1 {
  font-size: clamp(38px, 5.2vw, 58px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
}

.hero .sub {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 44ch;
  margin-bottom: 30px;
}

.hero-ctas {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.cta-note {
  width: 100%;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
}

.hero-stage {
  position: relative;
  min-height: 460px;
  height: 62vh;
  max-height: 640px;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-feed {
  position: absolute;
  left: 0;
  bottom: -6px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(14, 18, 24, 0.75);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  backdrop-filter: blur(6px);
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

.hero-feed .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--modified);
  box-shadow: 0 0 8px var(--modified);
  flex: none;
  animation: breathe 2.4s ease-in-out infinite;
}

.hero-feed:has(#hero-caption[data-state="added"]) .dot { background: var(--added); box-shadow: 0 0 8px var(--added); }
.hero-feed:has(#hero-caption[data-state="signature"]) .dot { background: var(--signature); box-shadow: 0 0 8px var(--signature); }
.hero-feed:has(#hero-caption[data-state="removed"]) .dot { background: var(--removed); box-shadow: 0 0 8px var(--removed); }
.hero-feed:has(#hero-caption[data-state="idle"]) .dot { background: var(--unchanged); box-shadow: none; animation: none; }

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ── sections ────────────────────────────────────────────────────────── */

section { padding: 96px 0; }

section h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 16px;
}

section .lede {
  color: var(--text-dim);
  max-width: 52ch;
}

.feature {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px;
  align-items: center;
}

.feature + .feature { margin-top: 110px; }

.feature.flip .feature-visual { order: -1; }

.feature-copy p { color: var(--text-dim); margin-bottom: 14px; }
.feature-copy p strong { color: var(--text); font-weight: 650; }

.feature-visual {
  min-height: 300px;
  position: relative;
}

.vignette-canvas {
  width: 100%;
  height: 300px;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(20, 26, 35, 0.6), transparent 75%),
    var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* app-panel mockups */

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-faint);
}

.panel-head .mono { font-size: 10.5px; text-transform: none; letter-spacing: 0.2px; }

.panel-body { padding: 6px 0 10px; }

.file-row { padding: 10px 14px 2px; }

.file-row + .file-row { border-top: 1px solid var(--border-soft); margin-top: 8px; }

.file-row .file-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.file-row .path {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

.file-row .delta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
}
.file-row .delta .plus { color: var(--added); }
.file-row .delta .minus { color: var(--removed); }

.chip {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-radius: 3px;
  padding: 1.5px 5px;
}
.chip.low { background: rgba(61, 220, 132, 0.14); color: #7ce8ac; }
.chip.medium { background: rgba(245, 166, 35, 0.15); color: #ffc46b; }
.chip.high { background: rgba(255, 77, 94, 0.16); color: #ff9aa3; }

.note {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.55;
  padding-bottom: 8px;
}
.note .sym { font-family: var(--mono); font-size: 11.5px; color: var(--text); }

/* narrative pane (typing) */

.narrative-entry { padding: 12px 14px; }
.narrative-entry + .narrative-entry { border-top: 1px solid var(--border-soft); }

.narrative-entry .stamp {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  margin-bottom: 5px;
}

.phase {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 8.5px;
}
.phase.implementing { background: rgba(61, 220, 132, 0.14); color: #7ce8ac; }
.phase.refactoring { background: rgba(245, 166, 35, 0.15); color: #ffc46b; }
.phase.wiring { background: rgba(56, 189, 248, 0.15); color: #8ed6fb; }

.narrative-entry .line {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
  min-height: 1.55em;
}
.narrative-entry .line .sym { font-family: var(--mono); font-size: 11.5px; color: #b998ff; }

.line.typing::after {
  content: "";
  display: inline-block;
  width: 6px; height: 13px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--entry);
  animation: caret 1s steps(2) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  list-style: none;
}
.trust li::before { content: "· "; color: var(--external); }

/* split composite for feature 3 */

.composite {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}
.composite .vignette-canvas { height: 100%; min-height: 240px; }

.narrative-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.narrative-card .sym { font-family: var(--mono); font-size: 11.5px; color: var(--text); }
.narrative-card .tag-sig {
  align-self: flex-start;
  background: rgba(255, 95, 162, 0.14);
  color: #ff9ec8;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-radius: 3px;
  padding: 1.5px 6px;
}

/* ── screenshot showcase ─────────────────────────────────────────────── */

.showcase { text-align: center; }
.showcase .lede { margin: 0 auto 44px; }

.screenshot-frame {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    var(--shadow),
    0 0 80px rgba(56, 189, 248, 0.06),
    0 0 120px rgba(61, 220, 132, 0.04);
}
.screenshot-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.showcase figcaption {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
}

/* ── install ─────────────────────────────────────────────────────────── */

.install-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 44px;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 26px;
}

.card h3 { font-size: 17px; font-weight: 650; margin-bottom: 10px; }
.card p { color: var(--text-dim); font-size: 14px; margin-bottom: 16px; }
.card .fine { font-size: 12px; color: var(--text-faint); margin-top: 14px; margin-bottom: 0; }

.code-block {
  position: relative;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 8px;
  /* Right padding clears the absolutely-positioned Copy button. */
  padding: 14px 74px 14px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
}
.code-block .dim { color: var(--text-faint); }

.copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.copy-btn:hover { color: var(--text); border-color: #2b3543; }
.copy-btn.copied { color: var(--added); border-color: rgba(61, 220, 132, 0.4); }

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 44px;
}

.step { display: flex; gap: 14px; align-items: baseline; }

.step .num {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--entry);
}
.step .step-text { font-size: 14px; color: var(--text-dim); }
.step .step-text strong { color: var(--text); font-weight: 650; display: block; }

/* ── footer ──────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 44px 0 56px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.footer-inner .byline { color: var(--text-faint); font-size: 13px; }
.footer-links { display: flex; gap: 20px; font-size: 13px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
  list-style: none;
}
.legend .swatch {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: 1px;
}
.legend .sw-added { background: var(--added); box-shadow: 0 0 6px var(--added); }
.legend .sw-modified { background: var(--modified); box-shadow: 0 0 6px var(--modified); }
.legend .sw-signature { background: var(--signature); box-shadow: 0 0 6px var(--signature); }
.legend .sw-removed { background: var(--removed); box-shadow: 0 0 6px var(--removed); }
.legend .sw-external { background: var(--external); box-shadow: 0 0 6px var(--external); }
.legend .sw-entry { background: var(--entry); box-shadow: 0 0 6px var(--entry); }

/* ── scroll reveal ───────────────────────────────────────────────────── */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
[data-reveal].in-view {
  opacity: 1;
  transform: none;
}

/* ── responsive ──────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 24px; }
  .hero { min-height: 0; }
  .hero-stage { height: 46vh; min-height: 340px; }
  .feature { grid-template-columns: 1fr; gap: 28px; }
  .feature.flip .feature-visual { order: 0; }
  .feature + .feature { margin-top: 72px; }
  .composite { grid-template-columns: 1fr; }
  .install-cards { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 14px; }
  section { padding: 64px 0; }
}

/* ── reduced motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hero-feed .dot { animation: none; }
  .line.typing::after { animation: none; }
  .btn:hover { transform: none; }
}
