/* ═══════════════════════════════════════════════════════════
   Academic Project Page — style.css
   Customize your project's look by editing the variables below.
   ═══════════════════════════════════════════════════════════ */

/* ── Theme Variables ── */
:root {
  /* Colors — change --color-accent for your brand */
  --color-bg: #fafdffb0;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-secondary: #555555;
  --color-accent: #489ab3;
  --color-accent-light: #dbeafe;
  --color-accent-dark: #306c7e;
  --color-success: #059669;
  --color-fail: #dc2626;
  --color-border: #e5e5e5;
  --color-code-bg: #f5f5f0;

  /* Typography */
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-sans: 'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --max-width: 900px;
  --max-width-wide: 1308px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}


/* ════════════════════════════════════════
   HERO
   ════════════════════════════════════════ */
.hero {
  padding: 32px 24px 60px;
  text-align: center;
  background: linear-gradient(180deg, #ebf4f7 0%, var(--color-bg) 100%);
  border-bottom: 1px solid var(--color-border);
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
  background: var(--color-accent-light);
  padding: 6px 18px;
  border-radius: 100px;
  margin-bottom: 28px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  max-width: 1100px;
  margin: 0 auto 10px;
}

.hero h1 .highlight { color: var(--color-accent); }

.hero .subtitle {
  font-family: var(--font-serif);
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 400;
  color: var(--color-text-secondary);
  max-width: 680px;
  margin: 0 auto 32px;
  line-height: 1.5;
}


/* ════════════════════════════════════════
   AUTHORS
   ════════════════════════════════════════ */
.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
  margin-bottom: 8px;
  font-size: 17px;
}

.authors a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.authors a:hover { color: var(--color-accent); }
.authors sup { font-size: 11px; color: var(--color-accent); font-weight: 600; margin-left: 1px; }

.affiliation {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
}

.affiliation sup { font-size: 10px; color: var(--color-accent); font-weight: 600; margin-right: 2px; }

.affiliation a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.affiliation a:hover {
  color: var(--color-accent);
}

/* ════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════ */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

.btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: 0 2px 12px rgba(37,99,235,0.1);
  transform: translateY(-1px);
}

.btn .icon { font-size: 16px; }
.btn.btn-primary { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.btn.btn-primary:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); color: #fff; }
.btn-disabled { opacity: 0.5; pointer-events: none; }


/* ════════════════════════════════════════
   SECTIONS & LAYOUT
   ════════════════════════════════════════ */
section { padding: 64px 24px; }
section:nth-child(even) {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

section p {
  text-align: justify;
}



.container      { max-width: var(--max-width); margin: 0 auto; }
.container-wide { max-width: var(--max-width-wide); margin: 0 auto; }

.section-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 12px;
}

h2 { font-family: var(--font-serif); font-size: 30px; font-weight: 700; margin-bottom: 24px; line-height: 1.25; }
h3 { font-family: var(--font-serif); font-size: 22px; font-weight: 600; margin-bottom: 16px; margin-top: 36px; line-height: 1.3; }
p  { margin-bottom: 16px; color: var(--color-text); }
p.secondary { color: var(--color-text-secondary); }


/* ════════════════════════════════════════
   TL;DR
   ════════════════════════════════════════ */
