/* ============================================================
   AutoResearchClaw — Showcase Website Styles
   Pure CSS, no build step.  Tailwind-inspired utility patterns.
   ============================================================ */

/* ---------- Reset & Variables ---------- */
:root {
  --color-bg:        #0f172a;
  --color-bg-alt:    #1e293b;
  --color-surface:   #334155;
  --color-border:    #475569;
  --color-text:      #e2e8f0;
  --color-text-muted:#94a3b8;
  --color-primary:   #38bdf8;
  --color-primary-d: #0284c7;
  --color-accent:    #a78bfa;
  --color-accent-d:  #7c3aed;
  --color-success:   #4ade80;
  --color-warning:   #fbbf24;
  --color-danger:    #f87171;
  --color-white:     #f8fafc;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  --radius:  0.75rem;
  --radius-lg: 1rem;
  --shadow:  0 4px 6px -1px rgba(0,0,0,.3), 0 2px 4px -2px rgba(0,0,0,.2);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.3);
  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent); }

img { max-width: 100%; height: auto; display: block; }

/* ---------- Layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section   { padding: 5rem 0; }

/* ---------- Navigation ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 0;
}
.navbar .container {
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  display: flex; align-items: center; gap: 0.75rem;
  font-weight: 700; font-size: 1.15rem; color: var(--color-white);
}
.nav-brand img { height: 32px; width: 32px; border-radius: 6px; }
.nav-links { display: flex; gap: 1.5rem; list-style: none; }
.nav-links a {
  color: var(--color-text-muted); font-size: 0.9rem; font-weight: 500;
  padding: 0.4rem 0; transition: color var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--color-primary); }
.nav-github {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--color-surface); color: var(--color-white);
  padding: 0.45rem 1rem; border-radius: 9999px; font-size: 0.85rem;
  font-weight: 600; transition: background var(--transition);
}
.nav-github:hover { background: var(--color-primary-d); color: var(--color-white); }

/* Mobile nav toggle */
.nav-toggle { display: none; background: none; border: none; color: var(--color-text); font-size: 1.5rem; cursor: pointer; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; flex-direction: column; position: absolute;
    top: 100%; left: 0; right: 0; background: var(--color-bg-alt);
    padding: 1rem 1.5rem; gap: 0.5rem; border-bottom: 1px solid var(--color-border);
  }
  .nav-links.open { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 10rem 0 5rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(56,189,248,0.08) 0%, transparent 60%);
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.hero h1 .gradient {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .tagline {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--color-text-muted);
  max-width: 640px; margin: 0 auto 2rem;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem; border-radius: 9999px;
  font-weight: 600; font-size: 0.95rem; cursor: pointer;
  border: none; transition: all var(--transition);
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #0f172a;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: #0f172a; }
.btn-outline {
  background: transparent; color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.btn-outline:hover { background: rgba(56,189,248,0.1); color: var(--color-primary); }

.hero-code {
  margin-top: 2.5rem;
  display: inline-block;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.8rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--color-success);
}

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem; padding: 3rem 0;
}
.stat {
  text-align: center; padding: 1.5rem;
  background: var(--color-bg-alt); border-radius: var(--radius);
  border: 1px solid var(--color-border);
}
.stat-value {
  font-size: 2rem; font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 0.85rem; color: var(--color-text-muted); margin-top: 0.25rem; }

/* ---------- Section headings ---------- */
.section-header {
  text-align: center; margin-bottom: 3rem;
}
.section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700; margin-bottom: 0.5rem;
}
.section-header p {
  color: var(--color-text-muted); max-width: 600px; margin: 0 auto;
}

/* ---------- Pipeline Overview (Landing) ---------- */
.pipeline-preview {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.phase-card {
  background: var(--color-bg-alt); border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: 1.5rem; transition: all var(--transition);
}
.phase-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-3px); box-shadow: var(--shadow-lg);
}
.phase-card .phase-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
.phase-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.4rem; }
.phase-card p  { font-size: 0.85rem; color: var(--color-text-muted); line-height: 1.5; }
.phase-card .phase-stages {
  margin-top: 0.75rem; display: flex; gap: 0.35rem; flex-wrap: wrap;
}
.stage-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-primary); opacity: 0.5;
}
.stage-dot.gate { background: var(--color-warning); opacity: 1; }

