/* ============================================================
 * Autonomous Agents page — local stylesheet (ag- prefix)
 * Design vocabulary: editorial · agent loop · violet accent
 * Mirrors the v2 / marketing conventions so AI & Automation reads as
 * one studio. LIME stays the site-wide primary accent; violet
 * (--ag-violet) flavors the demo / loop / dashboard internals only.
 * ============================================================ */

.ag-page {
  --ag-violet: #7C5CFF;
  --ag-violet-2: #A78BFA;
  --ag-amber: #F59E0B;
  --ag-red: #F4796F;
  --ag-paper: #ECE9FA;
  --ag-ink: #08060F;
  --ag-lime: #d4ff3a;
  --ag-paper-soft: rgba(236, 233, 250, 0.04);
  --ag-line: rgba(236, 233, 250, 0.12);
  --ag-line-strong: rgba(236, 233, 250, 0.22);
  --ag-mono: 'JetBrains Mono', ui-monospace, monospace;
  --ag-display: 'Fraunces', 'Bodoni Moda', serif;
  --ag-sans: 'Space Grotesk', system-ui, sans-serif;
  background: var(--ag-ink);
  color: var(--ag-paper);
}

/* ===== shared atoms ===== */
.ag-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ag-mono);
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(236, 233, 250, 0.62);
  padding: 8px 12px;
  border: 1px solid var(--ag-line);
  border-radius: 999px;
  background: var(--ag-paper-soft);
}
.ag-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 12px var(--lime);
  animation: agPulse 2.4s ease-in-out infinite;
}
@keyframes agPulse { 0%, 100% { opacity: 1 } 50% { opacity: 0.45 } }

.ag-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ag-sans);
  font-size: 14px; font-weight: 500;
  letter-spacing: 0.04em;
  padding: 14px 22px;
  border: 1px solid var(--ag-line-strong);
  border-radius: 999px;
  color: var(--ag-paper);
  background: transparent;
  text-decoration: none;
  transition: background-color 0.35s cubic-bezier(0.16,1,0.3,1),
              color 0.35s cubic-bezier(0.16,1,0.3,1),
              border-color 0.35s cubic-bezier(0.16,1,0.3,1);
}
.ag-btn:hover { background: var(--ag-paper); color: var(--ag-ink); border-color: var(--ag-paper); }
/* Primary CTA — LIME per site convention. .ag-btn--violet aliases lime so
 * markup can opt into a "violet" name without ever colouring a primary CTA violet. */
