/* =============================================================================
   lofi.nexhub.dev
   Eigenstaendiges Stylesheet. Keine Frameworks, kein CDN.

   Aufbau wie eine Musik-App: feste Seitenleiste links, eigener Scrollbereich
   rechts, durchgehende Abspielleiste unten. Das Theme ist nur dunkel, die Seite
   ist ein Nachtradio. Ein Akzent (Bernstein), eine Radius-Skala, wenige
   Bewegungen, und jede davon bildet etwas Echtes ab.
   ========================================================================== */

@font-face { font-family:'Geist'; src:url('/fonts/Geist-Regular.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face { font-family:'Geist'; src:url('/fonts/Geist-Medium.woff2') format('woff2'); font-weight:500; font-display:swap; }
@font-face { font-family:'Geist'; src:url('/fonts/Geist-SemiBold.woff2') format('woff2'); font-weight:600; font-display:swap; }
@font-face { font-family:'Geist Mono'; src:url('/fonts/GeistMono-Regular.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face { font-family:'Geist Mono'; src:url('/fonts/GeistMono-Medium.woff2') format('woff2'); font-weight:500; font-display:swap; }

:root {
  color-scheme: dark;

  --shell:     #08060a;   /* Rahmen und Seitenleiste */
  --bg:        #120d15;   /* Hauptflaeche */
  --bg-2:      #180f1b;
  --card:      #1b131f;
  --card-2:    #261b2c;
  --stroke:    rgba(255, 255, 255, 0.08);
  --stroke-2:  rgba(255, 255, 255, 0.16);

  --txt:       #f4eeeb;
  --txt-dim:   #b1a3ab;
  --txt-faint: #7c7180;

  /* Ein Akzent. Ueberall identisch. */
  --acc:       #e9a178;
  --acc-hi:    #f2b593;
  --acc-soft:  rgba(233, 161, 120, 0.13);
  --acc-line:  rgba(233, 161, 120, 0.30);
  --on-acc:    #23130b;   /* Kontrast 8.9:1 gegen --acc */

  --ok:        #6fcf9b;
  --warn:      #e6c07b;
  --danger:    #e57373;

  /* Eine Radius-Skala: Flaechen 12, Bilder 6, Interaktives pillenfoermig. */
  --r-lg: 12px;
  --r-sm: 6px;
  --r-pill: 999px;

  --sidebar-w: 248px;
  --player-h: 80px;
  --gap: 8px;

  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, Menlo, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t: 180ms var(--ease);

  --z-drawer: 60;
  --z-player: 70;
  --z-toast: 80;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--shell);
  color: var(--txt);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;              /* gescrollt wird nur im Hauptbereich */
  height: 100dvh;
}

a { color: inherit; text-decoration: none; }
img, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
::selection { background: var(--acc-soft); }

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

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--txt-dim); }
.faint { color: var(--txt-faint); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 20px; height: 20px; flex: none; fill: currentColor; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }

/* --- Grundgeruest ---------------------------------------------------------- */
/* Die Abspielleiste belegt erst Platz, wenn wirklich etwas laeuft. Sonst stuende
   dauerhaft ein schwarzer Balken am unteren Rand. */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: var(--gap);
  padding: var(--gap);
  height: 100dvh;
  transition: height 300ms var(--ease);
}
body.has-player .app { height: calc(100dvh - var(--player-h)); }

/* --- Seitenleiste ---------------------------------------------------------- */
.sidebar {
  display: flex; flex-direction: column; gap: var(--gap);
  min-height: 0;
}
.side-block { background: var(--bg); border-radius: var(--r-lg); padding: 14px 10px; }
.side-block.grow { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: 8px; }

.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 14px; font-weight: 600; letter-spacing: -0.02em; }
.brand svg { width: 26px; height: 26px; color: var(--acc); }
.brand b { color: var(--acc); font-weight: 600; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 12px; border-radius: var(--r-sm);
  color: var(--txt-dim); font-weight: 500; font-size: 0.94rem;
  transition: color var(--t), background var(--t);
}
.side-nav a:hover { color: var(--txt); background: rgba(255, 255, 255, 0.05); }
.side-nav a[aria-current='page'] { color: var(--txt); background: rgba(255, 255, 255, 0.08); }
.side-nav a[aria-current='page'] .icon { color: var(--acc); }

.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 12px 10px; color: var(--txt-faint);
  font-size: 0.82rem; font-weight: 500;
}
.side-list { overflow-y: auto; flex: 1; padding: 0 4px; display: flex; flex-direction: column; gap: 2px; }
.side-list a {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 8px; border-radius: var(--r-sm);
  color: var(--txt-dim); font-size: 0.88rem;
  transition: background var(--t), color var(--t);
}
.side-list a:hover { background: rgba(255, 255, 255, 0.05); color: var(--txt); }
.side-list .cover { width: 36px; height: 36px; border-radius: 4px; flex: none; }
.side-empty { padding: 12px; color: var(--txt-faint); font-size: 0.84rem; line-height: 1.5; }

