/* =============================================
   Agentic-MME — midnight_aurora palette
   ============================================= */

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

:root {
  --bg: #F0EFF5;
  --surface: #FFFFFF;
  --primary: #2E1065;
  --secondary: #4C1D95;
  --accent: #6D28D9;
  --accent-light: #8B5CF6;
  --text: #1A0B3E;
  --muted: #8B85A0;
  --line: #D5D0E5;
  --radius: 12px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(46,16,101,0.10);
  --shadow-md: 0 8px 32px rgba(46,16,101,0.15);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.8;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', serif;
  line-height: 1.3;
  color: var(--primary);
}
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; }
h2 { font-size: 1.9rem; font-weight: 600; margin-bottom: 1.5rem; }
h3 { font-size: 1.4rem; font-weight: 600; margin-bottom: 1rem; color: var(--secondary); }
h4 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
p { margin-bottom: 1.1rem; max-width: 75ch; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  background: rgba(109,40,217,0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ---- Sections ---- */
.section {
  padding: 80px 0;
}
.section-alt {
  background: linear-gradient(to bottom, #ECEAF5, #F0EFF5);
}
.subsection {
  margin-bottom: 3rem;
}

/* ---- Scroll Reveal ---- */
.reveal {
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  color: #fff;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background-image: url('./assets/bg_hero.png');
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(26,11,62,0.88) 0%, rgba(46,16,101,0.72) 100%);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 60px 24px;
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.chip {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.chip-category { background: var(--accent); color: #fff; }
.chip-id { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.chip-date { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.8); }

.hero h1 {
  color: #fff;
  margin-bottom: 1.2rem;
}
.hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 2rem;
  max-width: 70ch;
}

/* Metrics row */
.metrics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 2rem;
}
.metric-card {
  background: rgba(109,40,217,0.35);
  border: 1px solid rgba(139,92,246,0.4);
  border-radius: var(--radius);
  padding: 16px 24px;
  min-width: 150px;
  text-align: center;
  backdrop-filter: blur(8px);
}
.metric-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  color: #fff;
}
.metric-label {
  display: block;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
  margin-top: 4px;
}

/* Hero abstract */
.hero-abstract {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 2rem;
  max-width: 80ch;
}
.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-light);
  font-family: 'Inter', sans-serif;
  margin-bottom: 0.75rem;
}
.hero-abstract p {
  color: rgba(255,255,255,0.90);
  font-size: 0.97rem;
  line-height: 1.75;
  max-width: none;
}

/* Hero actions */
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
}
.btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  text-decoration: none;
}
.hero-actions .btn { color: #fff; }

/* ---- Two-col layout ---- */
.two-col-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 768px) {
  .two-col-layout { grid-template-columns: 1fr; }
}

/* ---- Callouts ---- */
.callout {
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 1.5rem 0;
  border-left: 4px solid;
}
.callout h4 { margin-bottom: 0.5rem; }
.callout ul { padding-left: 1.2rem; }
.callout li { margin-bottom: 0.4rem; }
.callout-warning {
  background: rgba(109,40,217,0.06);
  border-color: var(--accent);
}
.callout-info {
  background: rgba(76,29,149,0.07);
  border-color: var(--secondary);
}
.callout-insight {
  background: rgba(109,40,217,0.08);
  border-color: var(--accent);
  font-size: 1.05rem;
}
.callout-takeaway {
  background: rgba(46,16,101,0.06);
  border-color: var(--primary);
}

