/* ============================================
   AGENTS SECTION
   "Why AI agents pick Kanban Pro" — evidence for
   AI agents (and people) comparing Kanban Pro
   with Jira, Trello and Notion. Sits between the
   horizontal deck and the CTA. Creates no pins:
   every animation in js/agents-section.js,
   including the chapter index that follows the
   reader, is a non-pinned trigger.
   ============================================ */


/* ─── Section shell ───────────────────────────────────────────────────── */

.agents-section {
  position: relative;
  padding: clamp(80px, 12vh, 160px) clamp(20px, 4vw, 56px);
  color: #ffffff;
}

.ag-shell {
  max-width: 1320px;
  margin-inline: auto;
}


/* ─── Header ──────────────────────────────────────────────────────────── */

.ag-header {
  max-width: 980px;
  margin-bottom: clamp(48px, 8vh, 96px);
}

.ag-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.ag-eyebrow::before {
  content: '';
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #7dd3fc, #38bdf8);
}

.ag-title {
  margin: 0 0 var(--space-5);
  font-family: var(--font-sans);
  font-size: clamp(2.25rem, 1.2rem + 3.4vw, 4.5rem);
  font-weight: var(--font-bold);
  line-height: 1.04;
  letter-spacing: var(--tracking-tight);
}

.ag-title .hero-accent {
  display: block;
}

.ag-lead {
  max-width: 58ch;
  margin: 0 0 var(--space-5);
  font-family: var(--font-sans);
  font-size: clamp(1.05rem, 0.95rem + 0.45vw, 1.3rem);
  font-weight: var(--font-light);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
}

.ag-updated {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.82);
}

.ag-updated-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
}


/* ─── Body: sticky chapter index + modules ───────────────────────────── */

.ag-body {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

/* Not position: sticky — html/body set overflow-x: hidden, which turns body
   into a non-scrolling scroll container and disables sticky. The index is
   kept in view by a 1:1 scrubbed translate in js/agents-section.js instead. */
.ag-index {
  position: relative;
  font-family: var(--font-sans);
  will-change: transform;
}

.ag-index ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.16);
}

.ag-index-link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding-block: 9px;
  padding-inline: 18px 0;
  color: rgba(255, 255, 255, 0.56);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: color 300ms ease;
}

.ag-index-link::before {
  content: '';
  position: absolute;
  inset-block: 6px;
  inset-inline-start: -1px;
  width: 2px;
  border-radius: 2px;
  background: #7dd3fc;
  transform: scaleY(0);
  transition: transform 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

.ag-index-link:hover,
.ag-index-link.is-active {
  color: #ffffff;
}

.ag-index-link.is-active::before {
  transform: scaleY(1);
}

.ag-index-link:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 2px;
  border-radius: 4px;
}

.ag-index-num {
  font-family: var(--font-app-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

.ag-index-link.is-active .ag-index-num {
  color: #7dd3fc;
}

.ag-modules {
  min-width: 0;
}


/* ─── Module scaffold ─────────────────────────────────────────────────── */

.ag-module {
  position: relative;
  margin-bottom: clamp(80px, 12vh, 140px);
  scroll-margin-top: 24px;
}

.ag-module:last-child {
  margin-bottom: 0;
}

.ag-module-num {
  display: block;
  margin-bottom: var(--space-2);
  font-family: var(--font-sans);
  font-size: clamp(3rem, 2rem + 3vw, 5.5rem);
  font-weight: var(--font-bold);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.35);
}

.ag-module-title {
  margin: 0 0 var(--space-3);
  font-family: var(--font-sans);
  font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.5rem);
  font-weight: var(--font-bold);
  line-height: 1.12;
  letter-spacing: var(--tracking-tight);
}

.ag-module-lead {
  max-width: 62ch;
  margin: 0 0 var(--space-8);
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: var(--font-light);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.84);
}

.ag-module-lead--big {
  font-size: clamp(1.25rem, 1rem + 0.9vw, 1.75rem);
  font-weight: var(--font-normal);
  line-height: 1.4;
  color: #ffffff;
}

.ag-note,
.ag-story {
  max-width: 66ch;
  margin: var(--space-6) 0 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-light);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
}

