/* Fonts - Classic Academic Serif */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --bg: #f8fafc;
  /* Slate-50 (Off-white) */
  --bg-card: #ffffff;
  /* White for cards */
  --text: #1e293b;
  /* Slate-800 */
  --text-light: #475569;
  /* Slate-600 */
  --text-lighter: #94a3b8;
  /* Slate-400 */
  --border: #e2e8f0;
  /* Slate-200 */

  /* Primary Color: Cleaner Blue */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;

  --bg-offset: #f1f5f9;
  /* Slate-100 */

  /* Modern Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Fonts - Classic Academic Style */
  --font-heading: 'Libre Baskerville', 'Georgia', 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --max-width: 1000px;
  /* Slightly wider for table */
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  /* Slightly tighter line-height */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 80px;
  /* Space for fixed navbar */
}

html {
  scroll-padding-top: 80px;
  /* Offset for fixed navbar */
}

/* Navbar Styles */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  /* Glassmorphism background */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 1000;
  padding: 0.8rem 0;
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  /* Match or slightly exceed main container */
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  /* Elegant serif font */
  font-weight: 800;
  font-size: 1.6rem;
  /* Slightly larger */
  text-decoration: none;
  background: linear-gradient(135deg, #2563eb 0%, #9333ea 100%);
  /* Blue to Purple Gradient */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  /* Vertically align text and button */
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: #4b5563;
  /* Slate-600 */
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--primary);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* Typography */
h1,
h2,
h3 {
  font-family: var(--font-heading);
  color: #0f172a;
  letter-spacing: 0.01em;
  /* Wider for serif */
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

h1 {
  line-height: 1.1;
}

h2 {
  font-size: 2.4rem;
  /* Significantly larger */
  font-weight: 600;
  text-align: center;
  display: block;
  background-color: #f3f4f6;
  /* Full-width light gray band */
  padding: 1.25rem 0;
  margin-left: calc(-50vw + 50%);
  /* Extend to full viewport width */
  margin-right: calc(-50vw + 50%);
  padding-left: calc(50vw - 50%);
  padding-right: calc(50vw - 50%);
  margin-bottom: 2rem;
  /* text-transform: uppercase; REMOVED to allow small-caps to distinguish first letter */
  font-variant: small-caps;
  /* Small caps: First letter Big Cap, others Small Cap */
  letter-spacing: 0.05em;
  font-family: var(--font-heading);
  /* Serif */
}

/* Remove the old blue underline */
h2::after {
  display: none;
}

h3 {
  font-family: var(--font-body);
  /* Switch to Sans-Serif (Inter) as requested */
  font-size: 1.75rem;
  /* Larger and distinct */
  font-weight: 800;
  /* Extra Bold */
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  color: #111827;
  /* Darker black */
  text-align: center;
  border-bottom: 2px solid #e5e7eb;
  /* Slightly thicker border for emphasis */
  padding-bottom: 0.5rem;
  display: inline-block;
  width: 100%;
  letter-spacing: -0.02em;
  /* Tighten slightly for display font look */
}

p {
  margin-bottom: 1rem;
  /* Tighter paragraph spacing */
  font-size: 1.05rem;
  color: var(--text-light);
  text-align: justify;
}

code {
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  background-color: var(--bg-offset);
  padding: 0.2em 0.5em;
  border-radius: 6px;
  font-size: 0.85em;
  color: #e11d48;
  border: 1px solid var(--border);
}

pre {
  background-color: #0f172a;
  /* Slate-900 */
  padding: 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-lg);
  border: 1px solid #1e293b;
}

pre code {
  color: #e2e8f0;
  /* Slate-200 */
  background: none;
  border: none;
  padding: 0;
  font-size: 0.9em;
  font-family: 'Menlo', monospace;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

section {
  animation: fadeIn 0.8s ease-out forwards;
  opacity: 0;
  /* Start hidden */
}

/* Stagger animations for sections */
section:nth-of-type(1) {
  animation-delay: 0.1s;
}

section:nth-of-type(2) {
  animation-delay: 0.2s;
}

section:nth-of-type(3) {
  animation-delay: 0.3s;
}

section:nth-of-type(4) {
  animation-delay: 0.4s;
}

section:nth-of-type(5) {
  animation-delay: 0.5s;
}


/* Layout */
.container {
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 60px;
  /* Reduced bottom padding */
}

/* Header / Nav */
.top-nav {
  display: flex;
  justify-content: flex-end;
  padding: 20px 0;
  /* Reduced padding */
  margin-bottom: 1rem;
  animation: fadeIn 0.8s ease-out forwards;
  /* Fix stacking context: Ensure nav sits above hero section */
  position: relative;
  z-index: 1000;
}

/* Dropdown / Button */
.dropdown {
  position: relative;
  display: inline-block;
}

.more-research-btn {
  background-color: transparent;
  /* Changed to transparent for navbar */
  color: var(--text);
  padding: 6px 14px;
  /* Slightly smaller padding */
  border-radius: 9999px;
  font-size: 0.85rem;
  /* Smaller font */
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #e5e7eb;
  /* Light border */
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-heading);
  box-shadow: none;
  /* Remove shadow */
}

