/* Salon (home) — the walk-through stage */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.salon { position: fixed; inset: 0; }
.stage {
  position: absolute; inset: 0; z-index: 0; isolation: isolate; overflow: hidden; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  background: var(--bg);
}
.stage.dragging { cursor: grabbing; }
.stage.over-look { cursor: none; }
.glow {
  position: absolute; inset: -10%; pointer-events: none;
  background:
    radial-gradient(ellipse 42% 38% at 50% 60%, var(--stage-glow), transparent 72%),
    radial-gradient(ellipse 80% 60% at 50% 100%, color-mix(in srgb, var(--stage-glow) 40%, transparent), transparent 70%);
  opacity: 0; transition: opacity 1.6s var(--ease);
}
.loaded .glow { opacity: 1; }
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 55%, color-mix(in srgb, var(--bg) 85%, transparent)); }

.fig {
  position: absolute; left: 0; top: 0; width: 0; height: 600px; transform-origin: 0 100%;
  pointer-events: none; will-change: transform, filter, opacity;
}
.fig img { position: absolute; bottom: 0; left: 0; height: 100%; width: auto; max-width: none; transform: translateX(-50%); }
.fig .shadow {
  position: absolute; bottom: -14px; left: 0; width: 330px; height: 40px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .55), transparent 68%);
}
:root[data-theme="light"] .fig .shadow { background: radial-gradient(ellipse at center, rgba(70, 50, 30, .28), transparent 68%); }
.fig .ring {
  position: absolute; bottom: -22px; left: 0; width: 360px; height: 56px; transform: translateX(-50%) scale(.85);
  border: 2px solid color-mix(in srgb, var(--text) 70%, transparent); border-radius: 50%;
  opacity: 0; transition: opacity .35s var(--ease), transform .5s var(--ease);
}
.fig.hover .ring { opacity: 1; transform: translateX(-50%) scale(1); }
.fig:focus-visible { outline: none; }
.fig:focus-visible .ring { opacity: 1; transform: translateX(-50%) scale(1); }

/* custom cursor */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 55; pointer-events: none;
  width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%;
  background: color-mix(in srgb, var(--cream) 82%, transparent); color: var(--on-cream);
  display: grid; place-items: center; font-size: 11px; letter-spacing: .02em;
  transform: scale(.2); opacity: 0; transition: transform .35s var(--ease), opacity .25s var(--ease);
}
.cursor.on { transform: scale(1); opacity: 1; }
.cursor .lbl { text-shadow: 0 1px 12px var(--bg), 0 0 2px var(--bg); position: absolute; top: 62px; left: 50%; transform: translateX(-50%); white-space: nowrap; color: var(--text); font-size: 11.5px; }
.cursor .lbl i { font-family: var(--serif); font-size: 15px; }
@media (hover: none) { .cursor { display: none; } }

