/* === Base & Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F0F7F4;
  --surface: #FFFFFF;
  --primary: #1565C0;
  --secondary: #2E7D32;
  --accent: #1B5E20;
  --text: #0D2818;
  --muted: #6E8B73;
  --line: #CDE0D0;
  --heading-font: 'Playfair Display', Georgia, serif;
  --body-font: 'Inter', 'Segoe UI', sans-serif;
  --mono-font: 'JetBrains Mono', 'Fira Code', monospace;
}

body {
  font-family: var(--body-font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 1.05rem;
}

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

a { color: var(--primary); }

/* === Reveal Animation === */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* === Container === */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Hero Section === */
.hero-section {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding-bottom: 3rem;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: url('./assets/generated/hero-bg.png') center/cover no-repeat;
  z-index: 0;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 40, 24, 0.78);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 850px;
  margin: 0 auto;
  padding: 4rem 1.5rem 2rem;
  text-align: center;
}
.hero-badges { margin-bottom: 1.5rem; display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.chip {
  display: inline-block;
  padding: 0.25rem 0.85rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(46, 125, 50, 0.35);
  color: #a5d6a7;
  border: 1px solid rgba(165, 214, 167, 0.3);
}
.hero-section h1 {
  font-family: var(--heading-font);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.hero-authors { font-size: 1rem; opacity: 0.9; margin-bottom: 0.3rem; }
.hero-institutions { font-size: 0.9rem; opacity: 0.7; margin-bottom: 1.5rem; }
.hero-abstract { font-size: 1rem; line-height: 1.65; opacity: 0.92; max-width: 720px; margin: 0 auto 2rem; }
.hero-metrics {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.metric-badge {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  text-align: center;
  min-width: 110px;
}
.metric-value { display: block; font-size: 1.4rem; font-weight: 700; color: #81c784; }
.metric-label { display: block; font-size: 0.75rem; opacity: 0.7; margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.04em; }
.hero-actions { margin-top: 1rem; }
.btn {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--primary);
  color: #fff;
  transition: background 0.2s, transform 0.15s;
}
.btn:hover { background: #1256a3; transform: translateY(-1px); }
.hero-figure-wrapper {
  position: relative;
  z-index: 2;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.hero-figure-wrapper figure {
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.hero-figure-wrapper figcaption {
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
}

/* === Content Sections === */
.content-section {
  padding: 4rem 0;
}
.content-section.alt-bg {
  background: var(--surface);
}
.content-section.method-bg {
  background: #E8F5E9;
}
.content-section h2 {
  font-family: var(--heading-font);
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--line);
}
.content-section h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.content-section p {
  margin-bottom: 1.2rem;
}

/* === Cards === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.contribution-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border-top: 3px solid var(--primary);
  transition: box-shadow 0.2s;
}
.contribution-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.contribution-card h3 {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--primary);
}
.contribution-card p { font-size: 0.95rem; color: var(--muted); margin-bottom: 0; }

/* === Math Callout === */
.math-callout {
  background: var(--surface);
  border-left: 4px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 1.5rem 1.75rem;
  margin: 1.5rem 0;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

/* === Full Figure === */
.full-figure {
  margin: 2rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}
.full-figure img { width: 100%; }
.full-figure figcaption {
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.table-figure img { border-radius: 0; }

/* === Agent Cards === */
.agent-cards {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 2rem 0;
}
.agent-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border-left: 4px solid var(--muted);
}
.agent-card h3 { margin-top: 0; font-size: 1.15rem; }
.agent-card p { margin-bottom: 0; font-size: 0.95rem; }
.agent-retriever { border-left-color: #1565C0; }
.agent-retriever h3 { color: #1565C0; }
.agent-planner { border-left-color: #7B1FA2; }
.agent-planner h3 { color: #7B1FA2; }
.agent-stylist { border-left-color: #E65100; }
.agent-stylist h3 { color: #E65100; }
.agent-visualizer { border-left-color: #2E7D32; }
.agent-visualizer h3 { color: #2E7D32; }
.agent-critic { border-left-color: #C62828; }
.agent-critic h3 { color: #C62828; }

/* === Callout Box === */
.callout-box {
  background: rgba(21, 101, 192, 0.06);
  border: 1px solid rgba(21, 101, 192, 0.2);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}
.callout-box h3 { color: var(--primary); margin-top: 0; }
.callout-box p { margin-bottom: 0; }

/* === Pipeline Steps === */
.pipeline-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}
.pipeline-step {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  text-align: center;
}
.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}
.pipeline-step h3 { font-size: 1rem; margin-top: 0; margin-bottom: 0.5rem; color: var(--primary); }
.pipeline-step p { font-size: 0.9rem; color: var(--muted); margin-bottom: 0; }

/* === Eval Grid === */
.eval-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.eval-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.content-eval { border-top: 3px solid var(--secondary); }
.presentation-eval { border-top: 3px solid var(--primary); }
.eval-card h4 { font-size: 1.05rem; margin-bottom: 0.75rem; color: var(--text); }
.eval-card ul { padding-left: 1.25rem; }
.eval-card li { font-size: 0.95rem; margin-bottom: 0.5rem; color: var(--text); }

/* === Limitations Grid === */
.limitations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.limitation-card {
  background: var(--bg);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--line);
}
.limitation-card h4 { font-size: 1rem; color: var(--primary); margin-bottom: 0.5rem; }
.limitation-card p { font-size: 0.9rem; color: var(--muted); margin-bottom: 0; }

/* === References === */
details { margin-top: 1rem; }
details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  padding: 0.5rem 0;
}
.reference-list {
  padding-left: 1.5rem;
  margin-top: 1rem;
}
.reference-list li {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  line-height: 1.5;
}

/* === Flecto Explanation UI === */
.flecto-note,
.flecto-callout,
.flecto-card,
.flecto-panel {
  margin: 1.5rem 0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}
.flecto-note::before,
.flecto-callout::before,
.flecto-card::before,
.flecto-panel::before {
  content: "\1F916  AI explanation";
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #60a5fa;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.5em;
}
.flecto-note {
  font-size: 0.92rem;
  background: rgba(21, 101, 192, 0.05);
  border-left: 3px solid var(--primary);
}
.flecto-callout {
  background: rgba(46, 125, 50, 0.06);
  border: 1px solid rgba(46, 125, 50, 0.15);
}
.flecto-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.flecto-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 3px 12px rgba(0,0,0,0.06);
  padding: 1.75rem 2rem;
}
.flecto-card h4,
.flecto-panel h4 {
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.flecto-card p,
.flecto-panel p,
.flecto-callout p,
.flecto-note p {
  font-size: 0.95rem;
  line-height: 1.65;
}
.flecto-card ul,
.flecto-panel ul {
  padding-left: 1.25rem;
  margin-top: 0.5rem;
}
.flecto-card li,
.flecto-panel li {
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
}

/* === Responsive === */
@media (max-width: 768px) {
  .hero-section h1 { font-size: 1.8rem; }
  .hero-content { padding: 2.5rem 1rem 1.5rem; }
  .hero-metrics { gap: 0.6rem; }
  .metric-badge { min-width: 90px; padding: 0.5rem 0.75rem; }
  .metric-value { font-size: 1.1rem; }
  .content-section { padding: 2.5rem 0; }
  .container { padding: 0 1rem; }
  .card-grid, .pipeline-steps, .eval-grid, .limitations-grid { grid-template-columns: 1fr; }
}