/* ---------- Paper Cards ---------- */
.paper-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.paper-card {
  background: var(--color-bg-alt); border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden; transition: all var(--transition);
}
.paper-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-3px); box-shadow: var(--shadow-lg);
}
.paper-thumb {
  height: 180px; background: linear-gradient(135deg, var(--color-surface), var(--color-bg));
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--color-text-muted);
}
.paper-body { padding: 1.25rem; }
.paper-body h3 { font-size: 1rem; font-weight: 600; line-height: 1.4; margin-bottom: 0.5rem; }
.paper-body .paper-meta {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem;
}
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.6rem; border-radius: 9999px;
  font-size: 0.72rem; font-weight: 600;
}
.badge-domain { background: rgba(56,189,248,0.15); color: var(--color-primary); }
.badge-score { background: rgba(74,222,128,0.15); color: var(--color-success); }
.badge-pending { background: rgba(251,191,36,0.15); color: var(--color-warning); }
.paper-body .paper-abstract {
  font-size: 0.82rem; color: var(--color-text-muted);
  line-height: 1.55; display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Feature Cards ---------- */
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: var(--color-bg-alt); border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: 1.75rem; transition: all var(--transition);
}
.feature-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}
.feature-card .feature-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 1rem;
}
.feature-card .feature-icon.bg-blue   { background: rgba(56,189,248,0.15); }
.feature-card .feature-icon.bg-purple { background: rgba(167,139,250,0.15); }
.feature-card .feature-icon.bg-green  { background: rgba(74,222,128,0.15); }
.feature-card .feature-icon.bg-amber  { background: rgba(251,191,36,0.15); }
.feature-card .feature-icon.bg-red    { background: rgba(248,113,113,0.15); }
.feature-card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.4rem; }
.feature-card p  { font-size: 0.85rem; color: var(--color-text-muted); line-height: 1.5; }

/* ---------- Pipeline Page (full) ---------- */
.pipeline-full { max-width: 860px; margin: 0 auto; }

.phase-group { margin-bottom: 3rem; }
.phase-group-header {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem; padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border);
}
.phase-group-header .phase-letter {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #0f172a;
}
.phase-group-header h3 { font-size: 1.15rem; font-weight: 600; }

.stage-list { display: flex; flex-direction: column; gap: 0.5rem; }

.stage-item {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  cursor: pointer; transition: all var(--transition);
}
.stage-item:hover { border-color: var(--color-primary); }
.stage-item.expanded { border-color: var(--color-primary); background: rgba(56,189,248,0.04); }

.stage-number {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
  background: var(--color-surface); color: var(--color-text);
}
.stage-number.gate { background: rgba(251,191,36,0.2); color: var(--color-warning); }

.stage-info { flex: 1; }
.stage-info h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.15rem; }
.stage-info .stage-subtitle { font-size: 0.8rem; color: var(--color-text-muted); }
.stage-detail {
  display: none; margin-top: 0.75rem; padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem; color: var(--color-text-muted); line-height: 1.6;
}
.stage-item.expanded .stage-detail { display: block; }

.stage-badges { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.5rem; }
.stage-badge {
  padding: 0.15rem 0.5rem; border-radius: 9999px;
  font-size: 0.7rem; font-weight: 600;
}
.stage-badge-gate   { background: rgba(251,191,36,0.15); color: var(--color-warning); }
.stage-badge-new    { background: rgba(167,139,250,0.15); color: var(--color-accent); }
.stage-badge-llm    { background: rgba(56,189,248,0.15); color: var(--color-primary); }
.stage-badge-docker { background: rgba(74,222,128,0.15); color: var(--color-success); }