/* Schmale Rollbalken, damit die Leiste ruhig bleibt. */
.side-list::-webkit-scrollbar, .content::-webkit-scrollbar { width: 10px; }
.side-list::-webkit-scrollbar-thumb, .content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box;
}
.content::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); background-clip: padding-box; }

/* --- Hauptbereich ---------------------------------------------------------- */
.content {
  position: relative;
  background: var(--bg);
  border-radius: var(--r-lg);
  overflow-y: auto; overflow-x: hidden;
  min-height: 0;
  scroll-behavior: smooth;
}
/* Farbschleier oben, aus der Seite heraus gesetzt. */
.content::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 340px;
  background: linear-gradient(to bottom, var(--tint, rgba(233, 161, 120, 0.16)), transparent);
  pointer-events: none;
}

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px;
  background: transparent;
  transition: background var(--t);
}
.topbar.is-stuck { background: rgba(18, 13, 21, 0.86); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); }
.topbar .spacer { flex: 1; }
.topbar-search { position: relative; flex: 0 1 320px; }
.topbar-search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--txt-faint); }
.topbar-search input { padding-left: 42px; }

.drawer-toggle { display: none; }

.page { position: relative; padding: 8px 24px 40px; }
.page-head { padding: 24px 0 30px; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; }
.page-head p { margin-top: 12px; color: var(--txt-dim); max-width: 62ch; }

.section { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { font-size: 1.4rem; font-weight: 600; letter-spacing: -0.025em; }
.section-head a { font-size: 0.84rem; color: var(--txt-faint); font-weight: 500; }
.section-head a:hover { color: var(--txt); text-decoration: underline; }

/* --- Kacheln --------------------------------------------------------------- */
.cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); }

.card {
  position: relative; text-align: left;
  padding: 14px; border-radius: var(--r-lg);
  background: var(--card);
  transition: background var(--t);
}
.card:hover { background: var(--card-2); }
.card-art { position: relative; border-radius: var(--r-sm); overflow: hidden; margin-bottom: 14px; }
.card-art .cover { aspect-ratio: 1 / 1; }
.card strong { display: block; font-weight: 500; letter-spacing: -0.01em; }
.card p { font-size: 0.82rem; color: var(--txt-faint); margin-top: 4px; line-height: 1.45; }

/* Der Abspielknopf faehrt beim Zeigen herein. Er meldet, was ein Klick tut. */
.card-play {
  position: absolute; right: 10px; bottom: 10px;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--acc); color: var(--on-acc);
  box-shadow: 0 8px 22px -6px rgba(0, 0, 0, 0.7);
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--t), transform var(--t), background var(--t);
}
.card:hover .card-play, .card:focus-within .card-play { opacity: 1; transform: translateY(0); }
.card-play:hover { background: var(--acc-hi); }
.card[aria-pressed='true'] .card-play { opacity: 1; transform: translateY(0); }

/* --- Schaltflaechen -------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 22px; border-radius: var(--r-pill);
  font-weight: 500; font-size: 0.93rem; white-space: nowrap;
  border: 1px solid transparent;
  transition: transform 110ms var(--ease), background var(--t), border-color var(--t), color var(--t);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--acc); color: var(--on-acc); font-weight: 600; }
.btn-primary:hover { background: var(--acc-hi); }
.btn-ghost { border-color: var(--stroke-2); color: var(--txt); }
.btn-ghost:hover { border-color: var(--acc-line); background: var(--acc-soft); }
.btn-quiet { color: var(--txt-dim); padding: 9px 14px; }
.btn-quiet:hover { color: var(--txt); background: rgba(255, 255, 255, 0.06); }
.btn-danger { color: var(--danger); border-color: rgba(229, 115, 115, 0.35); }
.btn-danger:hover { background: rgba(229, 115, 115, 0.12); }
.btn[disabled] { opacity: 0.42; pointer-events: none; }
.btn-sm { padding: 8px 15px; font-size: 0.86rem; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; color: var(--txt-faint);
  transition: color var(--t), background var(--t), transform 110ms var(--ease);
}
.icon-btn:hover { color: var(--txt); background: rgba(255, 255, 255, 0.07); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn[aria-pressed='true'] { color: var(--acc); }

.panel { background: var(--card); border: 1px solid var(--stroke); border-radius: var(--r-lg); }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--stroke);
  font-size: 0.76rem; color: var(--txt-dim); font-family: var(--mono);
}
.tag-acc { background: var(--acc-soft); border-color: var(--acc-line); color: var(--acc); }

/* --- Auswahl-Chips --------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--r-pill);
  border: 1px solid var(--stroke-2); color: var(--txt-dim);
  font-size: 0.89rem; font-weight: 500; transition: all var(--t);
}
.chip:hover { color: var(--txt); border-color: var(--acc-line); }
.chip[aria-pressed='true'] { background: var(--acc-soft); border-color: var(--acc-line); color: var(--acc); }
.chip .icon-sm { opacity: 0; width: 0; transition: opacity var(--t), width var(--t); }
.chip[aria-pressed='true'] .icon-sm { opacity: 1; width: 16px; }

/* --- Cover ----------------------------------------------------------------- */
.cover { position: relative; overflow: hidden; background: var(--bg-2); border-radius: inherit; }
.cover canvas { width: 100%; height: 100%; display: block; }
.cover-sq { aspect-ratio: 1 / 1; }

