/* ==========================================================================
   CVB marketing site - styles mirror the desktop app's design tokens
   (client/src/index.css @theme block). Dark chrome, blurple CTA,
   violet/cyan brand glow.
   ========================================================================== */

:root {
  /* Backgrounds (from app @theme) */
  --bg-primary: #1a1b23;
  --bg-secondary: #232430;
  --bg-tertiary: #2b2d3a;
  --bg-hover: #32344a;
  --bg-active: #3a3d52;

  /* Text */
  --text-primary: #e4e5eb;
  --text-secondary: #9ca0b0;
  --text-muted: #6b6f82;

  /* Accents */
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --success: #3ba55c;
  --danger: #ed4245;
  --warning: #faa61a;
  --border: #2e303e;

  /* Brand glow (favicon mark) */
  --brand-violet: #863bff;
  --brand-violet-deep: #7e14ff;
  --brand-cyan: #47bfff;

  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1120px;
  --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.6);
  --font-ui: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'VT323', 'Courier New', monospace;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

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

h1, h2, h3 { color: var(--text-primary); line-height: 1.2; font-weight: 700; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* VT323 self-hosted (SIL OFL 1.1, (c) Peter Hull) */
@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/vt323-latin.woff2') format('woff2');
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-ui); font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-lg { font-size: 17px; padding: 15px 30px; border-radius: var(--radius); }
.btn-sm { font-size: 14px; padding: 9px 16px; }
.btn-icon { flex-shrink: 0; }

/* Primary CTA gets the brand-violet glow to tie hero to the mark */
.btn-primary.btn-lg {
  box-shadow: 0 0 0 0 rgba(134, 59, 255, 0.0), 0 8px 30px rgba(88, 101, 242, 0.35);
  transition: box-shadow .25s, background .15s, transform .08s;
}
.btn-primary.btn-lg:hover {
  box-shadow: 0 0 40px rgba(134, 59, 255, 0.45), 0 8px 30px rgba(88, 101, 242, 0.5);
}

/* ---- Nav ---- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(26, 27, 35, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text-primary); font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand-mark { display: block; }
.nav-links { display: flex; gap: 6px; margin-left: 8px; }
.nav-links a {
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  padding: 8px 12px; border-radius: var(--radius-sm);
}
.nav-links a:hover { background: var(--bg-hover); color: var(--text-primary); text-decoration: none; }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.version-badge {
  font-size: 12px; color: var(--text-muted); font-family: var(--font-mono);
  letter-spacing: .04em; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg-secondary);
}
.version-badge:not(:empty)::before { content: ''; }

.nav-toggle {
  display: none; margin-left: auto;
  flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-mobile { display: none; flex-direction: column; gap: 4px; padding: 0 24px 16px; }
.nav-mobile a {
  color: var(--text-secondary); padding: 12px 12px; border-radius: var(--radius-sm); font-weight: 500;
}
.nav-mobile a:hover { background: var(--bg-hover); color: var(--text-primary); text-decoration: none; }
.nav-mobile .btn { margin-top: 8px; }

/* ---- Hero ---- */
.hero { position: relative; padding: 96px 0 72px; overflow: hidden; }
.hero-glow {
  position: absolute; top: -180px; left: 50%; transform: translateX(-50%);
  width: 720px; height: 720px; max-width: 120vw;
  background: radial-gradient(circle, rgba(134, 59, 255, 0.28) 0%, rgba(71, 191, 255, 0.10) 35%, transparent 65%);
  filter: blur(20px); pointer-events: none; z-index: 0;
}
.hero-inner { position: relative; z-index: 1; text-align: center; }
.hero-mark-wrap {
  width: 120px; height: 115px; margin: 0 auto 28px;
  filter: drop-shadow(0 0 40px rgba(134, 59, 255, 0.55));
  animation: heroPulse 4s ease-in-out infinite;
}
.hero-mark { width: 100%; height: 100%; display: block; }
@keyframes heroPulse {
  0%, 100% { filter: drop-shadow(0 0 40px rgba(134, 59, 255, 0.5)); }
  50% { filter: drop-shadow(0 0 60px rgba(71, 191, 255, 0.6)); }
}
.hero-title { font-size: clamp(34px, 6vw, 60px); margin-bottom: 22px; letter-spacing: -0.02em; }
.grad {
  background: linear-gradient(90deg, var(--brand-violet) 0%, var(--brand-cyan) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.hero-sub { font-size: clamp(16px, 2.2vw, 20px); color: var(--text-secondary); max-width: 640px; margin: 0 auto 32px; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; margin-bottom: 18px; }
.hero-meta { font-size: 14px; color: var(--text-muted); }
.hero-foot { font-size: 13px; color: var(--text-muted); }

/* ---- Sections ---- */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-secondary); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(26px, 4vw, 38px); margin-bottom: 12px; letter-spacing: -0.01em; }
.section-head p { font-size: 17px; max-width: 620px; margin: 0 auto; }

