/* ============================================================
   Research Paper Website — Style Sheet
   Nerfies-inspired clean academic design
   ============================================================ */

/* ---- CSS Custom Properties ---- */
:root {
  /* Colors */
  --color-bg: #ffffff;
  --color-bg-alt: #f7f8fa;
  --color-text: #1a1a2e;
  --color-text-secondary: #555770;
  --color-text-muted: #8888a0;
  --color-accent: #5b6abf;
  --color-accent-hover: #4a58a8;
  --color-accent-light: rgba(91, 106, 191, 0.08);
  --color-border: #e2e4ea;
  --color-code-bg: #282c34;
  --color-code-text: #abb2bf;
  --color-shadow: rgba(26, 26, 46, 0.06);
  --color-shadow-strong: rgba(26, 26, 46, 0.12);

  /* Typography */
  --font-body: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --content-width: 1200px;
  --content-width-wide: 1400px;
  --nav-height: 60px;

  /* Spacing */
  --section-padding: 80px 0;
  --section-padding-mobile: 50px 0;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.35s ease;
  --transition-slow: 0.5s ease;

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---- Container ---- */
.container {
  max-width: var(--content-width);
  width: 90%;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: all var(--transition-medium);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  border-bottom-color: var(--color-border);
  box-shadow: 0 1px 12px var(--color-shadow);
}

.nav-content {
  max-width: var(--content-width-wide);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.nav-logo:hover {
  color: var(--color-accent);
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
  transition: width var(--transition-fast);
}

.nav-links a:hover {
  color: var(--color-accent);
}

.nav-links a:hover::after {
  width: 100%;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  padding-top: calc(var(--nav-height) + 60px);
  padding-bottom: 40px;
  text-align: center;
}

.publication-badge {
  margin-bottom: 24px;
}

.badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-accent), #7b68ee);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 18px;
  border-radius: 50px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.paper-title {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  letter-spacing: -0.025em;
  margin-bottom: 28px;
}

/* Authors */
.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin-bottom: 12px;
}

.author {
  font-size: 1.05rem;
  font-weight: 500;
}

.author a {
  color: var(--color-accent);
  border-bottom: 1px dashed transparent;
  transition: all var(--transition-fast);
}

.author a:hover {
  border-bottom-color: var(--color-accent);
}

.author sup {
  font-size: 0.7em;
  color: var(--color-text-muted);
  margin-left: 1px;
}

/* Affiliations */
.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  margin-bottom: 32px;
}

.affiliation {
  font-size: 0.92rem;
  color: var(--color-text-secondary);
}

.affiliation sup {
  font-size: 0.7em;
  color: var(--color-text-muted);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  color: var(--color-text);
  background: var(--color-bg);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px var(--color-shadow);
}

.btn i {
  font-size: 1.1em;
}

/* ============================================================
   TEASER SECTION
   ============================================================ */
.teaser {
  padding: 20px 0 60px;
}

.teaser-video-wrapper {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 40px var(--color-shadow-strong);
  background: var(--color-bg-alt);
}

.teaser-video-wrapper iframe,
.teaser-video-wrapper video {
  width: 100%;
  aspect-ratio: 16/9;
  display: block;
}

.teaser-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  background: linear-gradient(135deg, #f0f2f8 0%, #e8eaf2 100%);
  color: var(--color-text-muted);
  text-align: center;
}

.teaser-placeholder i {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.teaser-placeholder p {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.teaser-placeholder .hint {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  opacity: 0.7;
  font-family: monospace;
}

.teaser-caption {
  text-align: center;
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  margin-top: 16px;
  line-height: 1.6;
}

/* ============================================================
   SECTIONS (Generic)
   ============================================================ */
.section {
  padding: var(--section-padding);
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 28px;
  letter-spacing: -0.02em;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), #7b68ee);
  border-radius: 3px;
}

.subsection-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 36px 0 20px;
  letter-spacing: -0.01em;
}

/* ============================================================
   ABSTRACT
   ============================================================ */
