/* ══════════════════════════════════════════
   AI Operators — Shared Styles
   ══════════════════════════════════════════ */

:root {
  --green: #00ff88;
  --green-dim: #00cc6a;
  --green-glow: rgba(0, 255, 136, 0.15);
  --green-glow-strong: rgba(0, 255, 136, 0.3);
  --bg: #050505;
  --bg-card: #0c0c0c;
  --bg-card-border: #1a1a1a;
  --text: #e8e8e8;
  --text-dim: #888;
  --text-dimmer: #555;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Noise overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ── Grid background ── */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 70%);
}

/* ── Glow orbs ── */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
}
.glow-orb.green {
  width: 500px; height: 500px;
  background: var(--green-glow);
  top: -100px; left: 20%;
  animation: float-orb 12s ease-in-out infinite;
}
.glow-orb.green2 {
  width: 400px; height: 400px;
  background: rgba(0, 255, 136, 0.08);
  bottom: 10%; right: 10%;
  animation: float-orb 15s ease-in-out infinite reverse;
}

@keyframes float-orb {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, 30px); }
}

/* ── Layout ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

section {
  position: relative;
  z-index: 1;
}

/* ── Navigation ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(5, 5, 5, 0.7);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.nav-logo .dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 12px var(--green); }
  50% { opacity: 0.6; box-shadow: 0 0 6px var(--green); }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-link {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-link:hover {
  color: var(--text);
}
.nav-cta {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 24px;
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.nav-cta:hover {
  box-shadow: 0 0 30px rgba(0,255,136,0.3);
  transform: translateY(-1px);
}

/* ── Buttons ── */
.btn-primary {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 16px 36px;
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary:hover {
  box-shadow: 0 0 40px rgba(0,255,136,0.35);
  transform: translateY(-2px);
}
.btn-primary .arrow {
  transition: transform 0.25s;
}
.btn-primary:hover .arrow {
  transform: translateX(4px);
}

/* ── Breadcrumbs ── */
.breadcrumbs {
  padding: 100px 0 0;
  position: relative;
  z-index: 1;
}
.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}
.breadcrumb-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.breadcrumb-list a {
  color: var(--text-dimmer);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb-list a:hover {
  color: var(--green);
}
.breadcrumb-list .sep {
  color: var(--text-dimmer);
  opacity: 0.5;
}
.breadcrumb-list .current {
  color: var(--text-dim);
}

/* ── Article/Page Content ── */
.page-hero {
  padding: 40px 0 60px;
  position: relative;
  z-index: 1;
}
.page-hero .page-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--green);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-hero .page-tag::before {
  content: '>';
  opacity: 0.5;
}
.page-hero h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.page-hero h1 .green {
  color: var(--green);
  text-shadow: 0 0 40px rgba(0,255,136,0.3);
}
.page-hero .page-subtitle {
  font-size: 1.15rem;
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 640px;
  font-weight: 300;
}

/* ── Article Body ── */
.article-body {
  padding-bottom: 80px;
  position: relative;
  z-index: 1;
}
.article-body h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 48px 0 20px;
  line-height: 1.2;
}
.article-body h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 36px 0 14px;
  letter-spacing: -0.01em;
}
.article-body p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-dim);
  margin-bottom: 20px;
  font-weight: 300;
}
.article-body p strong {
  color: var(--text);
  font-weight: 500;
}
.article-body ul, .article-body ol {
  margin: 16px 0 24px 24px;
  color: var(--text-dim);
}
.article-body li {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 8px;
  font-weight: 300;
}
.article-body li strong {
  color: var(--text);
  font-weight: 500;
}
.article-body a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,255,136,0.3);
  transition: border-color 0.2s;
}
.article-body a:hover {
  border-color: var(--green);
}

