/* === Executive Ink Palette === */
:root {
  --bg: #F5F3F0;
  --surface: #FFFFFF;
  --primary: #2C2C34;
  --secondary: #3D4560;
  --accent: #5C6B8A;
  --text: #1A1A22;
  --muted: #7A7B85;
  --line: #D6D4D0;
  --tint: #EEEDF0;

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius: 10px;
  --shadow: 0 2px 12px rgba(44,44,52,0.08);
  --shadow-lg: 0 4px 24px rgba(44,44,52,0.14);
  --max-width: 900px;
  --transition: 0.55s ease;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.25;
  color: var(--primary);
}

h2 { font-size: 1.8rem; font-weight: 600; margin-bottom: 1.5rem; }
h3 { font-size: 1.2rem; font-weight: 600; color: var(--secondary); margin-bottom: 0.75rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Layout === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 760px;
  margin: 0 auto;
}

.section {
  padding: 4rem 1.5rem;
}

.section-light { background: var(--surface); }
.section-tint { background: var(--bg); }

.section-subtitle {
  color: var(--muted);
  font-size: 1.0rem;
  margin-bottom: 2rem;
  max-width: 680px;
}

/* === Hero === */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: 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(135deg, rgba(44,44,52,0.88) 0%, rgba(61,69,96,0.78) 100%);
  z-index: 1;
}

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

.hero-badge {
  display: inline-block;
  background: rgba(92,107,138,0.35);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 0.35rem 1.1rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.9);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(4px);
}

.hero-content h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero-authors {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.hero-affil {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 1.5rem;
}

.hero-teaser {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.9);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

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

.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(255,255,255,0.5);
  font-size: 1.4rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 0.65rem 1.6rem;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none !important;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
}

.btn-primary:hover {
  background: var(--secondary);
  border-color: var(--secondary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(92,107,138,0.4);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.5);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.8);
}

/* === Cards Grid === */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
}

.cards-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}

.card-metric {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.card h3 {
  font-size: 1.0rem;
  font-family: var(--font-body);
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* === Two-column layout === */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.col-text, .col-figure { }

/* === Abstract === */
.abstract-text {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow);
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--text);
  margin: 0;
}

/* === Figures & Tables === */
figure {
  margin: 0;
}

figure img {
  border-radius: 8px;
  box-shadow: var(--shadow);
}

figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.6rem;
  line-height: 1.6;
}

figcaption strong { color: var(--secondary); }

.fig-center {
  text-align: center;
}

.fig-center img {
  margin: 0 auto;
}

.table-wrap {
  text-align: center;
}

.table-wrap img {
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.1);
}

.table-caption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.6rem;
  line-height: 1.6;
}

.table-caption strong { color: var(--secondary); }

/* === Callout & Panel === */
.callout {
  background: var(--tint);
  border-radius: var(--radius);
  padding: 1.5rem;
  border-left: 4px solid var(--accent);
}

.callout strong {
  display: block;
  font-size: 1.0rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.callout ul {
  padding-left: 1.2rem;
  margin-bottom: 0;
}

.callout li {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

/* === AI Explanation classes === */
.flecto-note,
.flecto-callout,
.flecto-panel,
.flecto-card {
  background: linear-gradient(135deg, #F0EEF8 0%, #E8EAF2 100%);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
  border: 1px solid #D8D6E8;
}

.flecto-note::before,
.flecto-callout::before,
.flecto-panel::before,
.flecto-card::before {
  content: "🤖 AI explanation";
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* === References === */
.references-accordion {
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.references-accordion summary {
  cursor: pointer;
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  font-size: 1.0rem;
  color: var(--primary);
  list-style: none;
  border-bottom: 1px solid var(--line);
  user-select: none;
}

.references-accordion summary::-webkit-details-marker { display: none; }

.references-accordion summary::after {
  content: " ▾";
  font-size: 0.85rem;
  color: var(--muted);
}

.references-accordion[open] summary::after { content: " ▴"; }

.references-list {
  padding: 1.5rem 1.5rem 1.5rem 2.5rem;
  list-style: decimal;
}

.references-list li {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

/* === Reveal Animation === */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition), transform var(--transition);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger for grid children */
.cards-grid .card:nth-child(1) { transition-delay: 0s; }
.cards-grid .card:nth-child(2) { transition-delay: 0.08s; }
.cards-grid .card:nth-child(3) { transition-delay: 0.16s; }
.cards-grid-2 .card:nth-child(1) { transition-delay: 0s; }
.cards-grid-2 .card:nth-child(2) { transition-delay: 0.08s; }

/* === Responsive === */
@media (max-width: 768px) {
  h2 { font-size: 1.5rem; }
  .section { padding: 2.5rem 1rem; }
  .cards-grid { grid-template-columns: 1fr; }
  .cards-grid-2 { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-content h1 { font-size: 1.6rem; }
  .container { padding: 0 1rem; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: center; }
  .btn { width: 100%; text-align: center; }
}
