/* Agent mode — terminal / markdown view for AI agents.
   Inspired by konghq.com/?mode=agent: dark background, neon accent,
   monospace font, content rendered as raw markdown syntax. */

/* ========== VERTICAL TOGGLE (visible in both modes) ========== */
.agent-mode-toggle {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 42px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 0;
  margin: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}
.agent-mode-toggle > * { pointer-events: auto; }
.agent-mode-toggle legend {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font: 500 10px/1 ui-monospace, "Roboto Mono", "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a8a8a;
  padding: 0;
  margin: 0 0 6px;
}
.agent-mode-toggle .agent-mode-option { display: block; }
.agent-mode-toggle input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.agent-mode-toggle label {
  display: block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font: 500 11px/1 ui-monospace, "Roboto Mono", "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.12em;
  color: #8a8a8a;
  padding: 10px 4px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.agent-mode-toggle label:hover { color: #ffffff; }
.agent-mode-toggle input:checked + label {
  color: #ffffff;
  border-left-color: #ffffff;
}

/* ========== AGENT MODE ACTIVE ========== */
html.agent-mode,
html.agent-mode body,
body.agent-mode {
  background: #000000 !important;
  color: #ffffff !important;
}

body.agent-mode {
  font-family: "Roboto Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
  margin: 0 !important;
  padding: 40px 24px 64px 80px !important;
  min-height: 100vh;
}

/* Hide decorative chrome */
body.agent-mode #header,
body.agent-mode .header,
body.agent-mode #preloader,
body.agent-mode .scroll-top,
body.agent-mode #scroll-top,
body.agent-mode .back-to-top,
body.agent-mode .hero img,
body.agent-mode .hero video,
body.agent-mode section.dark-background > img,
body.agent-mode section img[data-aos],
body.agent-mode .swiper-pagination,
body.agent-mode .swiper-button-next,
body.agent-mode .swiper-button-prev,
body.agent-mode .mobile-nav-toggle,
body.agent-mode iframe[src*="map"],
body.agent-mode i.bi,
body.agent-mode .icon {
  display: none !important;
}

/* Linearize layout */
body.agent-mode .container,
body.agent-mode .container-fluid,
body.agent-mode .container-xl,
body.agent-mode .row,
body.agent-mode [class*="col-"],
body.agent-mode main,
body.agent-mode .main,
body.agent-mode section,
body.agent-mode footer,
body.agent-mode .footer,
body.agent-mode .footer-top,
body.agent-mode .footer-bottom,
body.agent-mode .copyright,
body.agent-mode .credits {
  display: block !important;
  width: 100% !important;
  max-width: 880px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  float: none !important;
  position: static !important;
  transform: none !important;
  opacity: 1 !important;
  color: inherit !important;
  min-height: 0 !important;
  height: auto !important;
}

body.agent-mode section {
  padding: 8px 0 !important;
  min-height: 0 !important;
  height: auto !important;
}

/* Strip visual fx */
body.agent-mode *,
body.agent-mode *::before,
body.agent-mode *::after {
  background-image: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
  animation: none !important;
  transition: none !important;
  border-radius: 0 !important;
}
body.agent-mode section.dark-background,
body.agent-mode .dark-background,
body.agent-mode .light-background,
body.agent-mode footer,
body.agent-mode .footer {
  background: transparent !important;
  color: inherit !important;
}

/* Kill decorative overlay pseudos from the Nova template. These use
   position: absolute with inset: 0 to paint gradients over hero/CTA images
   — in agent mode we want no overlay, no image, nothing but text. */
body.agent-mode section::before,
body.agent-mode section::after,
body.agent-mode .hero::before,
body.agent-mode .hero::after,
body.agent-mode .call-to-action::before,
body.agent-mode .call-to-action::after,
body.agent-mode [class*="dark-background"]::before,
body.agent-mode [class*="dark-background"]::after {
  content: none !important;
  display: none !important;
  background: transparent !important;
}
body.agent-mode [data-aos] { opacity: 1 !important; transform: none !important; }

/* Typography — all uniform size, markdown prefix is the cue */
body.agent-mode h1,
body.agent-mode h2,
body.agent-mode h3,
body.agent-mode h4,
body.agent-mode h5,
body.agent-mode h6 {
  color: #ffffff !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.5 !important;
  margin: 18px 0 4px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
body.agent-mode h1::before { content: "# "; }
body.agent-mode h2::before { content: "## "; }
body.agent-mode h3::before { content: "### "; }
body.agent-mode h4::before { content: "#### "; }
body.agent-mode h5::before { content: "##### "; }
body.agent-mode h6::before { content: "###### "; }

body.agent-mode p,
body.agent-mode li,
body.agent-mode blockquote,
body.agent-mode span,
body.agent-mode div,
body.agent-mode strong,
body.agent-mode em {
  color: #ffffff !important;
  font-size: 14px !important;
  font-family: inherit !important;
  font-weight: 400 !important;
}

body.agent-mode strong { font-weight: 700 !important; color: #ffffff !important; }
body.agent-mode em { font-style: italic !important; }
body.agent-mode p { margin: 4px 0 8px !important; }

body.agent-mode blockquote {
  border-left: 2px solid #2a2f37 !important;
  padding: 0 0 0 12px !important;
  margin: 8px 0 !important;
  color: #9a9a9a !important;
}
body.agent-mode blockquote::before { content: "> "; color: #666; }

/* Markdown-style links: [text](href) */
body.agent-mode a {
  color: #ffffff !important;
  text-decoration: none !important;
  font-weight: 500 !important;
}
body.agent-mode a:hover { text-decoration: underline !important; }
/* Markdown-style link rendering. Force pseudos back into flow because
   Bootstrap's .stretched-link::after is absolutely positioned to cover
   a parent card — overriding its content without resetting position
   would leak "](href)" to the viewport corners. */
body.agent-mode a[href]::before,
body.agent-mode a[href]::after {
  position: static !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: auto !important;
  height: auto !important;
  z-index: auto !important;
  background: transparent !important;
  pointer-events: none !important;
  display: inline !important;
}
body.agent-mode main a[href]:not([data-agent-hide])::before { content: "["; color: #888; }
body.agent-mode main a[href]:not([data-agent-hide])::after { content: "](" attr(href) ")"; color: #888; font-weight: 400; }
body.agent-mode a[data-agent-hide] { display: none !important; }
/* don't re-wrap links inside nav we render ourselves */
body.agent-mode .agent-nav a::before,
body.agent-mode .agent-nav a::after { content: none !important; }
/* avoid double-wrap if a link has nested elements that inherit pseudo */
body.agent-mode a * { color: inherit !important; }

/* Lists as markdown bullets */
body.agent-mode ul,
body.agent-mode ol {
  list-style: none !important;
  padding-left: 0 !important;
  margin: 4px 0 8px !important;
}
body.agent-mode ul > li::before { content: "- "; color: #888; }
body.agent-mode ol { counter-reset: lst; }
body.agent-mode ol > li { counter-increment: lst; }
body.agent-mode ol > li::before { content: counter(lst) ". "; color: #888; }
body.agent-mode li { margin: 2px 0 !important; padding: 0 !important; }

/* Nested lists */
body.agent-mode li ul,
body.agent-mode li ol { margin: 2px 0 2px 16px !important; }

/* Images: hide (can't render to agent anyway) */
body.agent-mode img { display: none !important; }

/* Extracted nav at top of page */
body.agent-mode .agent-nav {
  display: block !important;
  max-width: 880px;
  margin: 0 auto 24px !important;
  padding: 8px 0 16px !important;
  border-bottom: 1px solid #1a1f27 !important;
}
body.agent-mode .agent-nav h2 {
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: 0.12em;
  color: #8a8a8a !important;
  text-transform: uppercase;
  margin: 0 0 8px !important;
}
body.agent-mode .agent-nav h2::before { content: none !important; }
body.agent-mode .agent-nav ul {
  display: flex !important;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0 !important;
}
body.agent-mode .agent-nav li::before { content: none !important; }
body.agent-mode .agent-nav a {
  color: #ffffff !important;
}

/* Top strip: copy-url + page meta */
body.agent-mode .agent-topbar {
  display: flex !important;
  align-items: center;
  gap: 12px;
  max-width: 880px;
  margin: 0 auto 16px !important;
  padding: 8px 0 !important;
  font-size: 12px;
  color: #8a8a8a !important;
}
body.agent-mode .agent-topbar .agent-url {
  flex: 1;
  font-family: inherit;
  color: #8a8a8a !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.agent-mode .agent-topbar button {
  background: transparent !important;
  border: 1px solid #2a2f37 !important;
  color: #ffffff !important;
  padding: 4px 10px;
  font: 500 11px/1 inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
body.agent-mode .agent-topbar button:hover { background: #141820 !important; }

/* Banner */
body.agent-mode .agent-mode-banner {
  max-width: 880px;
  margin: 0 auto 16px !important;
  padding: 8px 0 !important;
  font-size: 12px;
  color: #8a8a8a !important;
  border-bottom: 1px solid #1a1f27;
}
body.agent-mode .agent-mode-banner strong { color: #ffffff !important; }
body.agent-mode .agent-mode-banner a { color: #ffffff !important; }
body.agent-mode .agent-mode-banner a::before,
body.agent-mode .agent-mode-banner a::after { content: none !important; }

/* Forms */
body.agent-mode form { margin: 8px 0; }
body.agent-mode form label { display: block; margin: 8px 0 2px; color: #8a8a8a !important; font-size: 12px; }
body.agent-mode form input,
body.agent-mode form textarea,
body.agent-mode form select {
  width: 100% !important;
  max-width: 560px;
  padding: 6px 8px;
  background: #000000 !important;
  color: #e0e0e0 !important;
  border: 1px solid #2a2f37 !important;
  font: 400 13px/1.4 inherit !important;
  margin: 2px 0;
}
body.agent-mode .cta-btn,
body.agent-mode a.btn,
body.agent-mode a[role="button"] {
  display: inline !important;
  padding: 0 !important;
  background: transparent !important;
  color: #ffffff !important;
  border: 0 !important;
  font: inherit !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  margin: 0 !important;
}
body.agent-mode form button,
body.agent-mode form [type="submit"],
body.agent-mode button:not(.agent-topbar button) {
  padding: 6px 14px;
  background: #000000 !important;
  color: #ffffff !important;
  border: 1px solid #ffffff !important;
  font: 600 12px/1 inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 8px;
}

/* Scrollbar */
body.agent-mode::-webkit-scrollbar { width: 10px; height: 10px; }
body.agent-mode::-webkit-scrollbar-track { background: #000000; }
body.agent-mode::-webkit-scrollbar-thumb { background: #2a2f37; }
body.agent-mode::-webkit-scrollbar-thumb:hover { background: #3a4048; }

/* Selection */
body.agent-mode ::selection { background: #ffffff; color: #000000; }
