/* =============================================================
   AI agent development page — composed layout on NC tokens
   Loaded after styles.css; reuses :root design tokens.
   Namespace: .ag-
   (.ag-section, .ag-wrap, .ag-eyebrow and .ag-faq__icon already resolve
   to the shared container, eyebrow and FAQ icon rules in styles.css.)
   ============================================================= */
.ag {
  position: relative;
  overflow-x: clip;
  --ag-max: var(--container-inner);
  /* two accents, registered in docs/_as/colors.html */
  --ag-indigo: oklch(0.56 0.2 268);
  --ag-amber: oklch(0.8 0.15 78);
  /* indigo lifted for strokes and text on the dark panels */
  --ag-indigo-bright: oklch(0.74 0.15 268);
}

.ag-section { position: relative; z-index: 1; padding: var(--space-8) var(--gutter) 0; }

.ag-h2 {
  font-family: var(--font-title); font-weight: 700;
  font-size: var(--fs-h2); letter-spacing: -0.02em; line-height: 1.01;
  margin: var(--space-3) 0 0;
}
.ag-sub { font-size: var(--fs-lead); color: var(--color-ink-60); line-height: 1.55; max-width: 640px; margin: var(--space-3) 0 0; }
.ag-wrap--center-intro > .ag-eyebrow { text-align: center; }
.ag-wrap--center-intro > .ag-h2 { text-align: center; }
.ag-wrap--center-intro > .ag-sub { margin-inline: auto; text-align: center; }

/* ---------- Hero ---------- */
.ag-hero {
  position: relative;
  /* No bottom padding: the card ends the hero, and the next section's own
     padding-top is the gap below it (hero-panel skill). */
  padding: calc(var(--header-height) + var(--space-5)) var(--gutter) 0;
}

/* Literal copy of home's hero glow recipe (css/styles.css .hero__glow /
   --lime / --violet), per the "Background glow gradient" rule. Position,
   size, timing, keyframe percentage steps, hue-drift deltas, alphas and
   stop percentages are all identical to home's; only the two hues (268deg
   indigo, 78deg amber, from docs/_as/colors.html) and the pastel oklch
   register (L 0.9, C ~0.1-0.12) are page-specific. Same structure as
   .uxp-hero__glow in css/ux-ui.css. */
.ag-hero__glow {
  position: absolute; z-index: 0; pointer-events: none;
  top: -24%; right: -42%; width: 100vw; height: 100vh;
  max-width: none;
  transform-origin: 50% 50%;
  will-change: transform, filter;
  background: radial-gradient(
    var(--g-w, 50%) var(--g-h, 50%) at var(--g-x, 50%) var(--g-y, 50%),
    oklch(0.9 0.12 var(--g-h1, 268deg) / 0.85),
    oklch(0.9 0.1 var(--g-h2, 78deg) / 0.4) 46%,
    transparent 72%
  );
  animation:
    ag-glow-morph 11s ease-in-out infinite,
    ag-glow-float 17s ease-in-out infinite;
}
@keyframes ag-glow-morph {
  0%, 100% { --g-h1: 268deg; --g-h2: 78deg;  --g-w: 44%; --g-h: 54%; --g-x: 46%; --g-y: 54%; }
  30%      { --g-h1: 304deg; --g-h2: 100deg; --g-w: 66%; --g-h: 42%; --g-x: 60%; --g-y: 40%; }
  62%      { --g-h1: 242deg; --g-h2: 52deg;  --g-w: 42%; --g-h: 64%; --g-x: 40%; --g-y: 60%; }
}
@keyframes ag-glow-float {
  0%, 100% { transform: scale(1)    translate3d(0, 0, 0);    filter: hue-rotate(0deg)  saturate(1); }
  50%      { transform: scale(1.22) translate3d(-8%, 6%, 0); filter: hue-rotate(14deg) saturate(1.1); }
}

