/* Agents page: this page's own layout only. Colour, type, cards, the stage backdrop (.stagebox), the scenes and
   their parts (.stats, .camp, .adlines, .week__row, .bub, .opts) come from ../../design-system/ and agents.css.
   Loaded after agents.css. */

/* ============================================================
   Page header: the six agents, each a link to its section
   ============================================================ */
.ag-index {
  max-width: 76rem;
  margin: var(--space-10) auto 0;
}
.ag-index ul {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
}
.ag-index a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  height: 100%;
  min-height: var(--tap);
  padding: var(--space-3);
  border-radius: var(--card-radius-sm);
  background: color-mix(in srgb, var(--card-float) 72%, transparent);
  color: var(--color-text);
  text-align: left;
  text-decoration: none;
  transition: background-color var(--dur-base) var(--ease-out);
}
.ag-index a:hover {
  background: var(--card-float);
}
.ag-index__text {
  display: grid;
  line-height: 1.3;
}
.ag-index__text strong {
  font-weight: var(--weight-semibold);
}
.ag-index__text span {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
@media (min-width: 40rem) {
  .ag-index ul {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
  }
}
@media (min-width: 76rem) {
  .ag-index ul {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* ============================================================
   One section per agent. Four with a still on the agent's tint, copy and still side by side
   (alternating sides); two with the agent's scene at full width under the copy.
   ============================================================ */
.ag {
  padding-block: calc(var(--space-section) * 0.6);
}
.ag-head + .ag {
  padding-top: var(--space-section);
}
.ag__grid {
  row-gap: var(--space-8);
  align-items: center;
}
.ag__copy {
  display: grid;
  gap: var(--space-5);
  justify-items: start;
  align-content: start;
}
.ag__name {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
}
.ag__rules {
  display: grid;
  gap: var(--space-5);
  width: 100%;
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}
.ag__label {
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.ag__list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
}
.ag__list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  line-height: 1.45;
}
.ag__list .am-icon {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.15em;
  stroke-width: 2.25;
}
.ag__tools {
  display: grid;
  gap: var(--space-1);
}
.ag__logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  margin: 0;
  padding: 0;
  font-weight: var(--weight-semibold);
}
.ag__logos li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.ag__logos .am-brandmark {
  height: 1.25rem;
}
.ag__media {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}
@media (min-width: 40rem) {
  .ag__rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 60rem) {
  .ag__grid > .ag__copy {
    grid-column: 1 / span 5;
  }
  .ag__grid > .ag__media {
    grid-column: 7 / -1;
  }
  .ag--flip .ag__grid > .ag__copy {
    grid-column: 8 / -1;
    grid-row: 1;
  }
  .ag--flip .ag__grid > .ag__media {
    grid-column: 1 / span 6;
    grid-row: 1;
  }
}

/* ---------- A still: one or two floating cards on the agent's tint ---------- */
.ag__stage {
  display: grid;
  place-items: center;
}
.ag__still {
  position: relative;
  display: grid;
  width: 100%;
  max-width: 42rem;
}
.ag-card {
  --design: 280;
}
.ag-card .am-card {
  gap: var(--space-3);
}
.ag-card--main {
  width: min(100%, 24rem);
}
.ag-card--side {
  position: relative;
  width: min(92%, 19rem);
  margin: calc(var(--space-8) * -1) 0 0 auto;
}
.ag-chat {
  gap: var(--space-2);
}
.ag-chat .notif__head {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 6);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}
.ag-card .bub .opts {
  margin-top: calc(var(--u) * 6);
}
.ag-card .kcard__label {
  margin-top: calc(var(--space-1) * -1);
}
.ag-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}
.ag-row strong {
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}
.ag-badge {
  justify-self: start;
}
.ag-card .week {
  padding-block: 0;
}
.ag__photo--top img {
  object-position: 50% 22%;
}
@media (min-width: 40rem) {
  .ag__stage {
    padding: clamp(1.5rem, 0.5rem + 3vw, 3rem);
  }
  /* Two cards side by side, the second one lower, so neither hides the other */
  .ag__still {
    grid-template-columns: minmax(0, 56fr) minmax(0, 44fr);
    column-gap: var(--space-4);
    align-items: start;
  }
  .ag-card--main {
    --design: 300;
    width: 100%;
  }
  .ag-card--side {
    --design: 236;
    width: 100%;
    margin: var(--space-16) 0 0;
  }
  /* With a photo: the photo fills the top and left, the card sits over its lower right corner */
  .ag__still--photo {
    display: block;
    padding: 0 var(--space-6) var(--space-12) 0;
  }
  .ag__still--photo .am-photo {
    width: 100%;
  }
  .ag__still--photo .ag-card--side {
    --design: 280;
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(19rem, 52%);
    margin: 0;
  }
}

/* ---------- The two sections with a full scene ---------- */
.ag__head {
  display: grid;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}
.ag__side {
  display: grid;
  gap: var(--space-5);
  align-content: end;
}
.ag__ask {
  display: inline-block;
  max-width: 36rem;
  padding: var(--space-3) var(--space-4);
  border-radius: 1.125rem 1.125rem 0.375rem 1.125rem;
  background: var(--color-inverse-bg);
  color: var(--color-inverse-text);
  font-weight: var(--weight-medium);
  line-height: 1.4;
}
@media (min-width: 60rem) {
  .ag__head {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    align-items: end;
    gap: var(--space-12);
  }
}

/* ============================================================
   The same rules for every agent: heading beside three feature cards
   ============================================================ */
.ag-rules__head {
  display: grid;
  gap: var(--space-4);
  align-content: start;
}
.ag-rules__cards {
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
}
@media (min-width: 40rem) {
  .ag-rules__cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 60rem) {
  .ag-rules__head {
    grid-column: 1 / span 4;
  }
  .ag-rules__cards {
    grid-column: 5 / -1;
  }
}
@media (max-width: 39.99rem) {
  .ag-rules__cards .am-card--feature {
    min-height: 0;
    gap: var(--space-6);
  }
}
