/* Nyquist hi-fi tokens — warm paper, editorial. Ported from the design source. */

:root {
  --paper:        #F7F2E8;
  --paper-2:      #F1EADC;
  --paper-3:      #E9DFCB;
  --ink:          #1F1B16;
  --ink-2:        #4D463C;
  --ink-3:        #6B6358;
  --ink-4:        #948B7C;
  --hairline:     #E4DCC9;
  --hairline-2:   #D6CBB1;

  --accent:       #E26D5A;
  --accent-2:     #C8503D;
  --accent-soft:  #F4D7D0;
  --accent-ink:   #FFFFFF;

  --serif:  'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:   'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --d-pad: 24px;
  --d-row: 12px;
  --d-gap: 18px;
  --d-section: 40px;
  --d-card: 16px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 22px;

  --shadow-1: 0 1px 0 rgba(31,27,22,0.04), 0 1px 2px rgba(31,27,22,0.06);
  --shadow-2: 0 2px 6px rgba(31,27,22,0.08), 0 8px 24px rgba(31,27,22,0.06);
  --shadow-art: 0 1px 2px rgba(31,27,22,0.10), 0 12px 32px rgba(31,27,22,0.10);
}

[data-density="1"] { --d-pad: 14px; --d-row: 6px;  --d-gap: 10px; --d-section: 22px; --d-card: 10px; }
[data-density="2"] { --d-pad: 18px; --d-row: 8px;  --d-gap: 14px; --d-section: 30px; --d-card: 12px; }
[data-density="3"] { --d-pad: 24px; --d-row: 12px; --d-gap: 18px; --d-section: 40px; --d-card: 16px; }
[data-density="4"] { --d-pad: 30px; --d-row: 14px; --d-gap: 22px; --d-section: 52px; --d-card: 20px; }
[data-density="5"] { --d-pad: 38px; --d-row: 16px; --d-gap: 28px; --d-section: 64px; --d-card: 24px; }

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

.hf-display { font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; }
.hf-mono    { font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em; color: var(--ink-3); text-transform: uppercase; }
.hf-meta    { font-family: var(--sans); font-size: 12px; color: var(--ink-3); }

/* Buttons */
.hf-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 500; font-size: 13px;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms, transform 120ms;
  text-decoration: none;
}
.hf-btn:hover { background: var(--paper-3); }
.hf-btn:active { transform: scale(0.985); }
.hf-btn-primary { background: var(--accent); color: var(--accent-ink); }
.hf-btn-primary:hover { background: var(--accent-2); }
.hf-btn-ghost { background: transparent; color: var(--ink-2); }
.hf-btn-ghost:hover { background: var(--paper-2); color: var(--ink); }
.hf-btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; }
.hf-btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* Chips */
.hf-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: background 120ms, color 120ms;
  border: none;
  text-decoration: none;
}
.hf-chip:hover { background: var(--paper-3); color: var(--ink); }
.hf-chip-active { background: var(--ink); color: var(--paper); }
.hf-chip-active:hover { background: var(--ink); color: var(--paper); }

/* Input */
.hf-input {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--paper-2);
  border-radius: 999px;
  color: var(--ink-3);
  font-size: 13px;
  width: 100%;
  border: 1px solid transparent;
  transition: background 120ms, border-color 120ms;
}
.hf-input:focus-within, .hf-input.focused {
  background: var(--paper);
  border-color: var(--hairline-2);
  color: var(--ink);
}
.hf-input input {
  border: none; outline: none; background: transparent;
  font: inherit; color: inherit;
  flex: 1; min-width: 0;
}

.hf-card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  transition: background 120ms, border-color 120ms, transform 120ms;
}
.hf-card-hover:hover { background: var(--paper-2); }

/* Track row */
.hf-track {
  display: grid;
  grid-template-columns: 28px 40px 1fr 1.2fr 1fr 60px 28px;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 120ms;
}
.hf-track:hover { background: var(--paper-2); }
.hf-track-now { background: color-mix(in oklab, var(--accent) 12%, transparent); }
.hf-track-now:hover { background: color-mix(in oklab, var(--accent) 16%, transparent); }
.hf-track-num { font-family: var(--mono); font-size: 12px; color: var(--ink-3); text-align: right; }
.hf-track-title { font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-track-sub { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-track-now .hf-track-title { color: var(--accent-2); }
.hf-track-heart { color: var(--ink-4); font-size: 14px; cursor: pointer; background: none; border: none; padding: 0; display: inline-flex; }
.hf-track-heart-on { color: var(--accent); }

.hf-track-condensed { grid-template-columns: 28px 40px 1fr 1.2fr 60px 28px; }

/* Sidebar nav */
.hf-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 12px;
  border-radius: var(--r-md);
  color: var(--ink-2);
  cursor: pointer;
  font-size: 13px; font-weight: 500;
  transition: background 120ms, color 120ms;
}
.hf-nav-item:hover { background: var(--paper-2); color: var(--ink); }
.hf-nav-item-active { background: var(--paper-3); color: var(--ink); }
.hf-nav-icon { width: 18px; height: 18px; opacity: 0.7; display: inline-flex; align-items: center; justify-content: center; }
.hf-nav-item-active .hf-nav-icon { opacity: 1; }

.hf-hr { border: none; border-top: 1px solid var(--hairline); margin: 0; }

.hf-scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: var(--hairline-2) transparent; }
.hf-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.hf-scroll::-webkit-scrollbar-thumb { background: var(--hairline-2); border-radius: 999px; }
.hf-scroll::-webkit-scrollbar-track { background: transparent; }