/* Bottom-left blob: indigo on its own, home's lime slot. */
.ag-hero__glow--indigo {
  top: auto; right: auto;
  bottom: -20%; left: -22%; width: 60vw; height: 60vh;
  background: radial-gradient(
    var(--g-w, 50%) var(--g-h, 50%) at var(--g-x, 50%) var(--g-y, 50%),
    oklch(0.9 0.12 var(--g-h1, 268deg) / 0.4),
    transparent 66%
  );
  animation:
    ag-glow-morph-indigo 14s ease-in-out -5s infinite,
    ag-glow-float-indigo 21s ease-in-out -9s infinite;
}
@keyframes ag-glow-morph-indigo {
  0%, 100% { --g-h1: 268deg; --g-w: 46%; --g-h: 46%; --g-x: 50%; --g-y: 50%; }
  40%      { --g-h1: 300deg; --g-w: 68%; --g-h: 56%; --g-x: 60%; --g-y: 42%; }
  72%      { --g-h1: 246deg; --g-w: 42%; --g-h: 66%; --g-x: 40%; --g-y: 58%; }
}
@keyframes ag-glow-float-indigo {
  0%, 100% { transform: scale(1.06) translate3d(0, 0, 0);    filter: hue-rotate(0deg)   saturate(1); }
  50%      { transform: scale(0.84) translate3d(9%, -7%, 0); filter: hue-rotate(-12deg) saturate(1.12); }
}

/* Top-centre blob: amber on its own, home's violet slot. */
.ag-hero__glow--amber {
  top: -26%; right: auto; bottom: auto;
  left: 52%; width: 44vw; height: 44vh;
  background: radial-gradient(
    var(--g-w, 50%) var(--g-h, 50%) at var(--g-x, 50%) var(--g-y, 50%),
    oklch(0.9 0.1 var(--g-h1, 78deg) / 0.28),
    transparent 64%
  );
  animation:
    ag-glow-morph-amber 18s ease-in-out -7s infinite,
    ag-glow-float-amber 26s ease-in-out -13s infinite;
}
@keyframes ag-glow-morph-amber {
  0%, 100% { --g-h1: 78deg; --g-w: 48%; --g-h: 48%; --g-x: 50%; --g-y: 50%; }
  38%      { --g-h1: 54deg; --g-w: 70%; --g-h: 42%; --g-x: 40%; --g-y: 58%; }
  70%      { --g-h1: 98deg; --g-w: 42%; --g-h: 60%; --g-x: 60%; --g-y: 44%; }
}
@keyframes ag-glow-float-amber {
  0%, 100% { transform: scale(1)    translate3d(0, 0, 0);   filter: hue-rotate(0deg)   saturate(1);   opacity: 1; }
  45%      { transform: scale(1.28) translate3d(-9%, 5%, 0); filter: hue-rotate(-10deg) saturate(1.1); opacity: 0.7; }
}

/* Mandatory corner-seam accent, centred exactly on the hero's bottom-left
   corner (where the next section begins). A quiet echo of the indigo. */
.ag-hero__glow--corner {
  top: auto; right: auto;
  bottom: -37vw; left: -37vw; width: 74vw; height: 74vw;
  background: radial-gradient(
    var(--g-w, 50%) var(--g-h, 50%) at var(--g-x, 50%) var(--g-y, 50%),
    oklch(0.9 0.12 var(--g-h1, 268deg) / 0.15),
    transparent 60%
  );
  animation:
    ag-glow-morph-corner 8s ease-in-out -4s infinite,
    ag-glow-float-corner 11s ease-in-out -8s infinite;
}
@keyframes ag-glow-morph-corner {
  0%, 100% { --g-h1: 268deg; --g-w: 46%; --g-h: 46%; --g-x: 50%; --g-y: 50%; }
  50%      { --g-h1: 290deg; --g-w: 55%; --g-h: 37%; --g-x: 40%; --g-y: 60%; }
}
@keyframes ag-glow-float-corner {
  0%, 100% { transform: scale(1)    translate3d(0, 0, 0);    filter: saturate(1); }
  50%      { transform: scale(1.15) translate3d(9%, -6%, 0); filter: saturate(1.05); }
}

/* Mandatory mobile override: desktop's percentage-based blob positions
   clip away on a narrow screen. Same numbers as .uxp-hero's block. */
