/* ============================================================
   ACADEMIC REPORT — INDIGO INK PALETTE
   Fonts: Cormorant Garamond (display) + Manrope (body)
   Palette: #1B0A3C · #3D1E7C · #7B68EE · #E8E0F0
   ============================================================ */

:root {
  --ink-deep:    #1B0A3C;
  --ink-mid:     #3D1E7C;
  --ink-accent:  #7B68EE;
  --ink-light:   #E8E0F0;
  --ink-pale:    #F4F1FB;
  --ink-muted:   #9B8EC4;
  --ink-border:  #D0C8E8;
  --ink-text:    #2C1F5E;
  --ink-body:    #3D3060;
  --ink-subtle:  #6B5E9C;
  --white:       #FAFAFA;
  --paper:       #FDFCFF;
  --red-alert:   #FF6B6B;

  --sidebar-w:   260px;
  --content-max: 860px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Manrope', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink-text);
  line-height: 1.75;
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--ink-deep);
  display: flex;
  flex-direction: column;
  padding: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid rgba(123, 104, 238, 0.2);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(123, 104, 238, 0.2);
}

.sidebar-icon {
  font-size: 22px;
  color: var(--ink-accent);
  line-height: 1;
}

.sidebar-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.nav-list {
  list-style: none;
  padding: 16px 0;
  flex: 1;
}

.nav-list li { margin: 0; }

.nav-link {
  display: block;
  padding: 9px 24px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s, background 0.2s, padding-left 0.2s;
  border-left: 2px solid transparent;
}

.nav-link:hover {
  color: var(--ink-light);
  background: rgba(123, 104, 238, 0.08);
  padding-left: 30px;
}

.nav-link.active {
  color: var(--ink-accent);
  border-left-color: var(--ink-accent);
  background: rgba(123, 104, 238, 0.12);
  padding-left: 28px;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(123, 104, 238, 0.2);
  font-size: 10.5px;
  color: rgba(155, 142, 196, 0.6);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ── HAMBURGER ── */
.hamburger {
  display: none;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 200;
  background: var(--ink-deep);
  border: 1px solid rgba(123, 104, 238, 0.4);
  border-radius: 6px;
  width: 40px; height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
}

.hamburger span {
  display: block;
  width: 20px; height: 2px;
  background: var(--ink-accent);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 0 0 80px;
}

/* ============================================================
   COVER PAGE
   ============================================================ */
.cover-page {
  background: linear-gradient(135deg, var(--ink-deep) 0%, #2A1060 50%, #1B0A3C 100%);
  padding: 72px 80px 64px;
  position: relative;
  overflow: hidden;
}

.cover-page::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(123, 104, 238, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.cover-page::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(123, 104, 238, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.cover-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-accent);
  background: rgba(123, 104, 238, 0.15);
  border: 1px solid rgba(123, 104, 238, 0.35);
  padding: 5px 14px;
  border-radius: 3px;
  margin-bottom: 20px;
}

.cover-journal {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

.cover-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.5vw, 42px);
  font-weight: 600;
  line-height: 1.25;
  color: var(--white);
  max-width: 820px;
  margin-bottom: 40px;
  letter-spacing: -0.01em;
}

.cover-authors {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(123, 104, 238, 0.25);
}

.author-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.author-name {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-light);
}

.author-affil {
  font-family: var(--font-body);
  font-size: 11.5px;
  color: var(--ink-muted);
  max-width: 280px;
  line-height: 1.5;
}

.cover-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 20px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(155, 142, 196, 0.7);
}

.meta-value {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-light);
}

.cover-doi {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-bottom: 28px;
}

.cover-doi a {
  color: var(--ink-accent);
  text-decoration: none;
}

.cover-doi a:hover { text-decoration: underline; }

.cover-keywords {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.kw-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.kw-tag {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-light);
  background: rgba(123, 104, 238, 0.18);
  border: 1px solid rgba(123, 104, 238, 0.3);
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

/* ============================================================
   PAPER SECTIONS
   ============================================================ */
.paper-section {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 56px 80px 0;
  position: relative;
}

.paper-section:last-of-type { padding-bottom: 40px; }

/* Section label (Abstract) */
.section-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-accent);
  margin-bottom: 16px;
}

/* Section headings */
.section-heading {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 600;
  color: var(--ink-deep);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink-border);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.section-num {
  color: var(--ink-accent);
  margin-right: 6px;
}

.subsection-heading {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.8vw, 20px);
  font-weight: 600;
  color: var(--ink-mid);
  margin: 32px 0 14px;
  letter-spacing: -0.005em;
}

/* Body text */
.paper-section p {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-body);
  margin-bottom: 18px;
  text-align: justify;
  hyphens: auto;
}

/* Lists */
.paper-list {
  margin: 0 0 18px 24px;
  padding: 0;
}

.paper-list li {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-body);
  margin-bottom: 10px;
  padding-left: 6px;
}

/* ── ABSTRACT BOX ── */
.abstract-box {
  background: var(--ink-pale);
  border-left: 4px solid var(--ink-accent);
  border-radius: 0 8px 8px 0;
  padding: 28px 32px;
  margin-bottom: 8px;
}

.abstract-box p {
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--ink-body);
  margin: 0;
  text-align: justify;
}

