/* Basin8 — avatar turntable (2026-10-26). Pairs with turntable.js. Clay + neutrals only (no coral, no salmon).
   Mounted inside the studio stage: it covers the stage, stays out of the way until the visitor presses 360°, and its
   rest box (.tt-rest) uses the same rules as the studio's .avatar-media, so frame 0 stands where the still stands. */

.tt { position: absolute; inset: 0; z-index: 3; pointer-events: none;
  --tt-paper: var(--clay-hi, #f7f4ef); --tt-ink: var(--ink, #25211d); --tt-ink-2: var(--ink-2, #48423b); --tt-ink-3: var(--ink-3, #776e64);
  --tt-line: var(--line-2, rgba(37, 33, 29, .17)); --tt-ease: var(--ease, cubic-bezier(.2, .7, .2, 1));
  --tt-raise: var(--raise, 0 1px 0 rgba(255,255,255,.7) inset, 0 22px 44px -30px rgba(58,44,30,.42), 0 2px 8px -3px rgba(58,44,30,.14));
  --tt-h: calc(80% * var(--k, 1)); --tt-b: 7%; }
.tt[data-kind="robot"] { --tt-h: calc(70% * var(--k, 1)); }
.tt[data-kind="creature"] { --tt-h: calc(56% * var(--k, 1)); --tt-b: 10%; }

.tt-rest { position: absolute; left: 50%; bottom: var(--tt-b); height: var(--tt-h); aspect-ratio: 2 / 3; max-width: 88%; transform: translateX(-50%); visibility: hidden; }

.tt-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .2s ease-out; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.tt.is-on .tt-canvas { opacity: 1; pointer-events: auto; cursor: grab; }
.tt:not(.is-on) .tt-canvas { transition-duration: .32s; }   /* going home from the front at 1x: the loop is already back underneath */
.tt.is-leaving-apart:not(.is-on) .tt-canvas { transition-duration: .22s; }   /* any other view: out first, the loop fades in after */
.tt.is-on.is-grabbing .tt-canvas { cursor: grabbing; }
.tt.is-zoomed .tt-canvas { touch-action: none; }   /* zoomed: one finger turns her sideways and frames her up/down */

/* ENTRY. The studio's own figure steps aside only once the turntable fully covers it (two half-faded layers let the
   backdrop show through her). wipe: one soft band sweeps down the stage - turntable above it, the studio's figure below
   it, the two masks exact complements; fade: the turntable fades in over the paused figure in 150 ms. */
.tt-away { opacity: 0 !important; transition: none !important; }
.tt[data-entry="wipe"] .tt-canvas { transition: none; }
.tt.is-on[data-entry="wipe"] .tt-canvas { animation: tt-wipe-in .42s cubic-bezier(.3, 0, .3, 1) both; }
.tt.is-on[data-entry="fade"] .tt-canvas { transition-duration: .15s; }
.tt-wipe-out { animation: tt-wipe-out .42s cubic-bezier(.3, 0, .3, 1) both !important; }
.tt.is-on[data-entry="wipe"] .tt-canvas, .tt-wipe-out { -webkit-mask-size: 100% 220%; mask-size: 100% 220%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.tt.is-on[data-entry="wipe"] .tt-canvas { -webkit-mask-image: linear-gradient(#000 0 49%, transparent 51%); mask-image: linear-gradient(#000 0 49%, transparent 51%); }
.tt-wipe-out { -webkit-mask-image: linear-gradient(transparent 0 49%, #000 51%); mask-image: linear-gradient(transparent 0 49%, #000 51%); }
.tt.is-on[data-entry="cut"] .tt-canvas { transition: none; }   /* the cut in is instant; the way out always fades */
.tt:not(.is-on) .tt-canvas { -webkit-mask: none; mask: none; }
@keyframes tt-wipe-in { from { -webkit-mask-position: 0 100%; mask-position: 0 100%; } to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
@keyframes tt-wipe-out { from { -webkit-mask-position: 0 100%; mask-position: 0 100%; } to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
.tt-host[data-tt-zoom] > :not(.tt):not(.tt-away) { opacity: 0; transition: opacity .25s; pointer-events: none; }
.tt-host[data-tt-zoom]::after { opacity: 0; }

/* 360 button */
.tt-start { all: unset; box-sizing: border-box; position: absolute; right: 20px; bottom: 18px; display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px 0 13px; border-radius: 999px; background: var(--tt-paper); box-shadow: var(--tt-raise); color: var(--tt-ink-2);
  font: 650 13px/1 var(--sans, system-ui, sans-serif); letter-spacing: .02em; cursor: pointer; pointer-events: auto;
  transition: transform .25s var(--tt-ease), opacity .25s, box-shadow .25s; }
.tt-start svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tt-start:hover { transform: translateY(-1px); color: var(--tt-ink); }
.tt-start:active { transform: translateY(0) scale(.98); }
.tt-start:focus-visible { outline: 2px solid var(--tt-ink); outline-offset: 3px; }
.tt-start::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; opacity: 0; pointer-events: none; transition: opacity .2s;
  background: conic-gradient(var(--tt-ink-2) calc(var(--p, 0) * 1turn), transparent 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; padding: 2px; }
.tt.is-loading .tt-start::after { opacity: .55; }
.tt.is-on .tt-start, .tt.is-pressed .tt-start { opacity: 0; pointer-events: none; transform: translateY(6px); }

/* controls: one slim pill on the right edge, clear of the figure at every width (compass | zoom | done) */
.tt-bar { position: absolute; right: 18px; top: 50%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--tt-paper) 86%, transparent); -webkit-backdrop-filter: blur(12px) saturate(1.1); backdrop-filter: blur(12px) saturate(1.1);
  box-shadow: var(--tt-raise); opacity: 0; transform: translate(10px, -50%); transition: opacity .3s var(--tt-ease), transform .45s var(--tt-ease); pointer-events: none; }
.tt.is-on .tt-bar { opacity: 1; transform: translate(0, -50%); pointer-events: auto; transition-delay: .12s; }
.tt.is-pressed:not(.is-on) .tt-bar { opacity: .55; transform: translate(0, -50%); transition-delay: 0s; }   /* answered at once; live on the swap */
.tt-sep { width: 18px; height: 1px; margin: 5px 0; background: var(--tt-line); }

.tt-dial { position: relative; display: block; width: 36px; height: 36px; border-radius: 50%; }
.tt-dial input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.tt-dial svg { display: block; width: 36px; height: 36px; pointer-events: none; }
.tt-dial-ring { fill: none; stroke: var(--tt-line); stroke-width: 1.6; }
.tt-dial-dot path { fill: none; stroke: var(--tt-ink); stroke-width: 3.4; stroke-linecap: round; }   /* the way they face: bottom = toward you */
.tt-dial:focus-within { outline: 2px solid var(--tt-ink); outline-offset: 2px; }
.tt-dial:has(input:focus:not(:focus-visible)) { outline: none; }

.tt-icon { all: unset; box-sizing: border-box; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--tt-ink-2); cursor: pointer; transition: background .2s, color .2s; }
.tt-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tt-icon:hover { background: color-mix(in srgb, var(--tt-ink) 6%, transparent); color: var(--tt-ink); }
.tt-icon:disabled { opacity: .35; cursor: default; background: none; }
.tt-icon:focus-visible, .tt-done:focus-visible { outline: 2px solid var(--tt-ink); outline-offset: 1px; }
.tt-zval { display: block; padding: 2px 0; text-align: center; font: 650 11px/1 var(--sans, system-ui, sans-serif); color: var(--tt-ink-3); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.tt-done { all: unset; box-sizing: border-box; display: grid; place-items: center; min-width: 44px; height: 28px; margin-top: 2px; padding: 0 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--tt-ink) 7%, transparent); color: var(--tt-ink); font: 650 11.5px/1 var(--sans, system-ui, sans-serif); letter-spacing: .02em; cursor: pointer; transition: background .2s; }
.tt-done:hover { background: color-mix(in srgb, var(--tt-ink) 13%, transparent); }

/* first-time hint: a light chip just under the studio's name + line (JS places it; top-left fallback) */
.tt-hint { position: absolute; left: 26px; top: 110px; margin: 0; padding: 7px 12px; border-radius: 999px; background: color-mix(in srgb, var(--tt-paper) 90%, transparent); box-shadow: var(--tt-raise);
  color: var(--tt-ink-2); font: 650 12px/1.2 var(--sans, system-ui, sans-serif); letter-spacing: .01em; white-space: nowrap;
  opacity: 0; transform: translateY(-4px); transition: opacity .35s var(--tt-ease), transform .45s var(--tt-ease); pointer-events: none; }
.tt.show-hint .tt-hint { opacity: 1; transform: translateY(0); }

@media (max-width: 560px) {
  .tt-start { right: 14px; bottom: 14px; height: 38px; padding: 0 14px 0 11px; }
  .tt-bar { right: 12px; padding: 5px; }
  .tt-hint { font-size: 11.5px; padding: 6px 11px; }
}
/* 11-01: wide figures on narrow phones (Purrloaf's long body, Bao at 320) came within a few px of the 360 button; a tighter
   button tucked closer to the corner keeps it clear of every front pose */
@media (max-width: 420px) {
  .tt-start { right: 10px; bottom: 12px; gap: 6px; padding: 0 11px 0 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .tt, .tt *, .tt-away { transition-duration: .01ms !important; transition-delay: 0s !important; }
}
