/* Specialist pages (/agents/ai-<role>/)
   Clean, spacious, image-and-text: a soft gradient hero, three alternating feature rows on
   gradient tiles, a rounded team band, three "in practice" cards and a rounded CTA.
   Every page shares this sheet; each takes its tone from its role (data-role on .agent gives
   --role-solid / --role-text / --role-soft, site.css), blended with paper and dawn-soft so
   the whole family stays on the brand palette. Buttons stay dawn; text stays ink.
   Spec: DESIGN.md §6.12. */

.agent { --ag-wash: linear-gradient(120deg, var(--role-soft) 0%, var(--surface) 52%, var(--dawn-soft) 100%);
         --ag-tile: linear-gradient(140deg, var(--role-soft) 0%, var(--surface-raised) 55%, var(--dawn-soft) 110%); }

/* ---- Chips ------------------------------------------------------------------------- */
.ag-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--role-soft); color: var(--role-text); font-size: var(--type-small-size); line-height: 1.3; font-weight: 600;
}
.ag-chip svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ag-hero .ag-chip { background: var(--surface-raised); box-shadow: var(--shadow-card); }

/* ---- Hero -------------------------------------------------------------------------- */
.ag-hero { background: var(--ag-wash); padding: var(--space-64) 0 var(--space-96); }
.ag-hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.ag-hero h1 {
  margin-top: var(--space-20); max-width: 620px;
  font-size: var(--type-display-lg-size); line-height: var(--type-display-lg-line); letter-spacing: var(--type-display-lg-tracking);
}
.ag-bold { margin: var(--space-24) 0 0; font-size: var(--type-body-lg-size); line-height: var(--type-body-lg-line); font-weight: 600; color: var(--ink); }
.ag-lead { margin: var(--space-8) 0 0; max-width: 520px; font-size: var(--type-body-lg-size); line-height: var(--type-body-lg-line); color: var(--ink-muted); }
.ag-hero .btn-row { margin-top: var(--space-32); }
.ag-btn-light { background: var(--surface-raised); }

/* ---- Gradient tiles with product cards ---------------------------------------------- */
.ag-tile {
  position: relative; display: grid; place-items: center; min-height: 380px; padding: clamp(28px, 4vw, 56px);
  border-radius: var(--radius-2xl); background: var(--ag-tile); border: 1px solid var(--line); overflow: hidden;
}
.ag-tile.is-hero { min-height: 460px; background: linear-gradient(150deg, var(--surface-raised) 0%, var(--role-soft) 60%, var(--dawn-soft) 110%); box-shadow: var(--shadow-soft); }
.ag-tile.is-small { min-height: 240px; padding: var(--space-32) var(--space-24); }
.ag-tile-stage { position: relative; width: 100%; max-width: 440px; }
.ag-tile .ui { box-shadow: var(--shadow-pop); border-radius: var(--radius-xl); }
.ag-tile.is-pair .ui { width: 88%; }
.ag-tile.is-pair .ui.is-back { opacity: 0.94; }
.ag-tile.is-pair .ui.is-front { position: relative; margin: calc(-1 * var(--space-24)) 0 0 auto; }
.ag-tile.is-small .ag-tile-stage { max-width: 300px; }
.ag-tile.is-small .ui { padding: var(--space-16); }

/* Product card fragments used on these pages */
.ui-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--space-12); margin-top: var(--space-12); }
.ui-head + .ui-tiles, .ui-tiles:first-child { margin-top: 0; }
.ui-head + .ui-tiles { margin-top: var(--space-12); }
.ui-tile { background: var(--surface-sunken); border-radius: var(--radius-md); padding: var(--space-12) var(--space-16); }
.ui-tile .stat-value { margin-top: 4px; }
.ui-tile .badge { margin-top: var(--space-8); }
.ui-hbars { list-style: none; margin: var(--space-12) 0 0; padding: 0; }
.ui-hbars:first-child { margin-top: 0; }
.ui-hbars li {
  display: grid; grid-template-columns: minmax(84px, 0.9fr) minmax(0, 1.6fr) auto; gap: var(--space-12);
  align-items: center; padding: 9px 0; font-size: var(--type-body-sm-size);
}
.ui-hbars .hb-track { height: 10px; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; }
.ui-hbars .hb-track i { display: block; height: 100%; border-radius: inherit; background: var(--role-solid); }
.ui-hbars li.is-alt .hb-track i { background: var(--line-strong); }
.ui-hbars .num { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; min-width: 5ch; }
.ui-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: var(--space-12); }
.cal-day { background: var(--surface-sunken); border-radius: var(--radius-md); padding: var(--space-8) 6px; min-height: 96px; }
.cal-day b { display: block; font-size: var(--type-caption-size); color: var(--ink-muted); font-weight: 600; }
.cal-chip {
  display: block; margin-top: 6px; padding: 5px 6px; border-radius: var(--radius-sm); font-size: 11px; line-height: 1.3;
  font-weight: 500; background: var(--surface-raised); border-left: 3px solid var(--role-solid); word-break: keep-all;
}
.cal-chip.is-pending { border-left-color: var(--status-pending-text); background: var(--status-pending-soft); color: var(--status-pending-text); }
.cal-chip.is-plan { border-left: 1.5px dashed var(--line-strong); color: var(--ink-muted); }
.ui-rows:first-child { margin-top: 0; }

