:root {
  /* Color Palette - Elsa / Frozen Theme */
  --bg-color: #0b1120;
  /* Deep midnight blue */
  --bg-gradient: radial-gradient(circle at 50% 0%, #1e3a8a 0%, #0b1120 60%);
  --surface-color: rgba(30, 58, 138, 0.3);
  /* Transparent Royal Blue */
  --surface-hover: rgba(59, 130, 246, 0.2);
  --primary-color: #67e8f9;
  /* Ice Cyan */
  --primary-glow: rgba(103, 232, 249, 0.6);
  --secondary-color: #d8b4fe;
  /* Royal Purple */
  --text-primary: #f0f9ff;
  /* Snow White */
  --text-secondary: #bae6fd;
  /* Icy Blue Text */
  --border-color: rgba(103, 232, 249, 0.2);
  /* Icy Border */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.15);

  /* Typography */
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', monospace;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --container-width: 1000px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  text-shadow: 0 0 20px rgba(103, 232, 249, 0.3);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
  filter: drop-shadow(0 0 10px rgba(103, 232, 249, 0.4));
}

.title-text {
  background: linear-gradient(135deg, #fff 0%, #67e8f9 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  /* display: inline-block; removed to allow natural wrapping if needed, though inline-block is often needed for transforms/certain background clips. 
     Actually, background-clip: text works on inline elements too usually. */
}

h1 i {
  margin-right: 0.5em;
  font-size: 0.9em;
  /* Slightly smaller to align better visually */
}

.highlight-char {
  color: var(--secondary-color);
  -webkit-text-fill-color: var(--secondary-color);
  /* Override gradient text fill */
  text-shadow: 0 0 15px var(--secondary-color);
  font-weight: 800;
}

h2 {
  font-size: 2rem;
  margin-bottom: var(--spacing-md);
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition-fast);
  text-shadow: 0 0 5px rgba(103, 232, 249, 0.4);
}

a:hover {
  color: #fff;
  text-shadow: 0 0 10px var(--primary-color);
}

/* Layout */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

section {
  padding: var(--spacing-lg) 0;
}

/* Header / Hero */
.hero {
  padding: 8rem 0 4rem;
  text-align: center;
  position: relative;
}

.authors {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin: var(--spacing-md) 0;
  font-size: 1.1rem;
}

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

.affiliations {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--spacing-md);
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

/* Button Updates */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: var(--transition-smooth);
  border-radius: 9999px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--primary-color);
  box-shadow: 0 0 15px rgba(103, 232, 249, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn:hover {
  background: rgba(103, 232, 249, 0.2);
  box-shadow: 0 0 25px rgba(103, 232, 249, 0.4);
  transform: translateY(-2px);
  color: #fff;
  border-color: #fff;
}

.btn i {
  font-size: 1.1em;
}

/* Glassmorphism Cards & Containers */
.card,
.pipeline-item,
.carousel-container,
.image-container,
table {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  border-radius: 1rem;
}

.card {
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.image-container {
  overflow: hidden;
  margin: var(--spacing-md) 0;
}

.responsive-img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
  transition: transform 0.2s;
}

.responsive-img:hover {
  transform: scale(1.02);
}

.caption {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: var(--spacing-xs);
}

.text-content {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 800px;
  margin: 0 auto;
  text-align: justify;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  border-radius: 1rem;
  margin: var(--spacing-sm) 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: rgba(103, 232, 249, 0.1);
  color: var(--primary-color);
  font-weight: 600;
}

td {
  color: var(--text-secondary);
}

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

/* Audio Player */
audio {
  width: 100%;
  height: 40px;
  border-radius: 20px;
}

audio::-webkit-media-controls-panel {
  background-color: rgba(255, 255, 255, 0.8);
}

/* Citation */
#citation .card {
  position: relative;
}

pre {
  background: rgba(0, 0, 0, 0.3);
  color: #a5b4fc;
  padding: var(--spacing-md);
  border-radius: 0.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--primary-color);
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-main);
  backdrop-filter: blur(5px);
}

.copy-btn:hover {
  background: rgba(103, 232, 249, 0.2);
  color: #fff;
}

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

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

.fade-in {
  animation: fadeIn 0.8s ease forwards;
  opacity: 0;
}

.delay-1 {
  animation-delay: 0.1s;
}

