/* MiMi Pic — personalised Holzposter studio. CC #21121. Loaded only on /personalisieren/ and uses the
 * shop's tokens (shop.css). The stage is the product: one large surface that shows the board in 3D,
 * lets the customer place the photo, or hangs it on a real wall at true scale. */

.studio { padding-top: calc(76px + var(--safe-t)); padding-bottom: 150px; }
.st-head { text-align: center; max-width: 760px; margin: 8px auto 18px; }
.st-head h1 { font: 700 clamp(34px, 8.4vw, 64px)/1.02 var(--display); letter-spacing: -0.03em; margin: 12px 0 10px; }
.st-head p { color: var(--ink-2); margin: 0 auto; max-width: 560px; font-size: 17px; }

.st-grid { display: grid; gap: 22px; }
@media (min-width: 980px) { .st-grid { grid-template-columns: minmax(0, 1.35fr) minmax(340px, 1fr); align-items: start; } .st-stage-col { position: sticky; top: 90px; } }

/* ── stage ─────────────────────────────────────────────────────────── */
.st-stage {
  position: relative; overflow: hidden; border-radius: 28px; aspect-ratio: 1 / 1.08; max-height: 78vh; width: 100%;
  background: radial-gradient(120% 90% at 50% 20%, #fbf8f3 0%, #efe8de 55%, #e3d9cb 100%);
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
  box-shadow: inset 0 0 0 1px rgba(22,24,27,.05);
}
@media (min-width: 980px) { .st-stage { aspect-ratio: 1 / 0.92; } }
.st-stage:active { cursor: grabbing; }
.st-stage[data-view="edit"] { background: #1c1d20; cursor: move; }

.st-scene { position: absolute; inset: 0; display: grid; place-items: center; perspective: 1400px; perspective-origin: 50% 40%; }
.st-stage:not([data-view="3d"]) .st-scene { visibility: hidden; }
.st-slab { position: relative; transform-style: preserve-3d; will-change: transform; transition: width .45s cubic-bezier(.2,.8,.2,1), height .45s cubic-bezier(.2,.8,.2,1); }
.st-slab > * { position: absolute; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.st-front { inset: 0; transform: translateZ(calc(var(--t) / 2)); background: #e6d6bd url(/img/studio/ply-face.jpg) 0 0 / 900px auto repeat; overflow: hidden; }
.st-front canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .35s ease; }
.studio.has-face .st-front canvas { opacity: 1; }
.st-sheen { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(115deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.55) 48%, rgba(255,255,255,0) 66%); background-size: 260% 260%; }
.st-back { inset: 0; transform: rotateY(180deg) translateZ(calc(var(--t) / 2)); background: #cdb697 url(/img/studio/ply-face.jpg) 0 0 / 900px auto repeat; filter: brightness(.8); }
.st-e-l, .st-e-r { top: 0; height: 100%; width: var(--t); left: calc(50% - var(--t) / 2); background-repeat: repeat-y; background-size: 100% auto; }
.st-e-t, .st-e-b { left: 0; width: 100%; height: var(--t); top: calc(50% - var(--t) / 2); background-repeat: repeat-x; background-size: auto 100%; }
.st-e-r { transform: rotateY(90deg) translateZ(calc(var(--w) / 2)); filter: brightness(.9); }
.st-e-l { transform: rotateY(-90deg) translateZ(calc(var(--w) / 2)); filter: brightness(.72); }
.st-e-t { transform: rotateX(90deg) translateZ(calc(var(--h) / 2)); filter: brightness(1.06); }
.st-e-b { transform: rotateX(-90deg) translateZ(calc(var(--h) / 2)); filter: brightness(.66); }
.st-slab[data-thick="8"] .st-e-l, .st-slab[data-thick="8"] .st-e-r { background-image: url(/img/studio/ply-8-v.jpg); }
.st-slab[data-thick="8"] .st-e-t, .st-slab[data-thick="8"] .st-e-b { background-image: url(/img/studio/ply-8-h.jpg); }
.st-slab[data-thick="10"] .st-e-l, .st-slab[data-thick="10"] .st-e-r { background-image: url(/img/studio/ply-10-v.jpg); }
.st-slab[data-thick="10"] .st-e-t, .st-slab[data-thick="10"] .st-e-b { background-image: url(/img/studio/ply-10-h.jpg); }
.st-shadow { position: absolute; left: 50%; top: 50%; translate: -50% -50%; border-radius: 6px; background: rgba(60,40,20,.42); filter: blur(26px); z-index: -1; transition: width .45s, height .45s; }
.st-scene > .st-shadow { z-index: 0; }
.st-scene > .st-slab { z-index: 1; }

/* empty state: an unprinted board and one clear action */
.st-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; z-index: 3; pointer-events: none; }
.st-empty .btn { white-space: nowrap; box-shadow: 0 14px 34px -10px rgba(228, 87, 46, .75); }
.studio .btn svg, .st-photo-btn svg { width: 22px; height: 22px; flex: 0 0 auto; }
.studio:not(.has-photo) .st-views { display: none; }
.st-empty .btn { pointer-events: auto; }
.st-empty small { color: var(--ink-2); font-size: 13px; }
.studio.has-photo .st-empty { display: none; }
.st-loading { position: absolute; inset: 0; display: none; place-items: center; z-index: 4; background: rgba(243,239,233,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-weight: 650; }
.studio.is-loading .st-loading { display: grid; }
.studio.is-drag .st-stage { box-shadow: inset 0 0 0 3px var(--accent); }

/* edit view */
#st-edit { position: absolute; inset: 0; display: none; }
.st-stage[data-view="edit"] #st-edit { display: block; }
.st-tools { position: absolute; left: 12px; right: 12px; bottom: 74px; display: none; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--pill); z-index: 3; color: var(--ink); }
.st-stage[data-view="edit"] .st-tools { display: flex; }
.st-tools input[type="range"] { flex: 1; accent-color: var(--ink); min-width: 0; }
.st-tools .icon-btn { flex: 0 0 auto; }
.st-tools .st-tool-txt { font-size: 13px; font-weight: 650; padding: 0 8px; height: 36px; border-radius: var(--pill); }

/* wall view */
.st-wall { position: absolute; top: 0; bottom: 0; left: 50%; height: 100%; aspect-ratio: 1 / 1; transform: translateX(-50%); display: none; }
@supports not (aspect-ratio: 1 / 1) { .st-wall { width: 100%; left: 0; transform: none; } }
.st-stage[data-view="wall"] .st-wall { display: block; }
.st-wall img { position: absolute; inset: 0; width: 100%; height: 100%; }
.st-wall-poster { position: absolute; box-shadow: var(--edge) var(--edge) 0 0 #c9a77c, calc(var(--edge) * 2) calc(var(--edge) * 5) calc(var(--edge) * 7) rgba(0,0,0,.28); transition: all .45s cubic-bezier(.2,.8,.2,1); background: url(/img/studio/ply-face.jpg) center / cover; }
.st-wall-poster canvas { width: 100%; height: 100%; display: block; }
.st-rooms { position: absolute; left: 0; right: 0; top: 12px; display: none; gap: 6px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; z-index: 3; }
.st-rooms::-webkit-scrollbar { display: none; }
.st-stage[data-view="wall"] .st-rooms { display: flex; }
.st-rooms button { flex: 0 0 auto; padding: 8px 14px; border-radius: var(--pill); font-size: 13px; font-weight: 650; color: var(--ink); }
.st-rooms button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* view switcher: a floating glass segmented control */
.st-views { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 4px; padding: 5px; border-radius: var(--pill); z-index: 3; }
.st-views button { padding: 10px 16px; border-radius: var(--pill); font-weight: 650; font-size: 14px; color: var(--ink); white-space: nowrap; }
.st-views button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.st-stage[data-view="edit"] .st-views, .st-stage[data-view="edit"] .st-tools { color: var(--ink); }
.st-hint[data-hint="edit"] { display: none; }
.st-stage[data-view="edit"] .st-hint[data-hint="3d"] { display: none; }
.st-stage[data-view="edit"] .st-hint[data-hint="edit"] { display: block; }
.st-hint { position: absolute; top: 14px; left: 0; right: 0; text-align: center; font-size: 12.5px; color: var(--ink-3); pointer-events: none; z-index: 2; }
.st-stage[data-view="edit"] .st-hint { color: rgba(255,255,255,.7); }
.st-stage[data-view="wall"] .st-hint { display: none; }
.studio:not(.has-photo) .st-hint { display: none; }

/* ── panel ─────────────────────────────────────────────────────────── */
.st-panel h2 { font: 700 22px/1.2 var(--display); margin: 0 0 4px; }
.st-step { display: flex; align-items: baseline; gap: 10px; font-weight: 700; font-size: 14px; margin: 20px 0 8px; }
.st-step b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; }
.st-step span { font-weight: 500; color: var(--ink-3); margin-left: auto; font-size: 13px; }
.st-photo-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 16px; background: var(--card); border: 1.5px dashed var(--line); font-weight: 650; text-align: left; }
.studio.has-photo .st-photo-btn { border-style: solid; }
.st-photo-btn svg { width: 22px; height: 22px; flex: 0 0 auto; }
.st-photo-btn small { display: block; font-weight: 500; color: var(--ink-3); font-size: 12.5px; }
.st-quality { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 13.5px; }
.st-quality .bar { height: 5px; border-radius: 3px; background: var(--paper-2); margin-top: 8px; overflow: hidden; }
.st-quality .bar i { display: block; height: 100%; border-radius: 3px; transition: width .3s ease, background .3s; }
.st-quality.q-best .bar i, .st-quality.q-good .bar i { background: #2f9e62; }
.st-quality.q-ok .bar i { background: #d9a13b; }
.st-quality.q-low .bar i { background: var(--accent); }
.st-quality.q-low { border-color: rgba(228,87,46,.45); }
.st-panel .price-row { margin-top: 18px; }

/* ── occasions strip + how-it-works on this page ───────────────────── */
.st-how { display: grid; gap: 14px; margin-top: 44px; }
@media (min-width: 760px) { .st-how { grid-template-columns: repeat(3, 1fr); } }
.st-how div { background: var(--card); border-radius: 22px; padding: 22px; border: 1px solid var(--line); }
.st-how b { display: block; font: 700 20px/1.2 var(--display); margin: 6px 0; }
.st-how p { margin: 0; color: var(--ink-2); font-size: 15px; }
.st-how i { font-style: normal; font-weight: 800; color: var(--accent); }
