/* === Base & Variables === */
: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;
}

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

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

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

/* === Typography === */
h1, h2, h3 { font-family: var(--heading-font); font-weight: 700; line-height: 1.3; }
h1 { font-size: 2.5rem; }
h2 { font-size: 1.8rem; margin-bottom: 1.2rem; color: var(--primary); }
h3 { font-size: 1.3rem; margin-bottom: 0.8rem; }

/* === Sections === */
.section { padding: 4rem 1.5rem; }
.section-alt { background: var(--surface); }

/* === Hero === */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background: url('./assets/hero_bg.png') center/cover no-repeat;
  z-index: 0;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: rgba(13,40,24,0.75);
  z-index: 1;
}
.hero-content {
  position: relative; z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 3rem 1.5rem;
  color: #fff;
}
.hero-journal {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hero h1 { color: #fff; margin-bottom: 1rem; }
.hero-authors { font-size: 0.95rem; opacity: 0.85; margin-bottom: 1.2rem; }
.hero-keywords { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-bottom: 1.5rem; }
.chip {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 0.3rem 0.9rem;
  font-size: 0.8rem;
  color: #fff;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; }
.btn {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s;
}
.btn:hover { background: #0D47A1; }

/* === Abstract Card === */
.abstract-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border-left: 4px solid var(--primary);
}
.abstract-card h2 { font-size: 1.4rem; margin-bottom: 1rem; }

/* === Card Grids === */
.card-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin: 1.5rem 0; }
.card-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin: 1.5rem 0; }

/* === Factor / Benefit Cards === */
.factor-card, .benefit-card, .trend-card, .perspective-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.8rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}
.factor-card:hover, .benefit-card:hover, .trend-card:hover, .perspective-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.factor-card h3 { color: var(--primary); }
.benefit-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.benefit-card h3 { color: var(--secondary); }
.trend-card h3 { color: var(--secondary); border-bottom: 2px solid var(--line); padding-bottom: 0.5rem; margin-bottom: 1rem; }
.trend-card ul { list-style: disc; padding-left: 1.2rem; }
.trend-card li { margin-bottom: 0.5rem; font-size: 0.95rem; }
.perspective-card h3 { color: var(--primary); }

/* === Success / Challenge Cards === */
.success-card {
  background: #E8F5E9;
  border-radius: 12px;
  padding: 1.8rem;
  border-left: 4px solid var(--secondary);
}
.success-card h3 { color: var(--secondary); }
.success-card ul { list-style: disc; padding-left: 1.2rem; }
.success-card li { margin-bottom: 0.5rem; }

.challenge-card {
  background: #FFF3E0;
  border-radius: 12px;
  padding: 1.8rem;
  border-left: 4px solid #E65100;
}
.challenge-card h3 { color: #E65100; }
.challenge-card ul { list-style: disc; padding-left: 1.2rem; }
.challenge-card li { margin-bottom: 0.5rem; }

/* === Callout Box === */
.callout-box {
  background: #E3F2FD;
  border-radius: 12px;
  padding: 2rem;
  margin: 1.5rem 0;
  border-left: 4px solid var(--primary);
}
.callout-box h3 { color: var(--primary); margin-bottom: 0.8rem; }

/* === Conclusion Card === */
.conclusion-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border-left: 4px solid var(--primary);
}
.conclusion-card ul { list-style: none; padding: 0; }
.conclusion-card li {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  padding-left: 1.5rem;
}
.conclusion-card li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--secondary);
  font-weight: 700;
}
.conclusion-card li:last-child { border-bottom: none; }

/* === Tables === */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.92rem;
}
.data-table th {
  background: var(--primary);
  color: #fff;
  padding: 0.8rem 1rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.data-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.data-table tbody tr:nth-child(even) { background: #F5FAF7; }
.data-table tbody tr:hover { background: #E8F0EC; }
.highlight-col { background: rgba(21,101,192,0.08) !important; }
.challenge-table th { background: #E65100; }

/* === Figures === */
.paper-figure {
  margin: 2rem auto;
  text-align: center;
  max-width: 700px;
}
.paper-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.paper-figure figcaption {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

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

/* === 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);
}

/* === AI Explanation UI Classes === */
.flecto-note,
.flecto-callout,
.flecto-card,
.flecto-panel {
  margin: 1.5rem 0;
  border-radius: 10px;
  position: relative;
}
.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;
  padding: 1rem 1.2rem;
  background: #F0F7F4;
  border-left: 3px solid #60a5fa;
}
.flecto-callout {
  padding: 1.5rem;
  background: #EBF5FB;
  border: 1px solid #BEE3F8;
}
.flecto-card {
  padding: 1.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.flecto-panel {
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.flecto-card h4, .flecto-panel h4 {
  font-family: var(--heading-font);
  color: var(--primary);
  margin-bottom: 0.6rem;
}

/* === Responsive === */
@media (max-width: 768px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  .section { padding: 2.5rem 1rem; }
  .hero { min-height: 400px; }
  .card-grid-3 { grid-template-columns: 1fr; }
  .card-grid-2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
