/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&family=JetBrains+Mono:wght@500&family=Syne:wght@800&family=Unbounded:wght@900&display=swap');

/* FateForger Color Scheme */
[data-md-color-scheme="slate"] {
  /* Core Colors */
  --md-primary-fg-color: #D4AF37;        /* Fate Gold */
  --md-primary-fg-color--light: #E5C158;
  --md-primary-fg-color--dark: #B89B2F;
  --md-primary-bg-color: #1A1A1A;        /* Void Black */
  --md-primary-bg-color--light: #252525;
  --md-accent-fg-color: #00A8C6;         /* Deep Cyan */
  --md-accent-fg-color--transparent: rgba(0, 168, 198, 0.1);
  
  /* Background Colors */
  --md-default-bg-color: #1A1A1A;        /* Void Black */
  --md-default-fg-color: #EAEAEA;        /* Text White */
  --md-default-fg-color--light: #CCCCCC;
  --md-default-fg-color--lighter: #999999;
  --md-default-fg-color--lightest: #666666;
  --md-code-bg-color: #121212;
  --md-code-fg-color: #EAEAEA;
  --md-code-hl-color: rgba(0, 168, 198, 0.15);
  
  /* Tertiary Colors */
  --md-tertiary-color: #004E64;          /* Dark Teal */
  
  /* Typography Colors */
  --md-typeset-color: #EAEAEA;
  --md-typeset-a-color: #00A8C6;         /* Links: Deep Cyan */
  
  /* UI Element Colors */
  --md-footer-bg-color: #0F0F0F;
  --md-footer-fg-color: #EAEAEA;
  --md-footer-fg-color--light: #CCCCCC;
  --md-footer-fg-color--lighter: #999999;
}

/* Typography System */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--md-default-fg-color);
}

/* H1 - Unbounded 900 */
.md-typeset h1 {
  font-family: 'Unbounded', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: #D4AF37;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

/* H2, H3 - Syne 800 */
.md-typeset h2,
.md-typeset h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  color: #D4AF37;
  letter-spacing: -0.01em;
}

/* H4, H5, H6 - Syne 800 */
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  color: #EAEAEA;
}

/* Navigation & UI - Inter 500 */
.md-nav__link,
.md-header__button,
.md-search__input,
.md-button {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

/* Code - JetBrains Mono 500 */
.md-typeset code,
.md-typeset pre,
.md-typeset kbd {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-weight: 500;
}

/* ============================================
   PROCEDURAL CYBERNETIC BACKGROUND
   Three-layer system: Base + Circuit Grid + Atmosphere
   ============================================ */

@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.03;
  }
  50% {
    opacity: 0.06;
  }
}