@media (max-width: 900px) {
  .ag-hero {
    background:
      radial-gradient(120% 70% at 85% 0%, oklch(0.9 0.12 268 / 0.28), transparent 62%),
      radial-gradient(90% 55% at 10% 35%, oklch(0.9 0.1 78 / 0.19), transparent 58%),
      radial-gradient(80% 50% at 70% 18%, oklch(0.9 0.12 268 / 0.08), transparent 55%),
      var(--color-paper);
  }
  .ag-hero__glow {
    top: -8%; right: -28%; width: 100vh; height: 100vh; opacity: 1;
    background: radial-gradient(
      var(--g-w, 50%) var(--g-h, 50%) at var(--g-x, 50%) var(--g-y, 50%),
      oklch(0.9 0.12 var(--g-h1, 268deg) / 0.45),
      oklch(0.9 0.1 var(--g-h2, 78deg) / 0.22) 42%,
      transparent 70%
    );
  }
  .ag-hero__glow--indigo {
    top: auto; right: auto;
    bottom: 18%; left: -35%; width: 85vh; height: 85vh;
    background: radial-gradient(
      var(--g-w, 50%) var(--g-h, 50%) at var(--g-x, 50%) var(--g-y, 50%),
      oklch(0.9 0.12 var(--g-h1, 268deg) / 0.28),
      transparent 68%
    );
  }
  .ag-hero__glow--amber {
    top: 4%; right: auto; left: 42%; width: 65vh; height: 65vh;
    background: radial-gradient(
      var(--g-w, 50%) var(--g-h, 50%) at var(--g-x, 50%) var(--g-y, 50%),
      oklch(0.9 0.1 var(--g-h1, 78deg) / 0.16),
      transparent 66%
    );
  }
  .ag-hero__glow--corner {
    top: auto; right: auto; bottom: -37vw; left: -37vw; width: 74vw; height: 74vw;
  }
}

/* Hero card (hero-panel skill): the whole hero sits on one dark inset panel,
   capped at the content width. The pastel page glows above stay on the
   section and read around it; inside, an indigo -> amber wash (hues 268 / 78,
   this page's two accents) sits behind the copy in the "on ink" register. */
.ag-hero__panel {
  position: relative; z-index: 1; overflow: hidden;
  max-width: var(--ag-max); margin-inline: auto;
  background: var(--color-ink); color: var(--color-on-dark);
  border-radius: var(--radius-xl);
  padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1.5rem, 4vw, 4rem);
}
/* The morph drifts the gradient centre toward the box edge, so a radial mask
   fades every side to zero: no clipped rim, wherever the colour sits. */
.ag-hero__wash {
  position: absolute; z-index: 0; pointer-events: none;
  top: -40%; left: -20%; width: 70vw; height: 70vw;
  -webkit-mask-image: radial-gradient(closest-side, #000 45%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 45%, transparent 100%);
  background: radial-gradient(
    var(--g-w, 50%) var(--g-h, 50%) at var(--g-x, 50%) var(--g-y, 50%),
    oklch(0.72 0.17 var(--g-h1, 268deg) / 0.28),
    oklch(0.8 0.16 var(--g-h2, 78deg) / 0.12) 46%,
    transparent 70%
  );
  animation:
    ag-wash-morph 9s ease-in-out -3s infinite,
    ag-wash-float 13s ease-in-out -7s infinite;
}
@keyframes ag-wash-morph {
  0%, 100% { --g-h1: 268deg; --g-h2: 78deg;  --g-w: 46%; --g-h: 56%; --g-x: 50%; --g-y: 46%; }
  50%      { --g-h1: 78deg;  --g-h2: 268deg; --g-w: 56%; --g-h: 42%; --g-x: 66%; --g-y: 62%; }
}
@keyframes ag-wash-float {
  0%, 100% { transform: scale(1)    translate3d(0, 0, 0);    filter: saturate(1); }
  50%      { transform: scale(1.18) translate3d(-8%, 8%, 0); filter: saturate(1.1); }
}
/* Copy takes the wider column; both columns centre on one midline. */
.ag-hero__grid {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(3rem, 7vw, 6.5rem); align-items: center;
}
.ag-hero__title {
  font-family: var(--font-title); font-weight: 700;
  font-size: clamp(2.25rem, 4.4vw, 3.6rem); line-height: 0.97; letter-spacing: -0.03em;
  color: var(--color-on-dark); text-wrap: balance;
  margin: var(--space-4) 0 0;
}
.ag-hero__lead { font-size: var(--fs-lead); line-height: 1.6; color: var(--color-on-dark-muted); max-width: 560px; margin: var(--space-4) 0 0; text-wrap: pretty; }
.ag-hero__lead strong { color: var(--color-on-dark); font-weight: 600; }
.ag-hero__cta { margin-top: var(--space-6); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
/* One row under both columns, spanning the panel. */
.ag-hero__facts {
  position: relative; z-index: 2;
  list-style: none; padding: 0;
  margin: var(--space-6) 0 0;
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6);
  font-size: 0.875rem; color: var(--color-on-dark-muted);
}
.ag-hero__facts li { display: inline-flex; align-items: center; gap: 8px; }
.ag-hero__facts svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--ag-indigo-bright); }

/* ---------- Hero visual: the routing diagram, drawn as a wireframe ----------
   No frame, hairline white lines, no fills, no inner bloom, no shadow.
   Colour only where it means something: the indigo coordinator and its
   routing edges, the amber human-review step. */
