/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&family=Space+Grotesk:wght@600;700&display=swap');

:root {
  /* Typografie */
  --font-heading: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Gemeinsame Basis-Radien & Abstände */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  /* ==========================================================================
     DARK MODE (Standard-Theme)
     ========================================================================== */
  --bg-primary: #0d0e15;
  --bg-secondary: #141622;
  --bg-surface: rgba(24, 27, 42, 0.72);
  --bg-surface-hover: rgba(34, 38, 58, 0.85);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --brand-primary: #a855f7;       /* Neon Violett */
  --brand-primary-hover: #9333ea;
  --brand-secondary: #22d3ee;     /* Elektrisches Cyan */
  --brand-accent: #e879f9;        /* Leuchtendes Magenta */
  --danger: #f43f5e;

  --border-subtle: rgba(168, 85, 247, 0.22);
  --border-strong: rgba(34, 211, 238, 0.45);
  --glow-primary: 0 0 24px rgba(168, 85, 247, 0.28);
  --glow-secondary: 0 0 20px rgba(34, 211, 238, 0.25);

  color-scheme: dark;
}

/* ==========================================================================
   LIGHT MODE (Manuell über [data-theme="light"])
   ========================================================================== */
[data-theme="light"] {
  --bg-primary: #f8fafc;          /* Off-White Papier */
  --bg-secondary: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f8fafc;

  --text-primary: #0d0e15;        /* Tiefschwarz Ink */
  --text-secondary: #475569;
  --text-muted: #64748b;

  --brand-primary: #7c3aed;       /* Kontrastreiches Violett */
  --brand-primary-hover: #6d28d9;
  --brand-secondary: #0891b2;     /* Kontrastreiches Cyan-Teal */
  --brand-accent: #c026d3;        /* Kräftiges Magenta */
  --danger: #dc2626;

  --border-subtle: rgba(13, 14, 21, 0.10);
  --border-strong: rgba(124, 58, 237, 0.35);
  --glow-primary: 0 4px 20px rgba(124, 58, 237, 0.12);
  --glow-secondary: 0 4px 16px rgba(8, 145, 178, 0.12);

  color-scheme: light;
}

/* ==========================================================================
   AUTOMATISCHE SYSTEM-ERKENNUNG (falls kein data-theme gesetzt ist)
   ========================================================================== */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f8fafc;

    --text-primary: #0d0e15;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --brand-primary: #7c3aed;
    --brand-primary-hover: #6d28d9;
    --brand-secondary: #0891b2;
    --brand-accent: #c026d3;
    --danger: #dc2626;

    --border-subtle: rgba(13, 14, 21, 0.10);
    --border-strong: rgba(124, 58, 237, 0.35);
    --glow-primary: 0 4px 20px rgba(124, 58, 237, 0.12);
    --glow-secondary: 0 4px 16px rgba(8, 145, 178, 0.12);

    color-scheme: light;
  }
}

/* ==========================================================================
   BEISPIEL-ANWENDUNG (Basis-Styling & Scrobble-Cards)
   ========================================================================== */
body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  margin: 0;
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, .brand-title {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

.stat-number, .scrobble-timestamp, code {
  font-family: var(--font-mono);
}

.scrobble-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  box-shadow: var(--glow-primary);
  padding: 1.25rem;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.25rem;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  background-color: var(--brand-primary-hover);
  box-shadow: var(--glow-primary);
}
/* ==========================================================================
   SCROBBLE NINJA — Seiten-Komponenten
   Baut auf den Tokens oben auf; deren Werte bleiben unverändert.
   ========================================================================== */

/* Action color for filled buttons/pills. White text on --brand-primary only
   reaches 3.96:1 in dark mode (WCAG AA needs 4.5:1), so dark mode fills with
   --brand-primary-hover instead (5.4:1). Light mode uses the snippet's values
   as given (5.7:1). Same toggle structure as the tokens above. */
