/* ========================================================================
   YT Playlist Sorter — Site Styles
   Aesthetic: Editorial / Music magazine — warm dark, cream, wine accent
   ======================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap');
@import url('https://api.fontshare.com/v2/css?f[]=switzer@200,300,400,500,600,700,800&display=swap');

:root {
  /* Palette — warm dark editorial */
  --bg: #0F0D0B;
  --bg-elev: #16130F;
  --bg-card: #1C1814;
  --border: #2A2520;
  --border-soft: #1F1B17;

  --fg: #F5F1E8;
  --fg-muted: #B8AE9B;
  --fg-dim: #7D7468;

  --accent: #C73E3E;        /* wine red */
  --accent-soft: #A23535;
  --highlight: #E8B547;     /* amber */
  --highlight-soft: #B98F35;

  /* Type */
  --font-display: 'Instrument Serif', 'Times New Roman', serif;
  --font-body: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;

  /* Scale */
  --step--1: clamp(0.75rem, 0.7rem + 0.25vw, 0.85rem);
  --step-0:  clamp(0.95rem, 0.85rem + 0.45vw, 1.05rem);
  --step-1:  clamp(1.1rem, 0.95rem + 0.6vw, 1.25rem);
  --step-2:  clamp(1.35rem, 1.1rem + 1.1vw, 1.65rem);
  --step-3:  clamp(1.8rem, 1.4rem + 1.8vw, 2.35rem);
  --step-4:  clamp(2.4rem, 1.7rem + 3vw, 3.5rem);
  --step-5:  clamp(3.2rem, 2.1rem + 5vw, 5.5rem);
  --step-6:  clamp(4rem, 2.5rem + 7vw, 7.5rem);

  --container: 1180px;
  --container-narrow: 760px;
  --radius: 4px;
  --radius-lg: 8px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Grain overlay — subtle film noise for warmth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a.link {
  border-bottom: 1px solid var(--fg-dim);
  padding-bottom: 1px;
}
a.link:hover { color: var(--highlight); border-bottom-color: var(--highlight); }

::selection { background: var(--accent); color: var(--fg); }

/* ============== Typography ============== */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.95;
}

.italic { font-style: italic; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

p { color: var(--fg-muted); max-width: 65ch; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--highlight);
  font-weight: 500;
}

/* ============== Layout ============== */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 3vw, 2.5rem);
}

.container-narrow {
  max-width: var(--container-narrow);
}

section { padding-block: clamp(4rem, 8vw, 7rem); }

/* ============== Header ============== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  background: rgba(15, 13, 11, 0.7);
  border-bottom: 1px solid var(--border-soft);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-style: italic;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--highlight), var(--accent) 50%, var(--bg-card) 100%);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 0 20px rgba(199, 62, 62, 0.25);
}
.brand-mark::after {
  content: '';
  position: absolute;
  inset: 35%;
  background: var(--bg);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.nav-links {
  display: flex;
  gap: 2rem;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--fg-muted);
}
.nav-links a { transition: color 0.2s var(--ease); }
.nav-links a:hover { color: var(--fg); }

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

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

.hero {
  padding-block: clamp(5rem, 12vw, 9rem) clamp(4rem, 8vw, 6rem);
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--border));
  transform: translateX(-50%);
}

.hero-eyebrow {
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: rise 0.9s var(--ease) 0.1s forwards;
}

.hero-title {
  font-size: var(--step-6);
  margin-bottom: 1.75rem;
  max-width: 14ch;
  opacity: 0;
  animation: rise 1s var(--ease) 0.2s forwards;
}

.hero-title em {
  font-style: italic;
  color: var(--highlight);
}

.hero-lede {
  font-size: var(--step-2);
  font-family: var(--font-display);
  color: var(--fg-muted);
  max-width: 32ch;
  line-height: 1.3;
  font-style: italic;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: rise 1s var(--ease) 0.35s forwards;
}

.hero-cta {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: rise 1s var(--ease) 0.5s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: var(--step-0);
  letter-spacing: 0.005em;
  transition: all 0.25s var(--ease);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--fg);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--highlight);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--fg);
}
.btn-secondary:hover {
  border-color: var(--fg-muted);
  background: var(--bg-elev);
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.hero-store-row {
  margin-top: 3rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: var(--step--1);
  color: var(--fg-dim);
  opacity: 0;
  animation: rise 1s var(--ease) 0.7s forwards;
}

.hero-store-row .dot {
  width: 4px; height: 4px; background: var(--fg-dim); border-radius: 50%;
}

/* ============== Marquee — playlist-strip ============== */

.tape {
  border-block: 1px solid var(--border-soft);
  background: var(--bg-elev);
  overflow: hidden;
  padding-block: 1rem;
  position: relative;
}

.tape::before, .tape::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}
.tape::before { left: 0; background: linear-gradient(to right, var(--bg-elev), transparent); }
.tape::after { right: 0; background: linear-gradient(to left, var(--bg-elev), transparent); }

