/* Modern Scientific Design System */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700;800&family=Space+Grotesk:wght@500;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --accent: #3b82f6;
  --background: #ffffff;
  --surface: #f8fafc;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --glass: rgba(255, 255, 255, 0.8);
}

body.theme-dark {
  --primary: #60a5fa;
  --primary-dark: #93c5fd;
  --secondary: #94a3b8;
  --accent: #38bdf8;
  --background: #0b1220;
  --surface: #111827;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #334155;
  --glass: rgba(11, 18, 32, 0.82);
}

body {
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  color: var(--text);
  background-color: var(--background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.theme-dark .landing-hero {
  background:
    radial-gradient(circle at 90% 10%, rgba(14, 165, 233, 0.26), transparent 36%),
    radial-gradient(circle at 18% 80%, rgba(234, 179, 8, 0.2), transparent 40%),
    linear-gradient(125deg, #020617 0%, #0f172a 48%, #1e293b 100%);
}

body.theme-dark .feature-card,
body.theme-dark .speaker-card,
body.theme-dark .stat-item,
body.theme-dark blockquote {
  background: #111827;
  border-color: #334155;
  color: #dbeafe;
}

body.theme-dark .stat-item p,
body.theme-dark .speaker-affil,
body.theme-dark blockquote {
  color: #94a3b8;
}

body.theme-dark .stat-item h3,
body.theme-dark h1,
body.theme-dark h2,
body.theme-dark h3,
body.theme-dark h4,
body.theme-dark .speaker-name {
  color: #e2e8f0;
}

body.theme-dark a {
  color: #7dd3fc;
}

body.theme-dark .navbar {
  border-bottom-color: #334155;
}

body.theme-dark .btn.btn-outline-light {
  color: #e2e8f0;
  border-color: rgba(226, 232, 240, 0.5);
}

.theme-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 2000;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 0.86rem;
  line-height: 1;
  padding: 0.62rem 0.9rem;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

/* News page */
.news-hero {
  position: relative;
  overflow: hidden;
  margin: 1.25rem 0 1.5rem 0;
  padding: 2.2rem;
  border-radius: 22px;
  color: #f8fafc;
  background:
    radial-gradient(circle at 90% 10%, rgba(125, 211, 252, 0.18), transparent 35%),
    radial-gradient(circle at 10% 80%, rgba(34, 197, 94, 0.16), transparent 40%),
    linear-gradient(125deg, #0b1d2e 0%, #142d42 48%, #182538 100%);
}

.news-hero h1 {
  margin: 0 0 0.5rem 0;
  color: #f8fafc;
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
}

.news-hero p {
  margin: 0;
  color: #dbeafe;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.news-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.news-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--border);
  background: #0f172a;
}

.news-card h3 {
  margin: 1rem 1rem 0.45rem;
  font-size: 1.08rem;
  line-height: 1.35;
}

.news-card p,
.news-card code,
.news-card a.btn {
  margin-left: 1rem;
  margin-right: 1rem;
}

.news-card code {
  display: inline-block;
  margin-top: 0;
  margin-bottom: 0.55rem;
  padding: 0.15rem 0.45rem;
  border-radius: 8px;
  font-size: 0.78rem;
  background: #e2e8f0;
  color: #334155;
}

.news-card a.btn {
  margin-top: auto;
  margin-bottom: 1rem;
}

body.theme-dark .news-card {
  background: #0f172a;
  border-color: #334155;
}

body.theme-dark .news-card code {
  background: #1e293b;
  color: #cbd5e1;
}

body.theme-dark .news-hero {
  background:
    radial-gradient(circle at 90% 10%, rgba(56, 189, 248, 0.22), transparent 35%),
    radial-gradient(circle at 10% 80%, rgba(132, 204, 22, 0.18), transparent 40%),
    linear-gradient(125deg, #020617 0%, #0f172a 48%, #1e293b 100%);
}

/* Navbar */
.navbar {
  background: var(--glass) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 0.75rem 0;
}

.navbar-title {
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text) !important;
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
  margin-top: 2rem;
}

#title-block-header.quarto-title-block.default .quarto-title .title {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  border: none;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Hero Section Styling (Manual in QMD) */
.hero-banner {
  padding: 4rem 0;
  text-align: center;
  background: radial-gradient(circle at top right, #eff6ff 0%, #ffffff 100%);
  border-radius: 24px;
  margin-bottom: 3rem;
}

.columns.v-center {
  align-items: center;
}

/* Landing page styling */
.landing-hero {
  position: relative;
  overflow: hidden;
  margin: 1.5rem 0 1.75rem 0;
  padding: 3rem;
  border-radius: 28px;
  color: #f8fafc;
  background:
    radial-gradient(circle at 90% 10%, rgba(56, 189, 248, 0.28), transparent 36%),
    radial-gradient(circle at 18% 80%, rgba(251, 146, 60, 0.22), transparent 40%),
    linear-gradient(125deg, #0b1d2e 0%, #15354f 48%, #1f2937 100%);
  box-shadow: 0 24px 40px -30px rgba(0, 0, 0, 0.45);
}

.landing-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 72%);
}

.landing-hero h1 {
  position: relative;
  z-index: 1;
  margin-top: 0.35rem;
  margin-bottom: 0.85rem;
  color: #f8fafc;
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  letter-spacing: -0.03em;
}

.landing-hero p {
  position: relative;
  z-index: 1;
  max-width: 65ch;
  color: #dbeafe;
}

.hero-logo {
  width: min(360px, 78%);
  border-radius: 14px;
  box-shadow: none;
  margin-bottom: 0.8rem;
}

.hero-image {
  width: 100%;
  max-height: 390px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 18px 34px -24px rgba(15, 23, 42, 0.8);
}

.hero-btn {
  margin-right: 0.55rem;
  margin-bottom: 0.4rem;
}

.btn.btn-outline-light {
  color: #f8fafc;
  border-color: rgba(248, 250, 252, 0.65);
  background: rgba(255, 255, 255, 0.03);
}

.btn.btn-outline-light:hover {
  color: #0b1d2e;
  background: #f8fafc;
}

.stats-strip {
  margin: 0.6rem 0 2.2rem 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.stat-item {
  padding: 1rem 1rem 0.95rem;
  border-radius: 14px;
  border: 1px solid #dbe5f1;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5fd 100%);
  box-shadow: 0 10px 24px -22px #1d4ed8;
  text-align: center;
}

.stat-item h3 {
  margin: 0;
  color: #0f172a;
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  font-size: 1.4rem;
}

.stat-item p {
  margin: 0.2rem 0 0 0;
  font-size: 0.92rem;
  color: #334155;
}

.team-mosaic {
  width: 100%;
  border-radius: 16px;
}

/* Cards & Components */
blockquote {
  border: none;
  border-left: 4px solid var(--primary);
  background: var(--surface);
  padding: 1.5rem 2rem;
  font-style: italic;
  font-size: 1.125rem;
  color: var(--text-muted);
  border-radius: 0 12px 12px 0;
  margin: 2.5rem 0;
  box-shadow: var(--shadow-sm);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.feature-card {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

/* Speaker Grid Styling */
.speaker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.speaker-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.3s ease;
}

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

.speaker-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  background-color: var(--surface);
  border: 3px solid var(--border);
}

.speaker-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.speaker-affil {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1rem;
}

.talk-info {
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  width: 100%;
  color: var(--text);
}

/* Images */
img {
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Gallery Grid Styling */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.gallery-item {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-grid-2x3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

@media (max-width: 768px) {
  .gallery-grid-2x3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .gallery-grid-2x3 {
    grid-template-columns: 1fr;
  }
}

/* Archive List Styling */
.archive-list,
.archive-list ul,
.archive-list>ul {
  display: block !important;
  column-count: 2 !important;
  -webkit-column-count: 2 !important;
  -moz-column-count: 2 !important;
  column-gap: 3rem !important;
  list-style-position: inside !important;
  margin: 1.5rem 0 !important;
  padding: 0 !important;
}

.archive-list li {
  break-inside: avoid !important;
  -webkit-column-break-inside: avoid !important;
  margin-bottom: 0.75rem !important;
}

@media (max-width: 600px) {

  .archive-list,
  .archive-list ul,
  .archive-list>ul {
    column-count: 1 !important;
    -webkit-column-count: 1 !important;
    -moz-column-count: 1 !important;
  }

  .landing-hero {
    padding: 1.5rem;
    border-radius: 20px;
  }

  .stats-strip {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}