.delay-2 {
  animation-delay: 0.2s;
}

.delay-3 {
  animation-delay: 0.3s;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
  z-index: 1001;
}

/* Carousel */
.carousel-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
  padding-bottom: 3rem;
  /* Space for dots */
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.carousel-slide {
  min-width: 100%;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  padding: 1rem;
  cursor: pointer;
  z-index: 10;
  border-radius: 8px;
  transition: background 0.3s;
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.carousel-prev {
  left: 10px;
}

.carousel-next {
  right: 10px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  position: absolute;
  bottom: 0;
  width: 100%;
}

.dot {
  width: 10px;
  height: 10px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.dot.active {
  opacity: 1;
  background-color: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-color);
}

/* Pipeline Demo Styles */
.pipeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.pipeline-step {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pipeline-arrow {
  color: var(--text-secondary);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 0 10px var(--primary-color);
}

.step-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.score-badge {
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
  color: #0f172a;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-weight: bold;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
  text-align: center;
  min-width: 80px;
}

@media (max-width: 768px) {
  .pipeline-item {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .pipeline-arrow {
    transform: rotate(90deg);
    margin: 0.5rem 0;
  }
}

/* Snow Canvas */
#snow-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  /* Place above body background */
}

/* Ensure content sits above the snow */
.hero,
.container,
main,
section,
footer {
  position: relative;
  z-index: 10;
}

/* New Pipeline Visual Styles */
.pipeline-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
  overflow-x: auto;
}

.pipeline-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.process-node {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  min-width: 220px;
  /* Increased width */
  max-width: 300px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
  position: relative;
}

.process-node:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(103, 232, 249, 0.3);
  border-color: var(--primary-color);
}

.node-icon {
  font-size: 2rem;
  color: var(--primary-color);
  text-shadow: 0 0 15px var(--primary-color);
}

/* Image Wrappers for LLM/LASS icons */
.node-img-wrapper {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  padding: 5px;
  box-shadow: 0 0 20px rgba(103, 232, 249, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.node-img-wrapper img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.node-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-align: center;
}

.arrow-right {
  color: var(--text-secondary);
  font-size: 1.2rem;
}

/* Convergence Arrows */
.pipeline-convergence {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.convergence-arrow {
  font-size: 2rem;
  color: var(--secondary-color);
  text-shadow: 0 0 10px var(--secondary-color);
  animation: bounce 2s infinite;
}

@keyframes bounce {

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

  40% {
    transform: translateY(-10px);
  }

  60% {
    transform: translateY(-5px);
  }
}

/* Clickable Node (Popup) */
.clickable-node {
  cursor: pointer;
  transition: all 0.3s ease;
}

.clickable-node:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(103, 232, 249, 0.4);
  border-color: #fff;
}

/* Phantom Input Visual Logic */
.phantom-input-label {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--secondary-color);
  white-space: nowrap;
  border: 1px dashed var(--secondary-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Final Model Node */
.final-model {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.6), rgba(11, 17, 32, 0.8));
  border: 1px solid var(--primary-color);
  min-width: 300px;
}

.main-icon {
  font-size: 3rem;
  color: #fff;
}

.node-inputs {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Score Section Updates */
/* Score Section Updates */
.human-ref-container {
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem 1rem;
  border-radius: 99px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  margin-top: 0.5rem;
}

.human-ref-container span {
  font-weight: 600;
  color: #fff;
  margin-left: 0.3rem;
}

.score-badge.large {
  font-size: 1.5rem;
  padding: 1rem 3rem;
  min-width: 200px;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .pipeline-container {
    padding: 1rem 0;
    /* Removed overflow from here */
  }

  /* Only the top area scrolls */
  .pipeline-scroll-area {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
    width: 100%;
    margin-bottom: 1rem;
    /* Ensure SVG scrolls with content - container must be relative */
    position: relative;
  }

  .pipeline-row {
    flex-direction: row;
    /* Keep horizontal */
    flex-wrap: nowrap;
    /* No wrapping */
    justify-content: flex-start;
    /* Align left */
    gap: 1.5rem;
    min-width: max-content;
    /* Ensure row takes full width */
    padding-bottom: 0;
    /* padding handled by scroll area */
  }

  /* Override for centered rows (ELSA Model, Scores) */
  .pipeline-row.centered {
    justify-content: center;
    width: 100%;
    /* Ensure it spans width to center properly */
    min-width: unset;
    /* Remove max-content constraint */
  }

  .process-node {
    min-width: 200px;
    /* Fixed width to prevent squashing */
  }

  .arrow-right {
    transform: none;
    /* Reset rotation */
    min-width: 20px;
    display: flex;
    justify-content: center;
  }
}

/* Interactive Demo Styles */
.demo-selector-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
}

