:root {
  --blush: #f7dde2;
  --blush-2: #f2c4cd;
  --hot: #ff3e8a;
  --hot-deep: #d81b6a;
  --rose: #d4a373;
  --rose-2: #f3c3a8;
  --cream: #fbf3ec;
  --berry: #2a0f1c;
  --berry-2: #5a1733;
  --serif: "Didot", "Bodoni 72", "Bodoni MT", "Playfair Display", "Times New Roman", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 18px;
}
html[data-theme="night"] { --bg: var(--berry); --ink: #fbe9ef; --muted: #d9a9bb; --card: #3a1426; --line: rgba(243,195,168,.28); }
html[data-theme="day"] { --bg: #fdf0f2; --ink: #3a1426; --muted: #8a5068; --card: #fff8f6; --line: rgba(212,163,115,.45); }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100svh; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--hot); outline-offset: 3px; border-radius: 10px; }
[hidden] { display: none !important; }

/* ---------- loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-content: center; justify-items: center; gap: 14px;
  background: radial-gradient(120% 90% at 50% 40%, #3b1427 0%, #1a0910 70%);
}
#loader .monogram { filter: drop-shadow(0 0 14px rgba(255, 62, 138, .55)); animation: breathe 2.4s ease-in-out infinite; }
.loader-name { margin: 0; font-family: var(--serif); font-style: italic; font-size: 20px; letter-spacing: .08em; color: #f3c3a8; }
#loader-fx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 51; pointer-events: none; }
@keyframes breathe { 50% { transform: scale(1.04); filter: drop-shadow(0 0 22px rgba(255, 62, 138, .8)); } }

/* ---------- stage ---------- */
#stage { position: relative; height: 100svh; min-height: 480px; overflow: hidden; display: none; background: var(--bg); }
.is-3d #stage { display: block; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; outline: none; }
#scene:active { cursor: grabbing; }

.hud { position: absolute; z-index: 5; display: flex; gap: 10px; align-items: center; }
.hud-top { top: max(14px, env(safe-area-inset-top)); left: 14px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 78%, transparent); color: var(--ink);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: 26px; line-height: 1;
}
html[data-theme="night"] .i-sun, html[data-theme="day"] .i-moon { display: none; }
.pill { min-height: 44px; padding: 0 18px; border-radius: 999px; font: 600 14px var(--sans); cursor: pointer; }
.pill-ghost { border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 78%, transparent); color: var(--ink); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.hint {
  position: absolute; left: 50%; top: calc(72px + env(safe-area-inset-top)); transform: translateX(-50%);
  margin: 0; padding: 10px 16px; border-radius: 999px; z-index: 4; max-width: calc(100vw - 32px); text-align: center;
  font: 500 13px/1.3 var(--sans); letter-spacing: .02em; color: #fff4f7;
  background: rgba(42, 15, 28, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  pointer-events: none; transition: opacity .3s;
}
.hint:empty { opacity: 0; }
.skip-3d {
  position: absolute; left: 14px; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 5;
  font: 600 13px var(--sans); color: var(--ink); text-decoration: none; padding: 12px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--card) 70%, transparent); border: 1px solid var(--line);
}

