/* agent-factory site. Adapted from the software-factory site (its docs/DESIGN.md).
   Same tokens, type and components; this page is image-led, so it adds the
   illustration figures, role cards, speech bubbles and one entrance motion. */

@font-face {
  font-family: "SF Body";
  src: url("fonts/source-sans-3-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "SF Code";
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --surface: #F3F5F6;
  --raised: #E8ECEE;
  --border: #C9D1D6;
  --border-strong: #77838A;
  --text: #121719;
  --text-muted: #4A555B;
  --primary: #0B6A4C;
  --primary-hover: #08553D;
  --on-primary: #FFFFFF;
  --primary-soft: #E2F1EA;

  --font-body: "SF Body", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-code: "SF Code", "Cascadia Mono", Consolas, ui-monospace, Menlo, monospace;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 18px;

  --max: 72rem;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0E1214;
    --surface: #161B1E;
    --raised: #1E2529;
    --border: #30393E;
    --border-strong: #7D8A91;
    --text: #E8EDEF;
    --text-muted: #A9B4BA;
    --primary: #5BD0A0;
    --primary-hover: #7EDCB5;
    --on-primary: #062118;
    --primary-soft: #13342A;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1214;
  --surface: #161B1E;
  --raised: #1E2529;
  --border: #30393E;
  --border-strong: #7D8A91;
  --text: #E8EDEF;
  --text-muted: #A9B4BA;
  --primary: #5BD0A0;
  --primary-hover: #7EDCB5;
  --on-primary: #062118;
  --primary-soft: #13342A;
}

@media (min-width: 600px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 40px; } }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  font-kerning: normal;
}
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-weight: 650; color: var(--text); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem); line-height: 1.08; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.125rem); line-height: 1.15; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; line-height: 1.3; }
p, ul, ol, figure, pre { margin: 0; }
p { text-wrap: pretty; }

a { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 3px;
  border-radius: 2px;
}

code, pre { font-family: var(--font-code); font-feature-settings: "calt" 0; }
:not(pre) > code {
  font-size: 0.86em;
  background: var(--raised);
  border-radius: var(--radius-sm);
  padding: 0.12em 0.35em;
  overflow-wrap: anywhere;
}
a code { color: inherit; background: transparent; padding: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

/* Skip link */
.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  background: var(--primary);
  color: var(--on-primary);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: 650;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* Layout */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm) var(--space-lg);
  min-height: 64px;
  padding-block: var(--space-sm);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-code);
  font-weight: 600;
  font-size: 1rem;
  min-height: 44px;
  margin-right: auto;
}
.brand img { width: 24px; height: 24px; }
.header-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
.header-link:hover { border-bottom-color: var(--border-strong); }
.theme-toggle {
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  min-height: 44px;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
}
.theme-toggle:hover { background: var(--raised); }
@media (max-width: 719px) {
  .site-header { position: static; }
  .bar { gap: 0 var(--space-md); }
}

/* Sections */
main { display: block; }
main:focus { outline: none; }
.section { padding-block: var(--space-2xl); border-top: 1px solid var(--border); }
@media (min-width: 1024px) { .section { padding-block: var(--space-3xl); } }
.section h2 + * { margin-top: var(--space-xl); }
.muted { color: var(--text-muted); }
.small { font-size: 0.9375rem; line-height: 1.5; }

/* Hero */
.hero { padding-block: var(--space-xl) var(--space-2xl); }
@media (min-width: 1024px) { .hero { padding-block: 64px var(--space-3xl); } }
.hero h1 { max-width: 22ch; }
.lead { font-size: 1.25rem; line-height: 1.5; color: var(--text-muted); max-width: 36rem; margin-top: var(--space-md); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-lg); margin-top: var(--space-lg); }
.hero-art { margin-top: var(--space-xl); }
.hero-art img { display: block; width: 100%; height: auto; }
@media (max-width: 599px) {
  /* Keep the figures legible on a phone: crop to the middle of the table, where the approver stands. */
  .hero-art { border-radius: var(--radius-xl); overflow: hidden; }
  .hero-art img { aspect-ratio: 5 / 4; object-fit: cover; object-position: 50% 50%; }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius-md);
  font-weight: 650;
  font-size: 1.0625rem;
  text-decoration: none;
  transition: background-color 100ms ease-out;
}
.button:hover { background: var(--primary-hover); }
.text-link { font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }

/* Role cards */
.team {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr));
  gap: var(--space-lg);
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 6px 6px var(--space-md);
  transition: transform 160ms ease-out, border-color 160ms ease-out;
}
.card:hover, .card:focus-within { transform: translateY(-6px); border-color: var(--border-strong); }
.card img { display: block; width: 100%; height: auto; }
.card h3 { margin: var(--space-sm) 12px 0; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-xl); }
.card h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.card h3 a:focus-visible { outline: none; }
.card:has(a:focus-visible) { outline: 3px solid var(--text); outline-offset: 3px; }
.card .line { flex: 1 0 auto; margin: var(--space-xs) 12px 0; font-size: 1rem; line-height: 1.45; color: var(--text-muted); }

/* Speech bubble: the example ask */
.bubble {
  position: relative;
  margin: 22px 12px 0;
  padding: 12px 14px;
  background: var(--bubble, var(--primary-soft));
  color: var(--text);
  border-radius: 14px 14px 14px 4px;
  font-size: 1rem;
  line-height: 1.45;
  font-weight: 500;
}
.bubble::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 20px;
  border: 10px solid transparent;
  border-top: 0;
  border-bottom-color: var(--bubble, var(--primary-soft));
}

/* How a specialist works */
.how { display: grid; gap: var(--space-lg); }
.how .strip { display: block; width: 100%; height: auto; }
.how ol { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); counter-reset: how; }
.how li { counter-increment: how; padding-inline: 1%; }
.how li strong { display: flex; align-items: center; gap: 10px; font-size: 1.125rem; font-weight: 650; }
.how li strong::before {
  content: counter(how);
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-size: 0.9375rem;
}
.how li span { display: block; margin-top: var(--space-xs); color: var(--text-muted); font-size: 1rem; line-height: 1.45; }
.how .crop { display: none; }
@media (max-width: 719px) {
  /* One tile per caption: the strip is cut into its four panels. */
  .how .strip { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .how ol { grid-template-columns: 1fr 1fr; gap: var(--space-xl) var(--space-md); }
  .how li { padding-inline: 0; }
  .how .crop { display: block; aspect-ratio: 278 / 304; overflow: hidden; margin-bottom: var(--space-sm); }
  .how .crop img { display: block; max-width: none; width: calc(1200 / 278 * 100%); height: auto; }
  .how li:nth-child(1) .crop img { margin-left: calc(-8 / 278 * 100%); }
  .how li:nth-child(2) .crop img { margin-left: calc(-310 / 278 * 100%); }
  .how li:nth-child(3) .crop img { margin-left: calc(-612 / 278 * 100%); }
  .how li:nth-child(4) .crop img { margin-left: calc(-914 / 278 * 100%); }
}

/* Start in 3 steps */
.steps { list-style: none; padding: 0; display: grid; gap: var(--space-xl); counter-reset: step; }
.step {
  counter-increment: step;
  display: grid;
  gap: var(--space-md) var(--space-xl);
  align-items: center;
}
.step img { display: block; width: 100%; max-width: 240px; height: auto; }
.step-body { min-width: 0; }
.step-body > * + * { margin-top: var(--space-md); }
.step h3 { display: flex; align-items: center; gap: 12px; font-size: 1.375rem; }
.step h3::before {
  content: counter(step);
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 1.0625rem;
}
.step .bubble { display: inline-block; margin: 26px 0 0; font-size: 1.0625rem; }
@media (min-width: 720px) {
  .step { grid-template-columns: 240px minmax(0, 1fr); }
}
.fine { margin-top: var(--space-xl); }

/* Command block */
.cmd {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 46rem;
}
.cmd pre {
  padding: 16px 96px 16px 18px;
  font-size: 0.9375rem;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.cmd .ln { display: block; padding-left: 2ch; text-indent: -2ch; }
.cmd .w { white-space: nowrap; }
.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 36px;
  min-width: 72px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.copy::before { content: ""; position: absolute; inset: -4px; } /* 44px hit area */
.copy:hover { background: var(--raised); }
.copy[data-state="done"] { color: var(--primary); border-color: var(--primary); }
@media (max-width: 599px) {
  .cmd pre { padding-right: 18px; padding-top: 52px; font-size: 0.875rem; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding-block: var(--space-xl); font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-xl); }
.site-footer li { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.4em; color: var(--text-muted); }
.site-footer a { display: inline-flex; min-height: 44px; align-items: center; color: var(--text); font-weight: 600; }
.site-footer p { margin-top: var(--space-md); }

/* Entrance: only when the script runs and motion is welcome */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 500ms ease-out, transform 500ms ease-out; }
  .js .reveal.in { opacity: 1; transform: none; }
  .js .card.reveal.in { transition: opacity 500ms ease-out, transform 160ms ease-out, border-color 160ms ease-out; }
  .js .card.reveal.in:hover, .js .card.reveal.in:focus-within { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover, .card:focus-within { transform: none; }
}

@media print {
  .site-header, .skip, .theme-toggle, .copy { display: none !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}

/* Phones: keep the header on one line and the cards compact (picture beside the name) */
.brand span { white-space: nowrap; }
@media (max-width: 479px) {
  .header-link { display: none; }
}
@media (max-width: 599px) {
  .team { grid-template-columns: 1fr; gap: var(--space-md); }
  .card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-areas: "img name" "img line" "ask ask";
    grid-template-rows: auto 1fr auto;
    column-gap: 12px;
    padding: 6px 6px 12px;
  }
  .card img { grid-area: img; align-self: start; }
  .card h3 { grid-area: name; margin: 10px 6px 0 0; }
  .card .line { grid-area: line; margin: 2px 6px 0 0; font-size: 0.9375rem; }
  .card .bubble { grid-area: ask; margin: 18px 6px 0; }
  .card .bubble::before { left: 46px; }
}

/* Role accents: the palette tokens team.json names in `accent`.
   Light values match the illustrations; dark values are their dark-mode tints. */
:root {
  --accent-blue: #2D67B3; --accent-orange: #B8541B; --accent-teal: #0F7C80; --accent-purple: #7346A8;
  --accent-rose: #B23A62; --accent-amber: #8A5300; --accent-indigo: #4B4FC0; --accent-magenta: #A0337C;
  --accent-olive: #76660A; --accent-red: #C2412D; --accent-slate: #3B5070; --accent-brown: #8F5A34;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent-blue: #82B4EC; --accent-orange: #F29A62; --accent-teal: #5CC8CB; --accent-purple: #BC9CEA;
    --accent-rose: #F290B0; --accent-amber: #F2B755; --accent-indigo: #A3A6F5; --accent-magenta: #E58BC8;
    --accent-olive: #D9C65A; --accent-red: #FF8E7A; --accent-slate: #A5B8D3; --accent-brown: #DDA77A;
  }
}
:root[data-theme="dark"] {
  --accent-blue: #82B4EC; --accent-orange: #F29A62; --accent-teal: #5CC8CB; --accent-purple: #BC9CEA;
  --accent-rose: #F290B0; --accent-amber: #F2B755; --accent-indigo: #A3A6F5; --accent-magenta: #E58BC8;
  --accent-olive: #D9C65A; --accent-red: #FF8E7A; --accent-slate: #A5B8D3; --accent-brown: #DDA77A;
}
/* Each card sets --accent; its ask bubble takes a light tint of it. */
.card { --bubble: color-mix(in srgb, var(--accent, var(--primary)) 14%, var(--bg)); }
.card svg.rd { display: block; width: 100%; height: auto; }
@media (max-width: 599px) { .card svg.rd { grid-area: img; align-self: start; } }