/* ---- Feature cards ---- */
.card-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(4, 1fr);
}
.card {
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 22px; transition: transform .15s, border-color .15s, background .15s;
}
.card:hover { transform: translateY(-3px); border-color: var(--bg-hover); background: var(--bg-tertiary); }
.card-icon {
  width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; color: var(--accent);
}
.card-icon svg { display: block; }
.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { font-size: 14px; }

/* feature icon color accents */
.icon-noise { background: rgba(88, 101, 242, 0.14); }
.icon-lock  { background: rgba(59, 165, 92, 0.14); color: var(--success); }
.icon-world { background: rgba(71, 191, 255, 0.14); color: var(--brand-cyan); }
.icon-pet   { background: rgba(167, 139, 250, 0.16); color: #a78bfa; }
.icon-music { background: rgba(250, 166, 26, 0.14); color: var(--warning); }
.icon-screen{ background: rgba(134, 59, 255, 0.16); color: var(--brand-violet); }
.icon-window{ background: rgba(88, 101, 242, 0.14); }
.icon-shield{ background: rgba(59, 165, 92, 0.14); color: var(--success); }

/* ---- Security ---- */
.sec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.sec-col {
  background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column;
}
.sec-h { font-size: 18px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.sec-h-good { color: var(--success); }
.sec-h-warn  { color: var(--warning); }
.sec-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.sec-dot-good { background: var(--success); box-shadow: 0 0 12px rgba(59, 165, 92, 0.7); }
.sec-dot-warn  { background: var(--warning); box-shadow: 0 0 12px rgba(250, 166, 26, 0.6); }
.sec-list { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.sec-list li { padding-left: 24px; position: relative; font-size: 14.5px; }
.sec-list li::before {
  content: ''; position: absolute; left: 4px; top: 8px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted);
}
.sec-list .sec-col:first-child & li::before,
.sec-h-good ~ .sec-list li::before { background: var(--success); }
.sec-h-warn ~ .sec-list li::before { background: var(--warning); }
.sec-list strong { color: var(--text-primary); font-weight: 600; }
.sec-list code, .sec-note code { font-family: var(--font-mono); font-size: 15px; background: var(--bg-tertiary); padding: 1px 6px; border-radius: 4px; color: var(--brand-cyan); }
.sec-note { font-size: 13px; color: var(--text-muted); margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }

/* ---- Comparison table ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-secondary); }
.compare-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.compare-table th, .compare-table td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14.5px; vertical-align: top; }
.compare-table thead th { background: var(--bg-tertiary); font-weight: 700; color: var(--text-primary); font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table tbody tr:hover { background: var(--bg-tertiary); }
.compare-feature { width: 36%; color: var(--text-primary); font-weight: 600; }
.compare-cvb { color: var(--text-primary); }
.compare-discord { color: var(--text-secondary); }
.compare-cvb.win { color: var(--success); }
.cell-good { color: var(--success); font-weight: 600; }
.cell-bad  { color: var(--text-muted); }
.cell-mid  { color: var(--warning); }
.cell-icon { display: inline-block; width: 1.25em; font-weight: 700; text-align: center; flex: none; }
.cell-text { /* inline text next to the leading icon */ }
.compare-table td.cell-good, .compare-table td.cell-bad, .compare-table td.cell-mid {
  display: flex; align-items: flex-start; gap: 8px;
}
.compare-foot { font-size: 12.5px; color: var(--text-muted); margin-top: 14px; text-align: center; }

/* ---- Changelog (echoes in-app ChangelogModal) ---- */
.changelog { display: flex; flex-direction: column; gap: 0; max-width: 760px; margin: 0 auto; }
.cl-entry {
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; margin-bottom: 16px; box-shadow: var(--shadow-card);
}
.cl-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.cl-version { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.cl-version .v { color: var(--accent); }
.cl-date { font-size: 13px; color: var(--text-muted); font-family: var(--font-mono); }
.cl-title { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 14px; }
.cl-changes { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.cl-changes li { display: flex; gap: 10px; font-size: 14px; color: var(--text-secondary); line-height: 1.55; }
.cl-changes li svg { flex-shrink: 0; margin-top: 3px; color: var(--success); }
.changelog-loading { text-align: center; color: var(--text-muted); padding: 40px 0; }
.btn-show-more { display: block; margin: 8px auto 0; }

/* ---- CTA ---- */
.cta { text-align: center; }
.cta-inner { max-width: 640px; }
.cta h2 { font-size: clamp(26px, 4vw, 38px); margin-bottom: 12px; }
.cta p { font-size: 17px; margin-bottom: 28px; }
.cta .btn-lg { margin-bottom: 16px; }
.cta-note { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.cta-downloads { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 16px; }
.cta-downloads .btn-lg { margin-bottom: 0; }

/* ---- Footer ---- */
.footer { border-top: 1px solid var(--border); background: var(--bg-primary); padding: 36px 0; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--text-primary); font-weight: 600; }
.footer-note { font-size: 13px; color: var(--text-muted); max-width: 420px; }
.footer-copy { font-size: 12px; color: var(--text-muted); }

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .sec-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-actions .version-badge { display: none; }
  .nav-actions .btn { display: none; }
  .nav-toggle { display: flex; }
  .nav.open .nav-mobile { display: flex; }
  .nav.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .hero { padding: 64px 0 56px; }
  .section { padding: 60px 0; }
  .card-grid { grid-template-columns: 1fr; }
  .cl-entry { padding: 18px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-mark-wrap { animation: none; }
  * { transition: none !important; }
}

/* ---------- downloads page ---------- */
.download-hero { padding-top: 64px; padding-bottom: 32px; }
.download-hero-mark {
  width: 88px; height: 88px; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 0 24px rgba(134, 59, 255, 0.45));
  animation: heroPulse 4s ease-in-out infinite;
}
.download-hero-mark img { width: 72px; height: 70px; display: block; }
.download-hero .section-head { margin-bottom: 40px; }
.download-hero .section-head h1 { font-size: clamp(30px, 5vw, 44px); margin-bottom: 14px; letter-spacing: -0.02em; }
.download-hero .section-head p { font-size: 17px; max-width: 560px; margin: 0 auto; }

.download-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  max-width: 1000px;
  margin: 0 auto;
}
.download-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 32px 26px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1px solid var(--border);
  transition: border-color .2s, box-shadow .2s, transform .2s;
  position: relative;
}
.download-card:hover {
  border-color: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
}
.download-card.recommended {
  border-color: var(--accent);
  box-shadow: 0 0 40px rgba(88, 101, 242, 0.28), var(--shadow-card);
}
.recommended-badge {
  font-size: 11px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: rgba(88, 101, 242, 0.15);
  margin-bottom: 20px;
  display: none;
}
.download-card.recommended .recommended-badge { display: inline-block; }

