/* ==========================================================================
   WHO — 05 "Who it's for" (paper). Owned by Agent FLEET. Scoped under .who.
   An audience chooser: four big names, a phone tile marks the active one,
   and one card says the job and which offer fits.
   Without JS (.is-js absent) each card simply sits under its name.
   ========================================================================== */

.who {
  --who-size: clamp(1.875rem, 4.3vw, 4rem);
  --who-dim: var(--fg-3);
  --who-shift: 0.92em;
}
@supports (color: color-mix(in srgb, red, blue)) {
  .who { --who-dim: color-mix(in srgb, var(--fg) 56%, var(--bg)); }
}

.who .who-head { display: grid; row-gap: clamp(1.125rem, 2vw, 1.625rem); }

/* ---------- The chooser ---------- */

.who .who-chooser {
  position: relative;
  margin-top: clamp(2rem, 4vw, 3.5rem);
  font-size: var(--who-size);
}

.who .who-name { margin: 0; font-size: inherit; }
.who .who-btn {
  display: block;
  width: fit-content;
  max-width: calc(100% - var(--who-shift));
  padding: 0.13em 0;
  overflow: clip;
  text-align: left;
  font-stretch: 125%;
  font-weight: 640;
  font-size: inherit;
  letter-spacing: -0.035em;
  line-height: 1.02;
  color: var(--fg);
  text-wrap: balance;
  -webkit-tap-highlight-color: transparent;
}
.who .who-w { display: block; }
.who .who-btn:focus-visible { outline-offset: 0.12em; border-radius: var(--r-2); }

.who .who-marker { display: none; }

.who .who-panel { font-size: 1.0625rem; margin: 0.875rem 0 2.125rem; }
.who .who-card {
  display: grid;
  align-content: start;
  justify-items: start;
  row-gap: clamp(1.25rem, 2.2vw, 1.75rem);
  padding: clamp(1.375rem, 2.6vw, 2.25rem);
  border-radius: var(--r-3);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.who .who-job {
  max-width: 30ch;
  font-size: clamp(1.1875rem, 1.6vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.32;
  color: var(--fg);
  text-wrap: pretty;
}
.who .who-fit { display: grid; row-gap: 0.75rem; }
.who .who-opts { display: flex; flex-wrap: wrap; gap: 0.625rem 1.625rem; }
.who .who-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.0625rem;
  font-weight: 620;
  line-height: 1.2;
  color: var(--fg-3);
}
.who .who-opt .tile { font-size: 1.25rem; vertical-align: 0; color: var(--fg-3); }
.who .who-opt.is-on { color: var(--fg); }
.who .who-gos { display: flex; flex-wrap: wrap; gap: 0.625rem; }
.who .who-go .i { transition: transform var(--dur-2) var(--ease-out); }
.who .who-go:hover .i { transform: translateX(0.1875rem); }

/* ---------- With JS: a chooser ---------- */

.who .is-js .who-btn {
  color: var(--who-dim);
  transition: color 0.3s ease, transform 0.6s var(--ease-out);
}
.who .is-js .who-btn[aria-expanded="true"] { color: var(--fg); transform: translateX(var(--who-shift)); }
@media (hover: hover) {
  .who .is-js .who-btn:hover { color: var(--fg); }
}

/* the phone tile that marks the active audience */
.who .is-js .who-marker {
  display: block;
  position: absolute;
  z-index: 1;
  left: 0;
  top: 0;
  width: 0.5em;
  height: 1.08em;
  border-radius: 0.12em;
  background: var(--accent);
  transform: translateY(var(--my, 0.1em));
  transition: transform 0.6s var(--ease-out);
  pointer-events: none;
}

.who .is-js .who-panel { display: none; }
.who .is-js .who-panel.is-active { display: block; }

@media (min-width: 900px) {
  .who .who-chooser.is-js {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-rows: repeat(4, auto) 1fr;
    column-gap: clamp(1.75rem, 4.4vw, 4.5rem);
    align-items: start;
  }
  .who .is-js .who-name { grid-column: 1; }
  .who .is-js .who-name:nth-of-type(1) { grid-row: 1; }
  .who .is-js .who-name:nth-of-type(2) { grid-row: 2; }
  .who .is-js .who-name:nth-of-type(3) { grid-row: 3; }
  .who .is-js .who-name:nth-of-type(4) { grid-row: 4; }

  /* all four cards share one cell, so the layout never jumps */
  .who .is-js .who-panel {
    display: block;
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: stretch;
    margin: 0.13em 0 0;
    visibility: hidden;
    opacity: 0;
    transform: translateY(0.75rem);
    transition: opacity 0.25s ease, transform 0.5s var(--ease-out), visibility 0s linear 0.25s;
  }
  .who .is-js .who-panel.is-active {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition-delay: 0s;
  }
  .who .is-js .who-card { height: 100%; align-content: space-between; }
}

@media (max-width: 899.98px) {
  .who { --who-size: clamp(1.6875rem, 7.4vw, 2.75rem); }
  .who .who-btn { padding: 0.24em 0; }
  .who .who-panel { margin: 0.625rem 0 1.375rem; }
  .who .who-job { max-width: none; }
  .who .who-go { width: 100%; }
  .who .who-gos { width: 100%; }
}
