/* ========================================
   midnight_aurora palette
   ======================================== */
:root {
  --bg: #F0EFF5;
  --surface: #FFFFFF;
  --primary: #2E1065;
  --secondary: #4C1D95;
  --accent: #6D28D9;
  --text: #1A0B3E;
  --muted: #8B85A0;
  --line: #D5D0E5;
  --heading-font: 'Cormorant Garamond', Georgia, serif;
  --body-font: 'Inter', 'Segoe UI', sans-serif;
  --mono-font: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body-font);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono-font); font-size: 0.93em; background: rgba(109,40,217,0.07); border-radius: 4px; padding: 1px 5px; }

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4 { font-family: var(--heading-font); font-weight: 700; line-height: 1.25; }
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
h2 { font-size: 2rem; color: var(--primary); margin-bottom: 1rem; }
h3 { font-size: 1.35rem; font-family: var(--body-font); font-weight: 600; color: var(--secondary); margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ========================================
   Layout Helpers
   ======================================== */
.container { max-width: 900px; margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section--tinted { background: rgba(237,232,245,0.6); }

/* ========================================
   Scroll reveal
   ======================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ========================================
   HERO
   ======================================== */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: 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(26, 11, 62, 0.80);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  color: #FFFFFF;
  padding: 48px 24px;
  max-width: 860px;
}
.hero-tag {
  font-size: 0.82rem;
  font-family: var(--mono-font);
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero-content h1 {
  color: #FFFFFF;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #FFFFFF 0%, #C4B5FD 60%, #FFFFFF 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 8s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}
.hero-authors {
  font-size: 1rem;
  color: rgba(255,255,255,0.75);
  margin-bottom: 8px;
}
.hero-date {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 28px;
  font-family: var(--mono-font);
}
.hero-tagline {
  font-size: 1.15rem;
  font-style: italic;
  color: rgba(255,255,255,0.88);
  margin-bottom: 32px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
}
.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 20px;
  background: rgba(109,40,217,0.32);
  color: #FFFFFF;
  padding: 6px 16px;
  font-size: 0.88rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 8px;
  padding: 10px 22px;
  color: #FFFFFF;
  font-size: 0.9rem;
  font-weight: 500;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
}
.btn:hover { background: var(--accent); border-color: var(--accent); text-decoration: none; }
.btn--solid { background: var(--accent); border-color: var(--accent); }
.btn--solid:hover { background: var(--secondary); border-color: var(--secondary); }

/* ========================================
   ABSTRACT
   ======================================== */
.abstract-card {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 36px 40px;
  box-shadow: 0 2px 12px rgba(46,16,101,0.08);
  border-left: 4px solid var(--accent);
}
.abstract-card p { font-size: 1.05rem; }
.key-finding {
  background: rgba(109,40,217,0.07);
  border: 1px solid rgba(109,40,217,0.22);
  border-radius: 8px;
  padding: 16px 20px;
  margin-top: 20px;
  font-weight: 600;
  color: var(--primary);
}
.key-finding::before {
  content: "⚡ Key Finding: ";
  color: var(--accent);
}

/* ========================================
   CONTRIBUTION CARDS
   ======================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 640px) { .card-grid { grid-template-columns: 1fr; } }
.contrib-card {
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(46,16,101,0.07);
  padding: 28px;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.contrib-card:hover {
  box-shadow: 0 6px 24px rgba(109,40,217,0.16);
  transform: translateY(-2px);
}
.contrib-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: #FFFFFF;
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.contrib-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}
.contrib-card p { font-size: 0.93rem; color: var(--muted); }
.contrib-card a { color: var(--accent); word-break: break-all; }

/* ========================================
   FRAMEWORK SECTION
   ======================================== */
.framework-section {
  position: relative;
  overflow: hidden;
}
.framework-section-bg {
  position: absolute;
  inset: 0;
  background: url('./assets/framework_bg.png') center/cover no-repeat;
  opacity: 0.10;
  z-index: 0;
}
.framework-section > .container { position: relative; z-index: 1; }
.framework-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 700px) { .framework-layout { grid-template-columns: 1fr; } }
.concept-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  background: rgba(109,40,217,0.12);
  color: var(--primary);
  padding: 4px 10px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-right: 8px;
  margin-bottom: 8px;
}
.framework-figures { display: flex; flex-direction: column; gap: 16px; }
.fig-card {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #FAFAFE;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(46,16,101,0.07);
}
.fig-card img { border-radius: 6px; width: 100%; }
.fig-card figcaption {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 8px;
  font-style: italic;
  line-height: 1.5;
}

/* ========================================
   BENCHMARK SECTION
   ======================================== */
.guarantees-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
@media (max-width: 700px) { .guarantees-grid { grid-template-columns: 1fr; } }
.guarantee-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #FAFAFE;
  padding: 20px;
}
.guarantee-num {
  font-family: var(--heading-font);
  font-size: 2.5rem;
  font-weight: 700;
  color: rgba(109,40,217,0.20);
  line-height: 1;
  margin-bottom: 10px;
}
.guarantee-title { font-size: 1rem; font-weight: 600; color: var(--primary); margin-bottom: 8px; }
.guarantee-card p { font-size: 0.9rem; color: var(--muted); }

.estimator-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 700px) { .estimator-strip { grid-template-columns: repeat(2, 1fr); } }
.estimator-card {
  border-radius: 10px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  background: var(--surface);
  padding: 20px;
}
.estimator-card--diligent { border-top-color: var(--primary); }
.estimator-label {
  font-family: var(--heading-font);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 6px;
}
.estimator-name { font-size: 0.9rem; font-weight: 600; color: var(--secondary); margin-bottom: 8px; }
.estimator-card p { font-size: 0.85rem; color: var(--muted); }
.formula-block {
  font-family: var(--mono-font);
  font-size: 0.82rem;
  background: rgba(109,40,217,0.07);
  border-radius: 6px;
  padding: 10px;
  margin-top: 10px;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
}