/* bottom bar */
.salon-foot {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 40; padding: 0 var(--gutter) 22px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; pointer-events: none;
  transition: opacity .5s var(--ease);
}
.salon-foot > * { pointer-events: auto; }
.salon-foot .guide { font-family: var(--serif); font-style: italic; font-size: 17px; border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; justify-self: start; }
.salon-foot .hint { font-size: 12px; color: var(--muted); white-space: pre; }
.salon-foot .scroll { justify-self: end; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.salon-foot .scroll i { width: 1px; height: 16px; background: var(--line-strong); position: relative; overflow: hidden; }
.salon-foot .scroll i::after { content: ""; position: absolute; left: 0; width: 1px; height: 6px; background: var(--text); animation: drip 1.8s var(--ease) infinite; }
@keyframes drip { from { top: -6px; } to { top: 16px; } }
.focused .salon-foot { opacity: 0; pointer-events: none; }

/* intro veil */
.veil { position: absolute; inset: 0; z-index: 45; display: grid; place-items: center; pointer-events: none; transition: opacity 1s var(--ease) .2s; }
.veil span { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 15px; letter-spacing: .02em; }
.loaded .veil { opacity: 0; }

/* ── Detail (step closer) ───────────────────────────── */
.detail { position: absolute; inset: 0; z-index: 42; pointer-events: none; }
.d-left {
  position: absolute; left: var(--gutter); top: 21vh; width: min(30vw, 380px); z-index: 2;
  opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .8s var(--ease);
}
.d-left .k { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }
.d-left h1 { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(48px, 5.4vw, 84px); line-height: .95; }
.d-left p { color: var(--muted); font-size: 14px; margin: 18px 0 18px; max-width: 300px; }
.d-left a { font-size: 13px; border-bottom: 1px solid var(--line-strong); padding-bottom: 3px; }
.d-nav {
  position: absolute; left: var(--gutter); bottom: 30px; display: flex; align-items: baseline; gap: 26px; font-size: 12px; color: var(--muted);
  opacity: 0; transition: opacity .6s var(--ease);
}
.d-nav button { display: inline-flex; gap: 10px; align-items: baseline; color: var(--muted); transition: color .3s; }
.d-nav button:hover { color: var(--text); }
.d-nav .serif { font-style: italic; font-size: 18px; color: var(--text); }
.d-nav .cnt { color: var(--muted); letter-spacing: .04em; }

.d-panel {
  position: absolute; top: 88px; max-height: calc(100% - 116px); right: max(var(--gutter), 6vw); width: min(430px, 40vw); z-index: 3;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  padding: 20px 22px 18px; display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: none;
  opacity: 0; transform: translateY(20px); transition: opacity .55s var(--ease), transform .8s var(--ease);
}
.d-panel::-webkit-scrollbar { display: none; }
.focused .d-left, .focused .d-panel { opacity: 1; transform: none; pointer-events: auto; transition-delay: .35s; }
.focused .d-nav { opacity: 1; pointer-events: auto; transition-delay: .45s; }
.p-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.p-head .serif { font-style: italic; font-size: 18px; color: var(--muted); }
.p-head button { font-size: 13px; display: inline-flex; gap: 8px; align-items: center; }
.p-preview { position: relative; height: clamp(110px, 18vh, 190px); flex: none; background: var(--tile); border-radius: 2px; overflow: hidden; margin-bottom: 8px;
  background-image: radial-gradient(ellipse at 50% 60%, color-mix(in srgb, var(--text) 7%, transparent), transparent 70%); }
.p-preview img { position: absolute; left: 50%; top: 8%; height: 84%; width: auto; transform: translateX(-50%); transition: opacity .35s var(--ease); }
.p-preview.v-head img { top: 4%; height: 92%; }
.p-preview.v-lower img { top: auto; bottom: -2%; height: 210%; }
.p-preview.v-upper img { top: 2%; height: 170%; }
.p-list { list-style: none; margin: 0; padding: 0; }
.p-row {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 10px 0; border-top: 1px solid var(--line); opacity: .5; transition: opacity .3s var(--ease);
}
.p-row:hover, .p-row.on { opacity: 1; }
.p-row .thumb { width: 44px; height: 52px; }
.p-row .n { font-family: var(--serif); font-size: 20px; line-height: 1.15; }
.p-row .pr { font-size: 13px; }
.p-row .pr.in { color: var(--accent-text); }
.p-sizes { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 14px 0 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.p-sizes .one { font-size: 12.5px; color: var(--muted); }
.p-sizes .guide-btn { font-size: 11.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.p-sizes .chips { gap: 5px; }
.p-sizes .chip { min-width: 36px; height: 32px; padding: 0 8px; }
.bar.outline { background: none; color: var(--text); border: 1px solid var(--line-strong); margin-top: 8px; }
.bar.outline:hover { border-color: var(--text); }
.bar.outline.added { background: var(--accent); border-color: var(--accent); color: #f3e9e3; }
.d-panel .note { font-size: 11.5px; color: var(--muted); margin: 12px 0 0; }

/* size guide */
.sg { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility 0s .35s; }
.sg.open { opacity: 1; visibility: visible; transition: opacity .35s var(--ease); }
.sg .box { width: min(520px, 100%); background: var(--panel-solid); border: 1px solid var(--line); padding: 26px; }
.sg h3 { margin: 0 0 4px; font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 30px; }
.sg p { margin: 0 0 18px; font-size: 12px; color: var(--muted); }
.sg table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sg th, .sg td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--line); font-weight: 400; }
.sg th { color: var(--muted); font-size: 11.5px; }
.sg .x { margin-top: 18px; font-size: 13px; }

@media (max-width: 900px) {
  .salon-foot { grid-template-columns: 1fr; justify-items: center; gap: 10px; }
  .salon-foot .scroll { display: none; }
  .salon-foot .guide { justify-self: center; }
  .d-left { top: 76px; width: auto; right: var(--gutter); }
  .d-left h1 { font-size: 44px; }
  .d-left p, .d-left a { display: none; }
  .d-nav { display: none; }
  .d-panel {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 50vh; border-left: 0; border-right: 0; border-bottom: 0;
    padding: 16px var(--gutter) 18px;
  }
  .p-preview { display: none; }
  .p-row { padding: 8px 0; }
  .p-row .n { font-size: 18px; }
}

.d-panel > * { flex-shrink: 0; }