.ag-btn--lime,
.ag-btn--violet {
  background: var(--ag-lime);
  color: var(--ag-ink);
  border-color: var(--ag-lime);
}
.ag-btn--lime:hover,
.ag-btn--violet:hover { background: transparent; color: var(--ag-lime); border-color: var(--ag-lime); }
.ag-btn .arr { transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
.ag-btn:hover .arr { transform: translateX(4px); }

.ag-section {
  position: relative;
  padding: 140px 6vw 160px;
  z-index: 2;
}
.ag-loopwrap, .ag-arch, .ag-tools, .ag-compound, .ag-ledger, .ag-cta {
  z-index: 5;
  isolation: isolate;
}
.ag-program { z-index: 1; }
.ag-program__sticky { z-index: 1; }
.ag-loop__stage, .ag-loop__panel, .ag-loop__slider,
.ag-tools__grid, .ag-tool {
  pointer-events: auto;
  position: relative;
  z-index: 1;
}
.ag-section__head {
  max-width: 880px;
  margin: 0 auto 80px;
  text-align: center;
}
.ag-section__title {
  font-family: var(--ag-display);
  font-weight: 400;
  font-size: clamp(40px, 5.6vw, 92px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 24px 0 24px;
  font-variation-settings: 'opsz' 144, 'SOFT' 30, 'WONK' 1;
}
.ag-section__title em { font-style: italic; color: var(--ag-lime); }
.ag-section__lede {
  font-family: var(--ag-sans);
  font-size: 17px; line-height: 1.62;
  color: rgba(236, 233, 250, 0.70);
  max-width: 640px; margin: 0 auto;
}
.ag-section__lede em {
  font-family: var(--ag-display); font-style: italic;
  color: var(--ag-paper); font-weight: 500;
}
.ag-section__lede code {
  font-family: var(--ag-mono); font-size: 14px;
  color: var(--ag-violet-2); background: rgba(124, 92, 255, 0.1);
  padding: 1px 6px; border-radius: 5px;
}

/* ============================================================
 * 01 — HERO (agent console)
 * ============================================================ */
.ag-hero {
  position: relative; min-height: 100vh;
  padding: 120px 6vw 60px; overflow: hidden; z-index: 1;
}
.ag-hero__grain {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.06;
  background-image:
    radial-gradient(rgba(236, 233, 250, 0.6) 1px, transparent 1px),
    radial-gradient(rgba(236, 233, 250, 0.6) 1px, transparent 1px);
  background-size: 4px 4px, 6px 6px; background-position: 0 0, 2px 3px;
  mix-blend-mode: overlay;
}
.ag-hero__three {
  position: absolute; top: 6%; right: -8%;
  width: 72vw; max-width: 1000px; height: 76vh;
  pointer-events: none; opacity: 0.62; z-index: 0;
}
.ag-hero__inner {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px;
  align-items: center; min-height: calc(100vh - 240px);
}
.ag-hero__left { padding-right: 20px; }
.ag-hero__title {
  font-family: var(--ag-display); font-weight: 400;
  font-size: clamp(48px, 6.4vw, 108px); line-height: 1.0;
  letter-spacing: -0.025em; margin: 28px 0 28px;
  font-variation-settings: 'opsz' 144, 'wght' 400, 'SOFT' 30, 'WONK' 1;
}
.ag-hero__title em { font-style: italic; color: var(--ag-lime); }
.ag-hero__lede {
  font-family: var(--ag-sans); font-size: 18px; line-height: 1.62;
  color: rgba(236, 233, 250, 0.72); max-width: 540px;
}
.ag-hero__cta-row { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; }
.ag-hero__caption {
  margin-top: 38px; font-family: var(--ag-mono); font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(236, 233, 250, 0.45);
  display: flex; gap: 14px; align-items: baseline;
}
.ag-hero__caption .n {
  font-family: var(--ag-display); font-style: italic; font-size: 16px; color: var(--ag-lime);
}

/* agent console */
.ag-hero__console {
  position: relative; width: 100%;
  background: linear-gradient(180deg, #140f26 0%, #0c0918 100%);
  border: 1px solid var(--ag-line); border-radius: 14px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6), 0 0 0 1px rgba(236,233,250,0.04);
  overflow: hidden; display: flex; flex-direction: column;
}
.ag-console__chrome {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--ag-line);
  background: rgba(236, 233, 250, 0.02);
}
.ag-console__title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--ag-mono); font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase; color: rgba(236,233,250,0.6);
}
.ag-console__pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--lime); box-shadow: 0 0 10px var(--lime);
  animation: agPulse 1.6s ease-in-out infinite;
}
.ag-console__roas {
  font-family: var(--ag-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(236,233,250,0.55);
}
.ag-console__roas span {
  font-family: var(--ag-display); font-style: italic; font-size: 18px;
  color: var(--ag-lime); margin-left: 6px;
  font-variation-settings: 'opsz' 96, 'wght' 600;
}
.ag-console__query {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-bottom: 1px solid var(--ag-line);
  background: rgba(236,233,250,0.02);
  font-family: var(--ag-mono); font-size: 12.5px; color: rgba(236,233,250,0.82);
}
.ag-console__query-icon { color: var(--ag-violet-2); font-size: 14px; }
.ag-console__query-text { flex: 1; }
.ag-console__caret {
  width: 1.5px; height: 14px; background: var(--ag-violet);
  animation: agCaret 1.1s step-end infinite;
}
.ag-console__body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--ag-line);
}
.ag-console__metric {
  background: #0c0918; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.ag-console__metric .k {
  font-family: var(--ag-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(236,233,250,0.5);
}
.ag-console__metric .v {
  font-family: var(--ag-display); font-size: 30px; font-weight: 500; color: var(--ag-paper);
  font-variation-settings: 'opsz' 96, 'wght' 500;
}
.ag-console__spark { display: block; width: 100%; height: 90px; background: #0c0918; }
.ag-console__control {
  padding: 16px 20px 20px; border-top: 1px solid var(--ag-line);
  background: rgba(236,233,250,0.02);
}
.ag-console__control-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--ag-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(236,233,250,0.55); margin-bottom: 12px;
}
.ag-console__budget { font-family: var(--ag-display); font-style: italic; font-size: 18px; color: var(--ag-violet-2); }
.ag-console__slider, .ag-loop__slider {
  appearance: none; -webkit-appearance: none; width: 100%; height: 4px;
  background: var(--ag-line); border-radius: 2px; outline: none; cursor: ew-resize;
}
.ag-console__slider::-webkit-slider-thumb, .ag-loop__slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--lime); cursor: ew-resize; box-shadow: 0 4px 12px rgba(212,255,58,0.5);
}
.ag-console__slider::-moz-range-thumb, .ag-loop__slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--lime);
  cursor: ew-resize; border: 0; box-shadow: 0 4px 12px rgba(212,255,58,0.5);
}
@keyframes agCaret { 0%,100% { opacity: 1 } 50% { opacity: 0 } }