.task-overview {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 32px 36px;
  margin-bottom: 36px;
  box-shadow: 0 2px 8px rgba(46,16,101,0.06);
}
.task-overview strong { color: var(--primary); }
.task-steps {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}
.task-steps li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 0.97rem;
}
.task-steps li .step-label {
  font-weight: 700;
  color: var(--accent);
  min-width: 90px;
  font-family: var(--mono-font);
  font-size: 0.88rem;
}

/* ========================================
   RESULTS SECTIONS
   ======================================== */
.results-intro { margin-bottom: 32px; }
.results-intro ul { padding-left: 20px; margin: 12px 0; }
.results-intro ul li { margin-bottom: 8px; }
.fig-card--large {
  max-width: 820px;
  margin: 0 auto 32px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #FAFAFE;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(46,16,101,0.09);
}
.fig-card--large img { border-radius: 8px; width: 100%; }
.fig-card--large figcaption { font-size: 0.84rem; color: var(--muted); margin-top: 10px; font-style: italic; }

.fig-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 700px) { .fig-pair { grid-template-columns: 1fr; } }

.stat-callout {
  display: inline-block;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: #FFFFFF;
  border-radius: 20px;
  padding: 10px 24px;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 20px 0;
}

/* ========================================
   TABLE
   ======================================== */
.table-wrapper {
  max-width: 700px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(46,16,101,0.08);
}
.table-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 10px;
  text-align: center;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
thead tr { background: var(--primary); color: #FFFFFF; }
thead th { padding: 12px 16px; font-weight: 600; text-align: left; }
tbody tr:nth-child(even) { background: #FAFAFE; }
tbody tr:nth-child(odd) { background: var(--surface); }
tbody td { padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--text); }
tbody tr:last-child td { border-bottom: none; }
.table-highlight td { font-weight: 600; border-left: 3px solid var(--accent); }
td.mono-cell { font-family: var(--mono-font); font-size: 0.88rem; }
.table-note { font-size: 0.82rem; color: var(--muted); text-align: center; margin-top: 10px; font-style: italic; }

/* ========================================
   DISCUSSION
   ======================================== */
.discussion-prose { max-width: 820px; margin: 0 auto; }
.callout-pair {
  display: flex;
  gap: 20px;
  margin: 24px 0;
}
@media (max-width: 640px) { .callout-pair { flex-direction: column; } }
.callout {
  flex: 1;
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  background: rgba(109,40,217,0.05);
}
.callout--muted { border-left: 4px solid var(--muted); }
.callout--accent { border-left: 4px solid var(--accent); }
.callout h3 { font-size: 1rem; margin-bottom: 8px; }
.callout p { font-size: 0.92rem; }
.closing-statement {
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  color: var(--primary);
  margin-top: 32px;
  padding: 20px;
  background: rgba(109,40,217,0.06);
  border-radius: 8px;
  font-style: italic;
}

/* ========================================
   REFERENCES
   ======================================== */
.references-section { background: var(--bg); }
details summary {
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--secondary);
  padding: 12px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: "▶";
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  color: var(--accent);
}
details[open] summary::before { transform: rotate(90deg); }
details[open] { border-top: 1px solid var(--line); padding-top: 16px; }
.ref-list { list-style: decimal; padding-left: 24px; margin-top: 16px; }
.ref-list li { margin-bottom: 10px; font-size: 0.88rem; color: var(--muted); }
.ref-list li a { color: var(--accent); }

/* ========================================
   SECTION HEADERS
   ======================================== */
.section-header { margin-bottom: 40px; }
.section-header .section-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  font-family: var(--mono-font);
  margin-bottom: 8px;
}

/* ========================================
   NAV (minimal sticky)
   ======================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(240,239,245,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 10px 24px;
}
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.site-nav a { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.site-nav a:hover { color: var(--primary); text-decoration: none; }

/* ========================================
   Flecto explanation UI classes (Step 6b)
   ======================================== */
.flecto-note {
  display: block;
  font-size: 0.9rem;
  line-height: 1.6;
  background: rgba(109,40,217,0.06);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 8px 14px;
  margin: 10px 0;
  color: var(--text);
}
.flecto-callout {
  display: block;
  background: rgba(76,29,149,0.07);
  border: 1px solid rgba(109,40,217,0.18);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 16px 0;
  color: var(--text);
}
.flecto-callout::before {
  content: "💡 ";
  font-style: normal;
}
.flecto-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(46,16,101,0.08);
  padding: 20px 24px;
  margin: 20px 0;
}
.flecto-card h4 { font-size: 1rem; font-weight: 600; color: var(--primary); margin-bottom: 10px; }
.flecto-panel {
  display: block;
  background: var(--surface);
  border: 1px solid rgba(109,40,217,0.25);
  border-top: 4px solid var(--accent);
  border-radius: 0 0 10px 10px;
  padding: 24px 28px;
  margin: 24px 0;
}
.flecto-panel h4 { font-size: 1.05rem; font-weight: 600; color: var(--primary); margin-bottom: 12px; }

/* AI explanation labels */
.flecto-note::before,
.flecto-callout::before,
.flecto-card::before,
.flecto-panel::before {
  content: "🤖 AI explanation";
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #60a5fa;
  margin-bottom: 0.5em;
  opacity: 0.9;
}
