/* VibeVoice — The Sonic Void / Celestial Lab Design System */

/* ========== CSS Variables ========== */
:root {
  --bg: #121222;
  --surface: #121222;
  --surface-low: #1a1a2b;
  --surface-container: #1e1e2f;
  --surface-high: #29283a;
  --surface-highest: #333345;
  --surface-bright: #38374a;
  --text-primary: #e3e0f8;
  --text-secondary: #cbc3d7;
  --primary: #d0bcff;
  --primary-container: #a078ff;
  --secondary: #4cd7f6;
  --secondary-container: #03b5d3;
  --tertiary: #ffb869;
  --outline-variant: #494454;
  --gradient-cta: linear-gradient(135deg, #d0bcff, #03b5d3);
  --font-heading: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 0.5rem;
  --radius-sm: 0.25rem;
  --shadow-ambient: 0 12px 48px rgba(208, 188, 255, 0.06);
}

/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ========== Flecto Nav ========== */
.flecto-nav {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: #1a1a2e;
  padding: 6px 16px;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  border-bottom: 1px solid #333;
}
.flecto-nav a {
  color: #8b8bcd;
  text-decoration: none;
}
.flecto-nav a:hover { color: var(--primary); }

/* ========== Container ========== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ========== Hero ========== */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 5rem 0 4rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(18, 18, 34, 0.75) 0%,
    rgba(18, 18, 34, 0.88) 60%,
    rgba(18, 18, 34, 0.98) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient-cta);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  line-height: 1.1;
}

.hero-subtitle {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.hero-authors {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.hero-institution {
  display: inline-block;
  font-size: 0.75rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2rem;
}

/* Hero Metrics */
.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(208, 188, 255, 0.1);
  border: 1px solid rgba(208, 188, 255, 0.25);
  border-radius: 1rem;
  padding: 0.75rem 1.5rem;
  animation: badge-pulse 3s ease-in-out infinite;
}
.metric-badge:nth-child(2) { animation-delay: 0.5s; }
.metric-badge:nth-child(3) { animation-delay: 1s; }
.metric-badge:nth-child(4) { animation-delay: 1.5s; }

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(208, 188, 255, 0); }
  50% { box-shadow: 0 0 16px rgba(208, 188, 255, 0.18); }
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.metric-label {
  font-size: 0.7rem;
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.3rem;
}

/* Hero Abstract */
.hero-abstract {
  max-width: 760px;
  margin-bottom: 2rem;
  background: rgba(30, 30, 47, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 3px solid var(--primary);
}

.card-label {
  display: block;
  font-size: 0.7rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

/* Hero Actions */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

/* ========== Buttons ========== */
.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--gradient-cta);
  color: #23005c;
  border: none;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(208, 188, 255, 0.3);
}
.btn-ghost:hover {
  background: rgba(208, 188, 255, 0.1);
  border-color: rgba(208, 188, 255, 0.5);
}

/* ========== Cards ========== */
.card {
  background: var(--surface-container);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-ambient);
  transition: background 0.2s ease;
}
.card:hover { background: var(--surface-bright); }

/* ========== Sections ========== */
.section {
  padding: 4rem 0;
}
.section-alt {
  background: var(--surface-low);
  margin: 0 -100vw;
  padding: 4rem 100vw;
}
.section-alt > * { max-width: 900px; margin-left: auto; margin-right: auto; }

h2 {
  font-family: var(--font-heading);
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--outline-variant);
}

h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2rem 0 1rem;
}

h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  line-height: 1.7;
}

strong { color: var(--primary); font-weight: 600; }
em { color: var(--secondary); font-style: italic; }
sub, sup { font-size: 0.75em; }

/* ========== Card Grid ========== */
.card-grid { display: grid; gap: 1.5rem; margin: 1.5rem 0; }
.two-col { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.three-col { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ========== Contributions Card ========== */
.contributions-card {
  border-left: 3px solid var(--secondary);
  margin-top: 2rem;
}
.contributions-card h3 {
  font-size: 1rem;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 1rem;
}
.contributions-card ul {
  list-style: none;
  padding: 0;
}
.contributions-card ul li {
  padding: 0.5rem 0;
  padding-left: 1.25rem;
  position: relative;
  color: var(--text-primary);
}
.contributions-card ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--secondary);
}