/* hotspot buttons positioned over the 3D anchors */
#hotspots { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.hotspot {
  position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer;
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 6px; margin: -22px 0 0 -22px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(42, 15, 28, .55); color: #fff; font: 600 13px var(--sans); letter-spacing: .02em; white-space: nowrap;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); will-change: transform;
}
.hs-dot { width: 32px; height: 32px; border-radius: 50%; position: relative; background: radial-gradient(circle, #fff 0 28%, var(--hot) 30% 62%, transparent 64%); }
.hs-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--hot); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }
.hotspot-knock { padding: 0; margin: -40px 0 0 -40px; width: 80px; height: 80px; min-height: 0; justify-content: center; background: transparent; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.hotspot-knock .hs-dot { width: 80px; height: 80px; background: transparent; border: 2px solid rgba(255, 127, 176, .7); border-radius: 50%; }
.hotspot-knock .hs-dot::after { border-width: 3px; border-color: #ff7fb0; }
.hotspot-knock .hs-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* persistent shop button */
.shop-fab {
  position: fixed; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 20;
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 999px;
  background: linear-gradient(135deg, var(--hot), var(--hot-deep)); color: #fff; text-decoration: none;
  font: 700 14px var(--sans); letter-spacing: .02em; box-shadow: 0 8px 26px rgba(216, 27, 106, .45);
}
.shop-fab:hover { filter: brightness(1.06); }

/* ---------- plain page ---------- */
#closet { max-width: 920px; margin: 0 auto; padding: 56px 20px 120px; }
.plain-hero { text-align: center; display: grid; justify-items: center; gap: 12px; padding: 24px 0 36px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0; font: 600 12px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
h1, h2 { font-family: var(--serif); font-weight: 400; font-style: italic; margin: 0; }
h1 { font-size: clamp(40px, 9vw, 72px); line-height: 1; color: var(--ink); }
h2 { font-size: clamp(28px, 5vw, 38px); }
.lede { margin: 0; max-width: 34ch; font-size: 17px; line-height: 1.5; color: var(--muted); }
.plain-block { padding: 40px 0; border-bottom: 1px solid var(--line); display: grid; gap: 16px; justify-items: start; }
.plain-block p { margin: 0; max-width: 60ch; font-size: 16px; line-height: 1.6; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 999px;
  background: var(--hot); color: #fff; text-decoration: none; font: 700 15px var(--sans); border: 0; cursor: pointer;
}
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; width: 100%; }
.grid li { aspect-ratio: 3 / 4.4; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.grid img { width: 100%; height: 100%; object-fit: cover; }
.site-footer { padding: 36px 0 0; text-align: center; color: var(--muted); font-size: 13px; display: grid; gap: 8px; }
.site-footer p { margin: 0; }
.site-footer .handle a { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--ink); text-decoration: none; }
.friends a { color: var(--muted); text-underline-offset: 3px; }

/* ---------- panel ---------- */
#panel {
  width: min(560px, calc(100vw - 24px)); max-height: min(86svh, 760px); overflow: auto;
  border: 1px solid var(--line); border-radius: 24px; padding: 18px 22px 24px;
  background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
#panel::backdrop { background: rgba(26, 9, 16, .55); backdrop-filter: blur(3px); }
#panel[open] { animation: rise .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.panel-close-row { display: flex; justify-content: flex-end; margin: -4px -8px 0 0; }
#panel h2 { margin: -8px 0 12px; }
#panel-body { display: grid; gap: 12px; margin-bottom: 20px; line-height: 1.6; }
#panel-body p { margin: 0; }
.muted { color: var(--muted); font-size: 14px; }
.grid-mini { grid-template-columns: repeat(4, 1fr); }
.look-big { margin: 0 auto; display: grid; justify-items: center; gap: 8px; }
.look-big img { height: min(46svh, 340px); width: auto; border-radius: 14px; border: 1px solid var(--line); }
.look-big figcaption { font-size: 13px; color: var(--muted); text-align: center; }
.grid-thumbs { grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 12px; }
.grid-thumbs li { border-radius: 8px; }
.grid-thumbs button { all: unset; display: block; width: 100%; height: 100%; cursor: pointer; }
.grid-thumbs button:focus-visible { outline: 3px solid var(--hot); }

#toast {
  position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 60; padding: 12px 18px; border-radius: 999px;
  background: var(--berry-2); color: #fff; font: 600 14px var(--sans); box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
}

@media (max-width: 520px) {
  .hotspot { font-size: 12px; }
  .grid-thumbs { grid-template-columns: repeat(4, 1fr); }
  .shop-fab span { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
[data-config="about"] { display: grid; gap: 10px; }
.hotspot.is-far { padding: 0 6px; }
.hotspot.is-far .hs-label { display: none; }
