/* soulroster.com: the shelf of boxed agents, and the stage a box opens into. */

/* ── the shelf ─────────────────────────────────────────────────────────── */
.shelf{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:58px 34px;padding:34px 8px 10px}
.box{min-width:0;transition:opacity .4s ease,transform .5s cubic-bezier(.2,.8,.2,1);transition-delay:calc(var(--i,0)*70ms)}
.shelf.armed .box:not(.on-shelf){opacity:0;transform:translateY(22px)}
.box[hidden]{display:none}

/* the carton: the agent's colour, a hang tab, a darker side so it reads as a box */
.box-open{--side:color-mix(in srgb,var(--agent-color) 62%,#1d1512);position:relative;display:block;width:100%;padding:12px 12px 14px;border:0;border-radius:14px;background:linear-gradient(160deg,color-mix(in srgb,var(--agent-color) 88%,#fff) 0%,var(--agent-color) 45%,color-mix(in srgb,var(--agent-color) 90%,#1d1512) 100%);color:#1d1512;text-align:left;cursor:pointer;transform-origin:50% -18px;box-shadow:inset 0 1px 0 #ffffff8c,inset 0 -3px 0 #0000001f,7px 8px 0 var(--side),0 30px 44px -20px #2a1d1480;transition:transform .18s ease-out}
.box-tab{position:absolute;left:50%;top:-24px;width:92px;height:30px;margin-left:-46px;border-radius:12px 12px 0 0;background:color-mix(in srgb,var(--agent-color) 88%,#fff);box-shadow:inset 0 1px 0 #ffffff8c}
.box-tab:after{content:"";position:absolute;left:50%;top:9px;width:40px;height:11px;margin-left:-20px;border-radius:99px;background:var(--cream);box-shadow:inset 0 2px 3px #00000059}
.box-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;padding:2px 4px 10px}
.box-head b{font:800 clamp(17px,1.75vw,25px)/1 var(--sans);letter-spacing:.015em;text-transform:uppercase}
.box-head i{font:600 10px/1 var(--mono);font-style:normal;letter-spacing:.1em;opacity:.7;white-space:nowrap}

/* the window: the whole portrait, head room and shoulders, behind a sheet of plastic */
.box-window{position:relative;display:block;aspect-ratio:600/760;border-radius:9px;overflow:hidden;background:#1b1715;isolation:isolate}
.box-window img,.box-window video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.box-window video{object-position:50% 30%;opacity:0;transition:opacity .3s}
.box.awake .box-window video{opacity:1}
.box-window:after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:linear-gradient(128deg,#ffffff3d 0%,#ffffff14 16%,transparent 34%);box-shadow:inset 0 0 0 1.5px #00000059,inset 0 16px 22px -12px #000000b3,inset 0 -34px 40px -24px #00000080}
/* light crossing the plastic: a narrow band, so each frame redraws the strip it covers and not the whole window */
.box-sheen{position:absolute;top:-10%;bottom:-10%;left:0;width:38%;pointer-events:none;background:linear-gradient(104deg,transparent 12%,#ffffff4d 46%,#ffffff1c 62%,transparent 88%);transform:translateX(-140%)}
.box-cue{position:absolute;right:10px;bottom:10px;display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:#141312d9;color:#fff;border:1px solid #ffffff59;transition:background .25s,color .25s,transform .25s}
.box-cue .ico{width:18px;height:18px}
.box-plate{display:flex;align-items:flex-end;justify-content:space-between;gap:8px;padding:12px 4px 0}
.box-plate strong{font:700 clamp(27px,2.7vw,41px)/.95 var(--sans);letter-spacing:-.055em}
.box-tags{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}
.box-tags i{font:700 9.5px/1 var(--mono);font-style:normal;letter-spacing:.08em;text-transform:uppercase;border:1.5px solid #1d1512;border-radius:99px;padding:5px 8px 4px}

/* pointing at a box lifts it straight up, at once. No lean after the pointer and no shadow that grows:
   both had the whole carton redrawn for every move of the mouse */
.box-open:hover,.box-open:focus-visible{transform:translateY(-10px)}
.box-open:hover .box-cue,.box-open:focus-visible .box-cue{background:var(--orange);color:#1c100a;transform:scale(1.1)}
.box-open:focus-visible{outline:3px solid var(--coal);outline-offset:6px}

@media (prefers-reduced-motion:no-preference){
  /* hung on a peg: now and then one box sways and light crosses its window. shelf.mjs picks which,
     one at a time; nothing on the shelf moves for ever */
  .box.sway .box-open{animation:hang 1.5s ease-in-out 1}
  .box.sway .box-open:hover,.box.sway .box-open:focus-visible{animation:none}
  .box.sway .box-sheen{animation:sheen 1.15s ease-in-out .1s 1}
  @keyframes hang{0%,100%{transform:rotate(0)}20%{transform:rotate(-1.15deg)}48%{transform:rotate(.85deg)}74%{transform:rotate(-.4deg)}}
  @keyframes sheen{from{transform:translateX(-140%)}to{transform:translateX(310%)}}
}
@media (prefers-reduced-motion:reduce){.shelf.armed .box:not(.on-shelf){opacity:1;transform:none}.box{transition:none}}

/* ── the stage: the box, opened ────────────────────────────────────────── */
.stage-dialog{width:min(1080px,calc(100vw - 28px));max-width:1080px;padding:0;overflow:hidden;border:0;border-radius:16px;background:#191715}
.stage-dialog[open]{animation:unbox .26s cubic-bezier(.2,.9,.25,1)}
@keyframes unbox{from{opacity:0;transform:scale(.95) translateY(16px)}to{opacity:1;transform:none}}
/* nothing blurred and nothing moving behind an open dialog: the blur had the whole page drawn through a
   filter for every frame of the agent's video */
dialog::backdrop{backdrop-filter:none;background:rgba(8,7,6,.84)}
:root:has(dialog[open]) .hero-face img{animation-play-state:paused}
.stage-dialog #dialog-body{padding:0}
.stage{display:flex;flex-direction:column;max-height:94dvh}
.stage-top{display:flex;align-items:center;gap:14px;padding:9px 12px 9px 20px;background:var(--agent-color);color:#1d1512;flex:none}
.stage-top b{font:800 15px/1 var(--sans);letter-spacing:.07em;text-transform:uppercase}
.stage-top small{font:600 10px/1 var(--mono);letter-spacing:.09em;text-transform:uppercase;opacity:.72}
.stage-tools{margin-left:auto;display:flex;gap:4px;align-items:center}
.stage-top .icon-btn{color:#1d1512;border-color:#1d151259}
.stage-top .icon-btn[aria-pressed="false"]{opacity:.55}
.stage-body{position:relative;flex:1;min-height:0;overflow:auto}
.stage .agent-figure{width:56%;padding:18px 12px 16px 18px}
.stage .agent-chat{position:absolute;inset:0 0 0 56%;padding:18px 18px 14px 8px}

/* the agent: their window, their name, Talk and Hire right under it */
.agent-figure{display:flex;flex-direction:column;gap:12px;min-width:0}
.agent-window{position:relative;aspect-ratio:3/2;border-radius:12px;overflow:hidden;background:#0e0d0c;isolation:isolate;box-shadow:0 0 0 3px var(--agent-color),0 22px 40px -22px #000;transition:box-shadow .3s}
.agent-window.speaking{box-shadow:0 0 0 3px var(--agent-color),0 0 0 7px color-mix(in srgb,var(--agent-color) 35%,transparent),0 22px 40px -22px #000}
.agent-window img,.agent-window video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.agent-window video{opacity:0;transition:opacity .35s}
.agent-window.idle #agent-idle,.agent-window.intro #agent-intro,.agent-window.live #live-face{opacity:1}
.agent-window .box-sheen{animation:sheen 1.1s ease-out .15s 1 both}
.agent-window .live-dot{z-index:2}
.agent-window.live .live-dot{opacity:1}
.hear-btn{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);z-index:3;display:flex;align-items:center;gap:8px;padding:10px 16px;border-radius:99px;background:var(--orange);color:#1c100a;font:700 14px/1 var(--sans);border:0;cursor:pointer}
.hear-btn[hidden]{display:none}
.hear-btn .ico{width:16px;height:16px}
.play-btn{position:absolute;left:12px;bottom:12px;z-index:3;display:flex;align-items:center;justify-content:center;gap:7px;min-width:40px;height:40px;padding:0 11px;border-radius:99px;background:#0d0c0bcc;color:#fff;border:1px solid #ffffff40;font:700 13px/1 var(--sans);cursor:pointer}
.play-btn:hover,.play-btn:focus-visible{border-color:var(--agent-color,var(--orange))}
.play-btn[hidden]{display:none}
.play-btn .ico{width:18px;height:18px;stroke-width:2.2}
.play-btn path,.play-btn span{display:none}
.play-btn[data-mode=pause] .i-pause,.play-btn[data-mode=play] .i-play,.play-btn[data-mode=replay] .i-replay,.play-btn[data-mode=replay] span{display:inline}
.play-btn .i-play{fill:currentColor}
.agent-plate{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap}
.agent-plate h2{font:700 clamp(34px,3.6vw,50px)/.95 var(--sans);letter-spacing:-.06em;margin:0}
.agent-plate p{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:0}
.agent-plate b{font:700 12px/1 var(--mono);letter-spacing:.1em;text-transform:uppercase;color:var(--agent-color);margin-right:4px}
.agent-plate i{font:600 9.5px/1 var(--mono);font-style:normal;letter-spacing:.08em;text-transform:uppercase;border:1px solid #6d6457;border-radius:99px;padding:5px 8px 4px;color:#e7dcc9}
.agent-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.agent-actions>:only-child{grid-column:1/-1}
.talk-btn,.hire-btn{display:flex;align-items:center;justify-content:center;gap:10px;height:54px;border-radius:12px;font:750 17px/1 var(--sans);letter-spacing:-.01em;cursor:pointer}
.talk-btn{position:relative;border:0;background:#f3f0e6;color:#161311;transition:background .2s,color .2s,box-shadow .12s}
.talk-btn .ico{width:21px;height:21px}
.talk-btn:hover{background:#fff}
.talk-btn[data-state=listening]{background:#e0392f;color:#fff;box-shadow:0 0 0 calc(3px + var(--level,0)*16px) #e0392f55}
.talk-btn[data-state=thinking]{background:#37332e;color:#d8d0c2;cursor:default}
.talk-btn[data-state=thinking] .ico{display:none}
.talk-btn[data-state=thinking] span:after{content:"…";display:inline-block;width:1.1em;text-align:left;animation:dots 1.2s steps(4,end) infinite;overflow:hidden;vertical-align:bottom}
@keyframes dots{from{width:0}to{width:1.1em}}
.hire-btn .ico{width:18px;height:18px}
.agent-status{font:500 12px/1.4 var(--sans);color:#c9beb2;margin:0;min-height:1.4em}

/* the conversation beside them */
.agent-chat{display:flex;flex-direction:column;min-width:0;min-height:0}
.agent-chat .chat-history{flex:1;min-height:90px;padding-top:2px}
.agent-chat .message p{font-size:15.5px;line-height:1.42}
.agent-chat .starters{margin:8px 0}
.agent-chat .starters button{font-size:12px;padding:5px 10px}
.stage-links{display:flex;gap:16px;justify-content:flex-end;margin-top:6px}
/* "Already hired? Sign in", right under Hire (only on a browser that isn't signed in) */
.signin-hint{align-self:flex-end;font-size:13px;margin:-6px 0 -8px;padding:6px 0}
.signin-hint u{text-underline-offset:3px}

@media (max-width:760px){
  .shelf{grid-template-columns:repeat(2,minmax(0,1fr));gap:42px 14px;padding:30px 2px 6px}
  .box-open{padding:8px 8px 10px;border-radius:11px;box-shadow:inset 0 1px 0 #ffffff8c,inset 0 -2px 0 #0000001f,4px 5px 0 var(--side),0 22px 30px -18px #2a1d1480}
  .box-tab{width:64px;height:24px;margin-left:-32px;top:-19px}
  .box-tab:after{width:28px;height:8px;margin-left:-14px;top:8px}
  .box-head{padding:1px 2px 7px}
  .box-head i{display:none}
  .box-head b{font-size:14px}
  .box-plate{display:block;padding:8px 2px 0}
  .box-plate strong{font-size:25px;display:block;margin-bottom:6px}
  .box-tags{justify-content:flex-start}
  .box-tags i{font-size:8px;padding:4px 6px 3px}
  .box-cue{width:30px;height:30px;right:6px;bottom:6px}
  .box-cue .ico{width:15px;height:15px}
  .stage-dialog{width:calc(100vw - 14px);border-radius:14px}
  .stage{max-height:96dvh}
  .stage-top small{display:none}
  .stage .agent-figure{width:100%;padding:12px 12px 8px;gap:9px}
  .stage .agent-chat{position:static;padding:0 12px 12px}
  .agent-chat .chat-history{flex:none;max-height:24dvh;min-height:76px}
  .agent-chat .starters{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin:6px -12px;padding:0 12px}
  .agent-chat .starters button{white-space:nowrap;flex:none}
  .agent-plate h2{font-size:32px}
  .talk-btn,.hire-btn{height:50px;font-size:16px}
}