/* ========== Chips ========== */
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.chip {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.chip-primary {
  background: rgba(208, 188, 255, 0.15);
  color: var(--primary);
  border: 1px solid rgba(208, 188, 255, 0.3);
}
.chip-amber {
  background: rgba(255, 184, 105, 0.15);
  color: var(--tertiary);
  border: 1px solid rgba(255, 184, 105, 0.3);
}

/* ========== Callout Math ========== */
.callout-math {
  border-left: 3px solid var(--primary);
  background: var(--surface-high);
}
.callout-math h4 { color: var(--primary); }
.mono-formula {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--surface-highest);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0.75rem 0;
  color: var(--secondary);
  line-height: 1.8;
}

.model-specs { margin-top: 1rem; }

/* ========== Figures & Tables ========== */
.figure {
  margin: 2rem 0;
  background: var(--surface-high);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid rgba(208, 188, 255, 0.1);
}
.figure-prominent {
  border-color: rgba(208, 188, 255, 0.2);
  box-shadow: 0 0 32px rgba(208, 188, 255, 0.08);
}
.figure-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
}
figcaption {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  line-height: 1.5;
  font-style: italic;
}
figcaption strong { color: var(--secondary); font-style: normal; }

/* ========== Highlight Card ========== */
.highlight-card {
  border-left: 3px solid var(--primary);
  background: var(--surface-high);
  margin-top: 1rem;
}
.highlight-card p {
  margin-bottom: 0;
  font-size: 0.95rem;
}
.highlight-card strong { color: var(--primary); }

/* ========== Conclusion Card ========== */
.conclusion-card {
  border-image: linear-gradient(135deg, var(--primary), var(--secondary)) 1;
  border-left: 3px solid;
  border-left-color: var(--primary);
  padding: 2rem;
  margin-bottom: 2rem;
}
.conclusion-card p:last-child { margin-bottom: 0; }

/* ========== Warning Cards ========== */
.warning-card {
  border-top: 2px solid rgba(255, 184, 105, 0.4);
  background: var(--surface-high);
  transition: background 0.2s;
}
.warning-card:hover { background: var(--surface-bright); }
.warning-card h4 { color: var(--tertiary); }
.warning-card p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0; }
.warning-icon {
  display: block;
  font-size: 1.25rem;
  color: var(--tertiary);
  margin-bottom: 0.5rem;
}
.warning-card-full {
  margin-top: 1.5rem;
  grid-column: 1 / -1;
}

/* ========== References ========== */
.references-accordion {
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
  overflow: hidden;
}
.references-accordion summary {
  padding: 1rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--secondary);
  cursor: pointer;
  background: var(--surface-container);
  transition: background 0.2s;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.references-accordion summary::-webkit-details-marker { display: none; }
.references-accordion summary::before { content: '▸'; transition: transform 0.2s; }
.references-accordion[open] summary::before { transform: rotate(90deg); }
.references-accordion summary:hover { background: var(--surface-bright); }
.references-list {
  padding: 1.5rem;
  list-style-decimal;
  padding-left: 3rem;
  background: var(--surface-low);
}
.references-list li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.25rem 0;
  line-height: 1.5;
}

/* ========== Footer ========== */
.footer {
  background: var(--surface-low);
  padding: 2rem 0;
  border-top: 1px solid var(--outline-variant);
  text-align: center;
}
.footer p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}
.footer a { color: var(--secondary); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ========== Flecto AI Explanation Classes ========== */
.flecto-note,
.flecto-callout,
.flecto-card,
.flecto-panel {
  border-radius: var(--radius-sm);
  margin: 1.25rem 0;
  background: var(--surface-container);
  border: 1px solid rgba(208, 188, 255, 0.15);
}

.flecto-note::before,
.flecto-callout::before,
.flecto-card::before,
.flecto-panel::before {
  content: '🤖 AI explanation';
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #60a5fa;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.5em;
  padding: 0.5rem 1rem 0;
}

.flecto-note {
  padding: 0.75rem 1rem;
  border-left: 3px solid rgba(208, 188, 255, 0.5);
  font-size: 0.9rem;
}

.flecto-callout {
  padding: 1rem;
  background: rgba(30, 30, 47, 0.9);
}

.flecto-card {
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-ambient);
}

.flecto-panel {
  padding: 1.25rem;
}

/* ========== Reveal Animations ========== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .metric-badge, .btn { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ========== Responsive ========== */
@media (max-width: 640px) {
  .hero { padding: 3rem 0 2.5rem; min-height: auto; }
  .hero-title { font-size: 2.25rem; }
  .hero-metrics { gap: 0.625rem; }
  .metric-badge { padding: 0.5rem 1rem; }
  .metric-value { font-size: 1.4rem; }
  h2 { font-size: 1.5rem; }
  .section { padding: 2.5rem 0; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .two-col, .three-col { grid-template-columns: 1fr; }
}