:root {
  --page-width: 1200px;
  --action: var(--brand-primary-hover);
  --action-hover: color-mix(in srgb, var(--brand-primary-hover) 80%, #000);
  --tint-primary: color-mix(in srgb, var(--brand-primary) 16%, transparent);
  --tint-danger: color-mix(in srgb, var(--danger) 12%, transparent);
  --tint-ok: color-mix(in srgb, var(--brand-secondary) 14%, transparent);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --action: var(--brand-primary); --action-hover: var(--brand-primary-hover); }
}
[data-theme="light"] { --action: var(--brand-primary); --action-hover: var(--brand-primary-hover); }
[data-theme="dark"] { --action: var(--brand-primary-hover); --action-hover: color-mix(in srgb, var(--brand-primary-hover) 80%, #000); }

/* ---- Base ------------------------------------------------------------- */

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

body {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  font-size: 1rem;
}
/* The home page's full-bleed bands use a 100vw breakout, and 100vw includes
   the scrollbar, so they overhang by its width. clip (unlike hidden) also
   stops scrollIntoView/focus from scrolling the page sideways. */
html, body { overflow-x: clip; }

/* Type scale: major third (1.25) from a 16px base. */
h1 { font-size: 1.953rem; line-height: 1.15; margin: 0 0 .5rem; text-wrap: balance; }
h2 { font-size: 1.25rem; line-height: 1.3; margin: 0 0 .75rem; text-wrap: balance; }
h3 { font-size: 1rem; line-height: 1.4; margin: 1.5rem 0 .5rem; font-family: var(--font-heading); }
p { margin: 0 0 1rem; }

a {
  /* --brand-secondary (cyan) only clears AA at large text sizes against the
     light background (3.5:1); --brand-primary clears 4.5:1 in both themes. */
  color: var(--brand-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: color .15s ease;
}
a:hover { color: var(--brand-primary-hover); }

.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: 1rem; top: -4rem; z-index: 20;
  background: var(--bg-secondary); color: var(--text-primary);
  padding: .6rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; }

/* ---- Header ------------------------------------------------------------ */

.site-header {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  flex-wrap: wrap; padding: 1rem 0;
}
.brand-title { line-height: 0; text-decoration: none; }

/* Logo variants swap like the tokens: system preference by default,
   [data-theme] overrides either way. Nothing else may set display on
   .logo-dark/.logo-light, or the toggle stops working. */
.logo { height: 40px; width: auto; }
.logo-dark { display: block; }
.logo-light { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .logo-dark { display: none; }
  :root:not([data-theme="dark"]) .logo-light { display: block; }
}
[data-theme="light"] .logo-dark { display: none; }
[data-theme="light"] .logo-light { display: block; }
[data-theme="dark"] .logo-dark { display: block; }
[data-theme="dark"] .logo-light { display: none; }

.site-nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; margin-left: auto; }

.theme-toggle {
  width: 44px; min-height: 44px; padding: 0; flex: none;
  background: transparent; border: 1px solid var(--border-subtle); border-radius: 50%;
  color: var(--text-secondary);
}
.theme-toggle:hover { color: var(--text-primary); background: var(--bg-surface); }
.site-nav a, .nav-button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .85rem;
  color: var(--text-secondary); text-decoration: none; font-weight: 500;
  border-radius: var(--radius-sm);
}
.site-nav a:hover, .nav-button:hover { color: var(--text-primary); background: var(--bg-surface); }
.site-nav a[aria-current="page"] {
  color: var(--text-primary);
  box-shadow: inset 0 -2px 0 var(--brand-primary);
  border-radius: 0;
}
.site-nav a.nav-cta {
  color: var(--text-primary); border: 1px solid var(--border-strong);
  margin-left: .25rem;
}
.site-nav a.nav-cta:hover { background: var(--tint-primary); }
.nav-form { margin: 0; }
@media (max-width: 560px) {
  /* logo + theme toggle on the first row, the nav gets its own row */
  .site-header { padding-bottom: .25rem; row-gap: .25rem; }
  .theme-toggle { order: 2; }
  .site-nav { order: 3; flex-wrap: nowrap; justify-content: space-between; margin: 0 -.6rem; width: calc(100% + 1.2rem); }
  .site-nav a, .nav-button { padding: 0 .6rem; font-size: .95rem; white-space: nowrap; }
  .site-nav a.nav-cta { margin-left: 0; }
}
@media (max-width: 380px) {
  .site-nav a, .nav-button { padding: 0 .4rem; font-size: .9rem; }
}
.nav-button {
  background: none; border: 0; font: inherit; font-weight: 500; cursor: pointer;
}

/* ---- Buttons ----------------------------------------------------------- */

button, .btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: 0 1.2rem;
  font: inherit; font-family: var(--font-heading); font-weight: 600;
  border-radius: var(--radius-sm); cursor: pointer; text-decoration: none;
  transition: background-color .15s ease, box-shadow .15s ease, border-color .15s ease;
}
button { background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-subtle); }
button:hover { background: var(--bg-surface-hover); }