/* ---------- Footer ---------- */
.footer {
  padding: 3rem 0; text-align: center;
  border-top: 1px solid var(--color-border);
}
.footer p { color: var(--color-text-muted); font-size: 0.85rem; }
.footer-links {
  display: flex; justify-content: center; gap: 1.5rem;
  list-style: none; margin-bottom: 1rem;
}
.footer-links a { color: var(--color-text-muted); font-size: 0.85rem; }
.footer-links a:hover { color: var(--color-primary); }

/* ---------- Getting Started ---------- */
.getting-started-content { max-width: 780px; margin: 0 auto; }
.step-block {
  background: var(--color-bg-alt); border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: 1.5rem; margin-bottom: 1rem;
}
.step-block h3 {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 1.05rem; font-weight: 600; margin-bottom: 0.75rem;
}
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  background: var(--color-primary); color: #0f172a;
}
.code-block {
  background: #0d1117; border-radius: 8px;
  padding: 1rem 1.25rem; margin-top: 0.5rem;
  font-family: var(--font-mono); font-size: 0.85rem;
  color: var(--color-success); overflow-x: auto;
  border: 1px solid #21262d;
}
.code-block .comment { color: var(--color-text-muted); }

/* ---------- Connector Line (pipeline page) ---------- */
.connector {
  display: flex; justify-content: center; padding: 0.5rem 0;
}
.connector-line {
  width: 2px; height: 24px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
  opacity: 0.4;
}

/* ---------- Coming Soon Overlay ---------- */
.coming-soon {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 4rem 2rem;
  text-align: center;
}
.coming-soon .cs-icon { font-size: 3rem; margin-bottom: 1rem; }
.coming-soon h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.coming-soon p { color: var(--color-text-muted); max-width: 400px; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-top: 1rem; }
.gap-2 { gap: 0.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }

/* ============================================================
   Light theme (html[data-theme="light"]) — dark stays default.
   Toggled by theme.js (light / dark / system).
   ============================================================ */
:root[data-theme="light"] {
  --color-bg:        #f8fafc;
  --color-bg-alt:    #ffffff;
  --color-surface:   #e2e8f0;
  --color-border:    #cbd5e1;
  --color-text:      #0f172a;
  --color-text-muted:#475569;
  --color-primary-d: #0369a1;
  --shadow:  0 4px 6px -1px rgba(15,23,42,.1), 0 2px 4px -2px rgba(15,23,42,.08);
  --shadow-lg: 0 10px 15px -3px rgba(15,23,42,.15), 0 4px 6px -4px rgba(15,23,42,.1);
}
:root[data-theme="light"] .navbar { background: rgba(248, 250, 252, 0.88); }

/* ============================================================
   Meet Your Research Team — agent cards + tasteful animations.
   Appended at end; self-contained, uses per-card --agent-color.
   ============================================================ */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.agent-card {
  --agent-color: var(--color-primary);
  position: relative;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-align: center;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.agent-card:hover {
  transform: translateY(-4px);
  border-color: var(--agent-color);
  box-shadow: var(--shadow-lg), 0 0 24px -4px var(--agent-color);
}

.agent-badge {
  width: 60px; height: 60px;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; line-height: 1;
  /* tint the circle with the agent color (color-mix keeps it subtle,
     with a solid fallback for older browsers) */
  background: rgba(148, 163, 184, 0.15);
  background: color-mix(in srgb, var(--agent-color) 18%, transparent);
  border: 1px solid transparent;
  border-color: color-mix(in srgb, var(--agent-color) 35%, transparent);
  transition: box-shadow var(--transition), transform var(--transition);
}
.agent-card:hover .agent-badge {
  box-shadow: 0 0 18px -2px var(--agent-color);
}

.agent-name { font-weight: 700; font-size: 1.05rem; color: var(--color-text); }
.agent-role { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.1rem; }
.agent-desc { font-size: 0.82rem; color: var(--color-text-muted); line-height: 1.5; margin-top: 0.6rem; }

/* Debate-team members get a colored ring + small corner tag */
.agent-card.debate {
  border-color: color-mix(in srgb, var(--agent-color) 40%, var(--color-border));
}
.debate-tag {
  position: absolute; top: 0.65rem; right: 0.65rem;
  padding: 0.12rem 0.5rem; border-radius: 9999px;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--agent-color);
  background: color-mix(in srgb, var(--agent-color) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--agent-color) 30%, transparent);
}
/* the .agent-role already reads "Debate team" for these; hide the duplicate label */
.agent-card.debate .agent-role { visibility: hidden; }