/* Layer 1: Base Void Black */
body {
  background-color: #1A1A1A;
  position: relative;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

/* MkDocs Material paints opaque surfaces; make the main containers transparent
   so the body background (hero pattern + circuit traces) remains visible. */
.md-container,
.md-main,
.md-main__inner {
  background: transparent !important;
}

/* Keep the app chrome above the fixed background layers. */
.md-container {
  position: relative;
  z-index: 2;
}

/* Layer 2: Hero-pattern watermark */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;

  background-color: #1A1A1A;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 304 304' width='304' height='304'%3E%3Cpath fill='%23004E64' fill-opacity='0.2' d='M44.1 224a5 5 0 1 1 0 2H0v-2h44.1zm160 48a5 5 0 1 1 0 2H82v-2h122.1zm57.8-46a5 5 0 1 1 0-2H304v2h-42.1zm0 16a5 5 0 1 1 0-2H304v2h-42.1zm6.2-114a5 5 0 1 1 0 2h-86.2a5 5 0 1 1 0-2h86.2zm-256-48a5 5 0 1 1 0 2H0v-2h12.1zm185.8 34a5 5 0 1 1 0-2h86.2a5 5 0 1 1 0 2h-86.2zM258 12.1a5 5 0 1 1-2 0V0h2v12.1zm-64 208a5 5 0 1 1-2 0v-54.2a5 5 0 1 1 2 0v54.2zm48-198.2V80h62v2h-64V21.9a5 5 0 1 1 2 0zm16 16V64h46v2h-48V37.9a5 5 0 1 1 2 0zm-128 96V208h16v12.1a5 5 0 1 1-2 0V210h-16v-76.1a5 5 0 1 1 2 0zm-5.9-21.9a5 5 0 1 1 0 2H114v48H85.9a5 5 0 1 1 0-2H112v-48h12.1zm-6.2 130a5 5 0 1 1 0-2H176v-74.1a5 5 0 1 1 2 0V242h-60.1zm-16-64a5 5 0 1 1 0-2H114v48h10.1a5 5 0 1 1 0 2H112v-48h-10.1zM66 284.1a5 5 0 1 1-2 0V274H50v30h-2v-32h18v12.1zM236.1 176a5 5 0 1 1 0 2H226v94h48v32h-2v-30h-48v-98h12.1zm25.8-30a5 5 0 1 1 0-2H274v44.1a5 5 0 1 1-2 0V146h-10.1zm-64 96a5 5 0 1 1 0-2H208v-80h16v-14h-42.1a5 5 0 1 1 0-2H226v18h-16v80h-12.1zm86.2-210a5 5 0 1 1 0 2H272V0h2v32h10.1zM98 101.9V146H53.9a5 5 0 1 1 0-2H96v-42.1a5 5 0 1 1 2 0zM53.9 34a5 5 0 1 1 0-2H80V0h2v34H53.9zm60.1 3.9V66H82v64H69.9a5 5 0 1 1 0-2H80V64h32V37.9a5 5 0 1 1 2 0zM101.9 82a5 5 0 1 1 0-2H128V37.9a5 5 0 1 1 2 0V82h-28.1zm16-64a5 5 0 1 1 0-2H146v44.1a5 5 0 1 1-2 0V18h-26.1zm102.2 270a5 5 0 1 1 0 2H98v14h-2v-16h124.1zM242 149.9V160h16v34h-16v62h48v48h-2v-46h-48v-66h16v-30h-16v-12.1a5 5 0 1 1 2 0zM53.9 18a5 5 0 1 1 0-2H64V2H48V0h18v18H53.9zm112 32a5 5 0 1 1 0-2H192V0h50v2h-48v48h-28.1zm-48-48a5 5 0 0 1-9.8-2h2.07a3 3 0 1 0 5.66 0H178v34h-18V21.9a5 5 0 1 1 2 0V32h14V2h-58.1zm0 96a5 5 0 1 1 0-2H137l32-32h39V21.9a5 5 0 1 1 2 0V66h-40.17l-32 32H117.9zm28.1 90.1a5 5 0 1 1-2 0v-76.51L175.59 80H224V21.9a5 5 0 1 1 2 0V82h-49.59L146 112.41v75.69zm16 32a5 5 0 1 1-2 0v-99.51L184.59 96H300.1a5 5 0 0 1 3.9-3.9v2.07a3 3 0 0 0 0 5.66v2.07a5 5 0 0 1-3.9-3.9H185.41L162 121.41v98.69zm-144-64a5 5 0 1 1-2 0v-3.51l48-48V48h32V0h2v50H66v55.41l-48 48v2.69zM50 53.9v43.51l-48 48V208h26.1a5 5 0 1 1 0 2H0v-65.41l48-48V53.9a5 5 0 1 1 2 0zm-16 16V89.41l-34 34v-2.82l32-32V69.9a5 5 0 1 1 2 0zM12.1 32a5 5 0 1 1 0 2H9.41L0 43.41V40.6L8.59 32h3.51zm265.8 18a5 5 0 1 1 0-2h18.69l7.41-7.41v2.82L297.41 50H277.9zm-16 160a5 5 0 1 1 0-2H288v-71.41l16-16v2.82l-14 14V210h-28.1zm-208 32a5 5 0 1 1 0-2H64v-22.59L40.59 194H21.9a5 5 0 1 1 0-2H41.41L66 216.59V242H53.9zm150.2 14a5 5 0 1 1 0 2H96v-56.6L56.6 162H37.9a5 5 0 1 1 0-2h19.5L98 200.6V256h106.1zm-150.2 2a5 5 0 1 1 0-2H80v-46.59L48.59 178H21.9a5 5 0 1 1 0-2H49.41L82 208.59V258H53.9zM34 39.8v1.61L9.41 66H0v-2h8.59L32 40.59V0h2v39.8zM2 300.1a5 5 0 0 1 3.9 3.9H3.83A3 3 0 0 0 0 302.17V256h18v48h-2v-46H2v42.1zM34 241v63h-2v-62H0v-2h34v1zM17 18H0v-2h16V0h2v18h-1zm273-2h14v2h-16V0h2v16zm-32 273v15h-2v-14h-14v14h-2v-16h18v1zM0 92.1A5.02 5.02 0 0 1 6 97a5 5 0 0 1-6 4.9v-2.07a3 3 0 1 0 0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 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm96 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16-64a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-32 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM49 36a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-32 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6z'%3E%3C/path%3E%3C/svg%3E");
  background-size: 600px 600px;
  background-repeat: repeat;
  mask-image: radial-gradient(circle at center, transparent 20%, white 100%);
  -webkit-mask-image: radial-gradient(circle at center, transparent 20%, white 100%);
}

