/* ============================================================
   MIND MATTER — Closet3D (additive demo layer)
   Single clean display platform + browser. All classes c3d-.
   ============================================================ */

/* ---------- Shared buttons ---------- */
.c3d-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.c3d-btn:hover { transform: translateY(-1px); }
.c3d-btn:active { transform: translateY(0); }
.c3d-btn-gold {
  background: linear-gradient(135deg, #f0c86a, #d9a441 60%, #c08a2e);
  color: #14151a;
  box-shadow: 0 2px 14px rgba(217, 164, 65, 0.35);
}
.c3d-btn-gold:hover { box-shadow: 0 4px 22px rgba(217, 164, 65, 0.5); }
.c3d-btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: #cfd2dc;
  border-color: rgba(255, 255, 255, 0.16);
}
.c3d-btn-ghost:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
.c3d-btn-sm { padding: 7px 13px; font-size: 11.5px; }

/* ============================================================
   Overlay — one still platform
   ============================================================ */
#c3dRoot {
  position: fixed; inset: 0; z-index: 10000;
  font-family: 'Space Grotesk', sans-serif;
  display: none;
}
#c3dRoot.open { display: block; }
#c3dStage {
  position: absolute; inset: 0;
  background:
    radial-gradient(1100px 500px at 50% 20%, rgba(217, 164, 65, 0.09), transparent 60%),
    radial-gradient(900px 460px at 50% 118%, rgba(255, 45, 111, 0.07), transparent 55%),
    linear-gradient(180deg, #111216, #0b0c0f);
  cursor: grab;
}
#c3dStage:active { cursor: grabbing; }
#c3dStage canvas { display: block; }

.c3d-hud { position: absolute; inset: 0; pointer-events: none; }
.c3d-hud > * { pointer-events: auto; }