.glass-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--primary-color);
  color: var(--text-primary);
  padding: 0.8rem 2rem;
  border-radius: 9999px;
  font-size: 1rem;
  font-family: var(--font-main);
  cursor: pointer;
  outline: none;
  backdrop-filter: blur(10px);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--primary-color) 50%),
    linear-gradient(135deg, var(--primary-color) 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(1em + 2px),
    calc(100% - 15px) calc(1em + 2px);
  background-size: 5px 5px,
    5px 5px;
  background-repeat: no-repeat;
  min-width: 250px;
  box-shadow: 0 0 15px rgba(103, 232, 249, 0.2);
  transition: all 0.3s ease;
}

.glass-select:hover {
  background-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 25px rgba(103, 232, 249, 0.4);
}

.node-content {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem;
  border-radius: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  max-width: 200px;
  word-wrap: break-word;
  transition: all 0.3s ease;
}

.code-box {
  font-family: var(--font-mono);
  color: #a5b4fc;
}

.text-box {
  font-style: italic;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(103, 232, 249, 0.7);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 0 20px 10px rgba(103, 232, 249, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(103, 232, 249, 0);
  }
}

.pulse-anim {
  animation: pulse 0.5s ease-out;
  border-color: var(--primary-color);
  background: rgba(103, 232, 249, 0.1);
}

/* Audio Player & Waveform */
.audio-player-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1rem;
  width: 100%;
}

.audio-player-wrapper audio {
  width: 100%;
  max-width: 200px;
  height: 35px;
  margin-top: 0.5rem;
}

.waveform-visualizer {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 30px;
  margin-bottom: 5px;
}

.wave-bar {
  width: 4px;
  background-color: var(--primary-color);
  border-radius: 2px;
  height: 100%;
  transform: scaleY(0.2);
  transform-origin: bottom;
  transition: transform 0.1s;
}

/* Animations for Bars */
@keyframes waveAnimation {

  0%,
  100% {
    transform: scaleY(0.2);
  }

  50% {
    transform: scaleY(1.0);
  }
}

.waveform-visualizer.playing .wave-bar {
  animation: waveAnimation 0.5s infinite ease-in-out;
}

/* Multi Audio List */
.multi-audio-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.5rem;
}

.mini-player-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.mini-player-row:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--secondary-color);
}

.mini-label {
  font-size: 0.7rem;
  color: #fff;
  background: var(--secondary-color);
  padding: 1px 4px;
  border-radius: 3px;
  min-width: 40px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-play-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-play-btn:hover {
  color: #fff;
  transform: scale(1.1);
}

/* Waveform Visualizer - specific for mini (or reuse) */
.mini-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 15px;
  flex-grow: 1;
}

.mini-wave-bar {
  width: 2px;
  background-color: var(--text-secondary);
  height: 100%;
  border-radius: 1px;
  animation: none;
}

.mini-player-row.playing .mini-wave-bar {
  background-color: var(--primary-color);
  animation: waveAnimation 0.5s infinite ease-in-out;
}

/* Helper Class for Hidden Audio elements */
.hidden-audio {
  display: none;
}

.wave-bar:nth-child(2) {
  animation-delay: 0.1s;
  height: 60%;
}

.wave-bar:nth-child(3) {
  animation-delay: 0.2s;
  height: 100%;
}

.wave-bar:nth-child(4) {
  animation-delay: 0.3s;
  height: 50%;
}

.wave-bar:nth-child(5) {
  animation-delay: 0.1s;
  height: 80%;
}

.wave-bar:nth-child(6) {
  animation-delay: 0.2s;
  height: 40%;
}

.wave-bar:nth-child(7) {
  animation-delay: 0.4s;
  height: 70%;
}

.wave-bar:nth-child(8) {
  animation-delay: 0.2s;
  height: 60%;
}

.wave-bar:nth-child(9) {
  animation-delay: 0.0s;
  height: 30%;
}