.tldr {
  background: linear-gradient(135deg, #f5f8fc 0%, #f0fdf4 100%);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 28px 32px;
  margin: 16px auto 0;
  max-width: var(--max-width);
  font-size: 16px;
  line-height: 1.65;
}

.tldrr {
  background: linear-gradient(135deg, #e9eaec 0%, #f3f3f3 100%);
  border: 1px solid #dfdfdf;
  border-radius: 12px;
  padding: 28px 32px;
  margin: 16px auto 0;
  max-width: 1308px;
  font-size: 16px;
  line-height: 1.65;
}

.tldr strong { color: var(--color-accent-dark); }


/* ════════════════════════════════════════
   STATS
   ════════════════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin: 48px auto 0;
  max-width: var(--max-width);
}

.stat-card {
  text-align: center;
  padding: 28px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label { font-size: 13px; font-weight: 500; color: var(--color-text-secondary); line-height: 1.4; }


/* ════════════════════════════════════════
   FIGURES
   ════════════════════════════════════════ */
.figure {
  margin: 36px 0 0 0;
  padding: 0;                 /* important */
  text-align: center;
  overflow: hidden;
}

.figure img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Mobile: add inset padding so it doesn't touch edges */
@media (max-width: 900px) {
  .figure {
    padding: 0 16px;
  }
}

.figure.fig-narrow img { max-width: 720px; }
.figure.fig-medium img { max-width: 900px; }
.figure.fig-wide img   { max-width: 100%; }

.figure-caption {
  margin-top: 14px;
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.55;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
  padding: 0 4px;
}

.figure-caption strong { color: var(--color-text); }


/* ════════════════════════════════════════
   VIDEO
   ════════════════════════════════════════ */
.video-container {
  position: relative;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  border: 0px solid var(--color-border);
  background: #000;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
}

.video-container video { display: block; width: 100%; height: auto; }

/* ════════════════════════════════════════
   VIDEO GRID (teaser videos)
   ════════════════════════════════════════ */

.video-grid {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.video-item {
  text-align: center;
}

.video-item {
  width: 260px;           /* desktop size */
  max-width: 100%;        /* allow shrink on narrow screens */
}

.video-item video {
  width: 100%;            /* fill the item */
  max-width: 900px;       /* optional: cap like results */
  border-radius: 8px;
  display: block;
}

.video-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

@media (max-width: 900px) {
  .video-grid {
    gap: 16px;
  }
  .video-item {
    width: 100%;          /* each becomes full-width on narrow screens */
  }
}

/* Comparison: large, fill container */
.video-grid--compare {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.video-item--compare {
  width: 100%;
}

/* Mobile: stack comparison videos */
@media (max-width: 900px) {
  .video-grid--compare {
    grid-template-columns: 1fr;
  }
}

/* ════════════════════════════════════════
   VIDEO SLIDER (Results)
   ════════════════════════════════════════ */

.video-slider {
  position: relative;
  margin-top: 18px;
}

.video-slider .slides {
  overflow: hidden;
  border-radius: 12px;
}

.video-slider .track {
  display: flex;
  gap: 16px;
  transition: transform 0.35s ease;
  will-change: transform;
}

.video-slider .slide {
  flex: 0 0 100%;
  background: transparent;
  border: 0px solid var(--color-border);
  border-radius: 12px;
  padding: 12px;
}

.video-slider .video-title {
  font-size: 20px;
  font-weight: 450;
  color: var(--color-text);
  margin-bottom: 8px;
  text-align: center;
}

.video-slider video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  background: #000;
}

/* nav buttons */
.video-slider .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.692);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  color: var(--color-text);
}

.video-slider .nav.prev { left: -10px; }
.video-slider .nav.next { right: -10px; }

.video-slider .nav:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* dots */
.video-slider .dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.video-slider .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #cfd4dc;
  border: none;
  cursor: pointer;
}

.video-slider .dot.active {
  background: var(--color-accent);
}

/* responsive */
@media (max-width: 900px) {
  .video-slider .slide { flex-basis: 100%; } /* 1 per view */
  .video-slider .nav.prev { left: 6px; }
  .video-slider .nav.next { right: 6px; }
}


/* ════════════════════════════════════════
   TABLES
   ════════════════════════════════════════ */