/* ---- Feature rows ------------------------------------------------------------------ */
.ag-features { padding-top: var(--space-128); }
.ag-feature { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.ag-feature + .ag-feature { margin-top: var(--space-128); }
.ag-feature.is-flipped { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
.ag-feature.is-flipped .ag-feature-copy { order: 2; }
.ag-feature-copy h2 {
  margin-top: var(--space-20); font-size: var(--type-display-lg-size); line-height: var(--type-display-lg-line);
  letter-spacing: var(--type-display-lg-tracking); max-width: 520px;
}
.ag-feature-copy .ag-bold { margin-top: var(--space-20); }
.ag-feature-copy p:not(.ag-bold) { margin: var(--space-8) 0 0; max-width: 460px; font-size: var(--type-body-lg-size); line-height: var(--type-body-lg-line); color: var(--ink-muted); }
.ag-list { list-style: none; margin: var(--space-24) 0 0; padding: 0; display: grid; gap: var(--space-12); }
.ag-list li { display: flex; align-items: center; gap: var(--space-12); font-weight: 500; }
.ag-list-icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-md); background: var(--role-soft); color: var(--role-text); flex: none; }
.ag-list-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Team band --------------------------------------------------------------------- */
.ag-band-wrap { padding-top: var(--space-128); }
.ag-band {
  border-radius: var(--radius-2xl); padding: clamp(32px, 6vw, 88px) clamp(20px, 5vw, 72px);
  background: linear-gradient(170deg, var(--surface-sunken) 0%, var(--surface) 45%, var(--role-soft) 130%); border: 1px solid var(--line);
}
.ag-band-head { max-width: 640px; margin: 0 auto var(--space-56); text-align: center; }
.ag-band-head h2 { margin-top: var(--space-20); font-size: var(--type-display-lg-size); line-height: var(--type-display-lg-line); letter-spacing: var(--type-display-lg-tracking); }
.ag-band-head p { margin: var(--space-12) auto 0; max-width: 520px; font-size: var(--type-body-lg-size); line-height: var(--type-body-lg-line); color: var(--ink-muted); }

.collab { display: grid; grid-template-columns: minmax(0, 1fr) 240px minmax(0, 1fr); gap: var(--space-48); align-items: center; }
.collab-col { display: flex; flex-direction: column; gap: var(--space-12); }
.collab-label {
  font-size: var(--type-eyebrow-size); line-height: var(--type-eyebrow-line); font-weight: var(--type-eyebrow-weight);
  letter-spacing: var(--type-eyebrow-tracking); text-transform: uppercase; color: var(--ink-muted);
}
.collab-node {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-8); row-gap: 2px; align-items: center;
  padding: var(--space-12) var(--space-16); background: var(--surface-raised); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card); color: var(--ink); text-decoration: none;
}
.collab-node:hover { border-color: var(--line-strong); color: var(--ink); }
.collab-node .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--role-solid); }
.collab-node b { font-weight: 600; }
.collab-node > span:last-child { grid-column: 2; font-size: var(--type-small-size); line-height: var(--type-small-line); color: var(--ink-muted); }
.collab-col.is-in .collab-node::after, .collab-col.is-out .collab-node::before {
  content: ""; position: absolute; top: 50%; width: var(--space-48); border-top: 2px dashed var(--line-strong);
}
.collab-col.is-in .collab-node::after { right: calc(-1 * var(--space-48) - 1px); }
.collab-col.is-out .collab-node::before { left: calc(-1 * var(--space-48) - 1px); }
.collab-hub {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-8);
  padding: var(--space-32) var(--space-20); background: var(--surface-raised); border: 1px solid var(--line);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-soft);
}
.collab-ring { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--role-solid); }
.collab-ring .dot { width: 20px; height: 20px; border-radius: 50%; background: var(--role-solid); }
.collab-hub b { font-family: var(--font-display); font-size: var(--type-heading-3-size); line-height: var(--type-heading-3-line); }
.collab-hub > span:last-child { font-size: var(--type-small-size); line-height: var(--type-small-line); color: var(--ink-muted); }

/* ---- In practice ------------------------------------------------------------------- */
.ag-story { padding-top: var(--space-128); }
.ag-story-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-24); margin-bottom: var(--space-48); }
.ag-story-head h2 { margin-top: var(--space-20); max-width: 640px; font-size: var(--type-display-lg-size); line-height: var(--type-display-lg-line); letter-spacing: var(--type-display-lg-tracking); }
.ag-story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-32); }
.ag-story-card h3 { margin-top: var(--space-24); font-size: var(--type-heading-3-size); line-height: var(--type-heading-3-line); letter-spacing: var(--type-heading-3-tracking); }
.ag-story-card p { margin: var(--space-8) 0 0; color: var(--ink-muted); }