/* ── EQUATION BLOCK ── */
.equation-block {
  display: flex;
  align-items: baseline;
  gap: 24px;
  background: var(--ink-pale);
  border: 1px solid var(--ink-border);
  border-radius: 6px;
  padding: 18px 28px;
  margin: 20px 0;
}

.equation {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink-deep);
  flex: 1;
}

.equation sup {
  font-size: 11px;
  vertical-align: super;
}

.equation-label {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-subtle);
  white-space: nowrap;
}

/* ── CODE ── */
code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(123, 104, 238, 0.1);
  color: var(--ink-mid);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(123, 104, 238, 0.2);
}

/* ============================================================
   FIGURES & TABLES
   ============================================================ */
.figure-container {
  margin: 36px 0;
  background: var(--white);
  border: 1px solid var(--ink-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(27, 10, 60, 0.06);
}

.figure-inner {
  padding: 24px;
  background: var(--ink-pale);
}

.figure-caption {
  padding: 14px 20px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-subtle);
  border-top: 1px solid var(--ink-border);
  background: var(--white);
}

.figure-caption strong {
  color: var(--ink-deep);
  font-weight: 600;
}

/* SVG Diagrams */
.diagram-svg {
  width: 100%;
  height: auto;
  display: block;
}

.diagram-svg--narrow {
  max-width: 420px;
  margin: 0 auto;
}

/* Table title */
.table-title {
  padding: 16px 20px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-deep);
  letter-spacing: 0.01em;
  border-bottom: 1px solid var(--ink-border);
  background: var(--white);
}

/* Table wrapper */
.table-wrapper {
  overflow-x: auto;
  background: var(--white);
}

/* Paper table */
.paper-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 13px;
}

.paper-table thead tr {
  background: var(--ink-deep);
}

.paper-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-light);
  white-space: nowrap;
}

.paper-table tbody tr {
  border-bottom: 1px solid var(--ink-border);
  transition: background 0.15s;
}

.paper-table tbody tr:hover {
  background: rgba(123, 104, 238, 0.04);
}

.paper-table tbody tr:last-child {
  border-bottom: none;
}

.paper-table tbody td {
  padding: 11px 16px;
  color: var(--ink-body);
  line-height: 1.5;
  vertical-align: top;
}

.paper-table tbody tr:nth-child(even) {
  background: rgba(244, 241, 251, 0.5);
}

.paper-table tbody tr:nth-child(even):hover {
  background: rgba(123, 104, 238, 0.06);
}

.highlight-row {
  background: rgba(123, 104, 238, 0.1) !important;
  border-top: 2px solid var(--ink-accent) !important;
}

.highlight-row td {
  color: var(--ink-deep) !important;
  font-weight: 600;
}

/* ============================================================
   REFERENCES
   ============================================================ */
.references-list {
  list-style: decimal;
  padding-left: 28px;
  margin-top: 8px;
}

.references-list li {
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-body);
  margin-bottom: 14px;
  padding-left: 6px;
}

.references-list li em {
  font-style: italic;
  color: var(--ink-text);
}

.references-list li a {
  color: var(--ink-accent);
  text-decoration: none;
  word-break: break-all;
}

.references-list li a:hover {
  text-decoration: underline;
}

/* ============================================================
   FOOTER
   ============================================================ */
.paper-footer {
  margin-top: 60px;
  border-top: 1px solid var(--ink-border);
  background: var(--ink-pale);
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 20px 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-left, .footer-right {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-subtle);
}

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
.progress-bar {
  position: fixed;
  top: 0; left: var(--sidebar-w);
  right: 0; height: 3px;
  background: linear-gradient(90deg, var(--ink-accent), #B8A9FF);
  transform-origin: left;
  transform: scaleX(0);
  z-index: 50;
  transition: transform 0.1s linear;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(27, 10, 60, 0.4);
  }

  .hamburger {
    display: flex;
  }

  .main-content {
    margin-left: 0;
  }

  .progress-bar {
    left: 0;
  }

  .cover-page {
    padding: 64px 28px 48px;
  }

  .paper-section {
    padding: 40px 28px 0;
  }

  .footer-inner {
    padding: 20px 28px;
  }

  .cover-title {
    font-size: 24px;
  }

  .cover-authors {
    flex-direction: column;
    gap: 16px;
  }
}

@media (max-width: 600px) {
  .cover-page {
    padding: 56px 20px 40px;
  }

  .paper-section {
    padding: 32px 20px 0;
  }

  .footer-inner {
    padding: 16px 20px;
    flex-direction: column;
    align-items: flex-start;
  }

  .cover-meta {
    gap: 16px;
  }

  .paper-table {
    font-size: 12px;
  }

  .paper-table thead th,
  .paper-table tbody td {
    padding: 9px 12px;
  }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .sidebar, .hamburger, .progress-bar { display: none !important; }
  .main-content { margin-left: 0; }
  .paper-section { padding: 32px 40px 0; }
  .cover-page { padding: 40px; }
  body { background: white; }
  .figure-container { box-shadow: none; border: 1px solid #ccc; }
  a { color: inherit; text-decoration: none; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.paper-section {
  animation: fadeInUp 0.5s ease both;
}

.cover-page {
  animation: fadeInUp 0.6s ease both;
}