/* ============================================================
   M³ — MUSIC MERCH MARKETPLACE · Web App Design System
   app.musicmerchmarketplace.com
   Palette + type locked to M³ brand guidelines (Bible v23 §6)
   ============================================================ */

:root {
  --bg: #0a0a0a;
  --accent: #e8ff3a;
  --surface-dark: #111111;
  --surface-mid: #1a1a1a;
  --surface-light: #222222;
  --text: #ffffff;
  --text-2: #888888;
  --text-3: #555555;
  --green: #4ade80;
  --orange: #fb923c;
  --red: #f87171;
  --border: #232323;
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --nav-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: var(--font-body); cursor: pointer; }
input, select { font-family: var(--font-body); }

::selection { background: var(--accent); color: #000; }

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

/* ---------- Type utilities ---------- */

.display {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 400;
  line-height: 1;
}

.mono { font-family: var(--font-mono); }

.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 4px;
  font-size: 14px;
  color: var(--accent);
}

/* ---------- Layout ---------- */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(10,10,10,0.98) 60%, rgba(10,10,10,0.86));
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-brand img { width: 38px; height: 38px; }

.wordmark {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 1.5px;
  white-space: nowrap;
}
.wordmark .wm-merch { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1.5px;
  color: var(--text-2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: color .15s;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link.active { color: var(--accent); }

.nav-auth {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1.5px;
  background: var(--accent);
  color: #000;
  border: none;
  padding: 9px 18px 7px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: transform .12s;
  display: inline-block;
}
.nav-auth:hover { transform: translateY(-1px); }

/* Mobile nav: horizontal scroll links row under the bar */
.nav-links-mobile {
  display: none;
  overflow-x: auto;
  gap: 2px;
  padding: 0 12px 10px;
  scrollbar-width: none;
}
.nav-links-mobile::-webkit-scrollbar { display: none; }

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

.btn {
  font-family: var(--font-display);
  letter-spacing: 1.5px;
  font-size: 17px;
  border-radius: var(--radius-sm);
  padding: 12px 24px 10px;
  border: 1px solid var(--border);
  background: var(--surface-mid);
  color: var(--text);
  transition: transform .12s, border-color .15s, background .15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover { transform: translateY(-1px); border-color: var(--text-3); }

.btn-accent {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
}

/* ---------- Search ---------- */

.search-wrap {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  background: var(--surface-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  padding: 16px 54px 16px 20px;
  transition: border-color .15s, box-shadow .15s;
}
.search-input::placeholder { color: var(--text-3); }
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,255,58,0.12);
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 17px;
}

/* ---------- Hero ---------- */

.hero {
  padding: 72px 0 44px;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(52px, 9vw, 108px);
  letter-spacing: 2px;
  line-height: 0.95;
}
.hero h1 .accent { color: var(--accent); }

.hero-sub {
  color: var(--text-2);
  font-size: 17px;
  font-weight: 300;
  margin: 16px auto 34px;
  max-width: 520px;
}

.hero .search-wrap { max-width: 640px; margin: 0 auto; }
.hero .search-input { padding: 19px 60px 19px 24px; font-size: 17px; }

.hero-quicklinks {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.chip {
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface-dark);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 100px;
  transition: color .15s, border-color .15s;
}
.chip:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Stats strip (registry counter) ---------- */

.stats-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-dark);
}

.stats-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 20px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  text-align: center;
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 26px;
  color: var(--accent);
}

.stat-label {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--text-2);
  margin-top: 4px;
}

/* ---------- Sections ---------- */

.section { padding: 52px 0 8px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: 1.5px;
}
.section-title .accent { color: var(--accent); }

.see-all {
  font-family: var(--font-display);
  letter-spacing: 1.5px;
  font-size: 15px;
  color: var(--text-2);
  white-space: nowrap;
}
.see-all:hover { color: var(--accent); }

/* ---------- Listing cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.card {
  background: var(--surface-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s, border-color .15s;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-3px); border-color: var(--text-3); }

.card-img {
  aspect-ratio: 1;
  background: var(--surface-mid);
  position: relative;
  overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }

.card-img .no-img {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 40px;
  color: var(--text-3);
}

.card-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
}

.badge {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 4px 8px 2px;
  border-radius: 4px;
  background: rgba(10,10,10,0.85);
  color: var(--text);
  border: 1px solid var(--border);
}
.badge-signed { color: var(--accent); border-color: var(--accent); }

.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; }

.card-title {
  font-weight: 500;
  font-size: 14.5px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-artist {
  color: var(--text-2);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-price-row {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.card-price {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--accent);
}

.card-meta {
  font-size: 11.5px;
  color: var(--text-3);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* Registry serial footer — the M³ signature */