/* Layer 2.5: Circuit traces (subtle corner accents) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;

  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cg fill='none' stroke='%23004E64' stroke-width='2' stroke-linecap='round' opacity='0.28'%3E%3Cpath d='M210 10v46h-42v34H92'/%3E%3Cpath d='M240 36h-30' stroke='%2300A8C6' opacity='0.45'/%3E%3Cpath d='M168 90v58H74' stroke-width='1.5' opacity='0.22'/%3E%3C/g%3E%3Cg%3E%3Ccircle cx='92' cy='90' r='4' fill='%2300A8C6' opacity='0.35'/%3E%3Ccircle cx='74' cy='148' r='3' fill='%23004E64' opacity='0.28'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cg fill='none' stroke='%23004E64' stroke-width='2' stroke-linecap='round' opacity='0.22'%3E%3Cpath d='M30 230v-46h42v-34h76'/%3E%3Cpath d='M0 204h30' stroke='%2300A8C6' opacity='0.35'/%3E%3Cpath d='M72 150v-58h94' stroke-width='1.5' opacity='0.18'/%3E%3C/g%3E%3Cg%3E%3Ccircle cx='148' cy='150' r='4' fill='%2300A8C6' opacity='0.28'/%3E%3Ccircle cx='166' cy='92' r='3' fill='%23004E64' opacity='0.22'/%3E%3C/g%3E%3C/svg%3E");

  background-position: top right, bottom left;
  background-size: 520px 520px, 420px 420px;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 18px rgba(0, 168, 198, 0.14));
  opacity: 0.85;
}

/* Layer 3: Atmospheric Glow & Scanlines */
html::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  
  background: 
    radial-gradient(ellipse 60% 60% at 50% 40%, rgba(0, 78, 100, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 80% 50% at 20% 80%, rgba(0, 168, 198, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse 80% 50% at 80% 20%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 2px,
      rgba(0, 0, 0, 0.03) 2px,
      rgba(0, 0, 0, 0.03) 4px
    );
  
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 4px;
  
  animation: pulse-glow 8s ease-in-out infinite;
}
/* Agent Icon Glow Spots - Interactive feel */
.md-typeset img[src*="agent_icons"] {
  position: relative;
}

/* Links */
.md-typeset a {
  color: #00A8C6;
  text-decoration: none;
  transition: all 0.2s ease;
}

.md-typeset a:hover {
  color: #D4AF37;
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

/* Code Blocks */
.md-typeset pre {
  background-color: #121212;
  border: 1px solid #004E64;
  border-radius: 4px;
}

.md-typeset code {
  background-color: rgba(18, 18, 18, 0.6);
  color: #EAEAEA;
  border: 1px solid rgba(0, 78, 100, 0.3);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

/* Inline Code */
.md-typeset :not(pre) > code {
  background-color: rgba(18, 18, 18, 0.8);
  color: #00A8C6;
  font-size: 0.85em;
}

/* Primary Button */
.md-button--primary {
  background-color: #D4AF37;
  color: #1A1A1A;
  border: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.md-button--primary:hover {
  background-color: #E5C158;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

/* Secondary Button */
.md-button {
  background-color: transparent;
  color: #00A8C6;
  border: 2px solid #00A8C6;
  font-weight: 500;
  transition: all 0.2s ease;
}

.md-button:hover {
  background-color: rgba(0, 168, 198, 0.1);
  border-color: #D4AF37;
  color: #D4AF37;
}

/* Alerts / Admonitions */
.md-typeset .admonition {
  border-left: 4px solid #00A8C6;
  background-color: rgba(0, 168, 198, 0.05);
}

.md-typeset .admonition.warning {
  border-left-color: #D4AF37;
  background-color: rgba(212, 175, 55, 0.05);
}

/* Header - Force dark styling */
.md-header {
  background-color: #1A1A1A !important;
  border-bottom: 1px solid rgba(0, 168, 198, 0.2);
  backdrop-filter: blur(10px);
}

.md-header[data-md-state="shadow"] {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Header logo - scaled down by 50% from previous size */
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 1.674rem;
  width: auto;
}

/* Header title */
.md-header__title {
  color: #D4AF37;
}

.md-header__topic {
  color: #D4AF37;
}

/* Search */
.md-search__input {
  background-color: rgba(18, 18, 18, 0.8);
  border: 1px solid #004E64;
  color: #EAEAEA;
}

.md-search__input::placeholder {
  color: rgba(234, 234, 234, 0.5);
}

/* Navigation */
.md-nav__link--active {
  color: #D4AF37;
  font-weight: 600;
}

.md-nav__link:hover {
  color: #00A8C6;
}

/* Agent Icons Glow Effect */
.md-typeset img[src*="agent_icons"] {
  filter: drop-shadow(0 0 10px rgba(0, 168, 198, 0.3));
  transition: filter 0.3s ease;
}

.md-typeset img[src*="agent_icons"]:hover {
  filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.5));
}

/* Footer */
.md-footer {
  background-color: #0F0F0F;
  border-top: 1px solid rgba(0, 168, 198, 0.2);
}

/* Sidebar */
.md-sidebar {
  background-color: rgba(26, 26, 26, 0.6);
  backdrop-filter: blur(10px);
}

/* Tables */
.md-typeset table:not([class]) {
  border: 1px solid #004E64;
  background-color: rgba(18, 18, 18, 0.4);
}

.md-typeset table:not([class]) th {
  background-color: rgba(0, 78, 100, 0.3);
  color: #D4AF37;
  font-weight: 600;
}

.md-typeset table:not([class]) td {
  border-color: rgba(0, 78, 100, 0.2);
}

/* Footer attribution left as default (reverted) */
/* ...existing code... */

/* ============================================
   THE AGENTS (home page cards)
   ============================================ */

.md-typeset .ff-agents-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 40px 0;
  text-align: center;
}

.md-typeset .ff-agent-card {
  background: linear-gradient(135deg, rgba(0, 168, 198, 0.05), rgba(0, 78, 100, 0.05));
  padding: 14px 8px;
  border-radius: 8px;
  border: 1px solid rgba(0, 168, 198, 0.2);
}

.md-typeset .ff-agent-avatar {
  display: block;
  width: 140px;
  height: 140px;
  margin: 4px auto 10px;
  filter: drop-shadow(0 0 15px rgba(0, 168, 198, 0.4));
}

.md-typeset .ff-agent-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: var(--ff-agent-title-size, 0.9rem);
  color: #D4AF37;
  margin: 10px 0 0;
  line-height: 1.1;
  letter-spacing: -0.05em;
  max-width: 100%;
  white-space: nowrap;
}

.md-typeset .ff-agent-role {
  font-size: 0.9rem;
  color: #00A8C6;
  margin: 6px 0 0;
}

@media (max-width: 1100px) {
  .md-typeset .ff-agents-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .md-typeset .ff-agents-grid {
    grid-template-columns: 1fr;
  }

  .md-typeset .ff-agent-avatar {
    width: 128px;
    height: 128px;
  }
}
