/* === RESET & BASE === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  font-size: 1.05rem;
  line-height: 1.75;
  color: #1A0B3E;
  background: #F0EFF5;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4 { font-family: 'Playfair Display', Georgia, serif; line-height: 1.3; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; color: #2E1065; }
h3 { font-size: 1.4rem; margin-top: 2.5rem; margin-bottom: 1rem; color: #4C1D95; }
h4 { font-size: 1.15rem; margin-bottom: 0.5rem; color: #2E1065; }
p { margin-bottom: 1.25rem; }
strong { color: #2E1065; }
a { color: #6D28D9; }
sub { font-size: 0.75em; color: #8B85A0; }

/* === LAYOUT === */
.container { max-width: 900px; margin: 0 auto; padding: 0 1.5rem; }
.content-section { padding: 4rem 0; }
.alt-bg { background: #FFFFFF; }

/* === HERO === */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #2E1065 0%, #4C1D95 50%, #1A0B3E 100%);
}
.hero-bg {
  position: absolute; inset: 0;
  background: url('./assets/hero_bg.png') center/cover no-repeat;
  opacity: 0.2;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: rgba(46, 16, 101, 0.65);
}
.hero-content {
  position: relative; z-index: 1;
  max-width: 900px; margin: 0 auto;
  padding: 6rem 2rem 4rem;
  text-align: center;
  color: #fff;
}
.hero-badge {
  display: inline-block;
  padding: 0.3rem 1rem;
  border-radius: 999px;
  background: rgba(109, 40, 217, 0.4);
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.hero-authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.chip {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 0.85rem;
}
.hero-hook {
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 700px;
  margin: 0 auto 2rem;
  opacity: 0.92;
}
.hero-actions { margin-bottom: 2.5rem; }
.btn {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  border-radius: 8px;
  background: #6D28D9;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: #5B21B6; transform: translateY(-1px); }
.contrib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  text-align: left;
}
.contrib-card {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 1.5rem;
  border-left: 3px solid #6D28D9;
}
.contrib-card h3 { color: #fff; font-size: 1.1rem; margin-top: 0.5rem; margin-bottom: 0.5rem; }
.contrib-card p { color: rgba(255,255,255,0.8); font-size: 0.9rem; margin-bottom: 0; }
.contrib-icon { font-size: 1.5rem; }

/* === FIGURES === */
.figure-block {
  margin: 2rem auto;
  text-align: center;
}
.figure-block img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid #D5D0E5;
  box-shadow: 0 2px 12px rgba(46,16,101,0.08);
}
.figure-wide img { max-width: 100%; }
.figure-block figcaption {
  font-size: 0.9rem;
  color: #8B85A0;
  margin-top: 0.75rem;
  line-height: 1.5;
  text-align: left;
}

/* === CALLOUT === */
.callout-box {
  border-left: 4px solid #6D28D9;
  background: rgba(109, 40, 217, 0.04);
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  border-radius: 0 8px 8px 0;
  margin: 2rem 0;
}
.callout-box p { margin-bottom: 0; font-size: 1.05rem; }

/* === CONCEPT CARDS === */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
  margin: 1.5rem 0 2rem;
}
.concept-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(46,16,101,0.08);
  transition: box-shadow 0.2s, transform 0.2s;
}
.concept-card:hover { box-shadow: 0 4px 20px rgba(46,16,101,0.12); transform: translateY(-2px); }
.concept-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #6D28D9;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.concept-card p { font-size: 0.92rem; color: #8B85A0; margin-bottom: 0; }

/* === FEATURE TAGS === */
.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 2rem;
}
.concept-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  background: #6D28D9;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
}