.card-serial {
  border-top: 1px dashed var(--border);
  margin-top: 10px;
  padding-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
}
.card-serial .serial-no { color: var(--text-2); }

/* ---------- Entity cards ---------- */

.entity-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 132px;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-light) transparent;
}

.entity-card { text-align: center; }

.entity-img {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: var(--surface-mid);
  border: 2px solid var(--border);
  margin: 0 auto 10px;
  overflow: hidden;
  transition: border-color .15s, transform .15s;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 34px;
  color: var(--text-3);
}
.entity-card:hover .entity-img { border-color: var(--accent); transform: translateY(-2px); }
.entity-img img { width: 100%; height: 100%; object-fit: cover; }

.entity-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entity-sub {
  font-size: 11.5px;
  color: var(--text-3);
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* ---------- Skeletons ---------- */

@keyframes pulse { 50% { opacity: 0.45; } }

.skeleton {
  background: var(--surface-mid);
  border-radius: var(--radius);
  animation: pulse 1.4s ease-in-out infinite;
}
.skeleton.sk-card { aspect-ratio: 1 / 1.42; }
.skeleton.sk-entity { width: 108px; height: 108px; border-radius: 50%; margin: 0 auto; }

/* ---------- Empty states ---------- */

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-2);
  padding: 40px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}

/* ---------- CTA band ---------- */

.cta-band {
  margin: 64px 0 0;
  border-top: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 120% at 50% 120%, rgba(232,255,58,0.09), transparent),
    var(--surface-dark);
  text-align: center;
  padding: 64px 20px;
}

.cta-band h2 {
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 56px);
  letter-spacing: 1.5px;
}
.cta-band h2 .accent { color: var(--accent); }

.cta-band p {
  color: var(--text-2);
  font-weight: 300;
  max-width: 460px;
  margin: 14px auto 28px;
}

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--border);
  padding: 34px 20px 44px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

footer .foot-wordmark {
  font-family: var(--font-display);
  letter-spacing: 2px;
  font-size: 18px;
  color: var(--text-2);
  margin-bottom: 8px;
}
footer .foot-wordmark span { color: var(--accent); }

footer a { color: var(--text-2); }
footer a:hover { color: var(--accent); }

.foot-links {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin: 10px 0 14px;
  flex-wrap: wrap;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .stats-inner { grid-template-columns: repeat(5, auto); overflow-x: auto; justify-content: space-between; }
  .stat-num { font-size: 21px; }
}

@media (max-width: 680px) {
  .nav-links { display: none; }
  .nav-links-mobile { display: flex; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 11px; }
  .hero { padding: 48px 0 36px; }
  .section { padding: 40px 0 4px; }
  .section-title { font-size: 27px; }
  .card-body { padding: 10px 11px 12px; }
  .stats-inner { padding: 16px 14px; gap: 18px; }
  .stat-label { font-size: 11px; letter-spacing: 1.5px; }
}

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

/* ============================================================
   v1.1 additions — browse filters, detail pages, registry
   ============================================================ */

.nav-auth { white-space: nowrap; }

/* ---------- Page header ---------- */
.page-head { padding: 40px 0 8px; }
.page-title { font-family: var(--font-display); font-size: clamp(38px, 6vw, 60px); letter-spacing: 1.5px; }
.page-title .accent { color: var(--accent); }
.page-sub { color: var(--text-2); font-weight: 300; margin-top: 8px; max-width: 640px; }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 18px 0 24px; align-items: center;
}
.filter-bar .search-wrap { flex: 1 1 260px; }
.filter-bar .search-input { padding: 12px 46px 12px 16px; font-size: 14.5px; }
.filter-bar .search-btn { width: 34px; height: 34px; font-size: 15px; }

.select {
  background: var(--surface-dark); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 14px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px;
}
.select:focus { outline: none; border-color: var(--accent); }

.result-count { font-family: var(--font-mono); font-size: 13px; color: var(--text-3); padding: 0 0 16px; }

.load-more { display: block; margin: 28px auto 0; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; padding: 16px 0 4px; flex-wrap: wrap; }
.tab {
  font-family: var(--font-display); letter-spacing: 1.5px; font-size: 17px;
  background: none; border: 1px solid var(--border); color: var(--text-2);
  border-radius: 100px; padding: 9px 20px 7px; transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent); color: #000; border-color: var(--accent); }