/* ---- The rest of the team ---------------------------------------------------------- */
.ag-others { padding-top: var(--space-128); }
.ag-others h2 { font-size: var(--type-heading-2-size); line-height: var(--type-heading-2-line); letter-spacing: var(--type-heading-2-tracking); margin-bottom: var(--space-32); }
.team-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-16); }
.team-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-8); row-gap: 4px; align-items: center;
  padding: var(--space-20); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg);
  color: var(--ink); text-decoration: none; transition: box-shadow var(--motion-fast) var(--ease-standard);
}
.team-card:hover { box-shadow: var(--shadow-soft); color: var(--ink); }
.team-card .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--role-solid); }
.team-card b { font-weight: 600; }
.team-card > span:last-child { grid-column: 2; font-size: var(--type-small-size); line-height: var(--type-small-line); color: var(--ink-muted); }

/* ---- Closing CTA ------------------------------------------------------------------- */
.ag-cta-wrap { padding: var(--space-128) var(--gutter) var(--space-96); }
.ag-cta {
  border-radius: var(--radius-2xl); padding: clamp(56px, 8vw, 120px) var(--space-24); text-align: center;
  background: linear-gradient(130deg, var(--role-soft) 0%, var(--surface-raised) 50%, var(--dawn-soft) 100%); border: 1px solid var(--line);
}
.ag-cta h2 { max-width: 720px; margin: 0 auto; font-size: var(--type-display-lg-size); line-height: var(--type-display-lg-line); letter-spacing: var(--type-display-lg-tracking); }
.ag-cta p { margin: var(--space-16) auto 0; font-size: var(--type-body-lg-size); color: var(--ink-muted); }
.ag-cta .btn { margin-top: var(--space-32); }

/* ---- Responsive -------------------------------------------------------------------- */
@media (max-width: 1040px) {
  .collab { grid-template-columns: minmax(0, 1fr); gap: var(--space-24); }
  .collab-hub { order: -1; flex-direction: row; flex-wrap: wrap; text-align: left; padding: var(--space-20); }
  .collab-hub > span:last-child { flex-basis: 100%; }
  .collab-ring { width: 48px; height: 48px; }
  .collab-ring .dot { width: 14px; height: 14px; }
  .collab-col.is-in .collab-node::after, .collab-col.is-out .collab-node::before { display: none; }
  .ag-story-grid, .team-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .ag-hero-inner, .ag-feature, .ag-feature.is-flipped { grid-template-columns: minmax(0, 1fr); }
  .ag-feature.is-flipped .ag-feature-copy { order: 0; }
  .ag-feature + .ag-feature, .ag-features, .ag-band-wrap, .ag-story, .ag-others { padding-top: 0; }
  .ag-feature + .ag-feature { margin-top: var(--space-96); }
  .ag-features, .ag-band-wrap, .ag-story, .ag-others { margin-top: var(--space-96); }
  .ag-tile.is-hero { min-height: 0; }
}
@media (max-width: 520px) {
  .ag-hero { padding: var(--space-40) 0 var(--space-64); }
  .ag-tile { min-height: 0; padding: var(--space-24) var(--space-16); border-radius: var(--radius-xl); }
  .ag-tile.is-pair .ui { width: 100%; }
  .ag-tile.is-pair .ui.is-front { margin-top: var(--space-12); }
  .ag-story-grid, .team-cards { grid-template-columns: minmax(0, 1fr); }
  .ag-band, .ag-cta { border-radius: var(--radius-xl); }
  .ui-cal { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cal-day { min-height: 0; }
  .ui-hbars li { grid-template-columns: minmax(72px, 0.9fr) minmax(0, 1.2fr) auto; gap: var(--space-8); }
  .ag-cta-wrap { padding-left: var(--gutter-phone); padding-right: var(--gutter-phone); }
}

/* ---- Virtual people and platform marks inside product cards ------------------------ */
.ui-avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; display: block; }
.ui-rows li > .brand-logo { width: 18px; height: 18px; margin: 0; }
.ui-stack { display: inline-flex; align-items: center; padding-left: 8px; }
.ui-stack .ui-avatar { width: 24px; height: 24px; margin-left: -8px; box-shadow: 0 0 0 2px var(--surface-raised); }
.ui-tile .ui-stack { margin-top: var(--space-8); }
.ui-who .ui-avatar { width: 30px; height: 30px; }
.ui-role .brand-logo { width: 14px; height: 14px; vertical-align: -2px; }
.cal-chip .brand-logo { width: 12px; height: 12px; margin-right: 4px; vertical-align: -2px; }