.team-note {
  margin-top: 2rem; text-align: center;
  font-size: 0.85rem; color: var(--color-text-muted); line-height: 1.6;
  max-width: 720px; margin-left: auto; margin-right: auto;
}
.team-note strong { color: var(--color-text); }
.debate-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 0.4rem; vertical-align: middle;
  background: var(--color-accent);
}

/* ---------- Animations (guarded by prefers-reduced-motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes agent-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
  }
  @keyframes agent-talk {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--agent-color) 45%, transparent); }
    50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--agent-color) 0%, transparent); }
  }
  @keyframes debate-dot-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.35); }
  }

  /* Gentle idle float on every badge, staggered so they don't sync up */
  .agent-badge { animation: agent-float 5s ease-in-out infinite; }
  .agent-card:nth-child(2)  .agent-badge { animation-delay: 0.5s;  animation-duration: 5.4s; }
  .agent-card:nth-child(3)  .agent-badge { animation-delay: 1.1s;  animation-duration: 4.6s; }
  .agent-card:nth-child(4)  .agent-badge { animation-delay: 0.3s;  animation-duration: 5.2s; }
  .agent-card:nth-child(5)  .agent-badge { animation-delay: 1.6s;  animation-duration: 4.8s; }
  .agent-card:nth-child(6)  .agent-badge { animation-delay: 0.8s;  animation-duration: 5.6s; }
  .agent-card:nth-child(7)  .agent-badge { animation-delay: 1.9s;  animation-duration: 4.4s; }
  .agent-card:nth-child(8)  .agent-badge { animation-delay: 0.6s;  animation-duration: 5.1s; }
  .agent-card:nth-child(9)  .agent-badge { animation-delay: 1.3s;  animation-duration: 4.9s; }
  .agent-card:nth-child(10) .agent-badge { animation-delay: 0.2s;  animation-duration: 5.5s; }
  .agent-card:nth-child(11) .agent-badge { animation-delay: 1.7s;  animation-duration: 4.7s; }

  /* Debate agents also "talk" — a soft outward pulse in their own color */
  .agent-card.debate .agent-badge {
    animation: agent-float 5s ease-in-out infinite, agent-talk 2.6s ease-in-out infinite;
  }
  /* stagger the talking so the debate looks like a back-and-forth */
  .agent-card.debate:nth-of-type(4) .agent-badge { animation-delay: 0s,   0s;   }
  .agent-card.debate:nth-of-type(5) .agent-badge { animation-delay: 0.6s, 0.9s; }
  .agent-card.debate:nth-of-type(6) .agent-badge { animation-delay: 1.2s, 1.7s; }
  .agent-card.debate:nth-of-type(9)  .agent-badge { animation-delay: 0.4s, 0.5s; }
  .agent-card.debate:nth-of-type(10) .agent-badge { animation-delay: 1.0s, 1.3s; }

  .debate-dot { animation: debate-dot-pulse 2.2s ease-in-out infinite; }
}


/* ---- e5o brand overrides ---- */
:root {
  --color-primary:   #22d3ee;
  --color-primary-d: #0891b2;
  --color-accent:    #a78bfa;
  --color-accent-d:  #7c3aed;
}
:root[data-theme="light"] {
  --color-primary:   #0891b2;
  --color-primary-d: #0e7490;
  --color-accent:    #7c3aed;
}