/* hero metrics row */
.ag-hero__metrics {
  position: relative; z-index: 2; margin-top: 36px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border-top: 1px solid var(--ag-line);
}
.ag-hero__metric {
  padding: 22px 24px; border-right: 1px solid var(--ag-line);
  display: flex; flex-direction: column; gap: 8px;
}
.ag-hero__metric:last-child { border-right: 0; }
.ag-hero__metric .k {
  font-family: var(--ag-mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: rgba(236,233,250,0.5);
}
.ag-hero__metric .v {
  font-family: var(--ag-display); font-size: 38px; font-weight: 500; color: var(--ag-paper);
  font-variation-settings: 'opsz' 96, 'wght' 500;
}
.ag-hero__metric .v em { font-style: italic; color: var(--ag-lime); }

/* ============================================================
 * 02 — LEDGER
 * ============================================================ */
.ag-ledger__table { max-width: 1200px; margin: 0 auto; border-top: 1px solid var(--ag-line-strong); }
.ag-ledger__row {
  display: grid; grid-template-columns: 1.2fr 1fr 2.4fr 1fr; gap: 30px;
  padding: 26px 18px; border-bottom: 1px solid var(--ag-line);
  transition: background 0.3s ease, padding 0.3s ease; align-items: baseline;
}
.ag-ledger__row:hover { background: rgba(236,233,250,0.03); padding-left: 28px; }
.ag-ledger__name {
  font-family: var(--ag-display); font-style: italic; font-size: 28px;
  font-variation-settings: 'opsz' 96, 'wght' 500, 'SOFT' 30, 'WONK' 1; color: var(--ag-paper);
}
.ag-ledger__type {
  font-family: var(--ag-mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: rgba(236,233,250,0.55);
}
.ag-ledger__beat {
  font-family: var(--ag-sans); font-size: 14px; line-height: 1.55; color: rgba(236,233,250,0.72);
}
.ag-ledger__metric { text-align: right; display: flex; flex-direction: column; gap: 4px; }
.ag-ledger__metric em {
  font-family: var(--ag-display); font-style: italic; font-size: 32px; font-weight: 500;
  color: var(--ag-lime); font-variation-settings: 'opsz' 96, 'wght' 500;
}
.ag-ledger__metric span {
  font-family: var(--ag-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(236,233,250,0.45);
}

/* ============================================================
 * 03 — LOOP (signature: live agent loop visualizer)
 * ============================================================ */
.ag-loop__stage {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 44px;
  max-width: 1220px; margin: 0 auto; align-items: start;
}
/* left — scratchpad / trace + tool palette */
.ag-loop__pad {
  background: #0c0918; border: 1px solid var(--ag-line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,0.6);
  display: flex; flex-direction: column;
}
.ag-loop__pad-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--ag-line); background: rgba(236,233,250,0.02);
}
.ag-loop__pad-mark {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--ag-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(236,233,250,0.74);
}
.ag-loop__pad-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ag-violet); box-shadow: 0 0 10px var(--ag-violet); }
.ag-loop__pad-stage {
  font-family: var(--ag-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ag-violet-2);
}
.ag-loop__trace { padding: 14px; display: flex; flex-direction: column; gap: 9px; min-height: 380px; }

/* trace rows (injected by JS) */
.ag-trace-row {
  position: relative; padding: 12px 14px 12px 16px; border-radius: 9px;
  background: rgba(236,233,250,0.025); border: 1px solid var(--ag-line);
  display: flex; flex-direction: column; gap: 6px;
  transition: transform 0.5s cubic-bezier(0.16,1,0.3,1), border-color 0.4s ease, background 0.4s ease, opacity 0.4s ease;
}
.ag-trace-row.is-fresh { transform: translateY(8px); opacity: 0; }
.ag-trace-row.is-active { border-color: var(--ag-violet); background: rgba(124,92,255,0.08); box-shadow: 0 8px 24px -10px rgba(124,92,255,0.5); }
.ag-trace-row.is-gated { border-color: rgba(245,158,11,0.55); background: rgba(245,158,11,0.07); }
.ag-trace-row.is-done { border-color: rgba(212,255,58,0.4); background: rgba(212,255,58,0.05); }
.ag-trace-row__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ag-trace-row__kind {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--ag-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ag-violet-2);
}
.ag-trace-row__kind::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ag-violet);
}
.ag-trace-row--think .ag-trace-row__kind { color: rgba(236,233,250,0.6); }
.ag-trace-row--think .ag-trace-row__kind::before { background: rgba(236,233,250,0.5); }
.ag-trace-row--act .ag-trace-row__kind { color: var(--ag-violet-2); }
.ag-trace-row--observe .ag-trace-row__kind { color: var(--ag-violet-2); }
.ag-trace-row--observe .ag-trace-row__kind::before { background: var(--ag-violet-2); }
.ag-trace-row--gate .ag-trace-row__kind { color: var(--ag-amber); }
.ag-trace-row--gate .ag-trace-row__kind::before { background: var(--ag-amber); }
.ag-trace-row--done .ag-trace-row__kind { color: var(--ag-lime); }
.ag-trace-row--done .ag-trace-row__kind::before { background: var(--ag-lime); }
.ag-trace-row__step {
  flex: 0 0 auto; font-family: var(--ag-mono); font-size: 10px; color: rgba(236,233,250,0.4);
}
.ag-trace-row__text { font-family: var(--ag-sans); font-size: 13px; line-height: 1.45; color: rgba(236,233,250,0.88); }
.ag-trace-row__text b { color: var(--ag-paper); font-weight: 600; }
.ag-trace-row__tool {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-family: var(--ag-mono); font-size: 10px; letter-spacing: 0.06em;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(124,92,255,0.16); color: var(--ag-violet-2);
}
.ag-loop__empty {
  padding: 40px 18px; text-align: center; font-family: var(--ag-sans); font-size: 14px;
  color: rgba(236,233,250,0.4); font-style: italic;
}

