/* Core theme */
:root {
  --bg: #0e0f14;
  --card: #141720;
  --panel: #191d26;
  --muted: #a1a7b8;
  --line: rgba(255, 255, 255, 0.07);
  --text: #f5f7fb;
  --accent: #ff8a3d;
  --accent-2: #20d6ff;
  --accent-3: #9ef0b8;
  --shadow: 0 10px 50px rgba(0, 0, 0, 0.35);
  font-family: 'Space Grotesk', 'Sora', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(255, 138, 61, 0.08), transparent 28%),
    radial-gradient(circle at 80% 10%, rgba(32, 214, 255, 0.08), transparent 25%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.bg-texture {
  position: fixed;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 138, 61, 0.1), rgba(32, 214, 255, 0.1));
  filter: blur(80px);
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

/* Layout */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: rgba(14, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: #0a0c10;
  font-weight: 800;
}

.logo-type {
  font-size: 1.05rem;
}

.nav-links {
  display: flex;
  gap: 24px;
  font-weight: 500;
}

.nav-links a {
  color: var(--muted);
  transition: color 0.2s ease;
}

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

.nav-actions {
  display: flex;
  gap: 12px;
}

button {
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.primary-btn {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0a0c10;
  box-shadow: 0 8px 20px rgba(255, 138, 61, 0.35);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(255, 138, 61, 0.4);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--line);
}

.secondary-btn:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

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

.ghost-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

main {
  position: relative;
  z-index: 1;
  padding: 32px 32px 120px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  align-items: center;
  padding: 48px 0 32px;
}

.hero-content h1 {
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 12px 0;
}

.hero-content h1 span {
  color: var(--accent);
}

.hero-sub {
  color: var(--muted);
  max-width: 540px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 138, 61, 0.12);
  color: #ffd2ad;
  border: 1px solid rgba(255, 138, 61, 0.25);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.stat-number {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
}

.stat-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-visual {
  position: relative;
  min-height: 420px;
}

.glow {
  position: absolute;
  inset: -40px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 138, 61, 0.35), transparent 45%),
    radial-gradient(circle at 70% 70%, rgba(32, 214, 255, 0.25), transparent 40%);
  filter: blur(40px);
  z-index: 0;
}

.player-card {
  position: relative;
  z-index: 1;
  background: linear-gradient(160deg, #161a23 0%, #10131a 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.tag {
  display: inline-block;
  padding: 6px 10px;
  background: rgba(32, 214, 255, 0.12);
  color: #c4f3ff;
  border-radius: 10px;
  font-size: 0.85rem;
  border: 1px solid rgba(32, 214, 255, 0.3);
}

.book-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
}

.cover-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff8a3d, #20d6ff);
}

.book-title {
  margin: 0;
  font-weight: 700;
}

.book-author {
  margin: 4px 0 0;
  color: var(--muted);
}

.waveform {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 16px 0;
  height: 60px;
}

.wave {
  background: linear-gradient(180deg, rgba(255, 138, 61, 0.8), rgba(32, 214, 255, 0.8));
  border-radius: 10px;
  animation: pulse 1.4s ease-in-out infinite;
}

.wave:nth-child(2) {
  animation-delay: 0.15s;
}

.wave:nth-child(3) {
  animation-delay: 0.3s;
}

.wave:nth-child(4) {
  animation-delay: 0.45s;
}

.wave:nth-child(5) {
  animation-delay: 0.6s;
}

@keyframes pulse {
  0%,
  100% {
    transform: scaleY(0.3);
  }
  50% {
    transform: scaleY(1);
  }
}

.player-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.circle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--line);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.circle-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
}

.primary-fill {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0c10;
  border: none;
}

.progress {
  display: grid;
  gap: 6px;
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.progress-bar span {
  position: absolute;
  inset: 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
}

.progress-time {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}

.floating-card {
  position: absolute;
  right: -40px;
  bottom: -30px;
  width: min(360px, 90vw);
  background: rgba(25, 29, 38, 0.9);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  z-index: 2;
}

.label {
  color: var(--muted);
  margin: 0 0 8px;
  font-weight: 600;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  font-weight: 600;
}

.mini-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.mini-number {
  margin: 0;
  font-weight: 700;
  color: var(--accent);
}

.mini-label {
  margin: 4px 0 0;
  color: var(--muted);
}

.trust {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin: 32px 0 16px;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  color: var(--muted);
}

.trust-logos {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-weight: 600;
  color: var(--text);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 20px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 6px;
}

.features,
.showcase,
.process {
  margin: 32px 0;
}

.feature-grid,
.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.feature-card,
.process-step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.feature-card h3,
.process-step h3 {
  margin: 0 0 8px;
}

.feature-card p,
.process-step p {
  color: var(--muted);
  margin: 0;
}

.process-step {
  position: relative;
  overflow: hidden;
}

.process-step::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255, 138, 61, 0.08), transparent 40%);
  pointer-events: none;
}

