/* ============================================================
   AI employees: the showroom and the roles (/ai-employees) and the
   hire page. A portrait is a 4:5 studio profile, img/emp-<slug>.webp,
   placed by scripts/place_headshots.py. Every portrait faces right
   with the face in the same spot, so one crop rule fits all four.
   ============================================================ */

/* ---------- the portrait frame ---------- */
.emp-portrait { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; isolation: isolate; border-radius: var(--r-card); background: #D5DDDC; }
.emp-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.emp-portrait::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: .14; mix-blend-mode: multiply; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
/* a slot with no portrait yet stays empty rather than showing a stand-in */
.emp-portrait.ph { display: none; }

/* ---------- /ai-employees: the head ---------- */
.crew-hero { padding-bottom: 58px; }
.crew-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px 60px; flex-wrap: wrap; }
.crew-head h1 { max-width: none; }
.crew-head .lede { margin: 0 0 10px; max-width: 33ch; }

/* ---------- the showroom: four lit portraits that start on the paper and end in the dark ---------- */
.crew { position: relative; isolation: isolate; overflow: hidden; padding: 0 0 116px; color: var(--white);
  background: linear-gradient(180deg, var(--paper) 0, var(--paper) 168px, var(--dark) 168px, var(--dark) 100%); }
.crew > .dot-glow { right: -200px; bottom: -220px; z-index: 0; }
.crew-rail { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; max-width: 1380px; margin: 0 auto; padding: 0 var(--pad); }
.crew-tile { position: relative; display: block; aspect-ratio: 4 / 5.6; overflow: hidden; isolation: isolate; border-radius: 22px; background: var(--dark-2);
  box-shadow: 0 60px 90px -54px rgba(0,0,0,.78), 0 22px 34px -26px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.07);
  transition: opacity .45s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.crew-tile .emp-portrait { position: absolute; inset: 0; z-index: -2; aspect-ratio: auto; border-radius: 0; }
.crew-tile .emp-portrait img { object-position: 66% 26%; transition: transform 1.4s cubic-bezier(.2,.7,.2,1); }
.crew-tile::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(12,12,12,0) 48%, rgba(12,12,12,.5) 72%, rgba(12,12,12,.93) 100%); }
.crew-copy { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 9px; padding: clamp(18px, 1.7vw, 26px); }
.crew-role { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.76); }
.crew-role i { font-style: normal; letter-spacing: 0; font-size: 15px; color: var(--lime); opacity: 0; transform: translateY(-5px); transition: opacity .3s ease, transform .3s ease; }
.crew-line { min-height: 2.24em; font-size: clamp(21px, 1.95vw, 28px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.12; color: var(--white); text-wrap: balance; }
.crew-line em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.crew-tile.reveal:nth-child(2) { transition-delay: .07s; }
.crew-tile.reveal:nth-child(3) { transition-delay: .14s; }
.crew-tile.reveal:nth-child(4) { transition-delay: .21s; }
@media (hover: hover) {
  .crew-rail:hover .crew-tile:not(:hover) { opacity: .5; }
  .crew-tile.on:hover { transform: translateY(-8px); transition-delay: 0s; }
  .crew-tile:hover .emp-portrait img { transform: scale(1.05); }
  .crew-tile:hover .crew-role i { opacity: 1; transform: none; }
}
.crew-tile:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }

/* how it starts, and the terms, in one breath under the portraits */
.crew-how { position: relative; z-index: 2; margin-top: 104px; }
.crew-how .statement { max-width: 17em; color: var(--white); text-wrap: balance; }
.crew-terms { display: flex; flex-wrap: wrap; gap: 10px 38px; margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--dark-line); font-size: 15.5px; color: var(--dark-muted); }
.crew-terms b { font-weight: 600; color: var(--white); }

/* ---------- the roles ----------
   Default (phones, small windows, no script): a quiet list, one role after another.
   .pinned (script, wide screen): the section holds still while you scroll through the four. Names on the left,
   one full portrait in the middle, that role's words on the right. ---------- */
.roles { padding: 88px 0 0; }
.roles-index, .roles-stage { display: none; }
.role { padding: 46px 0; border-top: 1px solid var(--line-strong); scroll-margin-top: 96px; }
.role:first-child { border-top: 0; padding-top: 8px; }
.role-name { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: clamp(38px, 6vw, 54px); line-height: 1; letter-spacing: -0.012em; }
.role h3 { margin-top: 18px; font-size: clamp(21px, 1.8vw, 27px); font-weight: 500; letter-spacing: -0.022em; line-height: 1.18; }
.role p { margin-top: 12px; max-width: 46ch; color: var(--muted); font-size: 16px; line-height: 1.62; text-wrap: pretty; }
.role .role-tags { display: grid; gap: 7px; max-width: 46ch; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-strong); font-size: 14px; font-weight: 600; letter-spacing: .005em; color: var(--ink-soft); }
.role .btn { margin-top: 26px; }

/* the list on a mid-width screen (not pinned): the name in its own column, the words beside it */
@media (min-width: 761px) {
  .roles:not(.pinned) .role { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); column-gap: clamp(28px, 5vw, 64px); align-items: start; }
  .roles:not(.pinned) .role-name { grid-column: 1; grid-row: 1 / span 4; }
  .roles:not(.pinned) .role > :not(.role-name) { grid-column: 2; }
  .roles:not(.pinned) .role h3 { margin-top: 6px; }
  .roles:not(.pinned) .role .btn { justify-self: start; }
}

