/* ==========================================================================
   SpotiPrime — dark, app-style UI
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #121212;          /* page */
  --bg-deep: #000000;     /* header / footer */
  --elev-1: #181818;      /* cards */
  --elev-2: #1f1f1f;      /* card hover, inputs */
  --elev-3: #2a2a2a;      /* chips, borders on dark */
  --line: #2a2a2a;
  --line-strong: #3e3e3e;

  --text: #ffffff;
  --text-2: #b3b3b3;      /* secondary */
  --text-3: #7c7c7c;      /* tertiary */

  --green: #1fdf64;       /* primary accent */
  --green-hover: #3be477;
  --on-green: #000000;
  --red: #f15e6c;

  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Type scale — compact, app-like */
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: clamp(1.25rem, 1.15rem + 0.4vw, 1.5rem);
  --fs-xl: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  --fs-2xl: clamp(2rem, 1.5rem + 2.2vw, 3rem);
  --fs-3xl: clamp(2.25rem, 1.6rem + 3vw, 3.75rem);

  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --pill: 999px;

  --wrap: 1240px;
  --gutter: clamp(16px, 3vw, 32px);
  --ease: cubic-bezier(0.3, 0, 0, 1);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[id] { scroll-margin-top: 80px; } /* clear the sticky header on #anchor jumps */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p a, li a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--text-3); }
p a:hover, li a:hover { text-decoration-color: var(--green); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--green); color: var(--on-green); }

h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; }
h1 { font-size: var(--fs-3xl); letter-spacing: -0.04em; }
h2 { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: var(--fs-md); font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(40px, 6vw, 72px); }
.eyebrow { font-size: var(--fs-sm); font-weight: 700; color: var(--text); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.lede { font-size: var(--fs-md); color: var(--text-2); max-width: 60ch; }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.accent { color: var(--green); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--green); color: var(--on-green); padding: 8px 14px; border-radius: var(--pill); font-weight: 700; }
.skip:focus { left: 8px; }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.sec-head h2 { margin: 0; }
.sec-head a { font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); }
.sec-head a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 28px; border-radius: var(--pill);
  font: 700 var(--fs-base)/1 var(--font); letter-spacing: 0.01em;
  border: 1px solid var(--text-3); color: var(--text); background: transparent;
  cursor: pointer; transition: transform 0.15s var(--ease), background 0.15s, border-color 0.15s;
}
.btn:hover { transform: scale(1.04); border-color: var(--text); }
.btn:active { transform: scale(1); }
.btn-primary { background: var(--green); border-color: var(--green); color: var(--on-green); }
.btn-primary:hover { background: var(--green-hover); border-color: var(--green-hover); }
.btn svg { flex: none; }

.play {
  flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--green); color: var(--on-green); box-shadow: var(--shadow);
  transition: transform 0.15s var(--ease), background 0.15s;
}
.play:hover { transform: scale(1.06); background: var(--green-hover); }

/* ---------- "Now playing" equaliser (CSS only) ---------- */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; width: 14px; height: 14px; }
.eq i { flex: 1; background: var(--green); border-radius: 1px; animation: eq 1s ease-in-out infinite alternate; }
.eq i:nth-child(1) { height: 60%; animation-delay: -0.2s; }
.eq i:nth-child(2) { height: 100%; animation-delay: -0.6s; }
.eq i:nth-child(3) { height: 40%; animation-delay: -0.4s; }
.eq i:nth-child(4) { height: 80%; animation-delay: -0.8s; }
.eq i { transform-origin: bottom; }
@keyframes eq { from { transform: scaleY(0.3); } to { transform: scaleY(1); } }