.btn-primary { background-color: var(--action); color: #ffffff; border: 1px solid transparent; }
.btn-primary:hover, a.btn-primary:hover { background-color: var(--action-hover); color: #ffffff; box-shadow: var(--glow-primary); }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary { background: transparent; color: var(--text-primary); border: 1px solid var(--border-strong); }
.btn-secondary:hover { background: var(--tint-primary); }

.btn-block { width: 100%; }
.btn-lg { min-height: 52px; padding: 0 1.75rem; font-size: 1.05rem; border-radius: 999px; }

/* ---- Forms ------------------------------------------------------------- */

.stack-form { display: flex; flex-direction: column; gap: 1.1rem; align-items: flex-start; }
.stack-form .btn-block { margin-top: .25rem; }
.field { display: flex; flex-direction: column; gap: .35rem; width: 100%; }
.field label { font-weight: 600; font-size: .9rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; width: 100%; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.optional { font-weight: 400; color: var(--text-secondary); }

input, select {
  font: inherit; font-size: 1rem; /* 16px keeps iOS from zooming on focus */
  min-height: 44px; padding: 0 .8rem; width: 100%;
  background: var(--bg-surface); color: var(--text-primary);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
}
input[type="file"] { padding: .55rem .8rem; }
input:hover { border-color: var(--border-strong); }
input:focus { outline: none; border-color: var(--brand-secondary); box-shadow: var(--glow-secondary); }

.hint { font-size: .85rem; color: var(--text-secondary); margin: 0; }

.password-field { position: relative; }
.password-field input { padding-right: 6.5rem; }
.reveal {
  position: absolute; top: 4px; right: 4px; bottom: 4px; min-height: 0;
  padding: 0 .75rem; font-family: var(--font-body); font-size: .85rem; font-weight: 500;
  background: transparent; border: 0; color: var(--text-secondary);
}
.reveal:hover { background: var(--bg-surface-hover); color: var(--text-primary); }

.check { display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand-primary); }

.code-input {
  font-family: var(--font-mono); font-size: 1.5rem; letter-spacing: .4em;
  max-width: 12ch; text-align: center; font-variant-numeric: tabular-nums;
}

.form-error, .form-notice {
  padding: .75rem 1rem; border-radius: var(--radius-sm);
  border-left: 3px solid; margin: 0 0 1.25rem;
}
.form-error { background: var(--tint-danger); border-color: var(--danger); color: var(--text-primary); }
.form-notice { background: var(--tint-ok); border-color: var(--brand-secondary); color: var(--text-primary); }

/* ---- Auth pages (login, register, codes, messages) ------------------ */

.auth { max-width: 420px; margin: 2.5rem auto 1rem; }
.auth-intro { color: var(--text-secondary); margin-bottom: 1.5rem; }
.auth-links { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: .6rem; color: var(--text-secondary); font-size: .95rem; }

/* ---- Settings ---------------------------------------------------------- */

.narrow { max-width: 760px; }
.page-head { margin: 1.5rem 0 1.75rem; }
.page-intro { color: var(--text-secondary); }

.panel {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 1.5rem; margin-bottom: 1.25rem;
}
.panel h2 { margin-bottom: 1rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.panel-head h2 { margin: 0; }
.panel > p { color: var(--text-secondary); }
.panel-admin { border-style: dashed; border-color: var(--border-strong); }
.panel-admin h3:first-of-type { margin-top: 1.25rem; }

/* State shown by dot shape + text, never by color alone. */
.status {
  display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 600;
  padding: .3rem .75rem; border-radius: 999px; border: 1px solid var(--border-subtle);
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.status-on::before { background: var(--brand-secondary); box-shadow: 0 0 8px var(--brand-secondary); }
.status-off::before { border: 2px solid var(--text-secondary); width: 6px; height: 6px; }

.avatar-row { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.avatar-row .stack-form { flex: 1; min-width: 220px; }

.avatar { border-radius: 50%; object-fit: cover; flex: none; }
.avatar-lg { width: 96px; height: 96px; }
.avatar-xl { width: 88px; height: 88px; }
.avatar-empty {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--action); color: #ffffff;
  font-family: var(--font-heading); font-weight: 700; font-size: 2.2rem;
}

/* ---- Profile ----------------------------------------------------------- */

.profile-head {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1.25rem; align-items: center;
  margin: 1.5rem 0 1.75rem;
}
.profile-id h1 { margin: 0; }
.profile-meta { margin: .15rem 0 0; color: var(--text-secondary); }
.profile-handle { font-family: var(--font-mono); font-size: .9rem; }
.profile-count { margin: 0; text-align: right; color: var(--text-secondary); line-height: 1.2; }
.profile-count .stat-number {
  display: block; font-size: 1.953rem; font-weight: 700; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) {
  .profile-head { grid-template-columns: auto 1fr; }
  .profile-count { grid-column: 1 / -1; text-align: left; }
  .profile-count .stat-number { display: inline; margin-right: .3rem; }
}

/* "Now playing" is the one loud element on a profile. */
.now-playing {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; margin-bottom: 2rem;
}
.now-playing.is-playing { border-color: var(--border-strong); box-shadow: var(--glow-secondary); }
.now-playing-text { min-width: 0; }
.now-playing-text p { margin: 0; }
.now-playing-label { font-size: .85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: .2rem !important; }
.now-playing.is-playing .now-playing-label { color: var(--text-primary); }
.now-playing-track {
  font-family: var(--font-heading); font-weight: 700; font-size: 1.25rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.now-playing-artist { color: var(--text-secondary); }

.eq { display: flex; align-items: flex-end; gap: 4px; height: 40px; width: 56px; flex: none; }
.eq span { flex: 1; height: 30%; background: var(--brand-secondary); border-radius: 2px; animation: eq-bounce 1.1s ease-in-out infinite; }
.eq span:nth-child(1) { animation-delay: -.9s; }
.eq span:nth-child(2) { animation-delay: -.4s; }
.eq span:nth-child(3) { animation-delay: -1.1s; }
.eq span:nth-child(4) { animation-delay: -.2s; }
.eq span:nth-child(5) { animation-delay: -.7s; }
@keyframes eq-bounce { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.eq span { height: 100%; transform-origin: bottom; }

.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
@media (max-width: 820px) { .profile-grid { grid-template-columns: 1fr; gap: 2rem; } }
.profile-grid h3 { color: var(--text-secondary); font-size: .9rem; }

.track-list { list-style: none; padding: 0; margin: 0; }
.track-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .7rem 0; border-bottom: 1px solid var(--border-subtle);
}
.track-main { display: flex; flex-direction: column; min-width: 0; }
.track-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-artist { color: var(--text-secondary); font-size: .9rem; }
.track-time { color: var(--text-secondary); font-size: .85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

.charts-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.charts-head h2 { margin: 0; }

.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  border: 1px solid var(--border-subtle); border-radius: 999px;
}
.segmented a {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 .9rem;
  border-radius: 999px; color: var(--text-secondary); text-decoration: none;
  font-size: .9rem; font-weight: 500;
}
.segmented a:hover { color: var(--text-primary); }
.segmented a[aria-current="page"] { background: var(--action); color: #ffffff; }

/* Rank order is real information here, so the numbers stay; the bar behind
   each row shows how far apart the ranks actually are. */
.chart { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; gap: 4px; }
.chart li {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: 2ch 1fr auto; gap: .75rem; align-items: center;
  padding: .55rem .75rem; border-radius: var(--radius-sm);
}
.chart li::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  width: var(--pct); background: var(--tint-primary); border-radius: var(--radius-sm);
}
.chart-rank { color: var(--text-secondary); font-variant-numeric: tabular-nums; text-align: right; font-size: .9rem; }
.chart-title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-sub { display: block; font-weight: 400; color: var(--text-secondary); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; }
.chart-plays { font-variant-numeric: tabular-nums; color: var(--text-secondary); font-size: .9rem; }

.empty { color: var(--text-secondary); padding: 1rem 0; }

/* ---- Prose (privacy) -------------------------------------------------- */

.prose { max-width: 65ch; margin: 1.5rem 0 1rem; }
.prose h2 { margin-top: 2rem; }
.cookie-list { margin: 0 0 1.25rem; }
.cookie-list dt { font-family: var(--font-mono); font-size: .9rem; font-weight: 500; margin-top: .9rem; }
.cookie-list dd { margin: .2rem 0 0; color: var(--text-secondary); }

/* ---- Home -------------------------------------------------------------- */

/* Breaks out of the body column for full-bleed bands. */
.hero-full, .how {
  width: 100vw; position: relative; left: 50%; margin-left: -50vw;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  box-sizing: border-box;
}

.hero-full { padding-top: 1rem; padding-bottom: 4.5rem; }
.hero-full-inner {
  position: relative; max-width: calc(var(--page-width) - 2.5rem); margin: 0 auto;
  min-height: clamp(440px, 46vw, 580px);
  display: flex; flex-direction: column; justify-content: center;
}
.hero-full-inner > :not(.hero-art) { position: relative; max-width: 600px; }

/* Text-free crop of the banner (ninja + wave pattern), sitting behind the
   headline on the right. Fades out to the left and at top/bottom so the
   JPEG's own background never shows an edge against the page. */
.hero-art {
  position: absolute; top: 50%; right: 0; transform: translateY(-50%);
  height: 112%; aspect-ratio: 825 / 1100; max-width: 58%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 30%),
                      linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0%, #000 30%),
              linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
  mask-composite: intersect;
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: left center; opacity: .8; }
@media (max-width: 760px) {
  .hero-art { height: 100%; max-width: 75%; right: -12%; opacity: .15; }
}

.display {
  font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1; margin: 0 0 1.25rem;
  text-transform: uppercase; letter-spacing: -.03em;
}
.accent-text { color: var(--brand-secondary); }
.hero-full .lead { color: var(--text-secondary); max-width: 46ch; margin: 0 0 1.75rem; font-size: 1.125rem; }
.cta { display: flex; gap: .75rem; flex-wrap: wrap; }
.cta-sub { color: var(--text-secondary); font-size: .95rem; margin: 1rem 0 0; }

.why { padding: 4rem 0 3rem; }
.section-title { font-size: 1.563rem; margin: 0 0 .5rem; }
.section-lead { color: var(--text-secondary); max-width: 56ch; margin: 0 0 2rem; }

.why-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: start; }
@media (max-width: 760px) { .why-grid { grid-template-columns: 1fr; } }

.accordion details { border-bottom: 1px solid var(--border-subtle); }
.accordion details:first-child { border-top: 1px solid var(--border-subtle); }
.accordion summary {
  font-family: var(--font-heading); font-weight: 600; font-size: 1.05rem; cursor: pointer;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
  min-height: 56px;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; color: var(--brand-primary); font-size: 1.4rem; line-height: 1; }
.accordion details[open] summary::after { content: "\2212"; }
.accordion-body { padding-bottom: 1.1rem; color: var(--text-secondary); }
.accordion-body p { margin: 0; }

.preview { margin: 0; }
.preview .now-playing { margin-bottom: .6rem; }
.preview figcaption { color: var(--text-secondary); font-size: .85rem; }

.how { padding-top: 3.5rem; padding-bottom: 4rem; background: var(--bg-secondary); }
.how .section-title { text-align: center; margin-bottom: 1.75rem; }
.tabs-panel { max-width: 640px; margin: 0 auto; }
/* visually hidden but still focusable; sized explicitly because the generic
   input rule would otherwise stretch it to 100% and overflow the page */
.tab-radio { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; pointer-events: none; }
.tab-pills { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin-bottom: 1.25rem; }
.tab-pills label {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.1rem;
  font-family: var(--font-heading); font-size: .9rem; font-weight: 600;
  border-radius: 999px; border: 1px solid var(--border-subtle);
  color: var(--text-secondary); cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
.tab-pills label:hover { color: var(--text-primary); }
#step1:checked ~ .tab-pills label[for="step1"],
#step2:checked ~ .tab-pills label[for="step2"],
#step3:checked ~ .tab-pills label[for="step3"] {
  background: var(--action); border-color: var(--action); color: #ffffff;
}
.tab-panel {
  display: none; background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 1.5rem 1.75rem;
}
.tab-panel h3 { margin: 0 0 .4rem; font-size: 1.1rem; }
.tab-panel p { color: var(--text-secondary); margin: 0; }
#step1:checked ~ #panel1, #step2:checked ~ #panel2, #step3:checked ~ #panel3 { display: block; }
.how-cta { text-align: center; margin-top: 2rem; }

/* ---- Footer & cookie notice -------------------------------------------- */

.site-footer {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: 4rem; padding: 1.5rem 0 4.5rem; /* bottom clears the fixed cookie notice */
  border-top: 1px solid var(--border-subtle);
  font-size: .9rem; color: var(--text-secondary);
}

#cookie-notice {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--bg-surface); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle); color: var(--text-secondary);
  padding: .75rem max(1.25rem, env(safe-area-inset-right)) calc(.75rem + env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
  display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; justify-content: space-between;
}
/* The id selector above outranks the browser's [hidden]{display:none};
   this restores it at matching specificity. */
#cookie-notice[hidden] { display: none; }

/* ---- Focus & motion ------------------------------------------------------ */

/* Non-text UI only needs 3:1, which cyan clears in both themes. */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--brand-secondary); outline-offset: 3px;
}
#step1:focus-visible ~ .tab-pills label[for="step1"],
#step2:focus-visible ~ .tab-pills label[for="step2"],
#step3:focus-visible ~ .tab-pills label[for="step3"] {
  outline: 2px solid var(--brand-secondary); outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
  .eq span { animation: none; transform: scaleY(.6); }
}