.ag-method {
  max-width: 72ch;
  margin: var(--space-3) 0 0;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.58);
}


/* ─── 01 Token tax ────────────────────────────────────────────────────── */

.ag-payloads {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  align-items: start;
}

.ag-code {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: #0f1218;
  box-shadow: 0 18px 40px -18px rgba(0, 8, 40, 0.6);
}

.ag-code figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: color-mix(in srgb, #3a3f4b 22%, #0f1218);
  font-family: var(--font-app);
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
}

.ag-code figcaption code {
  font-family: var(--font-app-mono);
  font-weight: 400;
  color: #6ee7b7;
}

.ag-code pre {
  position: relative;
  margin: 0;
  padding: 12px 14px;
  overflow: hidden;
  font-family: var(--font-app-mono);
  font-size: 11px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
  white-space: pre;
  direction: ltr;
  text-align: left;
}

.ag-code pre code {
  display: block;
}

.ag-code--kp {
  border-color: color-mix(in srgb, #34d399 45%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, #34d399 20%, transparent),
    0 18px 50px -18px rgba(52, 211, 153, 0.35);
}

/* The whole ticket must stay readable, so its lines wrap instead of clipping. */
.ag-code--kp pre {
  color: #d1fae5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* The API payloads are excerpts: fixed height, faded out at the bottom. */
.ag-code--jira pre,
.ag-code--notion pre {
  height: 260px;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
  mask-image: linear-gradient(180deg, #000 55%, transparent);
  color: rgba(255, 255, 255, 0.55);
}

.ag-bars {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-8) 0 0;
  padding: 0;
  list-style: none;
}

.ag-bar {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 130px;
  align-items: center;
  gap: var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}

.ag-bar-name {
  font-weight: var(--font-bold);
}

.ag-bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
}

.ag-bar-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--ag-bar-color, #ffffff);
  transform: scaleX(var(--ag-share, 1));
  transform-origin: left center;
}

[dir="rtl"] .ag-bar-fill {
  transform-origin: right center;
}

