/* =====================================================================
   Tubidy 4 — hand-written CSS (no Tailwind build needed)
   Palette: ink #16133D · paper #F4F3FB · signal #E11D74 · sun #FFC83D · mint #0FA37F
   ===================================================================== */

:root {
  --bg: #F4F3FB;
  --surface: #FFFFFF;
  --surface-2: #ECEAF7;
  --ink: #16133D;
  --ink-2: #4C4878;
  --line: #E1DEF0;
  --stage: #16133D;
  --stage-ink: #F4F3FB;
  --stage-ink-2: #C9C5EA;
  --signal: #E11D74;
  --signal-ink: #FFFFFF;
  --sun: #FFC83D;
  --mint: #0FA37F;
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --wrap: 1120px;
  --header-h: 56px;
  --bottom-h: 64px;
  --font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

html.dark {
  --bg: #16133D;
  --surface: #1F1B4C;
  --surface-2: #2A2560;
  --ink: #F4F3FB;
  --ink-2: #B7B3DA;
  --line: #322D6B;
  --stage: #0F0C2E;
  --signal: #FF4F9A;
  --signal-ink: #16133D;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font-body);
  padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom));
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

h1, h2, .brand-name, .rank, .nf-code {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 6.5vw, 3.25rem); line-height: 1.06; font-weight: 800; }
h2 { font-size: 1.375rem; line-height: 1.2; font-weight: 700; }
h3 { font-size: 1.0625rem; line-height: 1.3; font-weight: 700; }

:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  padding: 10px 14px; border-radius: var(--radius-s);
  background: var(--sun); color: #16133D; font-weight: 700;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 16px;
}
.wrap-narrow { max-width: 760px; }

main { flex: 1; padding-top: 8px; padding-bottom: 40px; }
.has-hero main { padding-top: 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-bar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--signal);
  flex-shrink: 0;
}
.brand-name { font-size: 1.375rem; font-weight: 800; color: var(--ink); }
.brand-logo { display: block; height: 40px; width: auto; }
@media (min-width: 1024px) { .brand-logo { height: 44px; } }

.main-nav { display: none; }

.header-actions { margin-left: auto; display: flex; gap: 4px; }

.icon-btn {
  width: 44px; height: 44px;
  display: inline-grid; place-items: center;
  border: 0; border-radius: 12px;
  background: transparent;
  color: var(--ink);
}
.icon-btn:hover { background: var(--surface-2); }

.toggle-appearance .i-sun { display: none; }
html.dark .toggle-appearance .i-sun { display: block; }
html.dark .toggle-appearance .i-moon { display: none; }

.header-search { display: none; padding-bottom: 12px; }
.header-search.open { display: block; }

/* compact search (header) */
.search-form { position: relative; display: flex; }
.search-compact input {
  flex: 1;
  height: 46px;
  padding: 0 52px 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
}
.search-compact input:focus { outline: none; border-color: var(--signal); }
.search-compact button {
  position: absolute; right: 4px; top: 4px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0; border-radius: 999px;
  background: var(--signal); color: var(--signal-ink);
}

input[type='search']::-webkit-search-cancel-button { -webkit-appearance: none; }

/* desktop nav */
@media (min-width: 1024px) {
  .main-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 8px;
  }
  .main-nav > a,
  .nav-drop summary {
    display: block;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
    white-space: nowrap;
  }
  .main-nav > a:hover,
  .nav-drop summary:hover { color: var(--ink); background: var(--surface-2); }
  .main-nav > a[aria-current='page'] { color: var(--signal); }

  .nav-drop { position: relative; }
  .nav-drop summary { list-style: none; }
  .nav-drop summary::-webkit-details-marker { display: none; }
  .nav-drop summary::after {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    margin-left: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-3px) rotate(45deg);
  }
  .nav-drop[open] summary { color: var(--ink); background: var(--surface-2); }
  .nav-drop-panel {
    position: absolute; left: 0; top: calc(100% + 6px);
    width: 420px; max-height: 60vh; overflow-y: auto;
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    box-shadow: 0 18px 40px -12px rgba(22, 19, 61, 0.35);
  }
  .nav-drop-panel a {
    padding: 8px 10px; border-radius: 8px;
    font-size: 0.9375rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .nav-drop-panel a:hover { background: var(--surface-2); color: var(--signal); }

  body:not(.has-hero) .header-search { display: block; }
  body:not(.has-hero) .toggle-search { display: none; }
}

