/* ==========================================================================
   Spark Player — demo page styles (does NOT style the player itself;
   the player ships its own dist/spark-player.css).
   ========================================================================== */

:root {
  --bg: #060910;
  --bg-2: #0a1020;
  --panel: rgba(17, 24, 39, 0.66);
  --panel-solid: #111827;
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.32);
  --text: #e8eef5;
  --muted: #94a3b8;
  --accent: #6ee7ff;
  --accent-2: #a78bfa;
  --accent-3: #f472b6;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 18px;
  --shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 12% -8%, rgba(110, 231, 255, 0.14), transparent 60%),
    radial-gradient(1000px 620px at 92% 4%, rgba(167, 139, 250, 0.16), transparent 60%),
    radial-gradient(900px 700px at 50% 120%, rgba(244, 114, 182, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1240px, 100% - 40px); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: #04121a; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(16px) saturate(140%);
  background: rgba(6, 9, 16, 0.72);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); font-weight: 800; letter-spacing: -0.02em; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #051018; box-shadow: 0 8px 24px -6px rgba(110, 231, 255, 0.55);
}
.brand .logo svg { width: 20px; height: 20px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--muted); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 9px;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); text-decoration: none; }
.nav .nav-cta {
  color: #051018; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  margin-left: 6px; font-weight: 800;
}
.nav .nav-cta:hover { color: #051018; filter: brightness(1.06); }

/* ---------- hero ---------- */
.hero { padding: 76px 0 34px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
  background: rgba(110, 231, 255, 0.09); border: 1px solid rgba(110, 231, 255, 0.28);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 22px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.16); }
.hero h1 {
  font-size: clamp(2.5rem, 6.2vw, 4.5rem); line-height: 1.02; margin: 0 0 18px;
  letter-spacing: -0.035em; font-weight: 900;
}
.hero h1 .grad {
  background: linear-gradient(100deg, #6ee7ff 0%, #a78bfa 48%, #f472b6 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: clamp(1.02rem, 1.6vw, 1.24rem); color: var(--muted); max-width: 720px; margin: 0 auto 26px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 30px; }
.chip {
  font-size: 13px; font-weight: 600; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 7px;
}
.chip .ico { color: var(--accent); }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer; font-family: inherit;
  font-weight: 700; font-size: 15px; padding: 13px 24px; border-radius: 12px;
  display: inline-flex; align-items: center; gap: 9px; transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { color: #051018; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 16px 40px -12px rgba(110, 231, 255, 0.6); }
.btn-primary:hover { filter: brightness(1.05); color: #051018; }
.btn-ghost { color: var(--text); background: rgba(255, 255, 255, 0.04); border-color: var(--line-strong); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }

/* ---------- sections ---------- */
.section { padding: 46px 0; }
.section-head { margin-bottom: 26px; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0 0 8px; letter-spacing: -0.025em; }
.section-head p { margin: 0; color: var(--muted); max-width: 720px; }
.section-kicker { font-size: 12.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }

/* ---------- showcase ---------- */
.showcase { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 22px; align-items: start; }
.player-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); backdrop-filter: blur(10px);
}
#player { width: 100%; border-radius: 12px; overflow: hidden; }
.player-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 2px 4px; flex-wrap: wrap; }
.state-strip { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.state-strip b { color: var(--accent); font-weight: 700; }
.player-foot .badge { font-size: 11.5px; font-weight: 700; color: var(--ok); background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.3); padding: 4px 10px; border-radius: 999px; }

.side-panel { display: flex; flex-direction: column; gap: 14px; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
}
.panel h3 { margin: 0 0 12px; font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.select-chip {
  appearance: none; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--text); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-strong);
  padding: 8px 13px; border-radius: 10px; transition: all 0.12s ease;
}
.select-chip:hover { border-color: var(--accent); color: var(--accent); }
.select-chip.is-active { background: linear-gradient(135deg, rgba(110, 231, 255, 0.22), rgba(167, 139, 250, 0.22)); border-color: var(--accent); color: #fff; box-shadow: 0 6px 18px -8px rgba(110, 231, 255, 0.6); }
.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.action-btn {
  cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--text);
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 6px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.action-btn:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.09); }
.toggles { display: flex; flex-direction: column; gap: 9px; }
.toggle { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; color: var(--muted); }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