/* tool palette */
.ag-loop__palette {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  padding: 14px; border-top: 1px solid var(--ag-line); background: rgba(236,233,250,0.015);
}
.ag-tool-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px; cursor: pointer;
  font-family: var(--ag-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--ag-line); background: rgba(8,6,15,0.5); color: rgba(236,233,250,0.6);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.ag-tool-chip--side { grid-column: span 2; }
.ag-tool-chip__glyph svg {
  width: 16px; height: 16px; fill: none; stroke: var(--lime); stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.25s ease;
}
.ag-tool-chip.is-firing,
.ag-tool-chip[aria-pressed="true"] {
  color: var(--ag-paper); border-color: rgba(124,92,255,0.55);
  background: rgba(124,92,255,0.12); box-shadow: 0 0 18px -6px rgba(124,92,255,0.6);
}
.ag-tool-chip.is-off { opacity: 0.4; }
.ag-tool-chip.is-firing .ag-tool-chip__glyph svg { stroke: var(--ag-violet-2); }

/* right — control panel + verdict */
.ag-loop__panel {
  display: flex; flex-direction: column; gap: 18px; padding: 24px;
  background: rgba(236,233,250,0.03); border: 1px solid var(--ag-line); border-radius: 14px;
}
.ag-loop__goals { display: flex; gap: 8px; flex-wrap: wrap; }
.ag-loop__g {
  font-family: var(--ag-mono); font-size: 11px; letter-spacing: 0.06em;
  padding: 8px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--ag-line); background: transparent; color: rgba(236,233,250,0.7);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.ag-loop__g:hover { border-color: var(--ag-line-strong); color: var(--ag-paper); }