/* ---------- Header ---------- */
.hdr { position: sticky; top: 0; z-index: 50; background: rgba(0, 0, 0, 0.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.hdr-bar { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { flex: none; display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.logo-mark { width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: var(--on-green); display: grid; place-items: center; }
.links { display: flex; gap: 8px; margin-left: auto; }
.chip {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: var(--pill);
  background: var(--elev-3); color: var(--text); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap;
  transition: background 0.15s;
}
.chip:hover { background: #333; }
.chip[aria-current='page'] { background: var(--text); color: #000; }
@media (max-width: 860px) {
  .hdr-bar { gap: 16px; }
  .links {
    min-width: 0; overflow-x: auto; scrollbar-width: none; padding-right: 24px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
  }
  .links::-webkit-scrollbar { display: none; }
}

/* ---------- Home: hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(180deg, #0d5c2f 0%, #0b3a20 45%, var(--bg) 100%);
  padding-block: clamp(40px, 7vw, 88px) clamp(32px, 5vw, 56px);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero h1 { max-width: 14ch; }
.hero .lede { color: rgba(255, 255, 255, 0.78); }
.hero-meta { font-size: var(--fs-sm); font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Price "tracklist" */
.tracklist { background: rgba(0, 0, 0, 0.35); border-radius: var(--r-lg); padding: 20px 16px 12px; backdrop-filter: blur(8px); }
.tl-head { display: flex; align-items: center; gap: 16px; padding: 0 8px 16px; }
.tl-head h2 { font-size: var(--fs-lg); margin: 0; }
.tl-head p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-2); }
.tl-cols, .tl-row { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 16px; align-items: center; padding: 8px; }
.tl-cols .tl-acc { color: inherit; font-size: inherit; }
.tl-cols { font-size: var(--fs-xs); color: var(--text-2); letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 1px solid rgba(255, 255, 255, 0.1); margin-bottom: 8px; }
.tl-row { border-radius: var(--r-sm); transition: background 0.15s; }
.tl-row:hover { background: rgba(255, 255, 255, 0.08); }
.tl-num { color: var(--text-2); text-align: center; font-variant-numeric: tabular-nums; }
.tl-row.top .tl-num { color: var(--green); }
.tl-title { font-weight: 600; line-height: 1.3; }
.tl-title span { display: block; font-size: var(--fs-sm); color: var(--text-2); font-weight: 400; }
.tl-row.top .tl-title { color: var(--green); }
.tl-acc { color: var(--text-2); font-size: var(--fs-sm); text-align: right; }
.tl-price { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; min-width: 64px; }
.tl-note { font-size: var(--fs-xs); color: var(--text-3); padding: 12px 8px 0; margin: 0; }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { background: var(--elev-1); border-radius: var(--r); padding: 20px; transition: background 0.2s; }
.stat:hover { background: var(--elev-2); }
.stat b { display: block; font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.03em; color: var(--green); line-height: 1.1; margin-bottom: 4px; }
.stat span { color: var(--text-2); font-size: var(--fs-sm); }

/* ---------- Browse tiles (categories / guides) ---------- */
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1000px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile {
  position: relative; overflow: hidden; aspect-ratio: 1 / 0.62; border-radius: var(--r);
  background: var(--tone); padding: 16px; display: block;
  transition: transform 0.2s var(--ease);
}
.tile:hover { transform: scale(1.02); }
.tile h3 { font-size: var(--fs-lg); font-weight: 800; margin: 0; max-width: 70%; line-height: 1.15; }
.tile-art {
  position: absolute; right: -10px; bottom: -6px; width: 44%; aspect-ratio: 1; border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.25); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transform: rotate(25deg); display: grid; place-items: center; color: rgba(255, 255, 255, 0.9);
}
.tile-art svg { width: 55%; height: 55%; transform: rotate(-25deg); }

/* ---------- Content split + cards ---------- */
.split { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(24px, 5vw, 72px); align-items: start; }
.panel { background: var(--elev-1); border-radius: var(--r-lg); padding: clamp(20px, 3vw, 32px); }
.risk-list { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; }
.risk-list li { display: flex; gap: 14px; padding: 16px; background: var(--elev-2); border-radius: var(--r); color: var(--text-2); }
.risk-list li strong { display: block; color: var(--text); margin-bottom: 2px; }
.risk-icon { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(241, 94, 108, 0.15); color: var(--red); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 8px; }
.faq details { background: var(--elev-1); border-radius: var(--r); transition: background 0.15s; }
.faq details:hover, .faq details[open] { background: var(--elev-2); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 20px; font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { flex: none; color: var(--text-2); transition: transform 0.2s var(--ease); }
.faq details[open] summary svg { transform: rotate(45deg); color: var(--green); }
.faq details p { color: var(--text-2); margin: 0; padding: 0 20px 18px; max-width: 72ch; }

/* ---------- Playlist-style page header (categories + guides) ---------- */
.page-head {
  background: linear-gradient(180deg, var(--tone, #535353) 0%, color-mix(in srgb, var(--tone, #535353) 45%, var(--bg)) 70%, var(--bg) 100%);
  padding-block: clamp(32px, 6vw, 72px) clamp(24px, 4vw, 40px);
}
.ph-grid { display: flex; align-items: flex-end; gap: clamp(20px, 3vw, 32px); }
.ph-art {
  flex: none; width: clamp(128px, 18vw, 232px); aspect-ratio: 1; border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--tone), color-mix(in srgb, var(--tone) 40%, #000));
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55); display: grid; place-items: center; color: rgba(255, 255, 255, 0.92);
}
.ph-art svg { width: 42%; height: 42%; }
.ph-type { font-size: var(--fs-sm); font-weight: 700; margin: 0 0 4px; }
.page-head h1 { margin-bottom: 12px; }
.page-head .lede { color: rgba(255, 255, 255, 0.75); font-size: var(--fs-base); margin-bottom: 8px; }
.ph-meta { font-size: var(--fs-sm); font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.ph-meta span { color: rgba(255, 255, 255, 0.7); font-weight: 400; }
.crumbs { font-size: var(--fs-sm); color: rgba(255, 255, 255, 0.7); margin-bottom: 20px; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.action-bar { display: flex; align-items: center; gap: 20px; padding-block: 8px 24px; }
.action-bar p { margin: 0; color: var(--text-2); font-size: var(--fs-sm); }
@media (max-width: 640px) {
  .ph-grid { flex-direction: column; align-items: flex-start; }
}

/* ---------- Empty state ---------- */
.empty-wrap { padding-bottom: clamp(48px, 8vw, 96px); }
.empty { background: var(--elev-1); border-radius: var(--r-lg); padding: clamp(32px, 6vw, 64px) 24px; text-align: center; }
.empty-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--elev-3); display: grid; place-items: center; color: var(--text-2); }
.empty h2 { font-size: var(--fs-lg); margin-bottom: 8px; }
.empty p { color: var(--text-2); max-width: 44ch; margin: 0 auto 24px; }

/* ---------- Newsletter ---------- */
.nl { padding-block: clamp(40px, 6vw, 72px); }
.nl-card {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center;
  border-radius: var(--r-lg); padding: clamp(24px, 4vw, 48px);
  background: linear-gradient(135deg, #1e3264 0%, #3a1f6e 55%, #8400e7 130%);
}
.nl h2 { font-size: var(--fs-2xl); letter-spacing: -0.035em; margin-bottom: 8px; }
.nl .muted { color: rgba(255, 255, 255, 0.78); margin: 0; }
.nl-row { display: flex; gap: 8px; }
.nl input[type='email'] {
  flex: 1; min-width: 0; height: 48px; padding: 0 20px; border-radius: var(--pill);
  border: 1px solid transparent; background: var(--text); color: #000; font: 500 var(--fs-base) var(--font);
}
.nl input[type='email']::placeholder { color: #6a6a6a; }
.nl input[type='email']:focus { outline: 2px solid var(--green); outline-offset: 2px; }
.nl-msg { min-height: 1.4em; margin: 10px 0 0 4px; font-size: var(--fs-sm); color: rgba(255, 255, 255, 0.8); }
.nl-msg[data-state='ok'] { color: var(--green); font-weight: 700; }
.nl-msg[data-state='error'] { color: #ffb3bb; font-weight: 700; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.ftr { background: var(--bg); padding-block: 48px 32px; border-top: 1px solid var(--line); }
.ftr-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.ftr-brand { margin: 0 0 8px; }
.ftr-cols { display: flex; flex-wrap: wrap; gap: 32px 72px; }
.ftr-nav { display: flex; flex-direction: column; gap: 10px; min-width: 150px; }
.ftr-head { font-weight: 700; margin: 0 0 4px; }
.ftr-nav a { color: var(--text-2); font-size: var(--fs-sm); }
.ftr-nav a:hover { color: var(--text); text-decoration: underline; }
.ftr-legal { margin: 40px 0 0; padding-top: 24px; border-top: 1px solid var(--line); color: var(--text-3); font-size: var(--fs-xs); max-width: 90ch; }

/* ---------- 404 ---------- */
.nf { text-align: center; padding-block: clamp(80px, 14vw, 160px); }
.nf h1 { font-size: var(--fs-2xl); }
.nf .lede { margin-inline: auto; margin-bottom: 28px; }

/* ---------- Load-in (CSS only) ---------- */
.reveal { animation: rise 0.5s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .split, .nl-card { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .nl-row { flex-direction: column; }
  .tl-cols, .tl-row { grid-template-columns: 22px 1fr auto; }
  .tl-acc { display: none; }
  .lede { font-size: var(--fs-base); }
  .hero-meta { font-size: var(--fs-xs); }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tile h3 { font-size: var(--fs-md); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