/* --- Titelliste ------------------------------------------------------------ */
.tracklist { display: flex; flex-direction: column; }
.track {
  display: grid; align-items: center; gap: 14px;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  padding: 9px 10px; border-radius: var(--r-sm);
  transition: background var(--t);
}
.track:hover { background: rgba(255, 255, 255, 0.05); }
.track-art { width: 44px; height: 44px; border-radius: 4px; overflow: hidden; }
.track-main { min-width: 0; }
.track-main a { font-weight: 500; }
.track-main a:hover { text-decoration: underline; }
.track-sub { font-size: 0.77rem; color: var(--txt-faint); font-family: var(--mono); }
.track-actions { display: flex; align-items: center; gap: 2px; }
.track.is-playing .track-main a { color: var(--acc); }

/* --- Buehne (Visualizer) ---------------------------------------------------- */
.stage {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--stroke);
  background: radial-gradient(120% 90% at 50% 0%, rgba(233, 161, 120, 0.07), transparent 70%), var(--bg-2);
}
.stage canvas.viz { width: 100%; aspect-ratio: 16 / 4.2; display: block; }
@media (max-width: 700px) { .stage canvas.viz { aspect-ratio: 16 / 7; } }
.stage-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: linear-gradient(to top, rgba(18, 13, 21, 0.95), transparent);
}
.stage-bar .cover { width: 44px; height: 44px; border-radius: 6px; flex: none; }
.stage-meta { min-width: 0; }
.stage-meta strong { display: block; font-weight: 500; font-size: 0.95rem; }
.stage-meta span { font-size: 0.78rem; color: var(--txt-faint); font-family: var(--mono); }

/* Live-Punkt: der einzige farbige Punkt der Seite, und er meldet echten Zustand. */
.live { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--txt-faint); }
.live::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(111, 207, 155, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(111, 207, 155, 0); }
  100% { box-shadow: 0 0 0 0 rgba(111, 207, 155, 0); }
}

/* --- Formulare ------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 0.87rem; font-weight: 500; }
.field .hint { font-size: 0.79rem; color: var(--txt-dim); }
.field .err { font-size: 0.82rem; color: var(--danger); }
input[type='text'], input[type='password'], input[type='search'], select {
  width: 100%; padding: 12px 15px; min-height: 46px;
  background: var(--bg-2); border: 1px solid var(--stroke-2);
  border-radius: var(--r-sm); color: var(--txt);
  transition: border-color var(--t), background var(--t);
}
input::placeholder { color: var(--txt-faint); }
input:focus, select:focus { outline: none; border-color: var(--acc); background: var(--card); }

.copyline { display: flex; gap: 8px; }
.copyline input { flex: 1; font-family: var(--mono); font-size: 0.83rem; background: var(--shell); border-color: var(--stroke); }

/* --- Hinweise, leere Zustaende --------------------------------------------- */
.notice { display: flex; gap: 13px; align-items: flex-start; padding: 15px 17px; border-radius: var(--r-lg); border: 1px solid var(--stroke); background: var(--card); }
.notice .icon { color: var(--warn); margin-top: 2px; }
.notice p { font-size: 0.9rem; color: var(--txt-dim); }
.notice strong { color: var(--txt); font-weight: 500; display: block; margin-bottom: 2px; }
.notice-warn { border-color: rgba(230, 192, 123, 0.3); background: rgba(230, 192, 123, 0.06); }

.empty { text-align: center; padding: 56px 20px; }
.empty .icon { width: 34px; height: 34px; color: var(--txt-faint); margin: 0 auto 14px; }
.empty p { color: var(--txt-dim); max-width: 42ch; margin: 0 auto; }
.empty .btn { margin-top: 20px; }

.skeleton {
  background: linear-gradient(90deg, var(--card) 25%, var(--card-2) 50%, var(--card) 75%);
  background-size: 220% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r-sm);
}
@keyframes shimmer { to { background-position: -220% 0; } }

