/* ============================================
   Chiral Network — Launch Site Styles
   ============================================ */

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

[hidden] {
  display: none !important;
}

/* ============================================
   Theme toggle
   ============================================ */

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.2s;
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--accent-glow);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

[data-theme="light"] .theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

.genesis-header {
  margin-top: 56px;
  margin-bottom: 24px;
  text-align: center;
}

.genesis-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.genesis-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto;
}

.genesis-json {
  margin-top: 32px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.genesis-json summary {
  cursor: pointer;
  color: var(--accent-bright);
  font-size: 0.85rem;
  padding: 8px 0;
  user-select: none;
}

.genesis-json summary:hover {
  color: var(--accent);
}

.genesis-json pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-top: 12px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.genesis-json pre code {
  color: var(--text-primary);
  font-family: inherit;
}

.genesis-highlight {
  display: inline;
  background: rgba(6, 214, 160, 0.12);
  color: var(--gradient-3);
  border-radius: 4px;
  padding: 1px 4px;
}

.no-premine-callout {
  max-width: 800px;
  margin: 0 auto 32px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 20px 24px;
  background: rgba(6, 214, 160, 0.06);
  border: 1px solid rgba(6, 214, 160, 0.25);
  border-radius: var(--radius-sm);
}

.no-premine-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(6, 214, 160, 0.15);
  color: var(--gradient-3);
}

.no-premine-icon svg { width: 20px; height: 20px; }

.no-premine-text h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.no-premine-text p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.no-premine-text code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--bg-card);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--gradient-3);
}

.chain-spec-highlight {
  background: rgba(6, 214, 160, 0.06);
  border: 1px solid rgba(6, 214, 160, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.chain-spec-note {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gradient-3);
  background: rgba(6, 214, 160, 0.15);
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
}

:root {
  --bg-primary: #050a12;
  --bg-secondary: #0a1120;
  --bg-card: #0d1525;
  --bg-card-hover: #111d33;
  --bg-alt: #080e1a;
  --text-primary: #e8edf5;
  --text-secondary: #8896ab;
  --text-tertiary: #5a6a80;
  --accent: #4f8cff;
  --accent-bright: #6da3ff;
  --accent-dim: #2a5db8;
  --accent-glow: rgba(79, 140, 255, 0.15);
  --gradient-1: #4f8cff;
  --gradient-2: #a855f7;
  --gradient-3: #06d6a0;
  --border: rgba(79, 140, 255, 0.1);
  --border-hover: rgba(79, 140, 255, 0.25);
  --nav-scrolled-bg: rgba(5, 10, 18, 0.85);
  --orb-opacity: 0.4;
  --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.4);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-alt: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --accent: #2563eb;
  --accent-bright: #1d4ed8;
  --accent-dim: #93c5fd;
  --accent-glow: rgba(37, 99, 235, 0.08);
  --gradient-1: #2563eb;
  --gradient-2: #9333ea;
  --gradient-3: #059669;
  --border: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(15, 23, 42, 0.18);
  --nav-scrolled-bg: rgba(255, 255, 255, 0.85);
  --orb-opacity: 0.18;
  --shadow-strong: 0 20px 60px rgba(15, 23, 42, 0.08);
  color-scheme: light;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   Ambient Background
   ============================================ */

.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: var(--orb-opacity);
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(79, 140, 255, 0.15) 0%, transparent 70%);
  top: -10%;
  right: -5%;
  animation: float-1 20s ease-in-out infinite;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.12) 0%, transparent 70%);
  bottom: 10%;
  left: -5%;
  animation: float-2 25s ease-in-out infinite;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(6, 214, 160, 0.08) 0%, transparent 70%);
  top: 50%;
  left: 40%;
  animation: float-3 30s ease-in-out infinite;
}

@keyframes float-1 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(-30px, 40px); }
  66% { transform: translate(20px, -20px); }
}

@keyframes float-2 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(40px, -30px); }
  66% { transform: translate(-20px, 30px); }
}

@keyframes float-3 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(-25px, -35px); }
  66% { transform: translate(35px, 25px); }
}

/* ============================================
   Navigation
   ============================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 24px;
  transition: background 0.3s, backdrop-filter 0.3s;
}

.nav.scrolled {
  background: var(--nav-scrolled-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-github {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav-github:hover {
  color: var(--text-primary);
}

.nav-github svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* ============================================
   Hero
   ============================================ */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
  text-align: center;
}

.hero-content {
  max-width: 720px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--accent-glow);
  border: 1px solid var(--border-hover);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-bright);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #fff;
  box-shadow: 0 4px 20px rgba(79, 140, 255, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 30px rgba(79, 140, 255, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--accent-glow);
}

.btn-large {
  padding: 16px 40px;
  font-size: 1.05rem;
}

