/* === Base & Typography === */
:root {
  --bg: #F0EFF5;
  --surface: #FFFFFF;
  --primary: #2E1065;
  --secondary: #4C1D95;
  --accent: #6D28D9;
  --text: #1A0B3E;
  --muted: #8B85A0;
  --line: #D5D0E5;
  --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);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, h4 { font-family: var(--heading-font); font-weight: 700; line-height: 1.3; }
h1 { font-size: 2.8rem; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; color: var(--primary); }
h3 { font-size: 1.4rem; margin: 2rem 0 1rem; color: var(--secondary); }

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

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

.mono { font-family: var(--mono-font); font-size: 0.9rem; color: var(--accent); background: rgba(109,40,217,0.06); padding: 0.3rem 0.6rem; border-radius: 4px; display: inline-block; margin-top: 0.5rem; }

/* === Hero === */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30,10,78,0.88) 0%, rgba(46,16,101,0.7) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  text-align: center;
  padding: 4rem 1.5rem;
  color: #fff;
}

.hero-badges { margin-bottom: 1.5rem; display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.badge {
  background: rgba(109,40,217,0.5);
  color: #e0d0ff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero h1 { color: #fff; margin-bottom: 0.75rem; }
.hero-subtitle { font-size: 1.15rem; opacity: 0.9; margin-bottom: 0.5rem; }
.hero-authors { font-size: 0.95rem; opacity: 0.7; margin-bottom: 1.5rem; }
.hero-abstract { font-size: 1rem; opacity: 0.9; line-height: 1.8; text-align: left; max-width: 700px; margin: 0 auto 2rem; }

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.7rem 1.6rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: var(--secondary); transform: translateY(-1px); }

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

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

.card {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(46,16,101,0.08);
  border-top: 3px solid var(--accent);
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 4px 20px rgba(46,16,101,0.12); }
.section-alt .card { background: var(--bg); }

.accent-left {
  border-top: none;
  border-left: 4px solid var(--accent);
  background: rgba(109,40,217,0.04);
}
.accent-left ol { padding-left: 1.5rem; }
.accent-left li { margin-bottom: 0.75rem; }

.summary-card {
  border-top: 3px solid var(--accent);
  background: rgba(109,40,217,0.04);
}
.summary-card ul { list-style: none; padding: 0; }
.summary-card li { padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.summary-card li:last-child { border-bottom: none; }

/* === Metrics === */
.metrics-grid { margin: 2rem 0; }
.metric-card {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg);
  border-radius: 12px;
  border-top: 3px solid var(--accent);
}
.metric-value { font-family: var(--heading-font); font-size: 2.2rem; color: var(--accent); font-weight: 900; }
.metric-label { font-size: 0.85rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.3rem; }

/* === Figures === */
.figure-card {
  margin: 2rem 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(46,16,101,0.06);
}
.section-alt .figure-card { background: var(--bg); }
.figure-card img { width: 100%; height: auto; display: block; }
.figure-card figcaption { padding: 1rem 1.5rem; font-size: 0.9rem; color: var(--muted); line-height: 1.6; }

.figure-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }

/* === Lists === */
section ul, section ol { padding-left: 1.5rem; margin: 1rem 0; }
section li { margin-bottom: 0.5rem; }

/* === Details / References === */
details { margin: 1rem 0; }
details summary { cursor: pointer; font-family: var(--heading-font); font-size: 1.4rem; color: var(--primary); font-weight: 700; padding: 0.5rem 0; }
details summary:hover { color: var(--accent); }
.references-list { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.references-list li { margin-bottom: 0.3rem; }

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

/* === Flecto Explanation UI === */
.flecto-note,
.flecto-callout,
.flecto-card,
.flecto-panel {
  position: relative;
  margin: 1.5rem 0;
  border-radius: 10px;
  line-height: 1.7;
}

.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: 0.8rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(109,40,217,0.04);
}

.flecto-callout {
  padding: 1.2rem 1.5rem;
  background: rgba(109,40,217,0.06);
  border: 1px solid var(--line);
}

.flecto-card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(46,16,101,0.06);
}
.section-alt .flecto-card { background: var(--bg); }

.flecto-panel {
  padding: 1.5rem 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(46,16,101,0.08);
}
.section-alt .flecto-panel { background: var(--bg); }

.flecto-note h4, .flecto-callout h4, .flecto-card h4, .flecto-panel h4 {
  font-family: var(--body-font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}
.flecto-card ul, .flecto-panel ul { padding-left: 1.2rem; margin: 0.5rem 0; }
.flecto-card li, .flecto-panel li { margin-bottom: 0.3rem; font-size: 0.95rem; }

/* === Responsive === */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  .hero { min-height: 60vh; }
  .hero-content { padding: 3rem 1rem; }
  .three-col { grid-template-columns: 1fr; }
  .figure-row { grid-template-columns: 1fr; }
}
