:root, [data-theme="dark"] {
  --bg: #0d0d0f;
  --surface: #141417;
  --surface-2: #1c1c21;
  --surface-3: #26262d;
  --border: rgba(255,255,255,0.09);
  --border-2: rgba(255,255,255,0.16);
  --text: #f4f4f5;
  --text-dim: rgba(244,244,245,0.56);
  --text-dimmer: rgba(244,244,245,0.32);
  --accent: #d4ff5c;
  --accent-ink: #11130a;
  --shadow: 0 18px 50px rgba(0,0,0,0.5);
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

[data-theme="light"] {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f0f0ed;
  --surface-3: #e6e6e2;
  --border: rgba(0,0,0,0.10);
  --border-2: rgba(0,0,0,0.17);
  --text: #15151a;
  --text-dim: rgba(21,21,26,0.58);
  --text-dimmer: rgba(21,21,26,0.40);
  --accent: #16161a;
  --accent-ink: #ffffff;
  --shadow: 0 18px 50px rgba(0,0,0,0.12);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: clip; } /* clip (not hidden) keeps position:sticky working */
::selection { background: var(--accent); color: var(--accent-ink); }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background .35s ease, color .35s ease;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 20px; }

@keyframes cueRise { from { transform: translateY(20px); } to { transform: none; } }
@keyframes cueRiseFade { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes cueModalIn { from { transform: translateY(34px) scale(.955); } to { transform: none; } }
@keyframes cueBlurIn { from { backdrop-filter: blur(2px); } to { backdrop-filter: blur(16px); } }
@keyframes cueEqBar { 0%, 100% { transform: scaleY(0.28); } 50% { transform: scaleY(1); } }
@keyframes cueGlow { 0%, 100% { opacity: .35; transform: scale(1); } 50% { opacity: .6; transform: scale(1.08); } }
@keyframes cueSpin { to { transform: rotate(360deg); } }

/* When #app is re-rendered in place (polls, menu toggles, filter tweaks, theme
   switch) we add .no-enter so the one-shot entrance animations don't replay and
   make the UI twitch. Continuous animations (cueGlow/cueEqBar/cueSpin) are not
   matched here, so they keep running. */
#app.no-enter [style*="cueRise"],
#app.no-enter [style*="cueModalIn"],
#app.no-enter [style*="cueBlurIn"] { animation: none !important; }

.card-hover { transition: .2s; }
.card-hover:hover { border-color: var(--border-2) !important; transform: translateY(-3px); box-shadow: var(--shadow); }
.tile-hover { transition: .22s; }
.tile-hover:hover { border-color: var(--accent) !important; transform: translateY(-4px); box-shadow: var(--shadow); }
.row-hover { transition: .2s; }
.row-hover:hover { border-color: var(--border-2) !important; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-accent { transition: .18s; }
.btn-accent:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost { transition: .18s; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-theme { transition: .18s; }
.btn-theme:hover { border-color: var(--border-2) !important; color: var(--text); }
.menu-item { transition: .14s; }
.menu-item:hover { background: var(--surface-2); }

input:focus, textarea:focus, select:focus { border-color: var(--accent) !important; outline: none; }

button { cursor: pointer; }
button, input, textarea, select { font-family: inherit; }

@media (max-width: 900px) {
  .dj-layout { grid-template-columns: 1fr !important; }
  .profile-layout { grid-template-columns: 1fr !important; }
  /* When columns stack, don't pin sidebars/filters — they should scroll with the page. */
  .col-sticky { position: static !important; top: auto !important; }
}
@media (max-width: 760px) {
  /* Top bar on a phone: drop the Find-DJs / Find-Gigs tabs onto their own row
     so the sign-in / account controls always stay on screen (no sideways scroll). */
  .app-nav { padding: 12px 16px !important; gap: 12px !important; flex-wrap: wrap !important; }
  .app-nav .nav-tabs { order: 10; width: 100%; margin-left: 0 !important; justify-content: center; }
  .app-nav .post-btn { display: none !important; } /* still reachable: account menu + gig board */
  .intro-nav { padding: 16px 18px !important; }
}

@media (max-width: 640px) {
  .dj-grid { grid-template-columns: 1fr !important; }
  .intro-tiles { grid-template-columns: 1fr !important; }
  .intro-h1 { font-size: 42px !important; }
  .post-2col { grid-template-columns: 1fr !important; }
  /* Use the full width of the phone — smaller side gutters on every page. */
  #app main { padding-left: 16px !important; padding-right: 16px !important; }
  /* Gig rows: shrink the poster + gaps so the title/details aren't crushed. */
  .gig-row { gap: 13px !important; padding: 13px !important; }
  .gig-poster { width: 92px !important; height: 122px !important; }
}

@media (max-width: 420px) {
  .intro-h1 { font-size: 34px !important; }
}

/* Standalone document pages: terms.html / privacy.html / refunds.html */
.legal-nav { display:flex; align-items:center; gap:9px; padding:22px 24px 0; max-width:760px; margin:0 auto; }
.legal { max-width:760px; margin:0 auto; padding:8px 24px 80px; }
.legal h1 { font-family:var(--font-display); font-weight:700; font-size:34px; letter-spacing:-0.03em; margin:18px 0 4px; }
.legal h2 { font-family:var(--font-display); font-weight:600; font-size:19px; margin:30px 0 8px; }
.legal p, .legal li { color:var(--text-dim); line-height:1.7; font-size:15px; }
.legal ul { padding-left:20px; }
.legal a { color:var(--accent); }
.legal strong { color:var(--text); }
.legal .doc-note { background:var(--surface); border:1px solid var(--accent); border-radius:12px; padding:14px 16px; font-size:13.5px; color:var(--text); margin:16px 0 8px; line-height:1.6; }
.legal .muted { color:var(--text-dimmer); font-size:13px; }