/* AI explanation UI classes */
.flecto-note, .flecto-callout, .flecto-card, .flecto-panel {
  margin: 1.5rem 0;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.flecto-note::before, .flecto-callout::before, .flecto-card::before, .flecto-panel::before {
  content: "🤖 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;
  border-left: 3px solid var(--accent);
}
.flecto-callout {
  background: rgba(109,40,217,0.04);
}
.flecto-card {
  box-shadow: var(--shadow-md);
}

/* ---- Figures ---- */
figure {
  margin: 2rem 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
figure img {
  width: 100%;
  height: auto;
  display: block;
}
figcaption {
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #faf9fd;
}
.figure-wide { max-width: 100%; }
.col-figure figure { margin: 0; }

/* ---- Tables ---- */
.table-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 20px;
  margin: 1.5rem 0;
}
.table-card h4 { color: var(--primary); margin-bottom: 12px; }
.table-img-wrap {
  overflow: hidden;
  border-radius: var(--radius-sm);
}
.table-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}
.table-scroll { overflow-x: auto; }
.table-caption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 10px;
  margin-bottom: 0;
  max-width: none;
}

/* ---- Difficulty Grid ---- */
.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 1.5rem 0;
}
@media (max-width: 768px) {
  .difficulty-grid { grid-template-columns: 1fr; }
}
.difficulty-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 20px;
  position: relative;
}
.level-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.level1 { border-top: 4px solid #3D7A4A; }
.level1 .level-badge { background: #3D7A4A; color: #fff; }
.level2 { border-top: 4px solid var(--accent); }
.level2 .level-badge { background: var(--accent); color: #fff; }
.level3 { border-top: 4px solid var(--primary); }
.level3 .level-badge { background: var(--primary); color: #fff; }
.difficulty-card h4 { font-size: 1rem; color: var(--primary); }
.difficulty-card p { font-size: 0.9rem; color: var(--muted); margin: 0; }

/* ---- Metrics pills ---- */
.metrics-section { margin: 1.5rem 0; }
.metric-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 0.8rem;
}
.metric-pill {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}
.pill-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
}
.pill-desc {
  font-size: 0.88rem;
  color: var(--text);
}

/* ---- Tool Grid ---- */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 1.5rem 0;
}
@media (max-width: 640px) {
  .tool-grid { grid-template-columns: 1fr; }
}
.tool-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 20px;
}
.tool-card h4 { color: var(--secondary); margin-bottom: 8px; }
.tool-card p { font-size: 0.9rem; color: var(--muted); margin-bottom: 12px; }
.tool-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  background: rgba(109,40,217,0.08);
  border: 1px solid rgba(109,40,217,0.2);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 4px;
}

/* ---- Findings Grid ---- */
.findings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 1.5rem 0;
}
@media (max-width: 900px) {
  .findings-grid { grid-template-columns: 1fr; }
}
.finding-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 20px;
}
.finding-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--primary);
  color: #fff;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.finding-card p { font-size: 0.92rem; margin: 0; }

/* ---- Analysis Grid ---- */
.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 768px) {
  .analysis-grid { grid-template-columns: 1fr; }
}

/* ---- Related Work Grid ---- */
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) {
  .related-grid { grid-template-columns: 1fr; }
}
.related-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 24px;
}
.related-card h4 { color: var(--secondary); margin-bottom: 10px; }
.related-card p { font-size: 0.92rem; color: var(--text); margin: 0; }

/* ---- Conclusion ---- */
.conclusion-layout { max-width: 800px; }

/* ---- References ---- */
.references-details {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.references-details summary {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  color: var(--primary);
  background: rgba(109,40,217,0.04);
  border-bottom: 1px solid var(--line);
}
.references-details summary:hover { background: rgba(109,40,217,0.08); }
.references-list {
  padding: 20px 28px;
  columns: 2;
  column-gap: 32px;
}
@media (max-width: 768px) {
  .references-list { columns: 1; }
}
.references-list li {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
  break-inside: avoid;
  line-height: 1.5;
}

/* ---- Footer ---- */
.footer {
  background: var(--primary);
  color: rgba(255,255,255,0.75);
  padding: 24px 0;
  text-align: center;
  font-size: 0.88rem;
}
.footer a { color: rgba(255,255,255,0.9); }
.footer p { max-width: none; margin: 0; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  h2 { font-size: 1.5rem; }
  .section { padding: 48px 0; }
  .metrics-row { gap: 10px; }
  .metric-card { min-width: 120px; padding: 12px 16px; }
  .metric-number { font-size: 1.6rem; }
}
