/* ==========================================================================
   REVORA — 3D Studio page
   ========================================================================== */

/* This page has no entrance choreography: undo the hidden initial states. */
html.js .nav__brand, html.js .nav__links a, html.js .nav__actions > *,
html.js .viewer, html.js .studio__copy > * { opacity: 1; transform: none; }

.stage { position: relative; height: 100vh; height: 100svh; min-height: 620px; overflow: hidden; }

.viewer--full { position: absolute; inset: 0; aspect-ratio: auto; min-height: 0; border: 0; }
.viewer--full[data-look="dramatic"] { background: radial-gradient(70% 60% at 50% 42%, #1a1d20 0%, #0b0c0d 60%, #050506 100%); }
.viewer--full[data-look="soft"] { background: radial-gradient(80% 70% at 50% 40%, #4a5057 0%, #2a2f34 55%, #171a1d 100%); }
.viewer--full canvas { touch-action: none; }
.viewer--full .viewer__status { z-index: 2; }
.viewer--full .viewer__fallback { z-index: 3; }

.progress { width: 160px; height: 1px; background: var(--hair-dark); overflow: hidden; }
.progress span { display: block; height: 100%; width: 100%; background: var(--gold); transform: scaleX(0); transform-origin: 0 50%; transition: transform .4s var(--ease); }
.fallback__actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.filebtn { cursor: pointer; }
.filebtn input, .openglb input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Control panel */
.panel {
  position: absolute; z-index: 5; left: var(--gutter); top: calc(var(--nav-h) + 20px); bottom: 92px; width: min(360px, 32vw);
  overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--hair-dark) transparent;
  background: rgba(17,19,21,.9); border: 1px solid var(--hair-dark); padding: 22px 24px;
}
.panel__title { font-family: var(--f-head); font-weight: 600; font-size: clamp(26px, 2.5vw, 38px); letter-spacing: -.035em; line-height: 1.04; margin: 12px 0 14px; }
.panel__now { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-block: 1px solid var(--hair-dark); margin-bottom: 8px; }
.panel__now span { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--silver); font-family: var(--f-head); font-weight: 600; }
.panel__now b { font-family: var(--f-head); font-weight: 500; font-size: 17px; letter-spacing: -.01em; }

.group { padding: 14px 0 2px; }
.group__h { font-family: var(--f-head); font-size: 10.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--silver); margin-bottom: 12px; display: flex; gap: 10px; align-items: baseline; }
.group__h small { font-size: 10px; letter-spacing: .04em; text-transform: none; color: var(--gold); font-weight: 500; }
.group.is-disabled .swatches { opacity: .35; pointer-events: none; }

.models { display: flex; flex-direction: column; border-top: 1px solid var(--hair-dark); }
.models button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hair-dark); font-size: 14px; text-align: left; color: var(--paper-soft); transition: color .3s, padding .4s var(--ease); }
.models button small { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--silver); }
.models button:hover { color: var(--ivory); padding-left: 6px; }
.models button[aria-current="true"] { color: var(--ivory); }
.models button[aria-current="true"] small { color: var(--gold); }
.models button:disabled { opacity: .4; pointer-events: none; }
.openglb { display: inline-block; position: relative; margin-top: 12px; font-size: 12px; letter-spacing: .04em; color: var(--gold); border-bottom: 1px solid currentColor; cursor: pointer; padding-bottom: 2px; }
.openglb:focus-within { outline: 1.5px solid var(--gold); outline-offset: 4px; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { padding: 9px 13px; border: 1px solid var(--hair-dark); border-radius: 100px; font-family: var(--f-head); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; transition: background .3s, color .3s, border-color .3s; }
.seg button:hover { border-color: var(--ivory); }
.seg button[aria-pressed="true"] { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }

/* Dock */
.dock { position: absolute; z-index: 5; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 6px; background: rgba(17,19,21,.9); border: 1px solid var(--hair-dark); }
.dock .icon-btn { border-radius: 2px; }
.dock .icon-btn:hover { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }
.dock .icon-btn[aria-pressed="false"] { opacity: .5; }
.dock__sep { width: 1px; height: 22px; background: var(--hair-dark); margin: 0 4px; }
.stage__hint { position: absolute; z-index: 4; right: var(--gutter); bottom: 38px; font-size: 11px; letter-spacing: .08em; color: var(--silver); opacity: .8; text-align: right; max-width: 28ch; pointer-events: none; }
.stage__credit { position: absolute; z-index: 4; right: var(--gutter); bottom: 14px; font-size: 10px; color: rgba(255,255,255,.4); pointer-events: none; }

/* Fullscreen */
.stage:fullscreen, .stage.is-fullscreen { background: var(--black); }
.stage.is-fullscreen { position: fixed; inset: 0; z-index: 150; height: 100%; }
.stage.is-immersive .panel, .stage.is-immersive .stage__hint { opacity: 0; pointer-events: none; }
.panel, .stage__hint { transition: opacity .5s; }

/* How-to */
.howto { padding: clamp(80px, 10vw, 150px) 0; }
.howto__grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(32px, 6vw, 112px); align-items: start; }
.howto__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 44px); padding-top: 14px; }
.howto__cols article { border-top: 1px solid var(--hair-light); padding-top: 18px; }
.howto__cols h3 { font-family: var(--f-head); font-weight: 600; font-size: 18px; letter-spacing: -.02em; margin-bottom: 10px; }
.howto__cols p { font-size: 14px; color: var(--ink-soft); }
.howto code { font-size: 12px; background: var(--grey); padding: 1px 5px; }
.howto__cta { margin-top: clamp(40px, 5vw, 72px); display: flex; justify-content: space-between; align-items: center; gap: 28px; flex-wrap: wrap; border-top: 1px solid var(--hair-light); padding-top: 32px; }
.howto__cta p { max-width: 56ch; font-size: 13px; color: var(--ink-soft); }

@media (max-width: 960px) {
  .stage { height: auto; min-height: 0; overflow: visible; }
  .viewer--full { position: relative; inset: auto; height: 74svh; min-height: 420px; }
  .panel { position: relative; left: auto; top: auto; bottom: auto; width: auto; margin: 0; border-width: 1px 0 0; padding: 28px var(--gutter) 96px; background: var(--charcoal); overflow: visible; }
  .dock { bottom: auto; top: calc(74svh - 64px); }
  .stage__hint { display: none; }
  .stage__credit { top: calc(74svh - 28px); bottom: auto; }
  .howto__grid { grid-template-columns: 1fr; }
  .howto__cols { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .viewer--full { height: 64svh; }
  .dock { top: calc(64svh - 60px); }
  .stage__credit { display: none; }
  .howto__cta .btn { width: 100%; justify-content: center; }
}