/* ---------- event log ---------- */
.event-panel { display: flex; flex-direction: column; min-height: 0; }
.event-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.event-head h3 { margin: 0; }
.event-count { font-size: 11.5px; font-weight: 700; color: var(--accent); background: rgba(110, 231, 255, 0.1); border: 1px solid rgba(110, 231, 255, 0.28); padding: 2px 9px; border-radius: 999px; }
.event-log {
  height: 248px; overflow-y: auto; font-family: var(--mono); font-size: 11.5px; line-height: 1.5;
  background: rgba(3, 6, 12, 0.7); border: 1px solid var(--line); border-radius: 11px; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.event-log:empty::before { content: "Events appear here as you interact…"; color: var(--muted); opacity: 0.6; }
.log-row { display: flex; gap: 7px; padding: 2px 4px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: logIn 0.18s ease; }
.log-row:hover { background: rgba(255, 255, 255, 0.04); }
.log-time { color: #5b6b7f; flex: none; }
.log-name { color: var(--accent); font-weight: 700; flex: none; min-width: 96px; }
.log-payload { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.log-row.is-error .log-name { color: var(--err); }
.log-row.is-media .log-name { color: var(--ok); }
.log-row.is-playlist .log-name { color: var(--accent-2); }
@keyframes logIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* ---------- feature cards ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.feature {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.feature:hover { transform: translateY(-3px); border-color: var(--line-strong); background: rgba(24, 33, 48, 0.8); }
.feature .f-ico {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px;
  font-size: 20px; background: linear-gradient(135deg, rgba(110, 231, 255, 0.16), rgba(167, 139, 250, 0.16));
  border: 1px solid var(--line);
}
.feature h3 { margin: 0 0 6px; font-size: 16px; letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- themes ---------- */
.themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.theme-card {
  cursor: pointer; text-align: left; font-family: inherit; color: var(--text);
  border: 1px solid var(--line); border-radius: 16px; padding: 0; overflow: hidden; background: var(--panel);
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.theme-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.theme-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 18px 40px -20px rgba(110, 231, 255, 0.6); }
.theme-swatch { height: 74px; display: flex; align-items: flex-end; gap: 6px; padding: 12px; }
.theme-swatch span { width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.theme-meta { padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; }
.theme-meta strong { font-size: 14px; }
.theme-meta em { font-style: normal; font-size: 11.5px; color: var(--muted); }

/* ---------- shortcuts ---------- */
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 30px; }
.shortcut { display: flex; align-items: center; justify-content: space-between; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.shortcut span { color: var(--muted); font-size: 14px; }
.kbd { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 7px; padding: 3px 8px; }

/* ---------- code snippets ---------- */
.snippet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.snippet { background: rgba(3, 6, 12, 0.72); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.snippet-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 15px; border-bottom: 1px solid var(--line); }
.snippet-head strong { font-size: 13px; letter-spacing: 0.02em; }
.copy-btn { cursor: pointer; font-family: inherit; font-size: 11.5px; font-weight: 700; color: var(--muted); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.snippet pre { margin: 0; padding: 15px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; color: #c9d7e6; }
.snippet pre .tok-com { color: #5b6b7f; }
.snippet pre .tok-key { color: #a78bfa; }
.snippet pre .tok-str { color: #6ee7ff; }
.snippet pre .tok-fn { color: #f472b6; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 34px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .showcase { grid-template-columns: 1fr; }
  .side-panel { display: grid; grid-template-columns: 1fr 1fr; }
  .event-panel { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .nav a:not(.nav-cta) { display: none; }
  .hero { padding: 52px 0 20px; }
  .side-panel { grid-template-columns: 1fr; }
  .action-grid { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 34px 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