.tape-track {
  display: flex;
  gap: 3rem;
  animation: scroll 30s linear infinite;
  white-space: nowrap;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--fg-muted);
}
.tape-track span { display: inline-flex; align-items: center; gap: 3rem; flex-shrink: 0; }
.tape-track .sep { color: var(--accent); font-style: normal; font-family: var(--font-body); font-size: 0.9rem; }

@keyframes scroll {
  to { transform: translateX(-50%); }
}

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

.features-intro {
  margin-bottom: 4rem;
  max-width: 50ch;
}
.features-intro h2 {
  font-size: var(--step-4);
  margin-block: 0.8rem 1.25rem;
}
.features-intro h2 em { color: var(--highlight); font-style: italic; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.feature {
  background: var(--bg);
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: background 0.3s var(--ease);
}
.feature:hover { background: var(--bg-elev); }

.feature-num {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--accent);
  letter-spacing: 0.1em;
}

.feature h3 {
  font-size: var(--step-2);
}

.feature p {
  font-size: var(--step-0);
  color: var(--fg-muted);
  margin: 0;
}

/* ============== Pricing strip ============== */

.pricing {
  background: var(--bg-elev);
  border-block: 1px solid var(--border-soft);
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
@media (max-width: 720px) { .pricing-grid { grid-template-columns: 1fr; } }

.tier {
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-right: 1px solid var(--border-soft);
}
.tier:last-child { border-right: none; }
@media (max-width: 720px) {
  .tier { border-right: none; border-bottom: 1px solid var(--border-soft); }
  .tier:last-child { border-bottom: none; }
}

.tier-label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.tier-price {
  font-family: var(--font-display);
  font-size: var(--step-4);
  line-height: 1;
}
.tier-price small {
  font-size: 1rem;
  color: var(--fg-muted);
  font-style: italic;
  letter-spacing: 0;
}

.tier-feats {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  color: var(--fg-muted);
  font-size: var(--step-0);
  margin-top: 0.5rem;
}
.tier-feats li::before {
  content: '— ';
  color: var(--accent);
  margin-right: 0.35rem;
}

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

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding-block: 4rem 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--fg-dim);
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.footer-col a {
  color: var(--fg-muted);
  font-size: var(--step-0);
  transition: color 0.2s var(--ease);
}
.footer-col a:hover { color: var(--fg); }

.footer-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.3;
  max-width: 24ch;
  color: var(--fg-muted);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-soft);
  color: var(--fg-dim);
  font-size: var(--step--1);
  flex-wrap: wrap;
  gap: 1rem;
}

/* ============== Legal pages ============== */

.legal-hero {
  padding-block: clamp(5rem, 10vw, 7rem) 3rem;
  border-bottom: 1px solid var(--border-soft);
}

.legal-title {
  font-size: var(--step-5);
  margin-bottom: 1rem;
  max-width: 16ch;
}
.legal-meta {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.legal-body {
  padding-block: 4rem;
  max-width: 720px;
}

.legal-body h2 {
  font-size: var(--step-3);
  margin-block: 3rem 1rem;
  position: relative;
  padding-left: 2rem;
}
.legal-body h2:first-child { margin-top: 0; }
.legal-body h2::before {
  content: counter(section, decimal-leading-zero);
  counter-increment: section;
  position: absolute;
  left: 0;
  top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.legal-body { counter-reset: section; }

.legal-body h3 {
  font-size: var(--step-2);
  margin-block: 2rem 0.8rem;
  color: var(--fg);
  font-style: italic;
}

.legal-body p {
  color: var(--fg-muted);
  font-size: var(--step-1);
  line-height: 1.7;
  margin-bottom: 1rem;
  max-width: none;
}

.legal-body ul {
  margin-block: 1rem;
  padding-left: 0;
  list-style: none;
}
.legal-body li {
  padding-left: 1.5rem;
  color: var(--fg-muted);
  font-size: var(--step-1);
  line-height: 1.7;
  margin-bottom: 0.5rem;
  position: relative;
}
.legal-body li::before {
  content: '·';
  position: absolute;
  left: 0.4rem;
  color: var(--accent);
  font-weight: bold;
}

.legal-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-elev);
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  color: var(--highlight);
  border: 1px solid var(--border-soft);
}

.legal-body a {
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
}
.legal-body a:hover {
  border-bottom-color: var(--highlight);
  color: var(--highlight);
}

/* ============== 404 ============== */

.page-404 {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.5rem;
  padding: 4rem 1.5rem;
}
.page-404 .num {
  font-family: var(--font-display);
  font-size: var(--step-6);
  font-style: italic;
  color: var(--accent);
  line-height: 0.9;
}
.page-404 h1 {
  font-size: var(--step-3);
  max-width: 22ch;
}
.page-404 p { max-width: 36ch; color: var(--fg-muted); }

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
