/* ====================================================
  How Agent Harnesses Edit Files - editorial terminal UI
  ==================================================== */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&display=swap");

/* -------------------- CSS Variables -------------------- */
:root {
  /* Colors - Dark Mode Palette */
  --bg-primary: #080a0f;
  --bg-secondary: #101621;
  --bg-tertiary: #182230;
  --bg-card: rgba(18, 24, 35, 0.78);
  --bg-card-solid: #121823;
  --bg-code: #05070c;

  --border-primary: rgba(162, 188, 221, 0.18);
  --border-secondary: rgba(162, 188, 221, 0.1);
  --border-accent: #4dd4ff;

  --text-primary: #f4efe3;
  --text-secondary: #b6c0cc;
  --text-muted: #748093;
  --text-link: #68dcff;
  --text-link-hover: #f0b15a;

  /* Accent Colors */
  --accent-blue: #68dcff;
  --accent-green: #75e39d;
  --accent-purple: #bba0ff;
  --accent-orange: #f0b15a;
  --accent-red: #ff6b63;
  --accent-cyan: #5cf0dc;
  --accent-pink: #ff84c8;

  /* Gradients */
  --gradient-hero:
    radial-gradient(
      circle at 18% 20%,
      rgba(104, 220, 255, 0.34),
      transparent 28%
    ),
    radial-gradient(
      circle at 82% 22%,
      rgba(240, 177, 90, 0.32),
      transparent 30%
    ),
    radial-gradient(
      circle at 56% 80%,
      rgba(187, 160, 255, 0.22),
      transparent 38%
    ),
    linear-gradient(135deg, #101725 0%, #08111b 45%, #20170f 100%);
  --gradient-card: linear-gradient(
    145deg,
    rgba(24, 34, 48, 0.82),
    rgba(8, 10, 15, 0.82)
  );

  /* Shadows */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.45);
  --shadow-glow:
    0 0 0 1px rgba(104, 220, 255, 0.28), 0 18px 55px rgba(104, 220, 255, 0.13);

  /* Typography */
  --font-body: "Source Serif 4", Georgia, serif;
  --font-heading: "Outfit", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", "Fira Code", monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* System integration */
  color-scheme: dark;
}

/* -------------------- Reset & Base -------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background:
    radial-gradient(
      circle at 12% 4%,
      rgba(104, 220, 255, 0.14),
      transparent 28rem
    ),
    radial-gradient(
      circle at 88% 10%,
      rgba(240, 177, 90, 0.12),
      transparent 26rem
    ),
    linear-gradient(180deg, #080a0f 0%, #0c1018 48%, #080a0f 100%);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at top, black 0%, transparent 74%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
  background-image: radial-gradient(
    rgba(244, 239, 227, 0.16) 0.65px,
    transparent 0.65px
  );
  background-size: 3px 3px;
  mix-blend-mode: overlay;
}

/* -------------------- Typography -------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.055em;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  letter-spacing: -0.035em;
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-primary);
  margin-top: var(--space-2xl);
  position: relative;
}

h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 8rem;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-orange));
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  color: var(--accent-blue);
}

h4 {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
  font-size: 1.045rem;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text-link-hover);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* -------------------- Focus & Keyboard Navigation -------------------- */
:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Skip-to-content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  padding: 0.65rem 1.25rem;
  background: var(--accent-orange);
  color: #05070c;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0.5rem;
  outline: 3px solid var(--accent-blue);
  outline-offset: 2px;
}

/* -------------------- Layout -------------------- */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, var(--space-xl));
}

.container-narrow {
  max-width: 1100px;
}

main {
  padding: var(--space-2xl) 0 var(--space-3xl);
}

section {
  margin-bottom: var(--space-3xl);
}

/* -------------------- Navigation -------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(8, 10, 15, 0.74);
  backdrop-filter: blur(18px) saturate(1.25);
  border-bottom: 1px solid var(--border-primary);
  padding: 0.85rem 0;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  letter-spacing: -0.03em;
}

.nav-logo:hover {
  text-decoration: none;
  color: var(--accent-blue);
}

.nav-logo-icon {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-xs);
}

.nav-links a {
  display: block;
  padding: 0.45rem 0.78rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: rgba(104, 220, 255, 0.08);
  border-color: rgba(104, 220, 255, 0.18);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--accent-blue);
}

/* Mobile Navigation */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-sm);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    padding: var(--space-md);
  }

  .nav-links.open {
    display: flex;
  }
}