/* ── Terminal blocks ── */
.terminal {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 0 60px rgba(0,255,136,0.06),
    0 20px 60px rgba(0,0,0,0.5);
  margin: 32px 0;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: #0f0f0f;
  border-bottom: 1px solid #1a1a1a;
}
.terminal-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
}
.terminal-dot.r { background: #ff5f57; }
.terminal-dot.y { background: #febc2e; }
.terminal-dot.g { background: #28c840; }
.terminal-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-dimmer);
  margin-left: 8px;
}
.terminal-body {
  padding: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.8;
}
.terminal-line .prompt { color: var(--green); }
.terminal-line .cmd { color: var(--text); }
.terminal-line .output { color: var(--text-dim); }
.terminal-line .success { color: var(--green); }
.terminal-line .dim { color: var(--text-dimmer); }
.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--green);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Stats cards ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 32px 0;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  transition: all 0.3s;
}
.stat-card:hover {
  border-color: rgba(0,255,136,0.15);
  transform: translateY(-2px);
}
.stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 4px;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-dimmer);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Code blocks ── */
.code-block {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 10px;
  padding: 24px;
  margin: 24px 0;
  overflow-x: auto;
}
.code-block code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--text-dim);
}
.code-block .comment { color: var(--text-dimmer); }
.code-block .keyword { color: var(--green); }
.code-block .string { color: #f0c674; }
.code-block .prop { color: #81a2be; }

/* ── Diagram / flow blocks ── */
.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 40px 0;
  flex-wrap: wrap;
}
.flow-step {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 10px;
  padding: 20px 24px;
  text-align: center;
  min-width: 140px;
}
.flow-step .step-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.flow-step .step-label {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 400;
}
.flow-arrow {
  color: var(--green);
  font-size: 1.2rem;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Comparison table ── */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
}
.compare-table th {
  font-family: 'Syne', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  padding: 16px 20px;
  border-bottom: 2px solid var(--bg-card-border);
  color: var(--text);
}
.compare-table th:first-child {
  color: var(--text-dim);
}
.compare-table th.highlight {
  color: var(--green);
}
.compare-table td {
  padding: 14px 20px;
  font-size: 0.92rem;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-weight: 300;
}
.compare-table tr:hover td {
  background: rgba(255,255,255,0.02);
}
.compare-table .check { color: var(--green); }
.compare-table .cross { color: #ff5f57; opacity: 0.6; }

/* ── Info cards / feature boxes ── */
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 12px;
  padding: 32px 28px;
  margin: 24px 0;
  transition: all 0.3s;
}
.info-card:hover {
  border-color: rgba(0,255,136,0.12);
}
.info-card h4 {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.info-card p {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ── CTA Section ── */
.cta-section {
  padding: 100px 0;
  text-align: center;
  position: relative;
  z-index: 1;
}
.cta-section h2 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  line-height: 1.1;
}
.cta-section .green {
  color: var(--green);
}
.cta-section .cta-sub {
  color: var(--text-dim);
  font-size: 1.1rem;
  margin-bottom: 40px;
  font-weight: 300;
}

/* ── FAQ Accordion ── */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}
.faq-item {
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.faq-question {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  text-align: left;
  padding: 24px 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: color 0.2s;
}
.faq-question:hover {
  color: var(--green);
}
.faq-question .faq-icon {
  font-size: 1.2rem;
  color: var(--green);
  transition: transform 0.3s;
  flex-shrink: 0;
}
.faq-item.open .faq-icon {
  transform: rotate(45deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-answer-inner {
  padding: 0 0 24px;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.7;
  font-weight: 300;
}
.faq-item.open .faq-answer {
  max-height: 500px;
}

/* ── Interlink cards ── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 40px 0;
}
.related-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 10px;
  padding: 24px;
  text-decoration: none;
  transition: all 0.3s;
  display: block;
}
.related-card:hover {
  border-color: rgba(0,255,136,0.15);
  transform: translateY(-2px);
}
.related-card .related-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.related-card h4 {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.related-card p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── Footer ── */
footer {
  padding: 60px 0 40px;
  border-top: 1px solid rgba(255,255,255,0.04);
  position: relative;
  z-index: 1;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand .nav-logo {
  margin-bottom: 12px;
}
.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-dimmer);
  line-height: 1.6;
  max-width: 280px;
}
.footer-col h5 {
  font-family: 'Syne', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}
.footer-col a {
  display: block;
  font-size: 0.82rem;
  color: var(--text-dimmer);
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.2s;
}
.footer-col a:hover {
  color: var(--green);
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.04);
  padding-top: 24px;
  text-align: center;
}
.footer-bottom p {
  font-size: 0.75rem;
  color: var(--text-dimmer);
}

/* ── Scroll animations ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Before/After diagram ── */
.before-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 32px 0;
}
.ba-card {
  border-radius: 12px;
  padding: 28px 24px;
}
.ba-card.before {
  background: rgba(255, 95, 87, 0.05);
  border: 1px solid rgba(255, 95, 87, 0.15);
}
.ba-card.after {
  background: rgba(0, 255, 136, 0.05);
  border: 1px solid rgba(0, 255, 136, 0.15);
}
.ba-card h4 {
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.ba-card.before h4 { color: #ff5f57; }
.ba-card.after h4 { color: var(--green); }
.ba-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ba-card li {
  font-size: 0.88rem;
  color: var(--text-dim);
  padding: 6px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.ba-card.before li::before {
  content: '✗';
  color: #ff5f57;
  font-weight: 600;
  flex-shrink: 0;
}
.ba-card.after li::before {
  content: '✓';
  color: var(--green);
  font-weight: 600;
  flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .before-after {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
}
@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .stats-row {
    grid-template-columns: 1fr 1fr;
  }
  .flow-diagram {
    flex-direction: column;
  }
  .flow-arrow {
    transform: rotate(90deg);
  }
}