.abstract-content {
  max-width: 780px;
}

.abstract-content p {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  line-height: 1.8;
  text-align: justify;
}

.abstract-content p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   METHOD
   ============================================================ */
.method-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.method-figure {
  width: 100%;
}

.figure-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  background: linear-gradient(135deg, #f0f2f8 0%, #e8eaf2 100%);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  text-align: center;
  border: 2px dashed var(--color-border);
}

.figure-placeholder.small {
  padding: 40px 24px;
}

.figure-placeholder.video {
  padding: 50px 24px;
}

.figure-placeholder i {
  font-size: 2.2rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.figure-placeholder p {
  font-weight: 500;
  margin-bottom: 6px;
}

.figure-placeholder .hint {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  opacity: 0.6;
  font-family: monospace;
}

.method-description p {
  font-size: 1.02rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: 14px;
}

.method-description p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   RESULTS
   ============================================================ */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.result-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  transition: all var(--transition-medium);
}

.result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px var(--color-shadow-strong);
  border-color: transparent;
}

.result-caption {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  padding: 14px 18px;
  text-align: center;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.video-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  transition: all var(--transition-medium);
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px var(--color-shadow-strong);
  border-color: transparent;
}

/* ============================================================
   RELATED LINKS
   ============================================================ */
.related-content p {
  font-size: 1.02rem;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  line-height: 1.8;
}

.related-list {
  list-style: none;
  padding: 0;
}

.related-list li {
  position: relative;
  padding: 10px 0 10px 24px;
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  border-bottom: 1px solid var(--color-border);
}

.related-list li:last-child {
  border-bottom: none;
}

.related-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: 600;
}

.related-list a {
  font-weight: 600;
}

/* ============================================================
   BIBTEX
   ============================================================ */
.bibtex-wrapper {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 16px var(--color-shadow);
}

.bibtex-code {
  background: var(--color-code-bg);
  color: var(--color-code-text);
  padding: 28px 28px 28px 28px;
  font-family: 'SFMono-Regular', 'Fira Code', 'Fira Mono', 'Consolas', monospace;
  font-size: 0.88rem;
  line-height: 1.65;
  overflow-x: auto;
  margin: 0;
}

.bibtex-code code {
  font-family: inherit;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-body);
  color: #ccc;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 5;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.copy-btn.copied {
  background: rgba(76, 175, 80, 0.2);
  color: #81c784;
  border-color: rgba(76, 175, 80, 0.3);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 40px 0;
  text-align: center;
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
}

.footer p {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.footer a {
  color: var(--color-accent);
  font-weight: 500;
}

/* ============================================================
   ANIMATIONS — Fade-in on scroll
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 768px) {
  .paper-title {
    font-size: 2rem;
  }

  .section {
    padding: var(--section-padding-mobile);
  }

  .section-title {
    font-size: 1.55rem;
  }

  .results-grid,
  .video-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 20px;
  }

  .action-buttons {
    gap: 8px;
  }

  .btn {
    padding: 8px 16px;
    font-size: 0.82rem;
  }

  .teaser-placeholder {
    padding: 50px 24px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .paper-title {
    font-size: 1.6rem;
  }

  .authors {
    gap: 4px 14px;
  }

  .author {
    font-size: 0.95rem;
  }

  .nav-links {
    display: none;
  }

  .btn span {
    display: none;
  }

  .btn {
    padding: 10px 14px;
  }

  .action-buttons {
    gap: 8px;
  }

  .container {
    padding: 0 16px;
  }

  .bibtex-code {
    font-size: 0.75rem;
    padding: 20px 16px;
  }

  .abstract-content p {
    font-size: 0.98rem;
    text-align: left;
  }
}

/* Print styles */
@media print {

  .navbar,
  .copy-btn,
  .action-buttons {
    display: none !important;
  }

  .hero {
    padding-top: 20px;
  }

  .section {
    padding: 30px 0;
  }

  body {
    font-size: 12pt;
  }
}