:root {
  --bg: #0d0f12;
  --surface: #16191f;
  --surface-2: #1e222a;
  --border: #262b34;
  --text: #f2f4f7;
  --muted: #98a2b3;
  --accent: #ffb020;
  --accent-ink: #1a1200;
  --radius: 14px;
  --max: 620px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --surface-2: #f0f2f5;
    --border: #e3e7ed;
    --text: #14181f;
    --muted: #667085;
    --accent: #b26b00;
    --accent-ink: #ffffff;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.hero {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 20px 4px;
  text-align: center;
}
.hero h1 {
  margin: 0 0 4px;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.hero p { margin: 0; color: var(--muted); font-size: 14px; }

.menu { position: relative; display: inline-flex; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.brand {
  font: inherit;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  background: none;
  border: 0;
  padding: 0;
  color: var(--text);
  cursor: pointer;
}
.brand span { color: var(--accent); }

.menu-panel {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  min-width: 240px;
  max-width: min(320px, 90vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  padding: 8px;
  z-index: 30;
}
/* .menu-panel sets its own `display`, which otherwise beats the browser's default
   [hidden] rule — same fix as .btn[hidden] above, same reason. */
.menu-panel[hidden] { display: none; }
.menu-panel-right { left: auto; right: 0; }

.menu-section + .menu-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.menu-panel a,
.menu-panel button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.menu-panel a:hover,
.menu-panel button:hover { background: var(--surface-2); }

.account { display: flex; align-items: center; }
.account-trigger {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.account-trigger img { width: 100%; height: 100%; object-fit: cover; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
/* .btn sets its own `display`, which otherwise beats the browser's default [hidden]
   rule (author styles win over the user-agent stylesheet regardless of specificity). */
.btn[hidden] { display: none; }
.btn:hover { filter: brightness(1.08); }

.categories {
  position: sticky;
  top: 53px;
  z-index: 19;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  /* Stays a full-width element (so border-bottom spans edge to edge) while the extra
     side padding pushes the chips inward to line up with .feed's 1400px column once
     the viewport is wide enough — a fixed max-width here would clip the border short. */
  padding-left: max(16px, calc(50% - 700px + 16px));
  padding-right: max(16px, calc(50% - 700px + 16px));
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.categories::-webkit-scrollbar { display: none; }
.categories[hidden] { display: none; }

/* Nested inside the brand dropdown now, not its own row — see .menu-panel above. */
.region-picker[hidden] { display: none; }
.region-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

.mix-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 20px;
  color: var(--muted);
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.mix-banner a { color: var(--accent); font-weight: 600; }

.ad-slot {
  grid-column: 1 / -1;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.chip-icon { flex-shrink: 0; }
.chip[aria-pressed='true'] {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
}

.feed {
  /* auto-fill + minmax reflows from 1 column on mobile up to several on wide screens,
     with no explicit breakpoint needed — the browser just fits as many 340px+ columns
     as the viewport allows. Grid (not CSS columns) is deliberate: appending new cards
     during infinite scroll must never reshuffle cards already on screen, which multi-
     column layout does when it rebalances; grid never moves placed items. */
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
}
.card-mentor {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.follow-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.follow-btn[data-following='true'] {
  color: var(--accent);
  border-color: var(--accent);
}

.save-btn {
  flex-shrink: 0;
  border: 0;
  background: none;
  padding: 4px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
}
.save-btn:hover { color: var(--accent); }
.save-btn[data-saved='true'] { color: var(--accent); }

.share-btn {
  flex-shrink: 0;
  border: 0;
  background: none;
  padding: 4px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
}
.share-btn:hover { color: var(--accent); }
.share-btn.copied { color: var(--accent); }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}
.mentor-name { font-weight: 650; font-size: 15px; }
.verified { color: var(--accent); font-size: 13px; }
.published { margin-left: auto; color: var(--muted); font-size: 13px; }

.media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  cursor: pointer;
}
.media img,
.media iframe {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  display: block;
}
.media .play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.media .play::after {
  content: '';
  grid-area: 1 / 1;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.media .play span {
  /* Same grid cell as the circle, but painted above it. */
  grid-area: 1 / 1;
  place-self: center;
  z-index: 1;
  color: #fff;
  font-size: 22px;
  transform: translateX(2px);
}

.card-body { padding: 14px; display: grid; gap: 8px; }
.title { margin: 0; font-size: 16px; line-height: 1.35; font-weight: 650; }
.description { margin: 0; color: var(--muted); font-size: 14px; }
.source { color: var(--muted); font-size: 13px; }
.source:hover { color: var(--accent); }

.wall {
  max-width: var(--max);
  margin: 8px auto 60px;
  padding: 28px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.wall h2 { margin: 0 0 6px; font-size: 20px; }
.wall p { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.wall .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.profile {
  max-width: var(--max);
  margin: 32px auto;
  padding: 28px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.profile .avatar-lg {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  margin: 0 auto 16px;
  display: block;
}
.profile h1 { margin: 0 0 4px; font-size: 20px; }
.profile .email { margin: 0 0 4px; color: var(--muted); font-size: 15px; }
.profile .since { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.profile .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.mixes-panel {
  max-width: var(--max);
  margin: 0 auto 32px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.mixes-panel h2 { margin: 0 0 8px; font-size: 17px; }
.mixes-panel .mixes-hint { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.mixes-panel .mixes-hint a { color: var(--accent); }
.mixes-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.mixes-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 10px;
}
.mixes-list a { font-size: 14px; font-weight: 600; }
#mix-form { display: flex; gap: 8px; flex-wrap: wrap; }
#mix-form input {
  flex: 1;
  min-width: 140px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.mentor-header {
  max-width: var(--max);
  margin: 24px auto;
  padding: 28px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.mentor-header .avatar-lg {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  margin: 0 auto 16px;
  display: block;
}
.mentor-header h1 { margin: 0 0 6px; font-size: 22px; }
.mentor-header .verified {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.mentor-header .tagline { margin: 0 0 20px; color: var(--muted); font-size: 15px; }
.mentor-header .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.mentor-header .follow-btn { font-size: 14px; padding: 8px 16px; }
.mentor-header .resources {
  list-style: none;
  margin: 20px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mentor-header .resources a { color: var(--accent); font-size: 14px; }
.mentor-header .resources a:hover { text-decoration: underline; }
.mentor-header .resources[hidden] { display: none; }

.loading,
.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
/* .empty renders as a grid child of .feed — without this it would only take one
   column's width instead of spanning the row. */
.empty { grid-column: 1 / -1; }

.sentinel { height: 1px; }

.list-actions {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.list-actions h1 { margin: 0; font-size: 20px; }
.list-actions-buttons { display: flex; align-items: center; gap: 8px; }

footer.legal {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 16px 48px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
footer.legal a { text-decoration: underline; text-underline-offset: 2px; }
footer.legal a:hover { color: var(--accent); }
footer.legal span { margin: 0 8px; }

.doc {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 16px 24px;
}
.doc h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -0.01em; }
.doc .updated { color: var(--muted); font-size: 13px; margin: 0 0 28px; }
.doc h2 { font-size: 17px; margin: 28px 0 10px; }
.doc p { margin: 0 0 14px; color: var(--text); font-size: 15px; line-height: 1.6; }
.doc ul, .doc ol { margin: 0 0 14px; padding-left: 22px; color: var(--text); font-size: 15px; line-height: 1.6; }
.doc li { margin-bottom: 6px; }
.doc a { color: var(--accent); }
.doc .placeholder {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px dashed var(--accent);
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 0.95em;
}
.doc .callout {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--muted);
}
.doc .back { display: inline-block; margin-bottom: 8px; color: var(--muted); font-size: 14px; }