/* === RQ CARDS === */
.rq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}
.rq-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(46,16,101,0.08);
}
.rq-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.6rem;
  font-weight: 700;
  color: #6D28D9;
  margin-bottom: 0.5rem;
}
.rq-card p { font-size: 0.92rem; color: #8B85A0; margin-bottom: 0; }

/* === TABLES === */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(46,16,101,0.08);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.88rem;
}
.data-table caption {
  text-align: left;
  padding: 1rem;
  font-size: 0.9rem;
  color: #8B85A0;
  background: #fff;
  border-bottom: 1px solid #D5D0E5;
}
.data-table th {
  background: #2E1065;
  color: #fff;
  padding: 0.7rem 0.8rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.data-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #D5D0E5;
}
.data-table tbody tr:nth-child(even) { background: #F8F7FC; }
.data-table.compact { font-size: 0.92rem; }

/* === METRIC CARDS === */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin: 2rem 0;
}
.metric-card {
  background: #fff;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 2px 12px rgba(46,16,101,0.08);
}
.metric-card.accent {
  background: linear-gradient(135deg, #4C1D95, #6D28D9);
  color: #fff;
}
.metric-card.accent .metric-label { color: rgba(255,255,255,0.85); }
.metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 3rem;
  font-weight: 700;
  color: #2E1065;
  display: inline;
}
.metric-card.accent .metric-value { color: #fff; }
.metric-unit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: #6D28D9;
  display: inline;
}
.metric-card.accent .metric-unit { color: rgba(255,255,255,0.9); }
.metric-label {
  font-size: 0.9rem;
  color: #8B85A0;
  margin-top: 0.5rem;
}

/* === PULLQUOTE === */
.pullquote {
  border-left: 4px solid #6D28D9;
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  background: rgba(109, 40, 217, 0.03);
  border-radius: 0 8px 8px 0;
}
.pullquote p {
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.7;
  color: #4C1D95;
  margin-bottom: 0;
}

/* === RELATED WORK GRID === */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.2rem;
}
.related-card {
  background: #F0EFF5;
  border-radius: 12px;
  padding: 1.5rem;
}
.related-card p { font-size: 0.92rem; color: #8B85A0; margin-bottom: 0; }

/* === CONCLUSION === */
.conclusion-list {
  padding-left: 1.5rem;
  margin: 1.5rem 0;
}
.conclusion-list li {
  margin-bottom: 1rem;
  padding-left: 0.5rem;
}

/* === REFERENCES === */
details { border-radius: 8px; }
details summary {
  cursor: pointer;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  color: #2E1065;
  padding: 1rem 0;
}
.ref-list {
  padding-left: 1.5rem;
  font-size: 0.85rem;
  color: #8B85A0;
  line-height: 1.6;
}
.ref-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; }
}

/* === EXPLANATION UI === */
.flecto-note, .flecto-callout, .flecto-card, .flecto-panel {
  position: relative;
  margin: 1.5rem 0;
  border-radius: 8px;
}
.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 {
  background: rgba(109, 40, 217, 0.04);
  border-left: 3px solid #6D28D9;
  padding: 1rem 1.2rem;
  font-size: 0.95rem;
}
.flecto-callout {
  background: rgba(109, 40, 217, 0.06);
  border: 1px solid #D5D0E5;
  padding: 1.2rem 1.5rem;
}
.flecto-card {
  background: #fff;
  border: 1px solid #D5D0E5;
  box-shadow: 0 2px 8px rgba(46,16,101,0.06);
  padding: 1.5rem;
}
.flecto-panel {
  background: #fff;
  border: 1px solid #D5D0E5;
  box-shadow: 0 2px 12px rgba(46,16,101,0.08);
  padding: 2rem;
}
.flecto-note h4, .flecto-callout h4, .flecto-card h4, .flecto-panel h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #4C1D95;
}
.flecto-note p:last-child, .flecto-callout p:last-child, .flecto-card p:last-child, .flecto-panel p:last-child {
  margin-bottom: 0;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero-content { padding: 4rem 1.5rem 3rem; }
  h2 { font-size: 1.6rem; }
  .contrib-grid, .concept-grid, .rq-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
}
