/* SPReAD Project Academic Homepage Stylesheet */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, monospace;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;

  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-accent: #2563eb;

  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;

  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-secondary: #0d9488;
  --accent-purple: #7c3aed;
  --accent-amber: #d97706;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --nav-height: 72px;
  --container-width: 1200px;
}

[data-theme="dark"] {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  --bg-card: #131c2e;
  --bg-card-hover: #1a253c;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-accent: #60a5fa;

  --border-subtle: #1e293b;
  --border-strong: #334155;

  --accent-primary: #3b82f6;
  --accent-primary-hover: #60a5fa;
  --accent-secondary: #14b8a6;
  --accent-purple: #a855f7;
  --accent-amber: #f59e0b;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 24px);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body {
  line-height: 1.65;
  font-size: 16px;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.875rem; margin-bottom: 1rem; }
h3 { font-size: 1.35rem; margin-bottom: 0.5rem; }
h4 { font-size: 1.1rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

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

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

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

[data-theme="dark"] .navbar {
  background: rgba(9, 13, 22, 0.88);
}

.navbar .nav-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.22rem;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.nav-brand .brand-badge {
  font-size: 0.72rem;
  padding: 3px 8px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent-primary);
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: 1px solid rgba(37, 99, 235, 0.2);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 550;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.01em;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.lang-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.btn-icon:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

/* Hero Section */
.hero-section {
  padding: 64px 0 48px;
  text-align: center;
  background: radial-gradient(circle at 50% 10%, rgba(37, 99, 235, 0.08) 0%, transparent 65%);
}

.grant-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.grant-pill .pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-secondary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(13, 148, 136, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(13, 148, 136, 0); }
}

.hero-title {
  font-size: 2.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  max-width: 950px;
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 820px;
  margin: 0 auto 32px;
  line-height: 1.55;
}

.author-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 32px;
}

.author-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.author-affil {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.author-affil span {
  color: var(--accent-primary);
  font-weight: 500;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

/* Sections */
.section {
  padding: 64px 0;
  border-top: 1px solid var(--border-subtle);
}

.section-header {
  margin-bottom: 40px;
}

.section-tag {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  margin-bottom: 6px;
}

.section-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 780px;
}

/* Card Grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 28px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  font-size: 1.4rem;
}

.icon-blue { background: rgba(37, 99, 235, 0.1); color: var(--accent-primary); }
.icon-teal { background: rgba(13, 148, 136, 0.1); color: var(--accent-secondary); }
.icon-purple { background: rgba(124, 58, 237, 0.1); color: var(--accent-purple); }
.icon-amber { background: rgba(217, 119, 6, 0.1); color: var(--accent-amber); }

/* Executive Summary Box */
.exec-box {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(13, 148, 136, 0.05) 100%);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-xl);
  padding: 36px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-sm);
}

.exec-box h3 {
  color: var(--accent-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.exec-box p {
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Comparison Table / Cards */
.comparison-card {
  border-left: 4px solid var(--border-strong);
}

.comparison-card.negative {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.02);
}

.comparison-card.warning {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.02);
}

.comparison-card.positive {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.03);
}

.comparison-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  margin-bottom: 14px;
}

.badge-neg { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.badge-warn { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.badge-pos { background: rgba(16, 185, 129, 0.15); color: #059669; }

/* Image Viewer / Lightbox */
.figure-container {
  margin: 32px 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.figure-img-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  cursor: pointer;
}

.figure-img-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.figure-img-wrapper:hover img {
  transform: scale(1.015);
}

.zoom-hint {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(4px);
}

.figure-caption {
  margin-top: 14px;
  font-size: 0.925rem;
  color: var(--text-muted);
  text-align: left;
  line-height: 1.5;
}

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

/* Timeline / Milestones */
.timeline {
  position: relative;
  padding: 20px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-strong);
}

.timeline-item {
  position: relative;
  padding-left: 64px;
  margin-bottom: 36px;
}

.timeline-node {
  position: absolute;
  left: 14px;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--accent-primary);
  z-index: 2;
}

.timeline-item.active .timeline-node {
  background: var(--accent-primary);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.2);
}

.timeline-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* References & Foundations Item (Modest Academic Style) */
.pub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 18px;
  box-shadow: none;
  transition: border-color 0.2s ease;
}

.pub-card:hover {
  border-color: var(--border-strong);
}

.pub-badge {
  display: inline-block;
  font-size: 0.725rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}

.pub-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.35;
}

.pub-authors {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.pub-authors strong {
  color: var(--text-primary);
  font-weight: 600;
}

.pub-venue {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 12px;
}

.ref-summary-box {
  background: var(--bg-secondary);
  border-left: 3px solid var(--border-strong);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-top: 10px;
}

.ref-summary-box p {
  margin-bottom: 0;
  color: var(--text-secondary);
}

.pub-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 10px;
}

.pub-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pub-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

/* Modal Lightbox */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 24px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-xl);
  overflow: auto;
}

.modal-container img {
  max-width: 100%;
  max-height: 80vh;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius-md);
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 10;
}

/* BibTeX Box & Code Styling */
.bibtex-wrapper {
  position: relative;
  margin-top: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.bibtex-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.bibtex-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.bibtex-copy-btn:hover {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.bibtex-box {
  background: var(--bg-card);
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre;
  word-break: normal;
  overflow-x: auto;
  tab-size: 2;
  margin: 0;
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 48px 0 32px;
  text-align: center;
}

.footer-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 3000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive */
@media (max-width: 1024px) {
  .nav-links { gap: 6px; }
  .nav-links a { font-size: 0.82rem; padding: 4px 8px; }
  .brand-title { font-size: 1.12rem; }
  .nav-brand .brand-badge { font-size: 0.68rem; padding: 2px 6px; }
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .hero-title { font-size: 2.1rem; }
  .hero-subtitle { font-size: 1.05rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .timeline::before { left: 16px; }
  .timeline-item { padding-left: 48px; }
  .timeline-node { left: 6px; }
}