.step-number {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.showcase .carousel {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 230px);
  gap: 14px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 12px;
}

.carousel-track::-webkit-scrollbar {
  height: 8px;
}

.carousel-track::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.carousel-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 1.2rem;
}

.book-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.book-cover {
  height: 180px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
}

.book-info {
  display: grid;
  gap: 4px;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 138, 61, 0.12);
  color: #ffd2ad;
  width: fit-content;
  border: 1px solid rgba(255, 138, 61, 0.3);
}

.book-title {
  font-weight: 700;
}

.book-author {
  color: var(--muted);
}

.warm {
  background-image: linear-gradient(135deg, #ff8a3d, #ff5f6d);
}

.cool {
  background-image: linear-gradient(135deg, #20d6ff, #6c5ce7);
}

.dusk {
  background-image: linear-gradient(135deg, #f7971e, #ffd200);
}

.ember {
  background-image: linear-gradient(135deg, #f857a6, #ff5858);
}

.neon {
  background-image: linear-gradient(135deg, #00f2fe, #4facfe);
}

.cta {
  margin: 48px 0 0;
  padding: 28px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(255, 138, 61, 0.12), rgba(32, 214, 255, 0.1));
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.cta-sub {
  color: var(--muted);
  margin: 8px 0 0;
}

.cta-actions {
  display: flex;
  gap: 12px;
}

.footer {
  padding: 32px;
  border-top: 1px solid var(--line);
  background: rgba(14, 15, 20, 0.95);
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-copy {
  color: var(--muted);
  margin: 0;
}

/* Legal pages */
.legal-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 0 120px;
}

.legal-hero {
  background: linear-gradient(140deg, rgba(255, 138, 61, 0.12), rgba(32, 214, 255, 0.1));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.legal-hero h1 {
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.legal-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-weight: 600;
}

.legal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.legal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.legal-card h2 {
  margin-top: 0;
  margin-bottom: 10px;
}

.legal-card h3 {
  margin-bottom: 6px;
  margin-top: 18px;
}

.legal-card p {
  margin: 0 0 10px;
  color: var(--muted);
}

.legal-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.legal-toc {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.legal-toc a {
  color: var(--accent);
  font-weight: 600;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--accent);
  font-weight: 700;
}

.dashboard-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 0 120px;
  display: grid;
  gap: 18px;
}

.dashboard-header {
  background: linear-gradient(140deg, rgba(255, 138, 61, 0.12), rgba(32, 214, 255, 0.1));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.dashboard-header h1 {
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.dashboard-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-weight: 600;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.kpi-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.kpi-label {
  color: var(--muted);
  margin: 0 0 6px;
  font-weight: 600;
}

.kpi-value {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.panel-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.panel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.panel-card p {
  color: var(--muted);
  margin: 0 0 10px;
}

.danger {
  color: #ff8a8a;
}

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

.library-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}

.library-cover {
  width: 100%;
  height: 160px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff8a3d, #20d6ff);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
}

.library-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.library-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.danger-btn {
  border-color: rgba(255, 138, 138, 0.4);
  color: #ff8a8a;
}

.hidden {
  display: none;
}

.muted {
  color: var(--muted);
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: #0f1117;
  border-radius: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  width: min(520px, 100%);
  position: relative;
  box-shadow: var(--shadow);
}

.modal-content h3 {
  margin: 0 0 6px;
}

.modal-sub {
  color: var(--muted);
  margin: 0 0 14px;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 18px;
}

form {
  display: grid;
  gap: 12px;
}

.form-group {
  display: grid;
  gap: 6px;
}

label {
  font-weight: 600;
}

input {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1rem;
}

input:focus {
  outline: 2px solid rgba(255, 138, 61, 0.6);
  border-color: transparent;
}

.two-col {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.block {
  width: 100%;
}

.form-note {
  color: var(--muted);
  text-align: center;
  margin: 0;
}

.form-note a {
  color: var(--accent);
}

/* Toast */
#toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #0f1117;
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 60;
}

#toast.show {
  display: block;
}

/* Responsiveness */
@media (max-width: 1024px) {
  .top-nav {
    gap: 14px;
    flex-wrap: wrap;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .floating-card {
    position: relative;
    right: auto;
    bottom: auto;
    margin-top: 14px;
  }
}

@media (max-width: 720px) {
  main {
    padding: 24px;
  }

  .hero {
    padding-top: 24px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .carousel {
    grid-template-columns: 1fr;
  }

  .carousel-btn {
    display: none;
  }
}