.more-research-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  background-color: #f8fafc;
}

.dropdown-content {
  /* Display logic changed to support exit animation/delay */
  display: block;
  visibility: hidden;
  position: absolute;
  right: 0;
  top: 100%;
  /* Position directly below */
  margin-top: 8px;
  /* Add visual spacing */
  background-color: var(--bg-card);
  min-width: 200px;
  box-shadow: var(--shadow-xl);
  z-index: 50;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 8px;
  overflow: visible;
  /* Allow ::before to be outside */

  opacity: 0;
  transform: translateY(-10px);
  /* Use transition to delay hiding (visibility) so user doesn't lose menu instantly */
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

/* Invisible bridge to prevent menu from closing when moving mouse across gap */
.dropdown-content::before {
  content: '';
  position: absolute;
  top: -20px;
  /* Cover the gap and margin */
  left: 0;
  width: 100%;
  height: 20px;
  background: transparent;
}

.dropdown:hover .dropdown-content {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  /* Show immediately on hover */
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
}

.dropdown-content a {
  color: var(--text);
  padding: 10px 16px;
  text-decoration: none;
  display: block;
  font-size: 0.9rem;
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.2s;
}

.dropdown-content a:hover {
  background-color: var(--bg-offset);
  color: var(--primary);
}


/* Hero Section */
.hero-header {
  text-align: center;
  padding: 50px 0 40px;
  /* Increased top padding for more space below navbar */
  animation: fadeIn 0.8s ease-out forwards;
}

.paper-title {
  margin-top: 0;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.title-main {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 3.8rem;
  /* Larger as requested */
  color: #0f172a;
  -webkit-text-fill-color: unset;
  /* Remove gradient */
  background: none;
  line-height: 1.15;
  letter-spacing: 0.02em;
  /* Wider letter spacing as requested */
}

.title-icon {
  font-size: 3rem;
  line-height: 1;
  -webkit-text-fill-color: initial;
  animation: float 3s ease-in-out infinite;
  /* Cute floating animation for emoji */
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.title-sub {
  display: block;
  margin-top: 1rem;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.3rem;
  color: var(--text-light);
  line-height: 1.4;
  margin-left: auto;
  margin-right: auto;
  max-width: 800px;
}

/* Authors & Institutions */
.authors-list {
  font-size: 1.25rem;
  color: var(--primary);
  margin-top: 1.5rem;
  font-weight: 500;
  line-height: 1.6;
}

.author-name {
  color: #334155;
  font-weight: 500;
  margin: 0 6px;
  display: inline-block;
}

.institutions-list {
  margin-top: 1rem;
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.6;
}

.institution-name {
  display: block;
}

/* Buttons */
.link-buttons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background-color: #1e293b;
  /* Dark Slate */
  color: white;
  text-decoration: none;
  border-radius: 9999px;
  /* Pill shape */
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  font-size: 1rem;
  font-family: var(--font-body);
  border: 1px solid transparent;
}

.btn-link:hover {
  background-color: #334155;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-icon {
  font-size: 1.25em;
}

/* Table Highlights */
/* Table Highlights */
.highlight-row {
  background-color: #f0f9ff !important;
  /* Very soft blue tint */
}

.highlight-row td {
  border-bottom: 2px solid #bae6fd !important;
  /* Slightly distinct border */
  color: #0f172a !important;
  /* Changed to Black (Slate-900) */
  font-weight: 600;
}

/* Best score bolding */
.best-score {
  font-weight: 800;
  color: #0f172a !important;
  /* Changed to Black (Slate-900) */
  /* Purple highlight removed as requested */
}

/* Institution Colors */
.inst-1 {
  color: #2563eb !important;
  /* Blue for Inst 1 */
  font-weight: 700;
}

.inst-2 {
  color: #e11d48 !important;
  /* Rose/Red for Inst 2 */
  font-weight: 700;
}

.authors-list sup,
.institutions-list sup {
  margin-left: 2px;
  font-weight: 700;
}

.institutions-list {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

.nav-logo {
  font-family: 'Playfair Display', serif !important;
  /* Force elegant serif font */
  font-weight: 800;
  font-size: 1.6rem;
  text-decoration: none;
  background: linear-gradient(135deg, #2563eb 0%, #9333ea 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

/* Action Buttons */
.link-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.btn-link {
  background-color: #0f172a;
  /* Slate-900 */
  color: white;
  padding: 10px 24px;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow);
  font-family: var(--font-heading);
  border: 1px solid transparent;
}

.btn-link:hover {
  background-color: #1e293b;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.btn-icon {
  font-size: 1.1rem;
}


/* Content Cards - Now transparent, no boxes */
.content-card {
  background: transparent;
  padding: 1.5rem 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
  margin-bottom: 2rem;
}

.content-card:hover {
  transform: none;
  box-shadow: none;
}

/* Introduction Specifics */
.introduction-text {
  font-size: 1.2rem;
  line-height: 1.8;
  color: #334155;
  /* Justify for cleaner block appearance */
  text-align: justify;
  max-width: 1000px;
  /* Increased width to reduce line count */
  margin: 0 auto 2rem;

  /* Floating Card Style */
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  padding: 2rem;
  /* Ample padding */
  border: 1px solid rgba(0, 0, 0, 0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.introduction-text:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
}

.introduction-text strong {
  color: #000000;
  font-weight: 800;
}


/* Key Ideas */
.key-ideas-list {
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
}

.key-ideas-list li {
  padding: 1rem;
  background-color: var(--bg-offset);
  border-radius: 12px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
  font-size: 1rem;
  color: var(--text-light);
}

.key-ideas-list li:hover {
  background-color: #fff;
  border-color: var(--border);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.key-ideas-list strong {
  color: var(--primary);
  /* Highlight key terms */
  font-weight: 700;
  font-family: var(--font-heading);
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
}


/* Figures */
.figure-container {
  margin: 2rem auto;
  text-align: center;
  /* Floating Card Style */
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  /* Subtle shadow */
  padding: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  max-width: 1000px;
  /* Constrain width for card look */
}

.figure-container:hover {
  transform: translateY(-5px);
  /* Lift effect */
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
  /* Deeper shadow on hover */
}

.figure-img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  background-color: white;
  /* Ensure white background for transparent PNGs */
}

.figure-caption {
  margin-top: 1rem;
  color: var(--text-light);
  font-size: 0.95em;
  font-family: var(--font-body);
  font-weight: 500;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}


/* Comparison Table */
.table-container {
  overflow-x: auto;
  margin: 2rem auto;
  /* Floating Card Style for Table */
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  padding: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  max-width: 1000px;
}

.table-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
}

.comparison-table {
  width: 100%;
  border-collapse: separate;
  /* Changed for border-radius */
  border-spacing: 0;
  font-size: 0.95rem;
  text-align: center;
}

.comparison-table th,
.comparison-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.comparison-table th {
  background-color: var(--bg-offset);
  color: #0f172a;
  font-weight: 600;
  font-family: var(--font-heading);
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr.highlight-row {
  background-color: #eff6ff;
  /* Light blue bg for our method */
}

.comparison-table tr.highlight-row td {
  color: var(--primary);
  font-weight: 600;
}

.comparison-table .best-score {
  font-weight: 700;
  color: #059669;
  /* Green-600 */
}


/* Citation */
.citation-block {
  background: var(--bg-offset);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 12px;
  font-family: 'Menlo', 'Monaco', monospace;
  font-size: 0.85rem;
  color: #334155;
  overflow-x: auto;
  line-height: 1.6;
}


/* Footer */
.page-footer {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-lighter);
  font-size: 0.9rem;
  animation: fadeIn 0.8s ease-out forwards;
}

.page-footer a {
  color: var(--text-light);
  font-weight: 500;
}

.page-footer a:hover {
  color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
  .title-main {
    font-size: 2.5rem;
  }

  .title-icon {
    font-size: 2.5rem;
  }

  .title-sub {
    font-size: 1.2rem;
  }

  .introduction-text {
    font-size: 1.1rem;
    text-align: justify;
  }

  .content-card {
    padding: 1.5rem;
  }

  .btn-link {
    width: 100%;
    justify-content: center;
  }

  .key-ideas-list li {
    padding: 1rem;
  }
}