/* -------------------- Hero Section -------------------- */
.hero {
  text-align: center;
  padding: clamp(4.5rem, 10vw, 8rem) clamp(1rem, 4vw, 3rem);
  background: var(--gradient-hero);
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
  margin: calc(var(--space-lg) * -1) 0 var(--space-3xl);
  border: 1px solid rgba(244, 239, 227, 0.16);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  box-shadow:
    var(--shadow-lg),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  background:
    linear-gradient(
      115deg,
      transparent 0 18%,
      rgba(255, 255, 255, 0.08) 18% 18.35%,
      transparent 18.35% 100%
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.04) 0 1px,
      transparent 1px 90px
    );
  opacity: 0.75;
}

.hero::after {
  content: "SEARCH → MATCH → PATCH";
  position: absolute;
  right: -2rem;
  bottom: 1rem;
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 7vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  color: rgba(255, 255, 255, 0.045);
  pointer-events: none;
  white-space: nowrap;
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.hero h1 {
  color: white;
  margin-bottom: var(--space-md);
  text-shadow: 0 3px 28px rgba(0, 0, 0, 0.42);
  font-size: clamp(3.1rem, 9vw, 7.8rem);
  max-width: 11ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 0.86;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 760px;
  margin: 0 auto var(--space-xl);
  font-family: var(--font-body);
}

.hero-badge {
  display: inline-block;
  background: rgba(5, 7, 12, 0.42);
  backdrop-filter: blur(10px);
  padding: 0.55rem 1rem;
  border-radius: 50px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.22);
  margin-bottom: var(--space-xl);
  box-shadow: 0 0 30px rgba(104, 220, 255, 0.14);
}

/* -------------------- Cards -------------------- */
.card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 38%),
    var(--gradient-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at 18% 0%,
    rgba(104, 220, 255, 0.11),
    transparent 32%
  );
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  font-size: 1.55rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card-title {
  font-size: 1.25rem;
  margin: 0;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: var(--space-lg);
}

/* Agent Cards (colored accents) */
.card-cline {
  border-top: 3px solid var(--accent-green);
}
.card-codex {
  border-top: 3px solid var(--accent-purple);
}
.card-opencode {
  border-top: 3px solid var(--accent-orange);
}
.card-aider {
  border-top: 3px solid var(--accent-blue);
}
.card-grok {
  border-top: 3px solid var(--accent-cyan);
}

/* -------------------- Code Blocks -------------------- */
pre,
code {
  font-family: var(--font-mono);
}

code {
  background: var(--bg-code);
  padding: 0.15em 0.42em;
  border-radius: var(--radius-sm);
  font-size: 0.875em;
  color: #9cf5e9;
  border: 1px solid rgba(92, 240, 220, 0.16);
  box-shadow: inset 0 -1px 0 rgba(92, 240, 220, 0.12);
}

pre {
  background:
    linear-gradient(180deg, rgba(104, 220, 255, 0.045), transparent 4rem),
    var(--bg-code);
  border: 1px solid rgba(104, 220, 255, 0.18);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  overflow-x: auto;
  margin: var(--space-md) 0 var(--space-lg);
  position: relative;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

pre code {
  background: none;
  padding: 0;
  border: none;
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.6;
}

/* Code Block Header */
.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(
    90deg,
    rgba(104, 220, 255, 0.11),
    rgba(240, 177, 90, 0.08)
  );
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid rgba(104, 220, 255, 0.18);
  border-bottom: none;
  margin-top: var(--space-md);
}