.c3d-topbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 22px;
  background: linear-gradient(to bottom, rgba(8, 8, 12, 0.9), rgba(8, 8, 12, 0));
}
.c3d-brand {
  font-family: 'Cinzel', serif;
  font-size: 13px; letter-spacing: 0.22em;
  color: #d9a441;
  white-space: nowrap;
}
.c3d-brand b { color: #f4f0e6; font-weight: 700; }
.c3d-count {
  font-family: 'Space Mono', monospace;
  font-size: 11px; color: rgba(244, 240, 230, 0.55);
  margin-right: auto;
}
.c3d-modes { display: flex; gap: 4px; padding: 3px; background: rgba(255, 255, 255, 0.06); border-radius: 6px; }
.c3d-mode {
  font-family: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  color: #b9bcc7; background: transparent; border: 0; border-radius: 4px;
  padding: 6px 12px; cursor: pointer;
}
.c3d-mode.on { background: rgba(217, 164, 65, 0.18); color: #f0c86a; }
.c3d-help {
  width: auto; height: auto;
  padding: 8px 14px; border-radius: 5px;
  border: 1px solid rgba(217, 164, 65, 0.5); background: rgba(217, 164, 65, 0.12);
  color: #f0c86a; font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: 0.06em; cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.c3d-help:hover { background: rgba(217, 164, 65, 0.28); transform: scale(1.06); }
.c3d-exit {
  font-family: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  color: #e7e4da; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px; padding: 8px 14px; cursor: pointer;
  transition: background 0.2s ease;
}
.c3d-exit:hover { background: rgba(255, 255, 255, 0.14); }

/* Return to Profile — creator-only escape hatch back to the artist's page */
.c3d-profile {
  font-family: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  color: #f0c86a; background: rgba(217, 164, 65, 0.12);
  border: 1px solid rgba(217, 164, 65, 0.45); border-radius: 5px;
  padding: 8px 14px; cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.c3d-profile:hover { background: rgba(217, 164, 65, 0.26); box-shadow: 0 0 16px rgba(217, 164, 65, 0.25); }

/* Keep the topbar tidy when brand + modes + profile + exit crowd narrow widths */
@media (max-width: 760px) {
  .c3d-topbar { flex-wrap: wrap; row-gap: 8px; padding: 12px 14px; }
  .c3d-count { display: none; }
  .c3d-profile { padding: 7px 10px; font-size: 11px; }
}

/* Browse arrows */
.c3d-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(12, 12, 16, 0.55);
  color: #f4f0e6; font-size: 26px; cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}
.c3d-arrow:hover { background: rgba(217, 164, 65, 0.22); border-color: rgba(217, 164, 65, 0.55); }
.c3d-arrow:active { transform: translateY(-50%) scale(0.94); }
.c3d-arrow-prev { left: 26px; }
.c3d-arrow-next { right: 26px; }

.c3d-hint {
  position: absolute; bottom: 22px; left: 26px;
  font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: 0.04em;
  color: rgba(244, 240, 230, 0.55);
  pointer-events: none;
}

/* Plaque + browser column (bottom center) */
.c3d-plaque {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  width: min(280px, 84vw);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.c3d-plaque > * { pointer-events: auto; }
.c3d-plaque-inner {
  width: 100%; text-align: center;
  padding: 9px 14px 10px;
  background: linear-gradient(160deg, rgba(28, 29, 36, 0.9), rgba(14, 15, 19, 0.92));
  border: 1px solid rgba(217, 164, 65, 0.28);
  border-radius: 10px;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(8px);
}
.c3d-plaque-label {
  font-family: 'Space Mono', monospace; font-size: 8px; letter-spacing: 0.24em;
  color: #d9a441; text-transform: uppercase;
}
.c3d-plaque-inner h3 { font-family: 'Cinzel', serif; font-size: 13.5px; color: #f4f0e6; margin: 3px 0 1px; }
.c3d-plaque-inner p { color: rgba(244, 240, 230, 0.58); font-size: 10px; margin: 0 0 6px; }
.c3d-plaque-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.c3d-plaque-price { font-family: 'Space Mono', monospace; font-size: 12px; color: #f0c86a; }

.c3d-edit-actions {
  display: flex; justify-content: center; gap: 5px; margin-top: 8px; padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}
.c3d-edit-actions button {
  font-family: inherit; font-size: 9.5px; font-weight: 600; letter-spacing: 0.04em;
  padding: 4px 8px; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.05);
  color: #f4f0e6; cursor: pointer;
  transition: background 0.2s ease;
}
.c3d-edit-actions button:hover { background: rgba(255, 255, 255, 0.13); }
.c3d-edit-actions button.danger { color: #ff8a8a; border-color: rgba(255, 107, 107, 0.4); }
.c3d-edit-actions button.danger:hover { background: rgba(255, 107, 107, 0.14); }

/* Browser: counter + slider */
.c3d-browser {
  width: min(220px, 68vw);
  display: flex; align-items: center; gap: 9px;
  padding: 6px 12px;
  background: rgba(10, 10, 14, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  backdrop-filter: blur(6px);
}
.c3d-browser-count {
  font-family: 'Space Mono', monospace; font-size: 9.5px; color: rgba(244, 240, 230, 0.7);
  white-space: nowrap;
}
.c3d-slider {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(217, 164, 65, 0.75), rgba(217, 164, 65, 0.25));
  outline: none; cursor: pointer;
}
.c3d-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: #f0c86a;
  border: 2px solid #14151a;
  box-shadow: 0 0 10px rgba(217, 164, 65, 0.6);
  cursor: pointer;
}
.c3d-slider::-moz-range-thumb {
  width: 11px; height: 11px; border-radius: 50%;
  background: #f0c86a; border: 2px solid #14151a;
  cursor: pointer;
}

/* Guide / manual */
.c3d-guide {
  position: absolute; inset: 0; z-index: 5;
  display: none; align-items: center; justify-content: center;
  background: rgba(8, 8, 11, 0.72);
}
.c3d-guide.show { display: flex; }

/* First-run instructions gate the stage: the manual appears BEFORE the
   editor, and the closet stays hidden until the artist agrees. */
#c3dRoot.c3d-gating #c3dStage,
#c3dRoot.c3d-gating .c3d-hud,
#c3dRoot.c3d-gating .c3d-plaque,
#c3dRoot.c3d-gating .c3d-editorbar,
#c3dRoot.c3d-gating .c3d-tray { visibility: hidden; }
/* …but the topbar (brand + ✕ Exit) stays reachable so nobody is ever trapped. */
#c3dRoot.c3d-gating .c3d-hud .c3d-topbar { visibility: visible; }
.c3d-guide-card {
  width: min(540px, 92vw); max-height: 86vh; overflow: auto;
  padding: 34px 38px;
  background: linear-gradient(160deg, rgba(30, 31, 38, 0.98), rgba(15, 16, 20, 0.98));
  border: 1px solid rgba(217, 164, 65, 0.35);
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
}
.c3d-guide-kicker {
  font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: 0.3em;
  color: #d9a441; text-transform: uppercase;
}
.c3d-guide-card h2 {
  font-family: 'Cinzel', serif; font-weight: 700;
  font-size: 28px; color: #f4f0e6; margin: 10px 0 6px;
}
.c3d-guide-intro { color: rgba(244, 240, 230, 0.72); font-size: 14.5px; line-height: 1.55; margin: 0 0 18px; }
.c3d-guide-rows { display: flex; flex-direction: column; gap: 14px; margin: 18px 0 26px; }
.c3d-guide-row { display: flex; gap: 16px; align-items: flex-start; }
.c3d-guide-num {
  font-family: 'Space Mono', monospace; font-size: 12px; color: #d9a441;
  border: 1px solid rgba(217, 164, 65, 0.4); border-radius: 4px;
  padding: 3px 6px; margin-top: 2px; flex-shrink: 0;
}
.c3d-guide-row-body strong {
  display: block; font-family: 'Cinzel', serif; font-size: 15px; color: #f4f0e6; margin-bottom: 3px;
}
.c3d-guide-row-body span { font-size: 13px; color: rgba(244, 240, 230, 0.7); line-height: 1.5; }
.c3d-guide-row-body kbd {
  font-family: 'Space Mono', monospace; font-size: 11px; color: #14151a;
  background: #d9a441; border-radius: 3px; padding: 1px 6px; margin-right: 2px;
}
.c3d-guide-actions { display: flex; gap: 10px; }
.c3d-guide-actions .c3d-btn { flex: 1; }
.c3d-guide-skip {
  background: none; border: 0; color: rgba(244, 240, 230, 0.55);
  font-family: inherit; font-size: 13px; cursor: pointer;
}
.c3d-guide-skip:hover { color: #f4f0e6; }
.c3d-guide-note {
  display: block; margin-top: 16px; text-align: center;
  font-size: 11.5px; color: rgba(244, 240, 230, 0.4);
}

/* Editor bar (top-right, under the topbar) + tray */
.c3d-editorbar {
  position: absolute; top: 74px; right: 22px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: rgba(12, 12, 16, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  backdrop-filter: blur(6px);
}
.c3d-editorbar-title {
  font-family: 'Cinzel', serif; font-size: 12px; color: #f4f0e6;
  padding: 0 10px; border-right: 1px solid rgba(255, 255, 255, 0.12);
}
.c3d-tray {
  position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%);
  width: min(640px, 92vw); max-height: 38vh; overflow: auto;
  padding: 16px;
  background: rgba(12, 12, 16, 0.92);
  border: 1px solid rgba(217, 164, 65, 0.3);
  border-radius: 10px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}
.c3d-tray-head {
  font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: 0.12em;
  color: rgba(244, 240, 230, 0.6); margin-bottom: 12px;
}
.c3d-tray-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.c3d-tray-item {
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px; padding: 8px; cursor: pointer; text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.c3d-tray-item:hover { border-color: rgba(217, 164, 65, 0.6); background: rgba(217, 164, 65, 0.08); }
.c3d-tray-item img {
  width: 100%; height: 84px; object-fit: contain;
  background: #1a1b20; border-radius: 5px;
}
.c3d-tray-item span { display: block; margin-top: 6px; font-size: 11.5px; color: rgba(244, 240, 230, 0.75); }

/* ============================================================
   Demo page (standalone preview — not part of the live site)
   ============================================================ */
.c3d-demo {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(217, 164, 65, 0.12), transparent 60%),
    radial-gradient(900px 500px at 85% 110%, rgba(255, 45, 111, 0.08), transparent 55%),
    #0d0e12;
  color: #f4f0e6;
  font-family: 'Space Grotesk', sans-serif;
}
.c3d-demo-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 22px 34px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.c3d-demo-header h1 {
  font-family: 'Cinzel', serif; font-size: 20px; letter-spacing: 0.08em; margin: 0;
}
.c3d-demo-header h1 em { color: #d9a441; font-style: normal; }
.c3d-demo-header .c3d-demo-note {
  font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: 0.06em;
  color: rgba(244, 240, 230, 0.55); text-align: right; line-height: 1.5;
}
.c3d-demo-main { padding: 48px 40px 96px; max-width: 1440px; margin: 0 auto; }
.c3d-demo-section { margin-bottom: 56px; }
.c3d-demo-section > h2 {
  font-family: 'Cinzel', serif; font-size: 22px; margin: 0 0 6px;
}
.c3d-demo-section > p {
  color: rgba(244, 240, 230, 0.6); font-size: 13.5px; max-width: 720px;
  margin: 0 0 22px; line-height: 1.55;
}
.c3d-demo-badge {
  display: inline-block; font-family: 'Space Mono', monospace; font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: #f0c86a; border: 1px solid rgba(217, 164, 65, 0.45);
  border-radius: 20px; padding: 4px 10px; margin-left: 12px; vertical-align: middle;
}

/* Hero turntable */
.c3d-hero {
  position: relative;
  height: clamp(560px, 72vh, 760px);
  min-height: 560px;
  border-radius: 18px; overflow: hidden;
  background:
    radial-gradient(600px 300px at 50% 20%, rgba(255, 45, 111, 0.14), transparent 60%),
    radial-gradient(700px 400px at 50% 110%, rgba(217, 164, 65, 0.1), transparent 60%),
    linear-gradient(180deg, #14151b, #0c0d11);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}
.c3d-hero-stage { position: absolute; inset: 0; }
.c3d-hero-stage canvas { display: block; }
.c3d-hero-ui {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 34px 42px 36px;
  background: linear-gradient(to top, rgba(8, 8, 11, 0.9), rgba(8, 8, 11, 0.22) 26%, transparent 48%);
}
.c3d-hero-kicker {
  font-family: 'Space Mono', monospace; font-size: 10.5px; letter-spacing: 0.3em;
  color: #d9a441; text-transform: uppercase; margin-bottom: 8px;
}
.c3d-hero-title {
  font-family: 'Cinzel', serif; font-size: clamp(24px, 3.4vw, 38px); margin: 0 0 5px;
}
.c3d-hero-artist { color: rgba(244, 240, 230, 0.72); font-size: 15px; margin: 0 0 16px; }
.c3d-hero-artist b { color: #f0c86a; font-weight: 600; }
.c3d-hero-actions { display: flex; gap: 10px; align-items: center; pointer-events: auto; }
.c3d-hero-price { font-family: 'Space Mono', monospace; font-size: 16px; color: #f0c86a; margin-left: 8px; }
.c3d-hero-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 54px; height: 54px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(12, 12, 16, 0.6);
  color: #f4f0e6; font-size: 18px; cursor: pointer; pointer-events: auto;
  transition: background 0.2s ease, transform 0.15s ease;
}
.c3d-hero-nav:hover { background: rgba(217, 164, 65, 0.25); transform: translateY(-50%) scale(1.06); }
.c3d-hero-prev { left: 24px; }
.c3d-hero-next { right: 24px; }
.c3d-hero-progress {
  position: absolute; bottom: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, #d9a441, #f0c86a);
  transition: width 0.3s linear;
}

/* Thumb rail */
.c3d-rail-strip {
  display: flex; gap: 12px; margin-top: 16px;
  overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: thin; scrollbar-color: rgba(217, 164, 65, 0.4) transparent;
}
.c3d-thumb {
  flex: 0 0 108px;
  border-radius: 10px; overflow: hidden; cursor: pointer;
  background: #17181d; border: 2px solid transparent;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.c3d-thumb:hover { transform: translateY(-2px); }
.c3d-thumb.on { border-color: #d9a441; }
.c3d-thumb img { width: 100%; height: 96px; object-fit: cover; display: block; }
.c3d-thumb figcaption {
  font-size: 10.5px; color: rgba(244, 240, 230, 0.6); text-align: center;
  padding: 6px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Demo action rows */
.c3d-demo-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.c3d-demo-card {
  flex: 1 1 300px;
  padding: 26px;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(30, 31, 38, 0.85), rgba(16, 17, 22, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.c3d-demo-card h3 { font-family: 'Cinzel', serif; font-size: 17px; margin: 0 0 8px; }
.c3d-demo-card p { color: rgba(244, 240, 230, 0.6); font-size: 13px; line-height: 1.55; margin: 0 0 18px; }
.c3d-demo-card .c3d-btn { width: 100%; }
@media (min-width: 900px) {
  .c3d-hero-ui { align-items: flex-start; }
  .c3d-hero-kicker, .c3d-hero-title, .c3d-hero-artist, .c3d-hero-actions { max-width: 560px; }
}

@media (max-width: 700px) {
  .c3d-demo-main { padding: 32px 18px 68px; }
  .c3d-demo-header { padding: 18px; align-items: flex-start; flex-direction: column; }
  .c3d-demo-header .c3d-demo-note { text-align: left; }
  .c3d-hero { height: 600px; min-height: 600px; border-radius: 12px; }
  .c3d-hero-ui { padding: 26px 20px 24px; }
  .c3d-hero-actions { flex-wrap: wrap; }
  .c3d-hero-nav { width: 46px; height: 46px; }
  .c3d-hero-prev { left: 12px; }
  .c3d-hero-next { right: 12px; }
}

/* Short laptop windows: preserve a generous viewer without burying the
   garment under the metadata controls. */
@media (max-height: 760px) and (min-width: 701px) {
  .c3d-demo-main { padding-top: 32px; }
  .c3d-hero { height: min(620px, calc(100vh - 250px)); min-height: 470px; }
  .c3d-hero-ui { padding: 24px 34px 28px; }
}

@media (max-height: 650px) {
  .c3d-hero { height: 470px; min-height: 470px; }
  .c3d-hero-ui { padding: 18px 22px 20px; }
  .c3d-hero-title { font-size: clamp(21px, 3vw, 30px); }
  .c3d-hero-artist { margin-bottom: 10px; }
}

.c3d-demo-foot {
  text-align: center; padding: 26px;
  font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: 0.06em;
  color: rgba(244, 240, 230, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Toast */
.c3d-toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 20000;
  padding: 12px 22px; border-radius: 30px;
  font-family: 'Space Grotesk', sans-serif; font-size: 13.5px; font-weight: 600;
  color: #14151a; background: linear-gradient(135deg, #f0c86a, #d9a441);
  box-shadow: 0 10px 34px rgba(217, 164, 65, 0.45);
  opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.c3d-toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }
