/* Chapter 4: the night shift. A dark panel set into the page, not a full-bleed band, so there is
   no gradient in or out. Left: the team as an index. Right: one large screen, legible. */

.team { position: relative; z-index: 1; }
.team__pin { height: 100vh; height: 100svh; display: grid; grid-template-rows: 1fr auto; gap: 14px; padding: 92px var(--gutter) 24px; max-width: 1520px; margin: 0 auto; }
.team__panel {
  min-height: 0; display: grid; grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.6fr); gap: 40px; align-items: center;
  padding: 40px 44px; border-radius: 32px; background: var(--night); color: var(--night-text);
  box-shadow: 0 40px 80px -40px rgba(20, 20, 30, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  overflow: hidden;
}
.team__side { display: grid; gap: 18px; align-content: center; min-height: 0; }
.team__side .h { font-size: clamp(30px, 3vw, 48px); }
.team__side .lede { color: var(--night-dim); font-size: 14.5px; }
.team__clock { color: var(--night-dim); font-size: 12.5px; }
.team__clock span { color: var(--gold); font-variant-numeric: tabular-nums; }

.team__list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; }
.team__list button { width: 100%; display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; gap: 2px 12px; align-items: center; padding: 9px 10px; border-radius: 12px; text-align: left; color: var(--night-dim); transition: background-color 300ms var(--ease-out), color 300ms var(--ease-out); }
.team__list li.is-on button { background: rgba(255, 255, 255, 0.05); color: var(--night-text); }
@media (hover: hover) and (pointer: fine) { .team__list button:hover { color: var(--night-text); } }
.tl__mark { grid-row: 1 / 3; width: 30px; height: 30px; opacity: 0.55; transition: opacity 300ms; }
.is-on .tl__mark { opacity: 1; }
.tl__mark .monad-svg { width: 30px; height: 30px; }
.tl__txt b { display: block; font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.tl__txt small { display: block; font-size: 12px; color: #77736a; }
.tl__bar { grid-column: 2; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.tl__bar i { display: block; height: 100%; width: 100%; background: var(--c); transform-origin: left; transform: scaleX(var(--fill, 0)); }

.team__view { position: relative; min-height: 0; height: 100%; align-self: stretch; }
.tv__frame { position: relative; display: grid; height: 100%; }

/* One desk per agent, stacked; the active one is in. Like a dossier: the name set huge behind,
   the agent working at its own device, the screen running its job. */
.mx {
  grid-area: 1 / 1; position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0;
  border-radius: 24px; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 90% at 30% 100%, color-mix(in srgb, var(--c) 22%, transparent), transparent 60%), var(--night-2);
  box-shadow: 0 0 0 1px var(--night-line), 0 50px 90px -50px rgba(0, 0, 0, 0.8);
  opacity: 0; transform: translateY(18px) scale(0.985); pointer-events: none;
  transition: opacity 500ms var(--ease-out), transform 700ms var(--ease-out);
}
.mx.is-before { transform: translateY(-18px) scale(0.985); }
.mx.is-on { opacity: 1; transform: none; pointer-events: auto; }
.mx__name { position: absolute; z-index: -1; left: -0.04em; bottom: -0.2em; font: 700 clamp(90px, 13vw, 210px)/0.8 var(--sans); letter-spacing: -0.07em;
  color: color-mix(in srgb, var(--c) 30%, transparent); white-space: nowrap; pointer-events: none;
  transform: translateX(calc((1 - var(--in, 1)) * 30px)); transition: transform 900ms var(--ease-out); }
.mx:not(.is-on) .mx__name { --in: 0; }

.mx__head { display: flex; align-items: baseline; gap: 14px; padding: 18px 22px 0; }
.mx__head .mono { color: color-mix(in srgb, var(--c) 70%, #f1f0eb); font-size: 11.5px; white-space: nowrap; }
.mx__head b { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; color: var(--night-text); }
.mx__live { margin-left: auto; display: flex; align-items: center; gap: 7px; color: var(--night-dim); }
.mx__live i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); animation: live 2s ease-in-out infinite; }
@keyframes live { 50% { opacity: 0.4; } }

/* The desk: device centre-right, the agent at its corner looking down at the work, its message above. */
.mx__desk { position: relative; min-height: 0; display: grid; place-items: center; padding: 14px 22px 30px 18%; container-type: size; }
.mx__dev { position: relative; width: min(100cqw, 100cqh * 1.5); }
.mx__screen { position: relative; overflow: hidden; background: #12110f; aspect-ratio: 16 / 10; }
.mx__fit { position: absolute; left: 0; top: 0; width: 720px; height: 450px; transform-origin: 0 0; }

/* Laptop: a lid with a thin bezel and a camera, and a base that the lid sits on. */
.mx--laptop .mx__dev { width: min(92cqw, 86cqh * 1.5); margin-bottom: 14px; padding: 2.2% 2.2% 3%; border-radius: 14px 14px 4px 4px; background: #24221e; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07); }
.mx--laptop .mx__dev::before { content: ''; position: absolute; left: 50%; top: 0.9%; width: 5px; height: 5px; border-radius: 50%; translate: -50% 0; background: #3c3932; }
.mx--laptop .mx__dev::after { content: ''; position: absolute; left: -7%; right: -7%; top: 100%; height: 14px; border-radius: 0 0 16px 16px;
  background: linear-gradient(#3a3730, #1e1c19); box-shadow: 0 20px 30px -12px rgba(0,0,0,0.7); }
.mx--laptop .mx__screen { border-radius: 4px; }

/* Monitor: a deeper bezel on a stand. */
.mx--monitor .mx__dev { width: min(96cqw, 82cqh * 1.6); padding: 1.6%; border-radius: 12px; background: #1c1a17; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 26px 40px -22px rgba(0,0,0,0.8); margin-bottom: 12cqh; }
.mx--monitor .mx__dev::after { content: ''; position: absolute; left: 50%; top: 100%; width: 16%; height: 11cqh; translate: -50% 0;
  background: linear-gradient(90deg, #2a2823, #3a3731 50%, #2a2823); clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%); }
.mx--monitor .mx__screen { border-radius: 4px; }

/* Tablet: even bezel all round, rounded, propped at a slight angle. */
.mx--tablet .mx__dev { width: min(88cqw, 86cqh * 1.5); padding: 3%; border-radius: 26px; background: #22201c; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 30px 50px -24px rgba(0,0,0,0.8); transform: perspective(1400px) rotateX(8deg); }
.mx--tablet .mx__screen { border-radius: 10px; }

/* Phone: portrait, so the screen shows a slice of the job and pans with the scroll. A record dot: UGC is filming. */
.mx--phone .mx__dev { width: auto; height: 100cqh; aspect-ratio: 9 / 18.5; padding: 10px; border-radius: 34px; background: #22201c; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1), 0 30px 50px -24px rgba(0,0,0,0.8); }
.mx--phone .mx__screen { aspect-ratio: auto; height: 100%; border-radius: 26px; }
.mx--phone .mx__dev::before { content: ''; position: absolute; z-index: 1; left: 50%; top: 18px; width: 30%; height: 18px; border-radius: 99px; translate: -50% 0; background: #0b0a09; }
.mx--phone .mx__dev::after { content: 'REC'; position: absolute; z-index: 1; right: 22px; top: 50px; padding: 3px 7px 3px 18px; border-radius: 99px; font: 600 9px var(--mono); letter-spacing: 0.08em; color: #fff;
  background: radial-gradient(circle at 9px 50%, #ff4d4d 3.5px, transparent 4.5px), rgba(0,0,0,0.55); animation: live 1.4s ease-in-out infinite; }

/* The screen glows on the agent and the desk. */
.mx__dev { filter: drop-shadow(0 0 40px color-mix(in srgb, var(--c) 18%, transparent)); }

/* The agent, at the device's lower left corner, a little in front of it. */
.mx__face { position: absolute; z-index: 2; left: 2%; bottom: 4%; width: min(30cqw, 52cqh); aspect-ratio: 1; transform: translateY(calc((1 - var(--in, 1)) * 24px)) scale(calc(0.9 + var(--in, 1) * 0.1)); transition: transform 800ms var(--ease-out); }
.mx:not(.is-on) .mx__face { --in: 0; }
.mx__face .agent-persona { width: 100%; height: 100%; filter: drop-shadow(0 24px 30px rgba(0,0,0,0.55)); }

/* What it says to the team, a bubble from the agent. */
.mx__dm { position: absolute; z-index: 3; left: calc(2% + min(30cqw, 52cqh) * 0.62); bottom: calc(4% + min(30cqw, 52cqh) * 0.86); max-width: min(46cqw, 340px);
  margin: 0; padding: 11px 14px; border-radius: 16px 16px 16px 4px; background: #f1f0eb; color: #12110f; font-size: 13.5px; line-height: 1.4; box-shadow: 0 18px 30px -16px rgba(0,0,0,0.7);
  opacity: var(--in, 1); transform: translateY(calc((1 - var(--in, 1)) * 10px)); transition: opacity 500ms 300ms, transform 600ms 300ms var(--ease-out); }
.mx:not(.is-on) .mx__dm { --in: 0; transition-delay: 0ms; }
.mx__dm .mono { display: block; margin-bottom: 3px; font-size: 10px; color: color-mix(in srgb, var(--c) 75%, #0a0a0a); }
.team__note { color: var(--grey-3); text-align: center; }

@media (max-width: 900px) {
  /* Pinned like desktop: one screen tall, the index a row of pills, the screen larger and panning. */
  .team__pin { padding: 76px 10px 12px; gap: 8px; }
  .team__pin { grid-template-rows: minmax(0, 1fr); }
  .team__panel { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); align-content: stretch; gap: 14px; padding: 20px 14px 14px; border-radius: 26px; }
  .team__side { gap: 10px; align-content: start; }
  .team__view { min-height: 0; overflow: hidden; }
  /* The desk is a size container, so the card must stretch to give it a height. */
  .tv__frame { align-items: stretch; }
  .team__note { display: none; }
  .team__side .h { font-size: 28px; }
  .team__side .lede { display: none; }
  .team__list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 4px -14px 0; padding: 0 14px 2px; }
  .team__list::-webkit-scrollbar { display: none; }
  .team__list li { flex: 0 0 auto; }
  .team__list button { grid-template-columns: 22px auto; padding: 7px 12px 7px 7px; border-radius: 999px; background: rgba(255,255,255,0.04); }
  .team__list li.is-on button { background: rgba(255,255,255,0.1); box-shadow: inset 0 0 0 1px var(--c); }
  .tl__mark { width: 22px; height: 22px; grid-row: 1; }
  .tl__mark .monad-svg { width: 22px; height: 22px; }
  .tl__txt b { font-size: 13px; }
  .tl__txt small, .tl__bar { display: none; }
  .mx { border-radius: 18px; }
  .mx__head { padding: 12px 14px 0; flex-wrap: wrap; gap: 4px 10px; }
  .mx__head b { font-size: 13.5px; }
  .mx__desk { padding: 10px 12px 14px 12px; }
  .mx__face { width: min(34cqw, 40cqh); }
  .mx__dm { left: calc(2% + min(34cqw, 40cqh) * 0.6); bottom: calc(4% + min(34cqw, 40cqh) * 0.8); font-size: 12px; max-width: 58cqw; }
  .team__note { font-size: 10.5px; }
}

/* Short laptop screens: the panel must fit one viewport without clipping the index. */
@media (min-width: 901px) and (max-height: 860px) {
  .team__pin { padding-top: 80px; padding-bottom: 12px; }
  .team__panel { padding: 26px 32px; gap: 28px; }
  .team__side { gap: 12px; }
  .team__side .h { font-size: clamp(26px, 2.4vw, 36px); }
  .team__side .lede { display: none; }
  .team__list button { padding: 6px 10px; }
  .tl__txt small { display: none; }
  .tl__mark, .tl__mark .monad-svg { width: 24px; height: 24px; }
  .team__view { width: 100%; }
}

/* The phone's own portrait layout of the UGC job: the take full-bleed, the teleprompter over the
   top, captions in the middle, the beats and the hook score along the bottom. */
.mx--phone .mx__fit { width: 320px; height: 660px; }
.mx--phone .mx__dev::after { display: none; }
.mx--phone .s--ugc { display: block; padding: 0; }
.mx--phone .s--ugc .s__bar { display: none; }
.mx--phone .ug2__phone { position: absolute; inset: 0; border-radius: 0; box-shadow: none; }
.mx--phone .ug2__phone::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,0.55), transparent 34%, transparent 58%, rgba(0,0,0,0.7)); }
.mx--phone .ug2__rec { z-index: 2; left: auto; right: 16px; top: 54px; font-size: 12px; }
.mx--phone .ug2__words { z-index: 2; bottom: 46%; font-size: 24px; }
.mx--phone .ug2__right { position: absolute; z-index: 2; inset: 92px 14px 18px; display: flex; flex-direction: column; justify-content: space-between; }
.mx--phone .ug2__prompt { background: rgba(10, 10, 10, 0.45); backdrop-filter: blur(6px); padding: 10px 12px; gap: 3px; }
.mx--phone .ug2__line { font-size: 13px; }
.mx--phone .ug2__right > :not(.ug2__prompt) { margin-top: 0; }
.mx--phone .ug2__beats { order: 3; color: #fff; }
.mx--phone .ug2__score { order: 2; margin: auto 0 12px; background: rgba(20, 18, 16, 0.75); backdrop-filter: blur(6px); }