.ag-loop__g.is-on { background: var(--ag-violet); color: #0a0814; border-color: var(--ag-violet); }
.ag-loop__askbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 10px; background: rgba(8,6,15,0.6); border: 1px solid var(--ag-line);
  font-family: var(--ag-sans); font-size: 14px; color: var(--ag-paper);
}
.ag-loop__askbar-icon { color: var(--ag-violet-2); }
.ag-loop__controls { display: flex; flex-direction: column; gap: 16px; }
.ag-loop__control-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--ag-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(236,233,250,0.6); margin-bottom: 10px;
}
.ag-loop__val { font-family: var(--ag-display); font-style: italic; font-size: 17px; color: var(--ag-violet-2); }
.ag-loop__toggles { display: flex; gap: 10px; }
.ag-loop__toggle {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 12px; border-radius: 10px; cursor: pointer;
  font-family: var(--ag-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--ag-line); background: rgba(8,6,15,0.4); color: rgba(236,233,250,0.55);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.ag-loop__toggle-dot {
  width: 8px; height: 8px; border-radius: 50%; background: rgba(236,233,250,0.3);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.ag-loop__toggle.is-on { color: var(--ag-paper); border-color: rgba(124,92,255,0.5); }
.ag-loop__toggle.is-on .ag-loop__toggle-dot { background: var(--ag-violet); box-shadow: 0 0 9px var(--ag-violet); }
/* the approval-gate toggle reads amber when armed */
#ag-gate.is-on { border-color: rgba(245,158,11,0.5); }
#ag-gate.is-on .ag-loop__toggle-dot { background: var(--ag-amber); box-shadow: 0 0 9px var(--ag-amber); }

/* run + approve buttons */
.ag-loop__run-row { display: flex; gap: 10px; }
.ag-loop__run {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 18px; border-radius: 999px; cursor: pointer;
  font-family: var(--ag-sans); font-size: 13px; font-weight: 500; letter-spacing: 0.04em;
  background: var(--ag-lime); color: var(--ag-ink); border: 1px solid var(--ag-lime);
  transition: background 0.3s ease, color 0.3s ease;
}
.ag-loop__run:hover { background: transparent; color: var(--ag-lime); }
.ag-loop__run .arr { transition: transform 0.3s cubic-bezier(0.16,1,0.3,1); }
.ag-loop__run:hover .arr { transform: translateX(4px); }
.ag-loop__run[disabled] { opacity: 0.5; cursor: default; }
.ag-loop__approve {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 18px; border-radius: 999px; cursor: pointer;
  font-family: var(--ag-sans); font-size: 13px; font-weight: 500; letter-spacing: 0.04em;
  background: var(--ag-amber); color: #1a1205; border: 1px solid var(--ag-amber);
  transition: filter 0.3s ease;
}
.ag-loop__approve:hover { filter: brightness(1.08); }
.ag-loop__approve .arr { transition: transform 0.3s cubic-bezier(0.16,1,0.3,1); }
.ag-loop__approve:hover .arr { transform: translateX(4px); }

.ag-loop__verdict {
  border-radius: 12px; padding: 18px; border: 1px solid var(--ag-line);
  background: rgba(8,6,15,0.5); transition: border-color 0.35s ease, background 0.35s ease;
}
.ag-loop__verdict.is-gated { border-color: rgba(245,158,11,0.5); background: rgba(245,158,11,0.06); }
.ag-loop__verdict.is-limit { border-color: rgba(244,121,111,0.5); background: rgba(244,121,111,0.06); }
.ag-loop__verdict.is-done { border-color: rgba(124,92,255,0.45); background: rgba(124,92,255,0.07); }
.ag-loop__verdict-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ag-loop__verdict-label {
  font-family: var(--ag-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(236,233,250,0.55);
}
.ag-loop__verdict-flag {
  font-family: var(--ag-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
}
.ag-loop__verdict-flag.is-done { color: var(--ag-violet-2); background: rgba(124,92,255,0.16); }
.ag-loop__verdict-flag.is-gated { color: var(--ag-amber); background: rgba(245,158,11,0.16); }
.ag-loop__verdict-flag.is-warn { color: var(--ag-red); background: rgba(244,121,111,0.16); }
.ag-loop__verdict-text {
  font-family: var(--ag-display); font-size: 18px; line-height: 1.5; color: var(--ag-paper);
  font-variation-settings: 'opsz' 40, 'SOFT' 20;
}
.ag-loop__verdict-text sup {
  font-family: var(--ag-mono); font-size: 10px; font-weight: 600; color: var(--ag-violet-2);
  vertical-align: super; padding: 0 1px;
}

.ag-loop__readout {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px;
  background: var(--ag-line); border: 1px solid var(--ag-line); border-radius: 10px; overflow: hidden;
}
.ag-loop__stat { background: rgba(236,233,250,0.02); padding: 13px 14px; display: flex; flex-direction: column; gap: 5px; }
.ag-loop__stat .k {
  font-family: var(--ag-mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(236,233,250,0.5);
}
.ag-loop__stat .v {
  font-family: var(--ag-display); font-size: 22px; color: var(--ag-paper);
  font-variation-settings: 'opsz' 96, 'wght' 500;
}
.ag-loop__stat--hero { background: rgba(124,92,255,0.08); }
.ag-loop__stat--hero .v { color: var(--ag-lime); font-style: italic; }
.ag-loop__note {
  font-family: var(--ag-display); font-style: italic; font-size: 15px;
  color: rgba(236,233,250,0.7); line-height: 1.5;
}

/* ============================================================
 * 04 — ARCHITECTURE (mock run-trace dashboard)
 * ============================================================ */
.ag-arch__app {
  max-width: 1200px; margin: 0 auto;
  background: #0c0918; border: 1px solid var(--ag-line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,0.6);
}
.ag-arch__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--ag-line); background: rgba(236,233,250,0.02);
  flex-wrap: wrap; gap: 10px;
}
.ag-arch__bar-mark {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--ag-mono); font-size: 12px; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(236,233,250,0.78);
}
.ag-arch__pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ag-violet); box-shadow: 0 0 10px var(--ag-violet); }
.ag-arch__bar-strat {
  font-family: var(--ag-mono); font-size: 11px; letter-spacing: 0.1em; color: rgba(236,233,250,0.55);
}
.ag-arch__bar-strat strong { color: var(--ag-paper); font-weight: 600; }
.ag-arch__body { display: grid; grid-template-columns: 200px 1fr; }
.ag-arch__tree {
  border-right: 1px solid var(--ag-line); padding: 18px 0; display: flex; flex-direction: column;
  background: rgba(236,233,250,0.01);
}
.ag-tree__node {
  font-family: var(--ag-sans); font-size: 13px; color: rgba(236,233,250,0.7);
  padding: 9px 22px; cursor: default; transition: background 0.2s ease, color 0.2s ease;
}
.ag-tree__node--root { font-weight: 600; color: var(--ag-paper); font-size: 13px; }
.ag-tree__node--stage { color: rgba(236,233,250,0.78); }
.ag-tree__node.is-on { background: rgba(124,92,255,0.1); color: var(--ag-paper); box-shadow: inset 3px 0 0 var(--ag-violet); }
.ag-tree__node--stage:hover { background: rgba(236,233,250,0.04); }
.ag-arch__table { padding: 4px 0; overflow-x: auto; }
.ag-st__head, .ag-st__row {
  display: grid; grid-template-columns: 1fr 1.4fr 2.5fr 0.9fr; gap: 12px;
  padding: 13px 24px; align-items: center;
}
.ag-st__head {
  font-family: var(--ag-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(236,233,250,0.45); border-bottom: 1px solid var(--ag-line);
}
.ag-st__row {
  border-bottom: 1px solid rgba(236,233,250,0.06);
  font-family: var(--ag-sans); font-size: 13px; color: rgba(236,233,250,0.82);
}
.ag-st__row:last-child { border-bottom: 0; }
.ag-st__row.is-active { background: rgba(124,92,255,0.07); box-shadow: inset 3px 0 0 var(--ag-violet); }
.ag-st__stage { font-family: var(--ag-display); font-style: italic; font-size: 17px; color: var(--ag-paper); font-variation-settings: 'opsz' 72, 'wght' 500; }
.ag-st__tool { font-family: var(--ag-mono); font-size: 12px; color: var(--ag-violet-2); }
.ag-st__role { color: rgba(236,233,250,0.7); line-height: 1.4; }
.ag-st__sig {
  justify-self: start; font-family: var(--ag-mono); font-size: 10px; letter-spacing: 0.06em;
  padding: 3px 9px; border-radius: 999px; text-transform: lowercase; white-space: nowrap;
}
.ag-st__sig--ok { background: rgba(124,92,255,0.16); color: var(--ag-violet-2); }
.ag-st__sig--live { background: rgba(212,255,58,0.16); color: var(--ag-lime); }
.ag-st__sig--warn { background: rgba(245,158,11,0.16); color: var(--ag-amber); }
.ag-arch__foot {
  display: flex; gap: 28px; flex-wrap: wrap; padding: 16px 24px;
  border-top: 1px solid var(--ag-line); background: rgba(236,233,250,0.02);
}
.ag-arch__legend {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--ag-mono); font-size: 11px; letter-spacing: 0.06em; color: rgba(236,233,250,0.55);
}