.ag-visual {
  position: relative;
  background: transparent; color: var(--color-on-dark);
}
.ag-visual__svg { display: block; width: 100%; height: auto; overflow: visible; }
.ag-visual__svg--compact { display: none; }
.ag-visual__node { fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 0.7; }
.ag-visual__node--coord { stroke: var(--ag-indigo-bright); }
.ag-visual__node--review { stroke: var(--ag-amber); }
.ag-visual__flow { fill: none; stroke: var(--ag-indigo-bright); stroke-width: 0.8; stroke-dasharray: 4 6; animation: ag-flow 2.4s linear infinite; }
.ag-visual__edge--review { fill: none; stroke: var(--ag-amber); stroke-width: 0.8; stroke-dasharray: 3 5; }
.ag-visual text {
  font-family: var(--font-body); font-size: 12px; font-weight: 500; fill: rgba(255, 255, 255, 0.86);
}
.ag-visual .ag-visual__label--muted { fill: rgba(255, 255, 255, 0.5); font-size: 10.5px; font-weight: 400; }
@keyframes ag-flow { to { stroke-dashoffset: -20; } }

/* ---------- Card grid (value props, capabilities) ---------- */
.ag-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-6); }
.ag-card {
  background: var(--color-surface-light); border: 1px solid transparent;
  border-radius: var(--radius-lg); padding: var(--space-5);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.ag-card:hover { transform: translateY(-3px); border-color: var(--border-ink); }
.ag-card__icon {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: var(--radius-md);
  background: var(--color-paper); border: 1px solid var(--border-ink);
  color: var(--ag-indigo); margin-bottom: var(--space-4);
}
.ag-card__icon svg { width: 20px; height: 20px; }
.ag-card--dark-icon .ag-card__icon { background: var(--color-ink); border-color: var(--color-ink); color: var(--ag-amber); }
.ag-card__title { font-family: var(--font-title); font-size: var(--fs-card-title); font-weight: 700; letter-spacing: -0.01em; margin: 0 0 8px; }
.ag-card__body { font-size: 0.9375rem; color: var(--color-ink-60); line-height: 1.55; margin: 0; }

/* ---------- Use cases ---------- */
.ag-uses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-6); }
.ag-use {
  background: var(--color-ink); color: var(--color-on-dark); border: 1px solid transparent;
  border-radius: var(--radius-lg); padding: var(--space-5);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.ag-use:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.18); }
.ag-use__head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.ag-use__icon {
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 42px; height: 42px; border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--ag-amber);
}
.ag-use__icon svg { width: 20px; height: 20px; }
.ag-use__title { font-family: var(--font-title); font-size: var(--fs-card-title); font-weight: 700; letter-spacing: -0.01em; margin: 0; color: var(--color-on-dark); }
.ag-use__body { font-size: 0.9375rem; color: var(--color-on-dark-muted); line-height: 1.55; margin: 0 0 var(--space-4); }
.ag-use__list { list-style: none; padding: var(--space-4) 0 0; margin: 0; display: grid; gap: 8px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.ag-use__list li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.9375rem; line-height: 1.45; color: var(--color-on-dark); }
.ag-use__list svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; color: var(--ag-indigo-bright); }

/* ---------- Process ---------- */
.ag-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-6); }
.ag-step { background: color-mix(in srgb, var(--color-paper) 94%, var(--color-ink)); border: 1px solid transparent; border-radius: var(--radius-lg); padding: var(--space-5); }
.ag-step__when {
  display: block; margin: 0 0 var(--space-3);
  font-family: var(--font-title); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: color-mix(in srgb, var(--ag-indigo) 85%, var(--color-ink));
}
.ag-step__title { font-family: var(--font-title); font-size: var(--fs-step); font-weight: 700; letter-spacing: -0.01em; margin: 0 0 8px; }
.ag-step__body { font-size: 0.9375rem; color: var(--color-ink-60); line-height: 1.55; margin: 0; }