/* ============================================
   Countdown
   ============================================ */

.countdown-container {
  margin-top: 64px;
  padding: 32px 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}

.countdown-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  font-weight: 600;
  margin-bottom: 16px;
}

.countdown {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.countdown-value {
  font-family: var(--font-mono);
  font-size: 2.8rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}

.countdown-unit {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-top: 8px;
  font-weight: 500;
}

.countdown-separator {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  color: var(--text-tertiary);
  margin-bottom: 20px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0.3; }
}

.countdown-date {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--accent-bright);
  font-weight: 500;
}

/* ============================================
   Sections
   ============================================ */

.section {
  padding: 120px 24px;
}

.section-alt {
  background: var(--bg-alt);
}

.section-dark {
  background: #0a1120;
  /* Force dark-mode tokens inside this band so it always reads
     as a dark contrast section, even when the page is in light mode. */
  --text-primary: #e8edf5;
  --text-secondary: #8896ab;
  --text-tertiary: #5a6a80;
  --border: rgba(79, 140, 255, 0.18);
  --bg-card: rgba(255, 255, 255, 0.03);
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-tag {
  display: inline-block;
  padding: 4px 14px;
  background: var(--accent-glow);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-bright);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.section-tag-light {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title-light {
  color: var(--text-primary);
}

.section-title-light em {
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ============================================
   Features Grid
   ============================================ */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.feature-card {
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s;
}

.feature-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  margin-bottom: 20px;
  color: var(--accent-bright);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ============================================
   Steps (How It Works)
   ============================================ */

.steps {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 700px;
  margin: 0 auto;
}

.step {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.3s;
}

.step:hover {
  border-color: var(--border-hover);
}

.step-number {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.6;
  line-height: 1;
  flex-shrink: 0;
}

.step-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================
   Tech Grid
   ============================================ */

.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.tech-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s;
}

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

.tech-name {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-bright);
  margin-bottom: 10px;
}

.tech-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
   Stats
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-card {
  text-align: center;
  padding: 36px 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  transition: border-color 0.3s;
}

.stat-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.stat-desc {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* ============================================
   Chain Specs
   ============================================ */

.chain-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.chain-spec {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}

.chain-spec-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  font-weight: 500;
}

.chain-spec-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-bright);
}

/* ============================================
   CTA
   ============================================ */

.section-cta {
  background: var(--bg-alt);
}

.cta-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.cta-content h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.cta-content p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.7;
}

.cta-actions {
  display: flex;
  justify-content: center;
}

/* ============================================
   Footer
   ============================================ */

.footer {
  padding: 64px 24px 32px;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-brand {
  margin-bottom: 40px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.footer-tagline {
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 64px;
  margin-bottom: 40px;
}

.footer-col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  font-weight: 600;
  margin-bottom: 12px;
}

.footer-col a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* ============================================
   Scroll Animations
   ============================================ */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Responsive
   ============================================ */

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

  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .chain-specs {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero {
    padding: 100px 20px 60px;
  }

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

  .countdown-container {
    padding: 24px 20px;
    width: 100%;
    max-width: 380px;
  }

  .countdown-value {
    font-size: 2rem;
  }

  .countdown-item {
    min-width: 60px;
  }

  .countdown-separator {
    font-size: 1.6rem;
  }

  .features-grid,
  .tech-grid {
    grid-template-columns: 1fr;
  }

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

  .chain-specs {
    grid-template-columns: 1fr;
  }

  .step {
    flex-direction: column;
    gap: 16px;
  }

  .section {
    padding: 80px 20px;
  }

  .footer-links {
    flex-direction: column;
    gap: 32px;
  }
}

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

  .countdown {
    gap: 6px;
  }

  .countdown-value {
    font-size: 1.6rem;
  }

  .countdown-item {
    min-width: 50px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
  }
}

/* ============================================
   Preview Page
   ============================================ */