/* Album / playlist art */
.hf-art {
  border-radius: var(--r-md);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-art);
}
.hf-art-flat { box-shadow: none; }
.hf-art-grain {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence baseFrequency='1.2' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-repeat: repeat;
  mix-blend-mode: overlay;
  opacity: 0.75;
  pointer-events: none;
}
.hf-art-label {
  position: absolute; left: 10px; bottom: 8px; right: 10px;
  color: rgba(255,255,255,0.92);
  font-family: var(--serif); font-weight: 600;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
  letter-spacing: -0.01em;
  pointer-events: none;
}

.hf-section-h {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px;
  margin-bottom: var(--d-card);
}
.hf-section-title {
  font-family: var(--serif);
  font-size: 26px; line-height: 1.1; font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
}
.hf-section-link { font-size: 12px; color: var(--ink-3); cursor: pointer; }
.hf-section-link:hover { color: var(--ink); }

/* Now playing bar */
.hf-nowbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 10px 18px;
  background: var(--paper);
  border-top: 1px solid var(--hairline);
}
.hf-nowbar-track { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hf-nowbar-controls { display: flex; align-items: center; gap: 14px; flex-direction: column; }
.hf-nowbar-meta { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }

.hf-progress { display: flex; align-items: center; gap: 10px; width: 360px; }
.hf-progress-track {
  flex: 1; height: 3px; border-radius: 999px;
  background: var(--paper-3);
  overflow: hidden; position: relative;
  cursor: pointer;
}
.hf-progress-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--ink);
  border-radius: 999px;
  transition: width 80ms linear;
}

.hf-vol { display: flex; align-items: center; gap: 8px; width: 110px; }
.hf-vol-track {
  flex: 1; height: 3px; border-radius: 999px;
  background: var(--paper-3);
  overflow: hidden; position: relative;
  cursor: pointer;
}
.hf-vol-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink-2); border-radius: 999px; }

.hf-play-fab {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(226,109,90,0.35);
  cursor: pointer;
  transition: transform 140ms;
  border: none;
}
.hf-play-fab:hover { transform: scale(1.06); }
.hf-play-fab svg { width: 14px; height: 14px; fill: currentColor; }
.hf-play-fab-lg { width: 52px; height: 52px; }
.hf-play-fab-lg svg { width: 18px; height: 18px; }

.hf-art-hover-play { position: absolute; right: 8px; bottom: 8px; opacity: 0; transform: translateY(4px); transition: opacity 160ms, transform 160ms; }
.hf-card-hover:hover .hf-art-hover-play, .hf-tile:hover .hf-art-hover-play { opacity: 1; transform: translateY(0); }

.hf-tile {
  display: flex; flex-direction: column; gap: 10px;
  cursor: pointer;
  padding: 10px;
  border-radius: var(--r-lg);
  transition: background 120ms;
  text-decoration: none;
  color: inherit;
}
.hf-tile:hover { background: var(--paper-2); }
.hf-tile-title { font-weight: 600; font-size: 14px; line-height: 1.3; color: var(--ink); }
.hf-tile-sub { font-size: 12px; color: var(--ink-3); }

.hf-topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: color-mix(in oklab, var(--paper) 80%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; z-index: 5;
}

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

.hf-grid-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }

.hf-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  background: var(--paper-2);
  border-radius: 999px;
  font-size: 11px; color: var(--ink-3);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Now playing fullscreen */
.hf-np-stage { background: var(--paper); color: var(--ink); position: relative; overflow: hidden; }
.hf-np-art { border-radius: var(--r-xl); box-shadow: 0 30px 80px rgba(31,27,22,0.18), 0 8px 28px rgba(31,27,22,0.10); }
.hf-lyric-line {
  font-family: var(--serif);
  font-size: 28px; line-height: 1.3;
  font-weight: 500;
  color: var(--ink-4);
  letter-spacing: -0.01em;
  transition: color 220ms;
}
.hf-lyric-line.active { color: var(--ink); }
.hf-lyric-line.passed { color: var(--ink-4); opacity: 0.55; }

/* Layout shells */
.hf-shell {
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100vh;
  overflow: hidden;
}
.hf-shell-body { display: flex; min-height: 0; }
.hf-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hf-main-scroll { flex: 1; padding: var(--d-pad) calc(var(--d-pad) + 4px); }

.hf-sidebar {
  width: 248px;
  border-right: 1px solid var(--hairline);
  padding: 20px 14px 14px;
  display: flex; flex-direction: column; gap: 18px;
  background: var(--paper);
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;
}

.hf-brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--ink); color: var(--paper);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-size: 16px;
}
.hf-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.78 0.10 36), oklch(0.55 0.09 12));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px;
}

/* Forms */
.hf-form { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.hf-form label { font-size: 12px; color: var(--ink-3); font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.04em; }
.hf-form input[type="text"], .hf-form textarea, .hf-form input[type="file"] {
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 10px 12px;
  background: var(--paper);
  font: inherit; color: inherit;
}
.hf-form textarea { min-height: 60px; resize: vertical; }
.hf-form input:focus, .hf-form textarea:focus { outline: none; border-color: var(--ink); }
