/* The live stylist (/shop/try/<handle>): a video call. The shopper's mirrored camera fills the screen; the stylist is a
   picture-in-picture tile; the only other things are the close button and short-lived cards. */
:root { --ink: #F4F1EB; --mute: rgba(244,241,235,.72); --card: rgba(18,18,18,.78); --line: rgba(244,241,235,.2); --accent: #E8643C; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: var(--ink); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
#live { position: fixed; inset: 0; height: 100dvh; }
.stage { position: absolute; inset: 0; background: #000; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.close { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 12px; z-index: 5; width: 40px; height: 40px; border-radius: 20px; border: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(6px); font-size: 18px; display: grid; place-items: center; }
/* the stylist: a clear picture-in-picture tile, about a third of a phone's width, a large corner tile on a laptop */
.tile { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 4; width: 30vw; max-width: 340px; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; background: #1A1714; box-shadow: 0 10px 30px rgba(0,0,0,.45); outline: 2px solid transparent; transition: outline-color .2s; }
@media (min-width: 760px) { .tile { width: 22vw; min-width: 220px; } }
.tile .vid { position: absolute; inset: 0; }
.tile video { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }
.tile[data-state="speaking"] { outline-color: rgba(232,100,60,.85); }
.tile[data-state="listening"] { outline-color: rgba(244,241,235,.35); }
.orb { position: absolute; inset: 0; display: grid; place-items: center; }
.orb i { width: 42%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #F2A07F, var(--accent) 55%, #7A2E17); animation: breathe 3.2s ease-in-out infinite; }
.tile[data-state="speaking"] .orb i { animation-duration: .9s; }
/* no avatar face: the stylist is a small glowing orb, no box (the camera stays the whole screen) */
.tile.voice { width: 64px; min-width: 0; aspect-ratio: 1; border-radius: 50%; background: transparent; box-shadow: none; overflow: visible; outline: none; }
@media (min-width: 760px) { .tile.voice { width: 84px; } }
.tile.voice .orb i { width: 100%; box-shadow: 0 0 22px rgba(232,100,60,.55); }
.tile.voice[data-state="listening"] .orb i { box-shadow: 0 0 0 3px rgba(244,241,235,.55), 0 0 22px rgba(232,100,60,.4); }
@keyframes breathe { 0%, 100% { transform: scale(.92); } 50% { transform: scale(1.04); } }
.card { position: absolute; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 4; max-width: 420px; margin: 0 auto; display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: var(--card); backdrop-filter: blur(8px); animation: up .25s ease-out; }
.card img { width: 56px; height: 72px; object-fit: cover; border-radius: 8px; background: #2A2622; }
.card .t { flex: 1; min-width: 0; }
.card b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card s { color: var(--mute); margin-left: 6px; font-size: 13px; }
.btn { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); background: transparent; font-weight: 600; }
.btn.solid { background: var(--ink); color: #111; border-color: var(--ink); }
.toast { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 6; padding: 10px 16px; border-radius: 14px; background: var(--card); font-size: 14px; white-space: nowrap; animation: up .25s ease-out; }
@keyframes up { from { opacity: 0; transform: translate(var(--tx, 0), 8px); } to { opacity: 1; transform: translate(var(--tx, 0), 0); } }
.toast { --tx: -50%; }
.photo { position: absolute; inset: 0; z-index: 7; background: #0B0A09; display: flex; flex-direction: column; }
.photo img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.photo .row { display: flex; gap: 10px; justify-content: center; padding: 12px 12px calc(14px + env(safe-area-inset-bottom)); }
.making { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 4; padding: 8px 14px; border-radius: 999px; background: var(--card); font-size: 13px; color: var(--mute); }
.making i { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--accent); animation: breathe .9s infinite; }
/* the entry: one line of consent, one tap (it also unlocks the microphone and sound) */
.entry { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 24px; background: radial-gradient(120% 80% at 50% 30%, #2A2420, #0C0B0A); text-align: center; }
.entry .in { max-width: 380px; display: grid; gap: 18px; justify-items: center; }
.entry h1 { margin: 0; font: 500 30px/1.15 Georgia, "Times New Roman", serif; }
.entry p { margin: 0; color: var(--mute); font-size: 14px; }
.entry .go { min-height: 54px; min-width: 220px; border-radius: 27px; border: 0; background: var(--ink); color: #111; font-weight: 700; font-size: 16px; }
.entry .back { color: var(--mute); text-decoration: none; font-size: 13px; }
.note { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; padding: 24px; background: rgba(0,0,0,.72); text-align: center; }
@media (prefers-reduced-motion: reduce) { .orb i, .making i { animation: none; } .card, .toast { animation: none; } }
.hear { position: absolute; left: 50%; transform: translateX(-50%); top: calc(64px + env(safe-area-inset-top)); z-index: 6; }
/* the call's photos: a strip of thumbnails at the side, newest first (30 minutes), that never covers the face or body:
   a column under the stylist's tile on a laptop, a slim stack at the left edge on a phone */
.shots { position: absolute; z-index: 4; display: flex; flex-direction: column; gap: 8px; right: 12px; top: calc(12px + env(safe-area-inset-top) + min(22vw * 4 / 3, 453px) + 12px); max-height: 50vh; overflow-y: auto; scrollbar-width: none; }
.shot { width: 84px; aspect-ratio: 2 / 3; padding: 0; border: 2px solid rgba(244,241,235,.6); border-radius: 10px; overflow: hidden; background: #1A1714; }
.shot.on { border-color: var(--accent); }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 700px) {
  .shots { right: auto; left: 8px; top: calc(64px + env(safe-area-inset-top)); max-height: 46vh; gap: 6px; }
  .shot { width: 46px; border-radius: 8px; }
}
.photo .close { z-index: 8; }
/* the pieces the stylist found: a row of cards at the bottom that drifts on its own; a tap puts one on */
.rail { position: absolute; left: 0; right: 0; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 4; display: flex; gap: 10px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; animation: up .3s ease-out; }
.rail::-webkit-scrollbar { display: none; }
.piece { flex: none; width: 116px; padding: 6px; border: 0; border-radius: 14px; background: var(--card); backdrop-filter: blur(8px); text-align: left; color: var(--ink); }
.piece img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 9px; background: #2A2622; display: block; }
.piece b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 5px; font-size: 12px; font-weight: 600; line-height: 1.25; }
.piece span { font-size: 12px; color: var(--mute); }
@media (min-width: 760px) { .piece { width: 140px; } .rail { padding: 0 24px; } }
.making { bottom: calc(14px + env(safe-area-inset-bottom) + var(--rail-h, 0px)); }
/* which size, before a piece goes in the store's bag (inside a brand's own site) */
.card.sizes { align-items: flex-start; z-index: 7; }
.card.sizes .t span { display: block; color: var(--mute); font-size: 13px; margin-top: 2px; }
.card.sizes .sz { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.card.sizes .sz .btn { min-width: 48px; padding: 0 12px; }
.entry button.back { background: none; border: 0; color: var(--mute); font-size: 13px; text-decoration: none; }
