/* ============================
   CSS Custom Properties
   ============================ */
:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-secondary: #64748b;
  --color-accent: #4f46e5;
  --color-accent-hover: #4338ca;
  --color-accent-light: #e0e7ff;
  --color-border: rgba(0, 0, 0, 0.06);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ============================
   Base
   ============================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================
   Layout Containers
   ============================ */
.container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

/* ============================
   Hero Section
   ============================ */
.hero-section {
  position: relative;
  padding: 7rem 2rem 5rem;
  text-align: center;
  overflow: hidden;
  color: #ffffff;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  z-index: 0;
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
}

.hero-venue {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.35rem 1.2rem;
  border-radius: 9999px;
  margin-top: 1.25rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 2rem;
  color: #ffffff;
}

.hero-authors {
  font-size: 1.05rem;
  line-height: 2;
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
}

.hero-authors a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.hero-authors a:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

.hero-affiliations {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2.5rem;
}

.hero-links {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ============================
   Buttons
   ============================ */
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  text-decoration: none;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-body);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.link-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  color: #ffffff;
}

.link-btn i {
  font-size: 1rem;
}

/* ============================
   Section Titles
   ============================ */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.section-subtitle {
  text-align: center;
  font-size: 1rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto 3rem;
  line-height: 1.6;
}

/* ============================
   Abstract
   ============================ */
.abstract-section {
  background: var(--color-surface);
}

.abstract-text {
  font-size: 1.02rem;
  line-height: 1.8;
  color: #374151;
}

.abstract-text p {
  margin-bottom: 1.2rem;
}

.abstract-text p:last-child {
  margin-bottom: 0;
}

.abstract-text strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ============================
   Figures
   ============================ */
.figure-section {
  padding-top: 0;
  padding-bottom: 3rem;
  background: var(--color-surface);
}

.figure-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  transition: box-shadow 0.3s ease;
}

.figure-card:hover {
  box-shadow: var(--shadow-lg);
}

.figure-card img {
  width: 100%;
  display: block;
}

.figure-caption {
  padding: 1.25rem 1.5rem;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--color-text-secondary);
  background: #f8fafc;
  border-top: 1px solid var(--color-border);
  margin: 0;
}

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

/* ============================
   Video Demos
   ============================ */
.demos-section {
  background: var(--color-bg);
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 850px;
  margin: 0 auto;
}

.video-card {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.video-card video {
  width: 100%;
  display: block;
}

.video-label {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-align: center;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

/* ============================
   Delay Injection
   ============================ */
.delay-section {
  background: var(--color-surface);
}

.delay-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 550px;
  margin: 0 auto 2.5rem;
}

.delay-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.delay-badge {
  display: inline-block;
  background: rgba(15, 12, 41, 0.85);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.delay-chart {
  max-width: 650px;
  margin: 0 auto;
}

/* ============================
   Footer
   ============================ */
.site-footer {
  padding: 3rem 0;
  text-align: center;
  background: #f1f5f9;
  border-top: 1px solid var(--color-border);
}

.site-footer p {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.site-footer p:last-child {
  margin-bottom: 0;
}

.site-footer a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* ============================
   Scroll Reveal Animation
   ============================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children in the hero */
.hero-content .reveal:nth-child(1) { transition-delay: 0.05s; }
.hero-content .reveal:nth-child(2) { transition-delay: 0.15s; }
.hero-content .reveal:nth-child(3) { transition-delay: 0.25s; }
.hero-content .reveal:nth-child(4) { transition-delay: 0.35s; }
.hero-content .reveal:nth-child(5) { transition-delay: 0.45s; }

/* ============================
   Responsive
   ============================ */
@media screen and (max-width: 768px) {
  .hero-section {
    padding: 4rem 1.25rem 3rem;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-affiliations {
    flex-direction: column;
    gap: 0.25rem;
  }

  .section {
    padding: 3rem 0;
  }

  .delay-grid {
    grid-template-columns: 1fr;
    max-width: 280px;
  }

  .hero-links {
    flex-direction: column;
    align-items: center;
  }
}

@media screen and (max-width: 480px) {
  .hero-title {
    font-size: 1.5rem;
  }

  .hero-authors {
    font-size: 0.95rem;
  }

  .container-narrow,
  .container-wide {
    padding: 0 1rem;
  }
}