.roles.pinned { padding: 0; }
.roles.pinned .roles-pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; align-items: center; padding-top: 74px; }
.roles.pinned .roles-grid { display: grid; grid-template-columns: minmax(0, 4.4fr) minmax(0, 4.8fr) minmax(0, 3.8fr); gap: clamp(28px, 4.6vw, 80px); align-items: center; width: 100%; }
.roles.pinned .roles-index { display: grid; gap: clamp(4px, 1.2vh, 14px); list-style: none; }
.roles-index button { display: block; width: 100%; padding: 4px 0; border: 0; background: none; cursor: pointer; text-align: left; color: var(--ink);
  font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: clamp(42px, min(5.1vw, 9.2vh), 80px); line-height: 1.06; letter-spacing: -0.014em;
  opacity: .2; transition: opacity .45s ease; }
.roles-index button:hover { opacity: .5; }
.roles-index button.on { opacity: 1; }
.roles-index button:focus-visible { outline: 2px solid var(--lime); outline-offset: 6px; border-radius: 6px; opacity: .7; }
.roles.pinned .roles-stage { display: block; position: relative; justify-self: center; width: min(100%, 54vh); aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden; background: #D5DDDC;
  box-shadow: 0 64px 90px -56px rgba(18,18,18,.5), 0 24px 36px -28px rgba(18,18,18,.3); }
.roles-stage .emp-portrait { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; opacity: 0; transition: opacity .7s ease; }
.roles-stage .emp-portrait img { object-position: 50% 50%; transform: scale(1.045); transition: transform 1.6s cubic-bezier(.2,.7,.2,1); }
.roles-stage .emp-portrait.on { opacity: 1; }
.roles-stage .emp-portrait.on img { transform: none; }
.roles.pinned .roles-copy { display: grid; }
.roles.pinned .role { grid-area: 1 / 1; align-self: center; padding: 0; border: 0; opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity .45s ease, transform .6s cubic-bezier(.2,.7,.2,1), visibility 0s linear .45s; }
.roles.pinned .role.on { opacity: 1; visibility: visible; transform: none; transition: opacity .55s ease .12s, transform .7s cubic-bezier(.2,.7,.2,1) .12s, visibility 0s; }
.roles.pinned .role-name { display: none; }
.roles.pinned .role h3 { margin-top: 0; font-size: clamp(23px, 2vw, 30px); }
.roles.pinned .role p, .roles.pinned .role .role-tags { max-width: 36ch; }
.crew-close { padding: 96px 0 110px; }

/* ---------- the hire page ---------- */
.hire-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 76px); align-items: start; }
.hire-pick { border: 0; display: grid; gap: 12px; }
.hire-pick legend, .hire-form-title { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pick { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 18px 12px 12px; border-radius: 18px; background: var(--white); border: 1px solid var(--line-strong); cursor: pointer; transition: border-color .2s ease, box-shadow .2s ease; }
.pick:hover { border-color: rgba(18,18,18,.4); }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
/* a pick's face: its own head-centered square (img/emp-<slug>-face.webp, cut by scripts/headshot_set.py), never the big portrait zoomed in */
.pick-face { display: block; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; background: #D5DDDC; }
.pick-face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pick-text { display: grid; gap: 2px; }
.pick-text b { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.pick-text small { font-size: 13.5px; color: var(--muted); }
.pick-side { display: flex; align-items: center; gap: 14px; }
.pick-price { font-size: 14px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.pick-check { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; transition: background .2s ease, border-color .2s ease; }
.pick-check svg { width: 12px; height: 12px; opacity: 0; transform: scale(.6); transition: opacity .2s ease, transform .2s ease; }
.pick:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), 0 18px 30px -24px rgba(18,18,18,.5); }
.pick:has(input:checked) .pick-check { background: var(--lime); border-color: var(--lime); }
.pick:has(input:checked) .pick-check svg { opacity: 1; transform: none; }
.pick:has(input:focus-visible) { outline: 2px solid var(--lime); outline-offset: 3px; }
.hire-total { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 8px; padding: 18px 4px 0; border-top: 1px solid var(--line-strong); font-size: 15px; color: var(--muted); }
.hire-total b { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; color: var(--ink); }
.hire-none { display: none; margin-top: 4px; font-size: 14px; font-weight: 600; color: #A33A1E; }
.hire-none.show { display: block; }
#auditForm textarea { min-height: 112px; }

@media (max-width: 1020px) {
  .crew-rail { gap: 12px; }
}
@media (min-width: 761px) and (max-width: 940px) {
  .crew-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 720px; }
  .crew-tile { aspect-ratio: 4 / 5; }
}
@media (max-width: 860px) {
  .hire-grid { grid-template-columns: 1fr; gap: 44px; }
}
@media (max-width: 760px) {
  /* a phone swipes through the four */
  .crew { padding-bottom: 80px; background: linear-gradient(180deg, var(--paper) 0, var(--paper) 120px, var(--dark) 120px, var(--dark) 100%); }
  .crew-rail { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 12px; padding: 0 var(--pad) 8px; scroll-padding: 0 var(--pad); }
  .crew-rail::-webkit-scrollbar { display: none; }
  .crew-tile { flex: 0 0 74vw; max-width: 330px; scroll-snap-align: start; }
  .crew-how { margin-top: 64px; }
  .crew-terms { flex-direction: column; gap: 8px; margin-top: 30px; }
  .roles { padding-top: 60px; }
  .role { padding: 40px 0; }
  .role .btn { width: 100%; justify-content: center; }
  .crew-close { padding: 64px 0 74px; }
}
@media (max-width: 560px) {
  .pick { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; padding: 10px 14px 10px 10px; }
  .pick-face { width: 48px; height: 48px; }
  .pick-price { display: none; }
}
@media (prefers-reduced-motion: reduce) { .crew-tile, .crew-tile .emp-portrait img, .roles-index button, .roles-stage .emp-portrait, .roles-stage .emp-portrait img, .roles.pinned .role { transition: none; } }