/* ============================================================
 * 05 — PROGRAM (pinned cadence)
 * ============================================================ */
.ag-program {
  position: relative; padding: 0;
  background: linear-gradient(180deg, transparent, rgba(236,233,250,0.02), transparent);
}
.ag-program__inner { position: relative; height: 600vh; }
.ag-program__sticky {
  position: sticky; top: 0; height: 100vh; display: grid; place-items: center; overflow: hidden;
}
.ag-program__num {
  position: absolute; top: 8vh; right: 6vw;
  font-family: var(--ag-display); font-style: italic; font-size: clamp(120px, 18vw, 280px);
  line-height: 1; color: rgba(236,233,250,0.05);
  font-variation-settings: 'opsz' 144, 'wght' 400, 'SOFT' 30, 'WONK' 1; pointer-events: none;
}
.ag-program__scene {
  position: absolute; inset: 0; display: grid; place-items: center;
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease; padding: 0 6vw;
}
.ag-program__scene.is-active { opacity: 1; transform: translateY(0); }
.ag-program__scene-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px;
  align-items: center; width: 100%; max-width: 1200px;
}
.ag-program__copy h3 {
  font-family: var(--ag-display); font-size: clamp(40px, 5.6vw, 88px); line-height: 1.05;
  letter-spacing: -0.02em; margin: 24px 0 20px;
  font-variation-settings: 'opsz' 144, 'wght' 500, 'SOFT' 30, 'WONK' 1;
}
.ag-program__copy h3 em { font-style: italic; color: var(--ag-lime); }
.ag-program__copy p {
  font-family: var(--ag-sans); font-size: 17px; line-height: 1.62;
  color: rgba(236,233,250,0.72); max-width: 480px;
}
.ag-program__copy p code {
  font-family: var(--ag-mono); font-size: 14px; color: var(--ag-violet-2);
  background: rgba(124,92,255,0.1); padding: 1px 6px; border-radius: 5px;
}
.ag-program__step {
  margin-top: 24px; font-family: var(--ag-mono); font-size: 12px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--lime);
}
.ag-program__visual {
  position: relative; height: 56vh; border-radius: 8px; overflow: hidden;
  background: rgba(236,233,250,0.03); border: 1px solid var(--ag-line);
}
.ag-program__rail {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  width: 200px; height: 2px; background: rgba(236,233,250,0.12); border-radius: 1px;
  overflow: hidden; z-index: 50; opacity: 0; transition: opacity 0.4s ease;
}
.ag-program__rail.is-on { opacity: 1; }
.ag-program__rail-fill { height: 100%; width: 0%; background: var(--ag-lime); transition: width 0.2s linear; }