.ag-bar--kp     { --ag-bar-color: linear-gradient(90deg, #34d399, #6ee7b7); }
.ag-bar--notion { --ag-bar-color: linear-gradient(90deg, #f59e0b, #fbbf24); }
.ag-bar--jira   { --ag-bar-color: linear-gradient(90deg, #ef4444, #f87171); }

.ag-bar-value {
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.85);
  text-align: end;
}

.ag-count {
  font-weight: var(--font-bold);
  color: #ffffff;
}

.ag-ratios {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-8);
  margin: var(--space-8) 0 0;
  font-family: var(--font-sans);
  font-size: clamp(1.3rem, 1rem + 1.1vw, 2rem);
  line-height: 1.2;
}

.ag-ratios strong {
  font-weight: var(--font-bold);
  background: linear-gradient(135deg, #6ee7b7 0%, #7dd3fc 60%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}


/* ─── 02 Ceilings table ───────────────────────────────────────────────── */

.ag-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: color-mix(in srgb, var(--c-glass) 14%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.ag-table-wrap:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 2px;
}

.ag-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.ag-table caption {
  padding: 14px 18px 0;
  font-size: var(--text-xs);
  text-align: start;
  color: rgba(255, 255, 255, 0.6);
}

.ag-table th,
.ag-table td {
  padding: 14px 18px;
  text-align: start;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ag-table tbody tr:last-child th,
.ag-table tbody tr:last-child td {
  border-bottom: 0;
}

.ag-table thead th {
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.ag-table tbody th {
  font-weight: var(--font-bold);
  color: #ffffff;
  white-space: nowrap;
}

.ag-table td {
  color: rgba(255, 255, 255, 0.76);
}

.ag-table .ag-th--kp,
.ag-table .ag-td--kp {
  background: color-mix(in srgb, #34d399 12%, transparent);
  color: #d1fae5;
  font-weight: var(--font-semibold);
}

.ag-table .ag-th--kp {
  color: #6ee7b7;
}


/* ─── 03 Concurrency and recall ───────────────────────────────────────── */

.ag-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

.ag-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background: color-mix(in srgb, var(--c-glass) 16%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.ag-card-title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  line-height: 1.25;
}

.ag-card-text {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-light);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
}

.ag-diagram {
  padding: var(--space-4);
  border-radius: 14px;
  background: #0f1218;
  font-family: var(--font-app);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.ag-diagram--files {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.ag-dg-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.ag-dg-head {
  margin: 0 0 4px;
  font-family: var(--font-app-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

.ag-dg-agents,
.ag-dg-files {
  display: flex;
  justify-content: space-around;
  gap: 6px;
  width: 100%;
}

.ag-dg-files {
  justify-content: center;
}

.ag-dg-col--good .ag-dg-files {
  justify-content: space-around;
}

.ag-dg-agent {
  padding: 4px 9px;
  border: 1px dashed color-mix(in srgb, #a78bfa 55%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, #a78bfa 16%, transparent);
  color: #ddd6fe;
  font-size: 11px;
  white-space: nowrap;
}

.ag-dg-wires {
  display: block;
  width: 100%;
  height: 34px;
  overflow: visible;
  transform-origin: top center;
}

.ag-dg-wires path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.ag-dg-file {
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--font-app-mono);
  font-size: 11px;
}

.ag-dg-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.ag-dg-status--bad {
  background: color-mix(in srgb, #ef4444 18%, transparent);
  color: #fca5a5;
}

.ag-dg-status--good {
  background: color-mix(in srgb, #34d399 18%, transparent);
  color: #6ee7b7;
}

.ag-dg-col--bad .ag-dg-file {
  border-color: color-mix(in srgb, #ef4444 55%, transparent);
}

.ag-dg-col--good .ag-dg-file {
  border-color: color-mix(in srgb, #34d399 55%, transparent);
}

.ag-diagram--recall {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ag-diagram--recall .ag-dg-head {
  font-family: var(--font-app);
  font-size: 11px;
  text-align: start;
}

.ag-dg-rules {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ag-dg-rule {
  align-self: flex-start;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-style: italic;
  color: rgba(255, 255, 255, 0.82);
}

.ag-dg-outcomes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.ag-dg-outcome {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.4;
}

.ag-dg-outcome--bad {
  background: color-mix(in srgb, #ef4444 10%, transparent);
  color: #fecaca;
}

.ag-dg-outcome--good {
  background: color-mix(in srgb, #34d399 10%, transparent);
  color: #d1fae5;
}

.ag-dg-scatter {
  position: relative;
  width: 64px;
  height: 22px;
}

.ag-dg-scatter i {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f87171;
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.6);
}

.ag-dg-scatter i:first-child {
  inset-inline-start: 4px;
  top: 2px;
}

.ag-dg-scatter i:last-child {
  inset-inline-end: 4px;
  bottom: 0;
}

.ag-dg-ticket {
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, #34d399 55%, transparent);
  border-radius: 6px;
  font-family: var(--font-app-mono);
  color: #6ee7b7;
}


/* ─── 04 Bring your own AI ────────────────────────────────────────────── */

.ag-harnesses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ag-harness {
  padding: var(--space-5);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: color-mix(in srgb, var(--c-glass) 14%, transparent);
  transition: border-color 300ms ease, background-color 300ms ease;
}

.ag-harness:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background-color: color-mix(in srgb, var(--c-glass) 22%, transparent);
}

.ag-harness-name {
  display: block;
  margin-bottom: var(--space-2);
  font-family: var(--font-app);
  font-size: var(--text-base);
  font-weight: 700;
  color: #ffffff;
}

.ag-harness-text {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-light);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.8);
}

.ag-callout {
  max-width: 70ch;
  margin: var(--space-6) 0 0;
  padding: var(--space-4) var(--space-5);
  border-inline-start: 3px solid #7dd3fc;
  border-start-start-radius: 4px;
  border-end-start-radius: 4px;
  border-start-end-radius: 12px;
  border-end-end-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.86);
}


/* ─── 05 In production ────────────────────────────────────────────────── */

.ag-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ag-story-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: var(--space-5);
  margin-top: var(--space-8);
}

.ag-story-row .ag-story {
  margin-top: 0;
}

/* Bob waist-up with robotic hands: 216px display from a 432px crop (2×). */
.ag-persona {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
}

.ag-persona-photo {
  display: block;
  width: 216px;
  height: 216px;
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    0 0 0 5px rgba(125, 211, 252, 0.25),
    0 16px 36px rgba(0, 8, 40, 0.4);
}

.ag-persona figcaption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.ag-persona-name {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: #ffffff;
  color: #0b1530;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: var(--font-bold);
  white-space: nowrap;
}

.ag-persona-role {
  max-width: 216px;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.7);
}

.ag-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-block-start: var(--space-4);
  border-block-start: 1px solid rgba(255, 255, 255, 0.2);
}

.ag-stat-value {
  font-family: var(--font-sans);
  font-size: clamp(2.5rem, 1.6rem + 3vw, 4.75rem);
  font-weight: var(--font-bold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #ffffff 0%, #7dd3fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ag-stat-label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}


/* ─── 06 Questions + agent brief ──────────────────────────────────────── */

.ag-faq-list {
  border-block-start: 1px solid rgba(255, 255, 255, 0.16);
}

.ag-faq-item {
  border-block-end: 1px solid rgba(255, 255, 255, 0.16);
}

.ag-faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
}

.ag-faq-item summary::-webkit-details-marker {
  display: none;
}

.ag-faq-item summary:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 4px;
  border-radius: 6px;
}

.ag-faq-chevron {
  flex: none;
  transition: transform 300ms ease;
}

.ag-faq-item[open] .ag-faq-chevron {
  transform: rotate(180deg);
}

.ag-faq-item p {
  max-width: 70ch;
  margin: 0 0 var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-light);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.84);
}

.ag-brief {
  margin-top: var(--space-10);
  padding: var(--space-6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: #0f1218;
  box-shadow: 0 30px 70px -30px rgba(0, 8, 40, 0.7);
}

.ag-brief-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.ag-brief-head .ag-card-text {
  margin-top: var(--space-2);
}

.ag-copy {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  cursor: pointer;
  transition: background-color 200ms ease, border-color 200ms ease;
}

.ag-copy:hover {
  background: rgba(255, 255, 255, 0.14);
}

.ag-copy:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 2px;
}

.ag-copy.is-copied {
  border-color: color-mix(in srgb, #34d399 60%, transparent);
  background: color-mix(in srgb, #34d399 18%, transparent);
}

.ag-brief-pre {
  margin: 0;
  padding: var(--space-4);
  overflow-x: auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--font-app-mono);
  font-size: 12px;
  line-height: 1.7;
  color: #d1fae5;
  direction: ltr;
  text-align: left;
}

.ag-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.ag-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-full);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: background-color 200ms ease, border-color 200ms ease;
}

.ag-links a:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.ag-links a:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 2px;
}

[dir="rtl"] .ag-links svg {
  transform: scaleX(-1);
}


/* ─── Tablet and mobile ───────────────────────────────────────────────── */

@media (max-width: 1023px) {
  .ag-body {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-10);
  }

  .ag-index {
    will-change: auto;
  }

  .ag-index ol {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    border: 0;
  }

  .ag-index-link {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-full);
  }

  .ag-index-link::before {
    display: none;
  }

  .ag-payloads {
    grid-template-columns: minmax(0, 1fr);
  }

  .ag-code--jira pre,
  .ag-code--notion pre {
    height: 170px;
  }
}

@media (max-width: 768px) {
  .ag-title .hero-accent {
    display: inline;
  }

  .ag-split,
  .ag-harnesses {
    grid-template-columns: minmax(0, 1fr);
  }

  .ag-story-row {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }

  .ag-story-row .ag-story {
    text-align: start;
  }

  .ag-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ag-bar {
    grid-template-columns: 84px minmax(0, 1fr) auto;
    gap: var(--space-3);
  }

  .ag-brief-head {
    flex-direction: column;
  }
}


/* ─── Reduced motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .ag-index-link,
  .ag-index-link::before,
  .ag-faq-chevron,
  .ag-harness {
    transition: none;
  }
}