/* --- Abspielleiste --------------------------------------------------------- */
.playbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-player);
  height: var(--player-h);
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: 16px; padding: 0 16px;
  background: var(--shell);
  border-top: 1px solid var(--stroke);
  transform: translateY(100%);
  transition: transform 300ms var(--ease);
}
.playbar.is-open { transform: translateY(0); }
.playbar-now { display: flex; align-items: center; gap: 13px; min-width: 0; }
.playbar-art { width: 52px; height: 52px; border-radius: var(--r-sm); overflow: hidden; flex: none; background: var(--card); }
.playbar-meta { min-width: 0; }
.playbar-meta strong { display: block; font-size: 0.9rem; font-weight: 500; }
.playbar-meta span { font-size: 0.76rem; color: var(--txt-faint); font-family: var(--mono); }
.playbar-controls { display: flex; align-items: center; gap: 8px; justify-self: center; }
.playbar-big {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--acc); color: var(--on-acc);
  transition: transform 110ms var(--ease), background var(--t);
}
.playbar-big:hover { background: var(--acc-hi); transform: scale(1.05); }
.playbar-big:active { transform: scale(0.95); }
.playbar-right { display: flex; align-items: center; gap: 8px; justify-self: end; }
.playbar-right input[type='range'] { width: 96px; accent-color: var(--acc); }

@media (max-width: 820px) {
  .playbar { grid-template-columns: minmax(0, 1fr) auto; }
  .playbar-right { display: none; }
}

/* --- Toast ----------------------------------------------------------------- */
.toasts { position: fixed; bottom: 16px; transition: bottom 300ms var(--ease); left: 50%; transform: translateX(-50%); z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 17px; border-radius: var(--r-pill);
  background: var(--card-2); border: 1px solid var(--stroke-2); font-size: 0.88rem;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9);
  animation: toast-in 240ms var(--ease);
}
.toast .icon-sm { color: var(--ok); }
.toast.is-error .icon-sm { color: var(--danger); }
body.has-player .toasts { bottom: calc(var(--player-h) + 16px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* --- Fliesstext ------------------------------------------------------------- */
.prose { max-width: 70ch; }
.prose h2 { font-size: 1.26rem; font-weight: 600; letter-spacing: -0.02em; margin: 40px 0 12px; }
.prose h3 { font-size: 1rem; font-weight: 600; margin: 24px 0 8px; }
.prose p, .prose li { color: var(--txt-dim); }
.prose p { margin-bottom: 14px; }
.prose ul, .prose ol { margin: 0 0 16px 20px; display: flex; flex-direction: column; gap: 7px; }
.prose a { color: var(--acc); text-decoration: underline; text-underline-offset: 3px; }
.prose code { font-family: var(--mono); font-size: 0.86em; background: var(--shell); border: 1px solid var(--stroke); padding: 2px 6px; border-radius: 5px; color: var(--txt); }
.prose pre { background: var(--shell); border: 1px solid var(--stroke); border-radius: var(--r-sm); padding: 15px 17px; overflow-x: auto; margin-bottom: 16px; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose address { font-style: normal; color: var(--txt-dim); }
.prose .lead { font-size: 1.04rem; }

/* Schrittnummern sind echte Information (Reihenfolge), kein dekoratives Label. */
.steps { counter-reset: step; list-style: none; margin-left: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 44px; padding-bottom: 18px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--acc-soft); border: 1px solid var(--acc-line);
  color: var(--acc); font-family: var(--mono); font-size: 0.8rem;
}

.footnote { margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--stroke); display: flex; flex-wrap: wrap; gap: 18px; }
.footnote a { color: var(--txt-faint); font-size: 0.85rem; }
.footnote a:hover { color: var(--acc); }

/* --- Schmale Fenster -------------------------------------------------------- */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; height: calc(100dvh - var(--player-h)); }
  .content { border-radius: 0; }
  .drawer-toggle { display: grid; }

  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 84vw);
    z-index: var(--z-drawer); padding: var(--gap);
    background: var(--shell);
    transform: translateX(-100%);
    transition: transform 260ms var(--ease);
  }
  .sidebar.is-open { transform: translateX(0); }
  .scrim {
    position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1);
    background: rgba(0, 0, 0, 0.6); opacity: 0; pointer-events: none;
    transition: opacity 260ms var(--ease);
  }
  .scrim.is-open { opacity: 1; pointer-events: auto; }
  .page { padding: 8px 16px 40px; }
  .topbar { padding: 12px 16px; }
}

/* --- Bewegung: Inhalt ist ohne JavaScript sichtbar ------------------------- */
.rise { animation: rise 560ms var(--ease) both; }
.rise-2 { animation-delay: 70ms; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

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