/* ---------- hero ---------- */
.hero {
  margin: 0 -16px 8px;
  padding: 28px 16px 24px;
  background: var(--stage);
  color: var(--stage-ink);
  position: relative;
  /* no overflow:hidden here: the search suggestions must be able to drop below the hero */
}
.hero::after {
  /* the brand's sound bars, echoed big on desktop only */
  content: none;
  position: absolute;
  pointer-events: none;
}
.hero h1 { max-width: 15ch; color: var(--stage-ink); }
.hero .lede { margin-top: 12px; max-width: 52ch; color: var(--stage-ink-2); }
.hero .crumbs { color: var(--stage-ink-2); }

/* the search box (and its suggestion list) sits above the quick chips and the sections below */
.search-hero { margin-top: 20px; max-width: 640px; z-index: 30; }
.search-hero input {
  flex: 1;
  min-width: 0;
  height: 56px;
  padding: 0 116px 0 20px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: #FFFFFF;
  color: #16133D;
  font-size: 1.0625rem;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.45);
}
.search-hero input::placeholder { color: #7470A0; }
.search-hero input:focus { outline: none; border-color: var(--sun); }
.search-hero button {
  position: absolute; right: 5px; top: 5px;
  height: 46px; padding: 0 20px;
  border: 0; border-radius: 999px;
  background: var(--signal); color: #FFFFFF;
  font-weight: 700; font-size: 1rem;
}
.search-hero button:active { transform: scale(0.97); }

/* hero search used outside the stage (404, blog CTA) */
.not-found .search-hero input,
.cta-search .search-hero input { border-color: var(--line); box-shadow: none; }

.quick {
  margin-top: 14px;
  display: flex; gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  position: relative; z-index: 2;
  align-items: center;
}
.quick::-webkit-scrollbar { display: none; }
.quick > span { font-size: 0.875rem; color: var(--stage-ink-2); flex-shrink: 0; }
.chip-quick {
  border-color: rgba(244, 243, 251, 0.22) !important;
  background: transparent !important;
  color: var(--stage-ink) !important;
}
.chip-quick:hover { border-color: var(--sun) !important; }

.hero-compact { padding: 14px 16px 16px; }
.hero-compact::after { display: none; }
.hero-compact .search-hero { margin-top: 0; }

@media (min-width: 768px) {
  .hero {
    margin: 16px 0 8px;
    padding: 56px 48px 44px;
    border-radius: var(--radius-l);
  }
  .hero::after {
    content: '';
    right: 56px; bottom: 0;
    width: 150px; height: 170px;
    background:
      linear-gradient(var(--sun), var(--sun)) 0 100% / 30px 55% no-repeat,
      linear-gradient(var(--signal), var(--signal)) 60px 100% / 30px 100% no-repeat,
      linear-gradient(var(--sun), var(--sun)) 120px 100% / 30px 72% no-repeat;
  }
  .hero h1, .hero .lede, .quick { position: relative; z-index: 1; }
  .hero .search-hero { position: relative; z-index: 30; }
  .hero:not(.hero-compact) .search-hero, .hero:not(.hero-compact) .quick { max-width: calc(100% - 200px); }
  .chip-scroll { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; }
  .route-home main, .route-extHome main { padding-top: 0; }
  .hero-compact { padding: 20px 24px; }
}

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center;
  min-height: 40px; padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9375rem; font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.chip:hover { border-color: var(--signal); color: var(--signal); }
.chip-genre::before {
  content: ''; width: 8px; height: 8px; margin-right: 8px;
  border-radius: 2px; background: var(--signal);
}
.chip-mood::before {
  content: ''; width: 8px; height: 8px; margin-right: 8px;
  border-radius: 999px; background: var(--sun);
}

.chip-scroll {
  display: flex; gap: 8px;
  overflow-x: auto;
  margin-inline: -16px; padding: 2px 16px 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.chip-scroll::-webkit-scrollbar { display: none; }
.chip-scroll .chip { scroll-snap-align: start; }

.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- blocks ---------- */
.block { margin-top: 32px; }
.block > h2 { margin-bottom: 14px; }
.block-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.block-desc { margin: -6px 0 12px; color: var(--ink-2); font-size: 0.9375rem; }

.link-btn {
  border: 0; background: none; padding: 6px 0;
  color: var(--signal); font-weight: 700; font-size: 0.9375rem;
}
.link-btn:hover { text-decoration: underline; }

/* ---------- the chart (signature element) ---------- */
.chart {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
}
.chart-row {
  position: relative;
  display: grid;
  grid-template-columns: 2.25rem 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border-top: 1px solid var(--line);
}
.chart-row:first-child { border-top: 0; }
.chart-row:hover { background: var(--surface-2); }

.rank {
  font-size: 1.75rem; font-weight: 800; line-height: 1;
  text-align: center;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.rank-top { color: var(--signal); }

.thumb-sq {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: var(--radius-s);
  background: var(--surface-2);
}

.row-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-link {
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.row-link::after { content: ''; position: absolute; inset: 0; }
.row-link:hover { color: var(--signal); }
.row-sub {
  font-size: 0.875rem; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-dur { font-size: 0.875rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }

@media (min-width: 900px) {
  .chart {
    display: grid; grid-template-columns: 1fr 1fr;
    grid-auto-flow: column; grid-template-rows: repeat(10, auto);
  }
  .chart-row:nth-child(11) { border-top: 0; }
  .chart-row:nth-child(n + 11) { border-left: 1px solid var(--line); }
  .rank { font-size: 2rem; }
}

/* ---------- search results / related ---------- */
.results-title { font-size: clamp(1.375rem, 4.5vw, 1.875rem); margin-bottom: 14px; overflow-wrap: anywhere; }

.results { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.result-row {
  position: relative;
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.result-row:first-child { border-top: 0; }
.result-row:hover { background: var(--surface-2); }

.thumb-wide { position: relative; align-self: start; }
.thumb-wide img {
  width: 128px; height: 72px; object-fit: cover;
  border-radius: var(--radius-s); background: var(--surface-2);
}
.thumb-dur {
  position: absolute; right: 4px; bottom: 4px;
  padding: 1px 6px; border-radius: 6px;
  background: rgba(15, 12, 46, 0.86); color: #FFFFFF;
  font-size: 0.75rem; font-weight: 700; font-variant-numeric: tabular-nums;
}

.row-actions { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.pill-mp3, .pill-mp4 {
  padding: 2px 8px; border-radius: 6px;
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.02em;
}
.pill-mp3 { background: var(--mint); color: #FFFFFF; }
.pill-mp4 { background: var(--surface-2); color: var(--ink-2); }
.share-wa {
  position: relative; z-index: 2;
  margin-left: auto;
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; color: var(--ink-2);
}
.share-wa:hover { color: #1FA855; background: var(--bg); }

@media (min-width: 900px) {
  .results { grid-template-columns: 1fr 1fr; }
  .result-row:nth-child(2) { border-top: 0; }
  .result-row:nth-child(even) { border-left: 1px solid var(--line); }
  .result-row { grid-template-columns: 160px minmax(0, 1fr); }
  .thumb-wide img { width: 160px; height: 90px; }
}

.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px;
}
.pager-now { margin-inline: auto; color: var(--ink-2); font-size: 0.9375rem; }
.pager-btn {
  min-height: 44px; padding: 0 18px;
  display: inline-flex; align-items: center;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-weight: 700;
}
.pager-btn:hover { border-color: var(--signal); color: var(--signal); }
.prev-page { order: -1; }
.next-page { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.next-page:hover { color: var(--bg); background: var(--signal); border-color: var(--signal); }

.empty {
  padding: 24px; border-radius: var(--radius-m);
  background: var(--surface); border: 1px dashed var(--line);
  display: grid; gap: 6px; color: var(--ink-2);
}
.empty strong { color: var(--ink); }

/* ---------- video page ---------- */
.video-detail { margin-top: 0; }
.player {
  position: relative;
  margin-inline: -16px;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.player iframe, .player-facade { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-facade { padding: 0; background: #000; }
.player-facade img { width: 100%; height: 100%; object-fit: cover; opacity: 0.88; }
.play-dot {
  position: absolute; left: 50%; top: 50%;
  width: 68px; height: 68px; margin: -34px 0 0 -34px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--signal); color: #FFFFFF;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.play-dot svg { transform: translateX(2px); }
.player-facade:hover .play-dot { transform: scale(1.06); }

.video-info { padding: 14px 0 4px; }
.video-info h1 { font-size: clamp(1.25rem, 4.6vw, 1.875rem); line-height: 1.2; overflow-wrap: anywhere; }
.video-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; color: var(--ink-2); font-size: 0.9375rem; }
.video-meta li + li::before { content: '/'; margin-right: 14px; opacity: 0.4; }

.dl {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-m);
  background: var(--surface);
  border: 2px solid var(--mint);
}
.dl h2 { font-size: 1.125rem; margin-bottom: 10px; }
.dl-box { display: grid; gap: 12px; }
.dl-frame { display: block; width: 100%; border: 0; border-radius: var(--radius-s); background: transparent; }

.ad-buttons {
  display: flex; justify-content: center; align-items: flex-start; gap: 12px;
  padding: 12px;
  border-radius: var(--radius-m);
  background: var(--surface-2);
}
.ad-col { flex: 1; max-width: 200px; display: flex; flex-direction: column; align-items: stretch; }
.ad-button {
  display: block; padding: 12px 10px;
  border-radius: 10px;
  background: var(--ink); color: var(--bg);
  text-align: center; font-weight: 700; font-size: 0.9375rem; white-space: nowrap;
}
.ad-button.play { background: var(--signal); color: #FFFFFF; }
.advertising-text { margin-top: 4px; text-align: center; font-size: 0.6875rem; color: var(--ink-2); }

@media (min-width: 900px) {
  .video-detail {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-areas: 'player dl' 'info dl';
    grid-template-rows: auto 1fr;
    gap: 0 28px;
    align-items: start;
    margin-top: 20px;
  }
  .player { grid-area: player; margin-inline: 0; border-radius: var(--radius-m); }
  .video-info { grid-area: info; }
  .dl { grid-area: dl; margin-top: 0; position: sticky; top: calc(var(--header-h) + 16px); }
}

/* ---------- skeleton & loader ---------- */
.skeleton { display: grid; gap: 1px; margin-top: 16px; border-radius: var(--radius-m); overflow: hidden; }
.skeleton li { display: grid; grid-template-columns: 128px 1fr; gap: 12px; padding: 12px; background: var(--surface); }
.skeleton span { display: block; height: 72px; border-radius: var(--radius-s); background: var(--surface-2); }
.skeleton span + span { height: 16px; margin-top: 8px; width: 80%; box-shadow: 0 28px 0 -2px var(--surface-2); }

.loader {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 48px 16px;
  color: var(--ink-2); font-weight: 600;
}
.loader[hidden] { display: none; }
.eq { display: flex; align-items: flex-end; gap: 5px; height: 36px; }
.eq span { width: 7px; height: 100%; border-radius: 4px; background: var(--signal); animation: eq 0.9s ease-in-out infinite; transform-origin: bottom; }
.eq span:nth-child(2) { animation-delay: -0.3s; background: var(--sun); }
.eq span:nth-child(3) { animation-delay: -0.6s; }
.eq span:nth-child(4) { animation-delay: -0.15s; background: var(--sun); }
@keyframes eq { 0%, 100% { transform: scaleY(0.25); } 50% { transform: scaleY(1); } }

/* ---------- how-to & faq ---------- */
.steps { counter-reset: step; display: grid; gap: 12px; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 16px 16px 16px 64px;
  background: var(--surface);
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 16px; top: 14px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--sun); color: #16133D;
  font: 800 1.125rem/1 var(--font-display);
}
.steps h3 { margin-bottom: 4px; }
.steps p { color: var(--ink-2); font-size: 0.9375rem; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); } }

.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 56px; padding: 12px 0;
  font-weight: 700; cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; flex-shrink: 0;
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 999px; background: var(--surface-2);
  font-size: 1.25rem; line-height: 1;
}
.faq details[open] summary::after { content: '−'; background: var(--signal); color: #FFFFFF; }
.faq details p { padding: 0 0 16px; color: var(--ink-2); max-width: 68ch; }
@media (min-width: 900px) { .faq { max-width: 760px; } }

/* ---------- page heads, breadcrumbs ---------- */
.page-head { padding: 20px 0 8px; }
.page-head h1 { font-size: clamp(1.75rem, 6vw, 2.75rem); }
.page-head .lede { margin-top: 10px; color: var(--ink-2); max-width: 60ch; }

.crumbs { margin-bottom: 10px; font-size: 0.875rem; color: var(--ink-2); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs li { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.crumbs li + li::before { content: '›'; opacity: 0.6; }
.crumbs a:hover { color: var(--signal); text-decoration: underline; }
.crumbs span[aria-current] { max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- playlists grid ---------- */
.pl-grid {
  display: grid; gap: 16px 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}
@media (min-width: 600px) { .pl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .pl-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px 16px; } }
.pl-card { position: relative; display: grid; gap: 8px; }
.pl-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-m); background: var(--surface-2); }
.pl-card .row-link { font-size: 0.9375rem; }

.pl-head { padding: 20px 0 16px; }
.pl-head-row { display: flex; gap: 16px; align-items: flex-end; }
.pl-cover { width: 120px; height: 120px; border-radius: var(--radius-m); object-fit: cover; flex-shrink: 0; }
.pl-head h1 { font-size: clamp(1.5rem, 5.5vw, 2.5rem); }
.pl-desc { margin-top: 8px; color: var(--ink-2); font-size: 0.9375rem; max-width: 60ch;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 768px) { .pl-cover { width: 180px; height: 180px; } }

/* ---------- blog ---------- */
.post-cat { font-size: 0.875rem; font-weight: 700; color: var(--signal); margin-bottom: 6px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.875rem; color: var(--ink-2); margin-top: 10px; }

.post-lead {
  margin-top: 16px;
  padding: 24px 20px;
  border-radius: var(--radius-l);
  background: var(--stage); color: var(--stage-ink);
}
.post-lead .post-cat { color: var(--sun); }
.post-lead h2 { font-size: clamp(1.375rem, 5vw, 2rem); line-height: 1.15; }
.post-lead h2 a:hover { text-decoration: underline; }
.post-lead > p:not(.post-cat):not(.post-meta) { margin-top: 10px; color: var(--stage-ink-2); max-width: 62ch; }
.post-lead .post-meta { color: var(--stage-ink-2); }

.post-list { margin-top: 8px; }
.post-list li { padding: 20px 0; border-bottom: 1px solid var(--line); }
.post-list h2, .post-list h3 { font-size: 1.1875rem; line-height: 1.3; }
.post-list h2 a:hover, .post-list h3 a:hover { color: var(--signal); }
.post-list p:not(.post-cat):not(.post-meta) { margin-top: 6px; color: var(--ink-2); font-size: 0.9375rem; max-width: 68ch; }
@media (min-width: 900px) {
  .post-list:not(.post-list-compact) { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; }
}

.post-summary {
  margin: 8px 0 20px;
  padding-left: 14px;
  border-left: 4px solid var(--sun);
  font-size: 1.0625rem; color: var(--ink-2);
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.tags li { padding: 4px 12px; border-radius: 999px; background: var(--surface-2); font-size: 0.875rem; color: var(--ink-2); }

.cta-search {
  margin-top: 36px; padding: 20px;
  border-radius: var(--radius-l);
  background: var(--surface); border: 1px solid var(--line);
}
.cta-search h2 { margin-bottom: 12px; }
.cta-search .search-hero { margin-top: 0; }

/* ---------- long-form content (SEO copy, blog, pages) ---------- */
.seo-copy {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  max-width: 760px;
}
.content { color: var(--ink); }
.content > * + * { margin-top: 14px; }
.content h2 { font-size: 1.375rem; margin-top: 32px; }
.content h3 { margin-top: 24px; }
.content h2:first-child, .content h3:first-child { margin-top: 0; }
.content p, .content li { color: var(--ink-2); line-height: 1.7; }
.content strong { color: var(--ink); }
.content a { color: var(--signal); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.content ul, .content ol { padding-left: 1.4em; display: grid; gap: 6px; }
.content ul { list-style: disc; }
.content ol { list-style: decimal; }
.content li::marker { color: var(--signal); font-weight: 700; }
.content blockquote {
  margin: 20px 0; padding: 14px 16px;
  border-left: 4px solid var(--signal);
  background: var(--surface); border-radius: 0 var(--radius-s) var(--radius-s) 0;
  color: var(--ink);
}
.content table {
  display: block; overflow-x: auto;
  width: 100%; border-collapse: collapse;
  font-size: 0.9375rem;
}
.content th, .content td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
@media (min-width: 640px) {
  .content table { display: table; }
  .content th, .content td { white-space: nowrap; }
}
.content th { font-weight: 700; color: var(--ink); background: var(--surface-2); }
.content td { color: var(--ink-2); }

/* genre guide cards inside long-form content */
.content .genre-guide {
  display: grid; gap: 12px;
  margin: 18px 0 8px;
}
.content .genre-guide > div {
  padding: 16px;
  border-radius: var(--radius-m);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--signal);
}
.content .genre-guide > div:nth-child(even) { border-top-color: var(--sun); }
.content .genre-guide dt {
  font: 700 1.125rem/1.2 var(--font-display);
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 6px;
}
.content .genre-guide dd { margin: 0; color: var(--ink-2); line-height: 1.6; }
.content .genre-guide dd.try { margin-top: 10px; font-size: 0.875rem; }
.content .genre-guide dd.try em { font-style: normal; font-weight: 700; color: var(--signal); }
@media (min-width: 640px) { .content .genre-guide { grid-template-columns: 1fr 1fr; } }

/* ---------- 404 ---------- */
.not-found { padding: 40px 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.nf-code { font-size: clamp(4.5rem, 22vw, 8rem); font-weight: 800; line-height: 0.9; color: var(--signal); }
.not-found .lede { color: var(--ink-2); }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 24px;
  padding: 36px 0 20px;
  background: var(--stage);
  color: var(--stage-ink-2);
  font-size: 0.9375rem;
}
.site-footer .brand-name { color: var(--stage-ink); }
.site-footer .brand { color: var(--signal); }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; }
.footer-about { grid-column: 1 / -1; display: grid; gap: 10px; max-width: 46ch; }
.site-footer h2 { font: 700 0.9375rem/1.3 var(--font-body); letter-spacing: 0; color: var(--stage-ink); margin-bottom: 10px; }
.site-footer ul { display: grid; gap: 2px; }
.site-footer nav a { display: inline-block; padding: 6px 0; }
.site-footer a:hover { color: var(--sun); }
.footer-legal { margin-top: 28px; padding-top: 16px; border-top: 1px solid rgba(244, 243, 251, 0.12); font-size: 0.8125rem; }
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1.3fr 1fr; }
  .footer-about { grid-column: auto; }
}

/* ---------- bottom nav (mobile) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.bottom-nav a, .bottom-nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: none;
  font-size: 0.75rem; font-weight: 600;
  color: var(--ink-2);
}
.bottom-nav [aria-current='page'] { color: var(--signal); }
.bottom-nav a:active, .bottom-nav button:active { background: var(--surface-2); }

@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
}

/* ---------- browse sheet ---------- */
.sheet {
  width: 100%; max-width: 640px;
  max-height: 82vh;
  margin: auto auto 0;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  background: var(--bg); color: var(--ink);
  overflow-y: auto;
}
.sheet::backdrop { background: rgba(15, 12, 46, 0.6); }
.sheet[open] { animation: sheet-up 0.22s ease-out; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head {
  position: sticky; top: -8px; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; background: var(--bg);
}
.sheet h3 { margin: 18px 0 10px; font-size: 0.9375rem; color: var(--ink-2); }
@media (min-width: 768px) {
  .sheet { margin: auto; border-radius: var(--radius-l); }
}

/* ---------- autocomplete ---------- */
.suggests-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50;
  max-height: min(380px, 60vh); overflow-y: auto;
  padding: 6px;
  border-radius: var(--radius-m);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -12px rgba(22, 19, 61, 0.4);
  color: var(--ink);
}
.suggests-list:not(.show) { display: none; }
.suggests-list li {
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.suggests-list li:hover, .suggests-list li.active { background: var(--surface-2); color: var(--signal); }

/* ---------- motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- PWA install card ---------- */
.install-card {
  position: fixed; z-index: 46;
  left: 12px; right: 12px;
  bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom) + 10px);
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto auto;
  align-items: center; gap: 10px;
  padding: 12px 8px 12px 12px;
  border-radius: var(--radius-m);
  background: var(--stage); color: var(--stage-ink);
  box-shadow: 0 16px 40px -10px rgba(15, 12, 46, 0.55);
  animation: sheet-up 0.25s ease-out;
}
.install-card[hidden] { display: none; }
.install-card img { width: 76px; height: auto; }
.install-text { display: grid; gap: 2px; font-size: 0.875rem; line-height: 1.35; }
.install-text strong { font-size: 0.9375rem; }
.install-why, .install-ios { color: var(--stage-ink-2); }
.install-ios svg { display: inline; vertical-align: -3px; }
.install-btn {
  min-height: 40px; padding: 0 16px;
  border: 0; border-radius: 999px;
  background: var(--sun); color: #16133D; font-weight: 800;
}
.install-btn[hidden] { display: none; }
.install-card .icon-btn { color: var(--stage-ink-2); width: 36px; height: 36px; }
.install-card .icon-btn:hover { background: rgba(255, 255, 255, 0.08); }
@media (min-width: 1024px) {
  .install-card { left: auto; right: 24px; bottom: 24px; width: 420px; }
}
/* running as an installed app */
@media (display-mode: standalone) {
  .site-header { padding-top: env(safe-area-inset-top); }
}

/* ---------- touch screens: no sticky hover after a tap ---------- */
@media (hover: none) {
  .chart-row:hover, .result-row:hover { background: transparent; }
  .row-link:hover { color: inherit; }
  .chip:hover { border-color: var(--line); color: inherit; }
  .chart-row:active, .result-row:active { background: var(--surface-2); }
}