.table-wrapper {
  overflow-x: auto;
  margin: 28px 0;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead { background: #f8f9fb; }

th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-secondary);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

td { padding: 10px 16px; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
tr:last-child td { border-bottom: none; }

.table-title    { font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.table-subtitle { font-size: 13px; color: var(--color-text-secondary); margin-bottom: 16px; }
.cell-check     { color: var(--color-success); font-weight: 700; }
.cell-fail      { color: var(--color-fail); font-weight: 700; }
.cell-partial   { color: #d97706; font-weight: 600; }
.cell-highlight { background: #f0f7ff; font-weight: 600; }


/* ════════════════════════════════════════
   CARDS — method stages, contributions
   ════════════════════════════════════════ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.card {
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-light);
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.card h4 { font-family: var(--font-serif); font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.card p  { font-size: 14px; color: var(--color-text-secondary); margin-bottom: 0; line-height: 1.55; }

/* Accent border variant */
.accent-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.accent-card {
  padding: 20px 24px;
  border-left: 3px solid var(--color-accent);
  background: #f8faff;
  border-radius: 0 10px 10px 0;
}

.accent-card h4 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.accent-card p  { font-size: 13.5px; color: var(--color-text-secondary); margin-bottom: 0; line-height: 1.5; }


/* ════════════════════════════════════════
   BIBTEX
   ════════════════════════════════════════ */
.bibtex-block {
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 24px 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  position: relative;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  color: var(--color-text-secondary);
  transition: all 0.2s;
}

.copy-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }


/* ════════════════════════════════════════
   PDF VIEWER MODAL
   ════════════════════════════════════════ */
.pdf-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.pdf-overlay.active { display: flex; flex-direction: column; }
.pdf-overlay.show   { opacity: 1; }

.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #1a1a1a;
  color: #fff;
  flex-shrink: 0;
}

.pdf-title {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 16px;
}

.pdf-toolbar-actions { display: flex; gap: 8px; flex-shrink: 0; }

.pdf-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.pdf-toolbar-btn:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.4); }
.pdf-toolbar-btn.close-btn { border: none; background: none; font-size: 22px; padding: 4px 8px; line-height: 1; }
.pdf-viewer-frame { flex: 1; border: none; width: 100%; background: #525659; }


/* ════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════ */
footer {
  padding: 48px 24px 40px;
  text-align: center;
  border-top: 1px solid var(--color-border);
  background: #f8f9fb;
}

.footer-inner { max-width: 560px; margin: 0 auto; }
.visit-counter { margin-bottom: 4px; }
.visit-counter img { height: 24px; border-radius: 4px; }
.footer-divider { width: 48px; height: 1px; background: var(--color-border); margin: 24px auto; }
.template-credit { margin-bottom: 4px; }
.template-line { font-size: 15px; font-weight: 600; color: var(--color-text); margin-bottom: 14px; }

.template-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: #24292f;
  transition: all 0.2s ease;
  border: 1.5px solid #24292f;
}

.template-btn:hover { background: #1a1e23; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.15); }
.template-btn i:first-child { font-size: 17px; }
.template-desc { margin-top: 12px; font-size: 13px; color: var(--color-text-secondary); line-height: 1.5; }
.footer-legal { font-size: 12px; color: #999; margin-bottom: 0; }
footer a { color: var(--color-accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }
.footer-legal a { color: #888; }
.footer-legal a:hover { color: var(--color-accent); }


/* ════════════════════════════════════════
   ANIMATIONS
   ════════════════════════════════════════ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible { opacity: 1; transform: translateY(0); }


/* ════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════ */
@media (max-width: 640px) {
  .hero { padding: 24px 16px 32px; }
  section { padding: 40px 16px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-grid, .accent-cards { grid-template-columns: 1fr; }
  th, td { padding: 8px 10px; font-size: 13px; }

  .figure { margin: 24px -16px; }
  .figure img { border-radius: 0; border-left: none; border-right: none; }
  .figure.fig-narrow img, .figure.fig-medium img { max-width: 100%; }
  .figure-caption { padding: 0 16px; font-size: 13px; }

  .video-container {
    border-radius: 0;
    margin: 0 -16px;
    width: calc(100% + 32px);
    max-width: none;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  .tldr { padding: 20px; font-size: 15px; margin-left: -4px; margin-right: -4px; }
  .bibtex-block { padding: 16px; font-size: 12px; }
  .btn-row { gap: 8px; }
  .btn { padding: 8px 14px; font-size: 13px; }
  .authors { gap: 4px 16px; font-size: 15px; }
  h2 { font-size: 24px; }
  h3 { font-size: 19px; }
  .stat-card { padding: 20px 12px; }
  .stat-number { font-size: 28px; }
  .table-wrapper { margin: 20px -16px; border-radius: 0; border-left: none; border-right: none; }

  .pdf-toolbar { padding: 10px 14px; }
  .pdf-title { font-size: 13px; }
  .pdf-toolbar-btn span.btn-label { display: none; }
  .pdf-toolbar-btn { padding: 7px 10px; }
}

@media (max-width: 380px) {
  .stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .btn-row { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
}