.preview-back {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.nav-links a[aria-current="page"] {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================
   Demo Section — Chiral Network app mockup
   ============================================ */

.demo-window {
  max-width: 980px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 80px rgba(79, 140, 255, 0.08);
}

.demo-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.demo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.demo-dot-red    { background: #ff5f57; }
.demo-dot-yellow { background: #febc2e; }
.demo-dot-green  { background: #28c840; }

.demo-title {
  margin-left: 12px;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.demo-app {
  display: grid;
  grid-template-columns: 160px 1fr;
  min-height: 620px;
}

/* Sidebar */
.demo-sidebar {
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.demo-nav-item {
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  cursor: default;
  transition: background 0.2s;
}

.demo-nav-active {
  background: var(--accent-glow);
  color: var(--accent-bright);
  font-weight: 500;
}

.demo-nav-spacer { flex: 1; }

.demo-nav-balance {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.demo-nav-balance-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.demo-nav-balance-value {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

#demo-balance { transition: color 0.3s; }
#demo-balance.demo-balance-flash { color: var(--gradient-2); }

/* Main content */
.demo-main {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.demo-page-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.demo-page-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Cards */
.demo-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.demo-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.demo-active-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--bg-card);
  padding: 3px 10px;
  border-radius: 999px;
}

/* Search tabs */
.demo-search-tabs {
  display: flex;
  gap: 6px;
}

.demo-tab {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.demo-tab-active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent-bright);
  font-weight: 500;
}

.demo-search-row {
  display: flex;
  gap: 8px;
}

.demo-search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0 12px;
}

.demo-search-input {
  flex: 1;
  padding: 8px 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  width: 100%;
}

.demo-search-input::placeholder { color: var(--text-tertiary); }

.demo-caret {
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.1s;
}

.demo-caret.demo-caret-visible { opacity: 1; animation: demo-blink 1s steps(2, end) infinite; }

@keyframes demo-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* Buttons */
.demo-btn {
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.demo-btn-primary {
  background: var(--accent);
  color: white;
}

.demo-btn-primary:hover { background: var(--accent-bright); }

.demo-btn-success {
  background: var(--gradient-3);
  color: #032018;
}

.demo-btn-success.demo-btn-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Search result / file row */
.demo-file-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.demo-file-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.demo-file-icon-video {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

.demo-video {
  width: 100%;
  max-height: 320px;
  border-radius: var(--radius-xs);
  background: #000;
  display: block;
  border: 1px solid var(--border);
  margin-top: 4px;
}

.demo-file-icon svg { width: 22px; height: 22px; }
.demo-file-icon-small { width: 36px; height: 36px; }
.demo-file-icon-small svg { width: 18px; height: 18px; }

.demo-file-info {
  flex: 1;
  min-width: 0;
}

.demo-file-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.demo-file-meta {
  display: flex;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.demo-dot-sep { color: var(--text-tertiary); }

.demo-seeders-count { color: var(--gradient-3); font-weight: 500; }

.demo-hash {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.demo-elo-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  background: var(--accent-glow);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-bright);
}

/* Seeder list */
.demo-seeder-divider {
  height: 1px;
  background: var(--border);
}

.demo-seeder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.demo-seeder-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.demo-sort-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  padding: 3px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

.demo-sort {
  padding: 4px 10px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
}

.demo-sort-active {
  background: var(--accent);
  color: white;
  font-weight: 500;
}

.demo-seeder-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow: hidden;
}

.demo-seeder {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  opacity: 0;
  animation: demo-log-in 0.3s ease-out forwards;
  transition: border-color 0.2s, background 0.2s;
}

.demo-seeder-selected {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.demo-seeder-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.demo-seeder-peer {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-primary);
  font-weight: 500;
}

.demo-seeder-wallet {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.demo-seeder-right {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.demo-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.demo-pill-elo {
  background: var(--accent-glow);
  color: var(--accent-bright);
}

.demo-pill-price {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.demo-pill-rep-ok { color: var(--gradient-3); font-size: 0.72rem; }
.demo-pill-rep-fail { color: #f87171; font-size: 0.72rem; }

/* Cost row */
.demo-cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.demo-cost-info {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.demo-cost-info strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 600;
}

/* Active download */
.demo-download-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.demo-download-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.demo-download-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.demo-download-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.demo-status-badge {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: lowercase;
}

.demo-status-downloading {
  background: rgba(79, 140, 255, 0.15);
  color: var(--accent-bright);
}

.demo-status-completed {
  background: rgba(6, 214, 160, 0.15);
  color: var(--gradient-3);
}

.demo-download-meta {
  display: flex;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  align-items: center;
  flex-wrap: wrap;
}

/* Progress */
.demo-progress-track {
  height: 6px;
  background: var(--bg-alt);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
  position: relative;
}

.demo-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
  border-radius: 999px;
  transition: width 80ms linear;
  position: relative;
}

.demo-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: demo-shimmer 1.5s linear infinite;
}

@keyframes demo-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.demo-progress-stats {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* Animations */
@keyframes demo-log-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  .demo-app { grid-template-columns: 1fr; }
  .demo-sidebar {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 10px;
  }
  .demo-nav-spacer, .demo-nav-balance { display: none; }
  .demo-main { padding: 18px; }
  .demo-search-tabs { flex-wrap: wrap; }
  .demo-file-row { flex-wrap: wrap; }
  .demo-elo-badge { margin-left: auto; }
  .demo-cost-row { flex-direction: column; align-items: stretch; }
  .demo-cost-row .demo-btn { width: 100%; }
}