.entity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 18px 10px; padding-top: 14px; }

/* ---------- Detail pages ---------- */
.crumb { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); padding: 20px 0 0; }
.crumb a:hover { color: var(--accent); }

.detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 36px; padding: 24px 0 40px; }

.gallery-main {
  aspect-ratio: 1; background: var(--surface-dark); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; display: grid; place-items: center;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-main .no-img { font-size: 72px; color: var(--text-3); }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.gallery-thumbs img {
  width: 68px; height: 68px; object-fit: cover; border-radius: var(--radius-sm);
  border: 2px solid var(--border); cursor: pointer; opacity: .7; transition: all .15s;
}
.gallery-thumbs img.active, .gallery-thumbs img:hover { border-color: var(--accent); opacity: 1; }

.detail-title { font-family: var(--font-display); font-size: clamp(28px, 4vw, 42px); letter-spacing: 1px; line-height: 1.02; }
.detail-artist { color: var(--text-2); font-size: 15px; margin-top: 6px; }
.detail-artist a:hover { color: var(--accent); }

.price-panel {
  background: var(--surface-dark); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-top: 18px;
}
.price-big { font-family: var(--font-mono); font-size: 38px; color: var(--accent); line-height: 1; }
.price-note { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.price-panel .btn { width: 100%; justify-content: center; margin-top: 16px; }

.spec-table { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 14px; }
.spec-table td { padding: 10px 0; border-bottom: 1px solid var(--border); }
.spec-table td:first-child { color: var(--text-3); font-family: var(--font-mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: 1px; width: 40%; }

.detail-desc { color: var(--text-2); font-weight: 300; line-height: 1.65; margin-top: 18px; white-space: pre-line; }

.seller-card {
  display: flex; align-items: center; gap: 12px; margin-top: 20px;
  background: var(--surface-dark); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.seller-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-light); overflow: hidden; display: grid; place-items: center; font-family: var(--font-display); color: var(--text-3); }
.seller-avatar img { width: 100%; height: 100%; object-fit: cover; }
.seller-name { font-weight: 500; font-size: 14.5px; }
.seller-sub { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }

/* Registry serial hero on item pages */
.serial-plate {
  display: inline-block; font-family: var(--font-mono); font-size: 15px;
  color: var(--accent); background: rgba(232,255,58,0.07);
  border: 1px dashed rgba(232,255,58,0.45); border-radius: 6px;
  padding: 7px 14px; letter-spacing: 1px; margin-bottom: 14px;
}

/* Entity page header */
.entity-head { display: flex; align-items: center; gap: 22px; padding: 30px 0 8px; flex-wrap: wrap; }
.entity-head-img {
  width: 128px; height: 128px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  border: 3px solid var(--border); background: var(--surface-mid);
  display: grid; place-items: center; font-family: var(--font-display); font-size: 48px; color: var(--text-3);
}
.entity-head-img img { width: 100%; height: 100%; object-fit: cover; }
.entity-bio { color: var(--text-2); font-weight: 300; line-height: 1.65; max-width: 720px; padding: 12px 0 4px; }
.social-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0; }

/* ---------- Registry mission + CTA cards ---------- */
.mission {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: radial-gradient(ellipse 70% 130% at 50% -30%, rgba(232,255,58,0.07), transparent), var(--surface-dark);
  padding: 34px 30px; margin: 22px 0 8px;
}
.mission p { color: var(--text-2); font-weight: 300; line-height: 1.7; max-width: 760px; }
.mission p + p { margin-top: 12px; }
.mission strong { color: var(--text); font-weight: 500; }

.cta-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 22px 0 8px; }
.cta-card {
  background: var(--surface-dark); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 20px;
  transition: transform .15s, border-color .15s; display: block;
}
.cta-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.cta-card .cc-icon { font-size: 26px; }
.cta-card h3 { font-family: var(--font-display); letter-spacing: 1px; font-size: 21px; margin: 10px 0 6px; }
.cta-card p { color: var(--text-2); font-size: 13.5px; font-weight: 300; line-height: 1.55; }
.cta-card .cc-go { font-family: var(--font-display); letter-spacing: 1.5px; font-size: 14px; color: var(--accent); margin-top: 12px; display: inline-block; }

@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; gap: 24px; }
  .cta-cards { grid-template-columns: 1fr; }
}