.code-header + pre {
  margin-top: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.code-lang {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-blue);
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

/* Syntax Highlighting */
.token-keyword {
  color: var(--accent-purple);
}
.token-string {
  color: var(--accent-green);
}
.token-comment {
  color: var(--text-muted);
  font-style: italic;
}
.token-function {
  color: var(--accent-blue);
}
.token-number {
  color: var(--accent-orange);
}
.token-operator {
  color: var(--accent-pink);
}
.token-added {
  color: var(--accent-green);
  background: rgba(63, 185, 80, 0.15);
}
.token-removed {
  color: var(--accent-red);
  background: rgba(248, 81, 73, 0.15);
}

/* -------------------- Tables -------------------- */
.table-wrapper {
  overflow-x: auto;
  margin: var(--space-lg) 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  background: rgba(18, 24, 35, 0.64);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: rgba(104, 220, 255, 0.08);
}

th {
  text-align: left;
  padding: var(--space-md) var(--space-lg);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  border-bottom: 2px solid var(--border-primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-secondary);
  color: var(--text-secondary);
}

tbody tr:hover {
  background: rgba(104, 220, 255, 0.055);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* -------------------- Blockquotes -------------------- */
blockquote {
  background: rgba(16, 22, 33, 0.76);
  border-left: 4px solid var(--accent-orange);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

blockquote p {
  margin: 0;
  font-style: italic;
  color: var(--text-secondary);
}

blockquote cite {
  display: block;
  margin-top: var(--space-sm);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* -------------------- Callouts / Alerts -------------------- */
.callout {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  margin: var(--space-lg) 0;
  border: 1px solid var(--border-primary);
  background: rgba(18, 24, 35, 0.72);
  box-shadow: var(--shadow-sm);
}

.callout-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.9rem;
  font-size: 1.25rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  flex-shrink: 0;
}

.callout-content h4 {
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.callout-content p:last-child {
  margin-bottom: 0;
}

.callout-info {
  background: rgba(88, 166, 255, 0.1);
  border-color: rgba(88, 166, 255, 0.3);
}

.callout-warning {
  background: rgba(210, 153, 34, 0.1);
  border-color: rgba(210, 153, 34, 0.3);
}

.callout-tip {
  background: rgba(63, 185, 80, 0.1);
  border-color: rgba(63, 185, 80, 0.3);
}

/* -------------------- Badges / Tags -------------------- */
.badge {
  display: inline-block;
  padding: 0.28em 0.72em;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid currentColor;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.badge-blue {
  background: rgba(104, 220, 255, 0.12);
  color: var(--accent-blue);
}
.badge-green {
  background: rgba(117, 227, 157, 0.12);
  color: var(--accent-green);
}
.badge-purple {
  background: rgba(187, 160, 255, 0.12);
  color: var(--accent-purple);
}
.badge-orange {
  background: rgba(240, 177, 90, 0.12);
  color: var(--accent-orange);
}
.badge-red {
  background: rgba(255, 107, 99, 0.12);
  color: var(--accent-red);
}

.badge-cyan {
  background: rgba(92, 240, 220, 0.12);
  color: var(--accent-cyan);
}

/* -------------------- Lists -------------------- */
ul,
ol {
  margin: var(--space-md) 0;
  padding-left: var(--space-xl);
  color: var(--text-secondary);
}

li {
  margin-bottom: var(--space-sm);
}

li::marker {
  color: var(--accent-blue);
}

/* Checklist Style */
.checklist {
  list-style: none;
  padding: 0;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
}

.checklist li::before {
  content: "✓";
  color: var(--accent-green);
  font-weight: bold;
}

/* -------------------- Comparison Chart -------------------- */
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
  margin: var(--space-xl) 0;
}

.comparison-item {
  text-align: center;
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
}

.comparison-item h4 {
  margin-bottom: var(--space-md);
}

.comparison-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin-top: var(--space-sm);
}

.comparison-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width var(--transition-slow);
}

/* -------------------- Flowchart / Diagram Styling -------------------- */
.flow-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl);
  background:
    linear-gradient(180deg, rgba(104, 220, 255, 0.05), transparent),
    rgba(16, 22, 33, 0.78);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  margin: var(--space-xl) 0;
}

.flow-step {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: rgba(8, 10, 15, 0.56);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-sm);
}

.flow-step-number {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-blue);
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.flow-arrow {
  font-size: 1.5rem;
  color: var(--text-muted);
}