/* Platform-branded icon discs. Each platform gets its own tint so the cards
   are visually distinct at a glance, not three identical download arrows. */
.download-card-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  color: #fff;
  position: relative;
}
.download-card-icon--windows {
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
  box-shadow: 0 8px 24px rgba(0, 120, 212, 0.35);
}
.download-card-icon--mac {
  background: linear-gradient(135deg, #434446 0%, #1d1e1f 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.download-card-icon--linux {
  background: linear-gradient(135deg, #f6a609 0%, #c88410 100%);
  color: #1a1b23;
  box-shadow: 0 8px 24px rgba(246, 166, 9, 0.35);
}

.download-card-title {
  font-size: 22px;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.download-card-tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 22px;
  min-height: 20px;
}
.download-card-btn { width: 100%; margin-bottom: 22px; }

/* Structured system-requirements list (dt/dd pairs). Two-column micro-grid
   inside each card so the meta reads like a spec sheet, not a wall of text. */
.download-card-meta {
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.download-card-meta > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  text-align: left;
}
.download-card-meta dt {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  flex-shrink: 0;
}
.download-card-meta dd {
  color: var(--text-secondary);
  text-align: right;
  word-break: break-word;
}
.download-card-meta code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-tertiary);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-primary);
}

/* macOS Gatekeeper callout - distinct warning-tinted box so it reads as
   actionable, not as another system-requirement line. */
.download-callout {
  width: 100%;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}
.download-callout--warn {
  background: rgba(250, 166, 26, 0.08);
  border: 1px solid rgba(250, 166, 26, 0.3);
  color: var(--text-secondary);
}
.download-callout--warn strong { color: var(--warning); }
.download-callout--warn em { color: var(--text-primary); font-style: normal; font-weight: 600; }

/* "What's new" link + auto-update explainer below the cards */
.download-extras {
  max-width: 640px;
  margin: 40px auto 0;
  text-align: center;
}
.download-extras-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-secondary);
  transition: border-color .2s, background .2s;
}
.download-extras-link:hover {
  text-decoration: none;
  border-color: var(--accent);
  background: var(--bg-tertiary);
}
.download-extras-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 14px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.btn-unavailable { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 900px) {
  .download-cards { grid-template-columns: 1fr; max-width: 460px; }
}
@media (max-width: 720px) {
  .download-hero { padding-top: 40px; }
  .download-hero-mark { width: 72px; height: 72px; }
  .download-hero-mark img { width: 56px; height: 54px; }
  .download-card { padding: 26px 20px 22px; }
  .download-card-meta > div { flex-direction: column; gap: 2px; }
  .download-card-meta dd { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .download-hero-mark { animation: none; }
  .download-card:hover { transform: none; }
}