/* program visuals */
.ag-pv { position: absolute; inset: 0; padding: 28px; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.ag-pv--scope { gap: 12px; }
.ag-pv__find {
  display: flex; gap: 14px; align-items: baseline; padding: 14px 18px;
  background: rgba(236,233,250,0.04); border-left: 2px solid var(--ag-violet); border-radius: 0 6px 6px 0;
}
.ag-pv__find-tag {
  flex: 0 0 auto; font-family: var(--ag-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ag-violet-2); min-width: 80px;
}
.ag-pv__find span:last-child { font-family: var(--ag-sans); font-size: 14px; color: rgba(236,233,250,0.85); line-height: 1.45; }
.ag-pv--ingest, .ag-pv--report { padding: 22px 26px; gap: 0; }
.ag-pv__row, .ag-pv__report {
  display: grid; grid-template-columns: 100px 1fr; gap: 18px; padding: 13px 0;
  border-bottom: 1px solid var(--ag-line); align-items: baseline;
}
.ag-pv__row:last-child, .ag-pv__report:last-child { border-bottom: 0; }
.ag-pv__row .k, .ag-pv__report .k {
  font-family: var(--ag-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ag-lime);
}
.ag-pv__row .v { font-family: var(--ag-sans); font-size: 14px; color: rgba(236,233,250,0.9); }
.ag-pv__report .v {
  font-family: var(--ag-display); font-style: italic; font-size: 16px; color: rgba(236,233,250,0.92);
  font-variation-settings: 'opsz' 96, 'SOFT' 30, 'WONK' 1;
}
.ag-pv--launch { padding: 22px 26px; gap: 10px; }
.ag-pv__check {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: 1px solid var(--ag-line); border-radius: 8px;
  font-family: var(--ag-sans); font-size: 13.5px; color: rgba(236,233,250,0.7);
}
.ag-pv__check::before {
  content: ''; width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--ag-line-strong); flex: 0 0 auto;
}
.ag-pv__check.is-done { color: var(--ag-paper); border-color: rgba(124,92,255,0.4); }
.ag-pv__check.is-done::before {
  border-color: var(--ag-violet); background: var(--ag-violet);
  box-shadow: inset 0 0 0 2px #0c0918;
}
.ag-pv--ground { padding: 18px; }
.ag-pv__terms { display: flex; flex-direction: column; gap: 6px; }
.ag-pv__term {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
  padding: 9px 14px; border-radius: 7px; background: rgba(236,233,250,0.03);
  border: 1px solid var(--ag-line); font-family: var(--ag-mono); font-size: 12px;
}
.ag-pv__term-q { font-family: var(--ag-sans); color: rgba(236,233,250,0.85); }
.ag-pv__term-act { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.ag-pv__term-act--add { background: rgba(124,92,255,0.16); color: var(--ag-violet-2); }
.ag-pv__term-act--neg { background: rgba(245,158,11,0.16); color: var(--ag-amber); }
.ag-pv__term-roas { color: var(--ag-lime); }
.ag-pv--scale { flex-direction: row; flex-wrap: wrap; align-content: center; justify-content: center; gap: 8px; padding: 28px; }
.ag-pv__chip {
  padding: 8px 14px; border: 1px solid var(--ag-line); border-radius: 999px;
  font-family: var(--ag-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(236,233,250,0.7);
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.ag-pv__chip:hover { background: var(--ag-violet); color: #0a0814; border-color: var(--ag-violet); }

/* ============================================================
 * 06 — COMPOUND chart
 * ============================================================ */
.ag-compound__wrap {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: center;
}
.ag-compound__chart {
  display: block; width: 100%; height: 380px;
  background: rgba(236,233,250,0.02); border: 1px solid var(--ag-line); border-radius: 12px;
}
.ag-compound__legend { display: flex; flex-direction: column; gap: 18px; }
.ag-compound__key {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--ag-sans); font-size: 15px; color: rgba(236,233,250,0.85); line-height: 1.5;
}
.ag-compound__key span {
  flex: 0 0 auto; width: 14px; height: 14px; border-radius: 4px; margin-top: 2px;
}
.ag-compound__key--managed span { background: var(--ag-lime); }
.ag-compound__key--auto span { background: rgba(236,233,250,0.3); }
.ag-compound__caption {
  font-family: var(--ag-mono); font-size: 11px; letter-spacing: 0.08em;
  color: rgba(236,233,250,0.4); line-height: 1.6; margin-top: 8px;
}

/* ============================================================
 * 07 — TOOLS
 * ============================================================ */
.ag-tools__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  max-width: 1200px; margin: 0 auto; background: var(--ag-line);
  border: 1px solid var(--ag-line); border-radius: 12px; overflow: hidden;
}
.ag-tool {
  background: var(--ag-ink); padding: 22px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease; min-height: 110px; position: relative;
}
.ag-tool:hover { background: var(--ag-violet); color: #0a0814; }
.ag-tool .cat {
  font-family: var(--ag-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(236,233,250,0.45); margin-bottom: 6px;
}
.ag-tool:hover .cat { color: rgba(10,8,20,0.7); }
.ag-tool .nm {
  font-family: var(--ag-display); font-style: italic; font-size: 22px;
  font-variation-settings: 'opsz' 96, 'wght' 500, 'SOFT' 30, 'WONK' 1;
}
.ag-tool .glyph svg {
  width: 28px; height: 28px; fill: none; stroke: var(--lime); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
  transition: stroke 0.3s ease, transform 0.3s ease;
}
.ag-tool:hover .glyph svg { stroke: #0a0814; transform: rotate(8deg); }

/* ============================================================
 * 08 — CTA
 * ============================================================ */
.ag-cta { position: relative; padding: 160px 6vw 200px; text-align: center; overflow: hidden; }
.ag-cta canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.ag-cta__inner { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; }
.ag-cta__title {
  font-family: var(--ag-display); font-weight: 400; font-size: clamp(48px, 7vw, 112px);
  line-height: 1.04; letter-spacing: -0.025em; margin: 24px 0 24px;
  font-variation-settings: 'opsz' 144, 'wght' 400, 'SOFT' 30, 'WONK' 1;
}
.ag-cta__title em { font-style: italic; color: var(--ag-lime); }
.ag-cta__lede {
  font-family: var(--ag-sans); font-size: 18px; line-height: 1.6;
  color: rgba(236,233,250,0.7); max-width: 580px; margin: 0 auto 36px;
}

/* tweaks/sound hidden on production */
.ag-page .v2-tweaks, .ag-page .v2-sound { display: none !important; }

/* ============================================================
 * Trusted — client logo-loop strip (React Bits "Logo Loop")
 * ============================================================ */
.ag-trust {
  position: relative; z-index: 2;
  padding: 44px 0 52px;
  border-top: 1px solid var(--ag-line);
  border-bottom: 1px solid var(--ag-line);
  overflow: hidden;
}
.ag-trust__label {
  text-align: center;
  font-family: var(--ag-mono);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(236, 233, 250, 0.45);
  margin-bottom: 26px;
}
.ag-trust__loop { width: 100%; }
.ag-trust__track { display: flex; align-items: center; }
.ag-trust__logo {
  flex: 0 0 auto;
  padding: 0 42px;
  font-family: var(--ag-display);
  font-style: italic;
  font-size: clamp(24px, 3vw, 32px);
  color: rgba(236, 233, 250, 0.40);
  font-variation-settings: 'opsz' 96, 'wght' 500, 'SOFT' 30, 'WONK' 1;
  white-space: nowrap;
  transition: color 0.3s ease;
}
.ag-trust__logo:hover { color: var(--ag-paper); }

/* ============================================================
 * Responsive
 * ============================================================ */
@media (max-width: 1024px) {
  .ag-hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .ag-hero__three { display: none; }
  .ag-hero__metrics { grid-template-columns: repeat(2, 1fr); }
  .ag-hero__metric { border-bottom: 1px solid var(--ag-line); }
  .ag-hero__metric:nth-child(2) { border-right: 0; }
  .ag-program__scene-inner { grid-template-columns: 1fr; gap: 30px; }
  .ag-program__visual { height: 40vh; }
  .ag-loop__stage { grid-template-columns: 1fr; gap: 30px; }
  .ag-loop__trace { min-height: 0; }
  .ag-compound__wrap { grid-template-columns: 1fr; gap: 28px; }
  .ag-arch__body { grid-template-columns: 1fr; }
  .ag-arch__tree { display: grid; grid-template-columns: repeat(2, 1fr); border-right: 0; border-bottom: 1px solid var(--ag-line); }
  .ag-tools__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .ag-section { padding: 80px 5vw 100px; }
  .ag-hero { padding: 100px 5vw 40px; }
  .ag-ledger__row { grid-template-columns: 1fr; gap: 8px; padding: 18px 12px; }
  .ag-ledger__metric { text-align: left; }
  .ag-console__body { grid-template-columns: 1fr 1fr; }
  .ag-loop__readout { grid-template-columns: 1fr; }
  .ag-loop__palette { grid-template-columns: 1fr; }
  .ag-tool-chip--side { grid-column: span 1; }
  .ag-arch__tree { grid-template-columns: 1fr; }
  .ag-st__head { display: none; }
  .ag-st__row { grid-template-columns: 1fr 1fr; gap: 6px 10px; }
  .ag-program__inner { height: auto; }
  .ag-program__sticky { position: static; height: auto; padding: 60px 0; }
  .ag-program__scene { position: relative; opacity: 1; transform: none; padding: 30px 5vw; height: auto; }
  .ag-program__visual { height: 44vh; }
  .ag-program__rail { display: none; }
  .ag-tools__grid { grid-template-columns: 1fr; }
  .ag-trust { padding: 32px 0 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .ag-program__scene { transition: none; }
  .ag-trace-row { transition: none; }
  .ag-console__pulse, .ag-eyebrow .dot, .ag-console__caret, .ag-loop__pad-pulse { animation: none; }
}