/* -------------------- Tabs -------------------- */
.tabs {
  margin: var(--space-xl) 0;
}

.tab-buttons {
  display: flex;
  gap: var(--space-xs);
  border-bottom: 1px solid var(--border-primary);
  padding: var(--space-xs);
  overflow-x: auto;
  background: rgba(16, 22, 33, 0.7);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.tab-btn {
  background: none;
  border: none;
  padding: var(--space-sm) var(--space-lg);
  font-family: inherit;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 999px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.tab-btn.active {
  color: var(--accent-blue);
  background: rgba(104, 220, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(104, 220, 255, 0.22);
}

.tab-content {
  display: none;
  padding: var(--space-lg);
  background: rgba(16, 22, 33, 0.74);
  border: 1px solid var(--border-primary);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.tab-content.active {
  display: block;
}

/* -------------------- Collapsible Sections -------------------- */
.collapsible {
  margin: var(--space-md) 0;
}

.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.collapsible-header:hover {
  background: var(--bg-tertiary);
}

.collapsible-header h4 {
  margin: 0;
}

.collapsible-icon {
  transition: transform var(--transition-fast);
}

.collapsible.open .collapsible-icon {
  transform: rotate(180deg);
}

.collapsible-content {
  display: none;
  padding: var(--space-lg);
  border: 1px solid var(--border-primary);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.collapsible.open .collapsible-content {
  display: block;
}

/* -------------------- Footer -------------------- */
footer {
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(104, 220, 255, 0.12),
      transparent 36%
    ),
    rgba(8, 10, 15, 0.92);
  border-top: 1px solid var(--border-primary);
  padding: var(--space-2xl) 0;
  margin-top: var(--space-3xl);
}

.footer-content {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
  list-style: none;
  padding: 0;
}

/* -------------------- Utility Classes -------------------- */
.text-center {
  text-align: center;
}
.text-muted {
  color: var(--text-muted);
}
.text-accent {
  color: var(--accent-blue);
}

.mt-0 {
  margin-top: 0;
}
.mb-0 {
  margin-bottom: 0;
}
.mt-lg {
  margin-top: var(--space-lg);
}
.mb-lg {
  margin-bottom: var(--space-lg);
}

.flex {
  display: flex;
}
.flex-wrap {
  flex-wrap: wrap;
}
.gap-md {
  gap: var(--space-md);
}
.gap-lg {
  gap: var(--space-lg);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* -------------------- Animations -------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn var(--transition-base) ease forwards;
}

/* Staggered animations for cards */
.card-grid .card:nth-child(1) {
  animation-delay: 0ms;
}
.card-grid .card:nth-child(2) {
  animation-delay: 100ms;
}
.card-grid .card:nth-child(3) {
  animation-delay: 200ms;
}
.card-grid .card:nth-child(4) {
  animation-delay: 300ms;
}
.card-grid .card:nth-child(5) {
  animation-delay: 400ms;
}

/* -------------------- Print Styles -------------------- */
@media print {
  body {
    background: white;
    color: black;
  }

  .nav,
  .hero,
  footer,
  .aiguide-breadcrumb {
    display: none;
  }

  .card,
  pre,
  .callout {
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}

/* -------------------- AI Guide Breadcrumb/Back Link -------------------- */
.aiguide-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(5, 7, 12, 0.72);
  border-bottom: 1px solid var(--border-secondary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  backdrop-filter: blur(14px);
}

.aiguide-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s ease;
}

.aiguide-back-link:hover {
  color: var(--text-link-hover);
  text-decoration: none;
}

.aiguide-back-link:hover .aiguide-back-arrow {
  transform: translateX(-4px);
}

.aiguide-back-arrow {
  transition: transform 0.2s ease;
}

.aiguide-separator {
  color: var(--text-muted);
}

.aiguide-current {
  color: var(--text-secondary);
}

.footer-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.footer-back-link:hover {
  background: rgba(88, 166, 255, 0.1);
  border-color: var(--accent-blue);
  text-decoration: none;
}

::selection {
  color: #05070c;
  background: var(--accent-orange);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
