/* ============================================================
   InCoder-32B-Thinking — midnight_aurora palette
   ============================================================ */

/* Palette tokens */
:root {
  --bg: #F0EFF5;
  --surface: #FFFFFF;
  --primary: #2E1065;
  --secondary: #4C1D95;
  --accent: #6D28D9;
  --text: #1A0B3E;
  --muted: #8B85A0;
  --line: #D5D0E5;
  --code-bg: #1A0B3E;
  --code-text: #E0D9F5;
  --hero-overlay: rgba(46, 16, 101, 0.72);
  --radius: 12px;
  --shadow: 0 2px 12px rgba(46, 16, 101, 0.08);
  --shadow-lg: 0 6px 32px rgba(46, 16, 101, 0.14);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

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

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  color: #fff;
  text-align: center;
  padding: 80px 24px;
  width: 100%;
}
.badge-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.badge {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.hero-content h1 {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: rgba(255,255,255,0.85);
  margin-bottom: 12px;
  font-weight: 300;
}
.hero-authors {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 32px;
}
.hero-metrics {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.metric-badge {
  background: rgba(109, 40, 217, 0.5);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius);
  padding: 12px 20px;
  text-align: center;
}
.metric-val {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  color: #fff;
}
.metric-label {
  display: block;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  margin-top: 2px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  background: rgba(255,255,255,0.12);
}
.btn:hover { background: rgba(255,255,255,0.22); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}
.btn-primary:hover { background: #5b21b6; }
.hero-actions a.resource-link { color: inherit; }

/* ============================================================
   Sections
   ============================================================ */
.section { padding: 72px 0; }
.section-white { background: var(--surface); }
.section-alt { background: var(--bg); }

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 16px;
}
h2 {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 24px;
}
h3 {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--secondary);
  margin: 40px 0 16px;
}
h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 12px;
}
p { margin-bottom: 16px; color: var(--text); }
p:last-child { margin-bottom: 0; }

.subsection-heading { margin-top: 40px; }

/* ============================================================
   Abstract
   ============================================================ */
.abstract-card {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 28px 32px;
  box-shadow: var(--shadow);
}
.key-metrics-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.key-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.key-metric strong {
  font-size: 1.4rem;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--accent);
  display: block;
}
.key-metric span {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ============================================================
   Two / Three Col
   ============================================================ */
.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.three-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.col-card, .feature-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.feature-card { text-align: center; }
.feature-icon { font-size: 2rem; margin-bottom: 12px; }
.feature-card h4 { color: var(--secondary); margin: 0 0 8px; }
.feature-card p { font-size: 0.9rem; color: var(--muted); margin: 0; }

/* ============================================================
   Figures
   ============================================================ */
.paper-figure {
  margin: 32px 0;
  text-align: center;
}
.paper-figure img {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
figcaption {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   Methodology
   ============================================================ */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.step-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--accent);
}
.step-num {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--line);
  margin-bottom: 8px;
}
.step-card h4 { color: var(--secondary); margin: 0 0 8px; }
.step-card p { font-size: 0.88rem; color: var(--muted); margin: 0; }

.icwm-card {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 32px;
  margin: 24px 0;
}
.icwm-card p { color: rgba(255,255,255,0.9); }
.formula-block {
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 12px 20px;
  margin: 16px 0;
  font-size: 1rem;
  text-align: center;
  color: #c4b5fd;
}
.mono { font-family: 'IBM Plex Mono', monospace; }
.icwm-benefits { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.benefit-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
}
.benefit-icon { flex-shrink: 0; font-size: 1.1rem; }

/* ============================================================
   Evaluation
   ============================================================ */
.eval-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.eval-card h3 { margin: 0 0 16px; font-size: 1.05rem; }
.benchmark-list {
  list-style: none;
  padding: 0;
}
.benchmark-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--text);
}
.benchmark-list li:last-child { border-bottom: none; }

.results-highlight {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.result-metric {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--accent);
  text-align: center;
  min-width: 140px;
}
.r-val {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--accent);
}
.r-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Tables */
.table-scroll { overflow-x: auto; margin: 16px 0 32px; }
.results-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.results-table th {
  background: var(--primary);
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 500;
  font-size: 0.8rem;
}
.results-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.results-table tbody tr:hover { background: #f5f3ff; }
.highlight-row { background: #faf5ff !important; }
.highlight-row td { color: var(--primary); font-weight: 500; }

/* ============================================================
   Analysis
   ============================================================ */
.fidelity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.fidelity-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.fidelity-mean {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.fidelity-mean .f-domain, .fidelity-mean .f-val { color: #fff; }
.f-domain { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
.f-val { display: block; font-size: 0.95rem; font-weight: 600; font-family: 'IBM Plex Mono', monospace; color: var(--accent); }
.fidelity-label { font-size: 0.82rem; color: var(--muted); font-style: italic; margin-top: 8px; }

.thinking-insight {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.insight-item {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--accent);
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.insight-val {
  font-size: 1.3rem;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--accent);
}

/* ============================================================
   Conclusion
   ============================================================ */
.conclusion-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.conclusion-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 24px;
}
.conclusion-list li {
  padding: 10px 0 10px 20px;
  border-bottom: 1px solid var(--line);
  position: relative;
  font-size: 0.95rem;
}
.conclusion-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}
.conclusion-list li:last-child { border-bottom: none; }
.resource-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.resource-link {
  display: inline-block;
  padding: 8px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--secondary);
  text-decoration: none;
  transition: all 0.2s;
  font-weight: 500;
}
.resource-link:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ============================================================
   Related Work & References (collapsed)
   ============================================================ */
.collapsible-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.collapsible-section > summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-family: 'IBM Plex Serif', Georgia, serif;
  color: var(--primary);
  background: var(--surface);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.collapsible-section > summary::before {
  content: '▶';
  font-size: 0.7rem;
  color: var(--accent);
  transition: transform 0.2s;
}
.collapsible-section[open] > summary::before { transform: rotate(90deg); }
.details-content {
  padding: 20px 24px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.references-list {
  padding-left: 20px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.8;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,0.6);
  padding: 24px 0;
  text-align: center;
  font-size: 0.82rem;
}

/* ============================================================
   Flecto explanation UI classes (Step 6b)
   ============================================================ */
.flecto-note,
.flecto-callout,
.flecto-card,
.flecto-panel {
  margin: 20px 0;
  border-radius: var(--radius);
  padding: 16px 20px;
  position: relative;
}
.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.9rem;
  border-left: 3px solid var(--accent);
  background: #faf5ff;
  color: var(--text);
}
.flecto-callout {
  background: #ede9fe;
  border: 1px solid #c4b5fd;
  color: var(--text);
}
.flecto-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.flecto-panel {
  background: var(--surface);
  border: 1px solid var(--accent);
  box-shadow: var(--shadow-lg);
}

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

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
  .hero { min-height: 70vh; }
  .hero-content { padding: 60px 16px; }
  .section { padding: 48px 0; }
  .abstract-card { padding: 20px; }
  .icwm-card { padding: 20px; }
  .hero-metrics { gap: 12px; }
  .metric-badge { padding: 10px 14px; }
}