/* ---------- Stack (dark inset panel) ---------- */
.ag-stack {
  position: relative; overflow: hidden;
  background:
    radial-gradient(52% 120% at 100% 0%, color-mix(in srgb, var(--ag-indigo) 30%, transparent), transparent 70%),
    radial-gradient(40% 100% at 0% 100%, color-mix(in srgb, var(--ag-amber) 16%, transparent), transparent 72%),
    var(--color-ink);
  color: var(--color-on-dark);
  border-radius: var(--radius-xl);
  padding: var(--space-7) var(--space-6);
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: var(--space-6); align-items: start;
}
.ag-stack__title { font-family: var(--font-title); font-weight: 700; font-size: var(--fs-h2); letter-spacing: -0.02em; line-height: 1.01; color: var(--color-on-dark); margin: var(--space-3) 0 0; }
.ag-stack__lead { font-size: var(--fs-md); color: var(--color-on-dark-muted); line-height: 1.6; margin: var(--space-3) 0 0; }
.ag-stack__list { margin: 0; display: grid; }
.ag-stack__row {
  display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: var(--space-4);
  padding: var(--space-4) 0; border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.ag-stack__row:first-child { padding-top: 0; }
.ag-stack__row:last-child { border-bottom: 0; padding-bottom: 0; }
.ag-stack__label { font-family: var(--font-title); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ag-amber); margin: 0; }
.ag-stack__val { font-size: 0.9375rem; color: var(--color-on-dark-muted); line-height: 1.55; margin: 0; }

/* ---------- FAQ accordion ---------- */
.ag-faq { max-width: 820px; margin: var(--space-6) auto 0; border-top: 1px solid var(--border-ink); }
.ag-faq__item { border-bottom: 1px solid var(--border-ink); }
.ag-faq__q { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) 0; font-family: var(--font-title); font-size: var(--fs-faq); font-weight: 700; letter-spacing: -0.01em; color: var(--color-ink); }
.ag-faq__q::-webkit-details-marker { display: none; }
.ag-faq__icon { color: var(--ag-indigo); }
.ag-faq__a { font-size: var(--fs-md); color: var(--color-ink-60); line-height: 1.65; margin: 0; padding: 0 0 var(--space-5); max-width: 700px; }

/* ---------- Closing CTA ---------- */
/* The shared band ships with the site's green glow; this page runs indigo
   and amber. */
.ag .cta__glow {
  background:
    radial-gradient(42% 90% at 42% 45%, color-mix(in srgb, var(--ag-indigo) 38%, transparent), transparent 68%),
    radial-gradient(38% 85% at 66% 52%, color-mix(in srgb, var(--ag-amber) 22%, transparent), transparent 70%);
  animation: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .ag-hero__grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .ag-visual { max-width: 560px; width: 100%; margin-inline: auto; }
  .ag-cards { grid-template-columns: 1fr 1fr; }
  .ag-uses { grid-template-columns: 1fr; }
  .ag-steps { grid-template-columns: 1fr; }
  .ag-stack { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ag-section { padding-top: var(--space-5); }
  .ag-h2, .ag-stack__title { font-size: clamp(1.75rem, 7vw, 2.125rem); margin-top: var(--space-2); }
  .ag-sub { font-size: var(--fs-md); margin-top: var(--space-2); }
  .ag-hero { padding-top: calc(var(--header-height) + var(--space-3)); padding-bottom: 0; }
  .ag-hero__panel { padding: var(--space-5) var(--space-4); border-radius: var(--radius-lg); }
  .ag-hero__title { font-size: clamp(1.75rem, 8vw, 2.25rem); margin-top: var(--space-3); }
  .ag-hero__lead { margin-top: var(--space-3); }
  .ag-hero__cta { margin-top: var(--space-4); }
  .ag-hero__cta .btn { width: 100%; }
  .ag-hero__facts { flex-direction: column; align-items: flex-start; gap: var(--space-2); margin-top: var(--space-5); }
  /* Compact drawing under the buttons: one row per step, no sublabels. */
  .ag-visual__svg--full { display: none; }
  .ag-visual__svg--compact { display: block; }
  .ag-visual text { font-size: 13px; }

  .ag-cards, .ag-uses, .ag-steps { grid-template-columns: 1fr; gap: var(--space-3); margin-top: var(--space-4); }
  .ag-card, .ag-use, .ag-step { padding: var(--space-3); }
  .ag-card__icon { margin-bottom: var(--space-3); }

  .ag-stack { padding: var(--space-4); border-radius: var(--radius-lg); gap: var(--space-4); }
  .ag-stack__row { grid-template-columns: 1fr; gap: 4px; padding: var(--space-3) 0; }

  .ag-faq { margin-top: var(--space-4); }
}
@media (prefers-reduced-motion: reduce) {
  .ag-hero__glow,
  .ag-hero__glow--indigo,
  .ag-hero__glow--amber,
  .ag-hero__glow--corner,
  .ag-hero__wash,
  .ag-visual__flow { animation: none; }
}
