/* Akiva Solutions: site styles.
   One family (Archivo). Large display type, a white page with one pale
   grey alternate band, ink-black buttons and one link colour. Light and
   dark themes share every rule below the token blocks. */

/* Archivo is served from this site (SIL Open Font License, see
   /fonts/OFL.txt). The fallback face is system Arial scaled to Archivo's
   width, so text barely moves when the real font arrives. */
@font-face {
  font-family: Archivo;
  src: url("/fonts/archivo-v25-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Roboto");
  size-adjust: 101%;
}

:root {
  --paper: #ffffff;
  --paper-2: #f5f5f7;
  --surface: #ffffff;
  --tile: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #515154;
  --ink-3: #6e6e73;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --action: #0066cc;
  --action-hover: #004f9e;
  --btn: #1d1d1f;
  --btn-hover: #3a3a3d;
  --btn-ink: #ffffff;
  --signal: #b64400;
  --ok: #1d7a47;
  --danger: #b3261e;
  --person: #b45309;

  --display: 94%;
  --radius: 14px;
  --radius-lg: 28px;
  --wrap: 1200px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #000000;
  --paper-2: #161617;
  --surface: #1d1d1f;
  --tile: #161617;
  --ink: #f5f5f7;
  --ink-2: #b4b4ba;
  --ink-3: #8e8e93;
  --line: #424245;
  --line-soft: #2a2a2d;
  --action: #2997ff;
  --action-hover: #6bb6ff;
  --btn: #f5f5f7;
  --btn-hover: #d6d6db;
  --btn-ink: #000000;
  --signal: #ff9f45;
  --ok: #62d29c;
  --danger: #ff8a80;
  --person: #f2b93b;
  color-scheme: dark;
}

/* No JavaScript and a dark system: still get the dark theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #000000;
    --paper-2: #161617;
    --surface: #1d1d1f;
    --tile: #161617;
    --ink: #f5f5f7;
    --ink-2: #b4b4ba;
    --ink-3: #8e8e93;
    --line: #424245;
    --line-soft: #2a2a2d;
    --action: #2997ff;
    --action-hover: #6bb6ff;
    --btn: #f5f5f7;
    --btn-hover: #d6d6db;
    --btn-ink: #000000;
    --signal: #ff9f45;
    --ok: #62d29c;
    --danger: #ff8a80;
    --person: #f2b93b;
    color-scheme: dark;
  }
}

/* ── 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(--paper);
  color: var(--ink);
  font-family: Archivo, "Archivo fallback", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
main { flex: 1 0 auto; }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3 {
  font-stretch: var(--display);
  font-weight: 650;
  line-height: 1.06;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 1.35rem + 5.6vw, 5.5rem); line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: clamp(2rem, 1.3rem + 3.2vw, 3.5rem); }
h3 { font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem); line-height: 1.15; letter-spacing: -0.018em; }

p { text-wrap: pretty; }

a { color: var(--action); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--action-hover); }

:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 3px;
  border-radius: 4px;
}

img, svg { max-width: 100%; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}
.narrow > * { max-width: 50rem; }

/* Visible to screen readers only. */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Things that only work with scripts are not shown without them. */
html:not(.js) .js-only { display: none !important; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
}
.skip:focus { top: 0.75rem; color: var(--paper); }

.ext {
  width: 0.72em;
  height: 0.72em;
  margin-left: 0.3em;
  flex: none;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line-soft);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.brand:hover { color: var(--ink); }
/* The lockup is one outlined SVG (src/brand.mjs): AKIVA, then SOLUTIONS one step quieter. */
/* The logo is an image (two, one per theme). 30px tall from about 490px wide and never under 24px, the
   smallest size the brand allows. On the narrowest phones the theme button moves into the menu to make room. */
.brand-logo { display: block; height: clamp(1.5rem, 6.1vw, 1.875rem); width: auto; flex: none; }
.brand-logo.on-dark { display: none; }
:root[data-theme="dark"] .brand-logo.on-light { display: none; }
:root[data-theme="dark"] .brand-logo.on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .brand-logo.on-light { display: none; }
  :root:not([data-theme]) .brand-logo.on-dark { display: block; }
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
}
.site-nav a:not(.btn) {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9375rem;
  padding: 0.4rem 0;
  white-space: nowrap;
}
.site-nav a:not(.btn):hover,
.site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] { font-weight: 600; }

.header-tools { display: flex; align-items: center; gap: 0.25rem; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-2);
  cursor: pointer;
}
@media (hover: hover) {
  .icon-btn:hover { color: var(--ink); background: var(--paper-2); }
}
.icon-btn svg { width: 1.15rem; height: 1.15rem; }

.i-sun { display: none; }
[data-theme="dark"] .i-sun { display: block; }
[data-theme="dark"] .i-moon { display: none; }

.menu-btn { display: none; }
.m-close { display: none; }
.menu-btn[aria-expanded="true"] .m-open { display: none; }
.menu-btn[aria-expanded="true"] .m-close { display: block; }

/* Small screens: the nav folds into a panel. Only when scripts run, so the
   links stay reachable without JavaScript. */
@media (max-width: 899px) {
  .site-nav { order: 3; flex-basis: 100%; padding-bottom: 0.75rem; }
  .header-row { flex-wrap: wrap; }

  .js .menu-btn { display: inline-grid; }
  .js .site-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.25rem 0 1.25rem;
    border-top: 1px solid var(--line-soft);
  }
  .js .site-nav.open { display: flex; }
  .js .site-nav a:not(.btn) {
    padding: 0.85rem 0;
    color: var(--ink);
    font-stretch: var(--display);
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    border-bottom: 1px solid var(--line-soft);
  }
  .js .site-nav a[aria-current="page"] { color: var(--action); }
  .js .site-nav .btn { margin-top: 1.25rem; min-height: 3rem; }
}
/* Narrowest phones: logo and menu button share the row; the theme button
   sits at the foot of the open menu. */
@media (max-width: 359px) {
  .js .header-row { gap: 0.5rem; }
  .js .header-tools { display: contents; }
  .js .menu-btn { order: 2; }
  .js #themeToggle { display: none; order: 4; margin: -0.75rem 0 0.75rem -0.6rem; }
  .js .header-row:has(.site-nav.open) #themeToggle { display: inline-grid; }
}

/* ── Buttons, links, tags ─────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.6rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 550;
  font-size: 1.0625rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--btn); color: var(--btn-ink); }
.btn-primary:hover { background: var(--btn-hover); color: var(--btn-ink); }
.btn-quiet { border-color: var(--ink-3); color: var(--ink); background: none; }
.btn-quiet:hover { border-color: var(--ink); color: var(--ink); background: var(--paper-2); }
.btn-wide { width: 100%; }
.nav-cta { min-height: 2.75rem; padding: 0.35rem 1.1rem; font-size: 0.9375rem; }
@media (min-width: 900px) { .nav-cta { min-height: 2.25rem; } }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
@media (max-width: 479px) {
  .actions .btn { flex: 1 1 100%; }
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 550;
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; }
/* A link that leads on, not out: it gets a chevron. */
.text-link:not([target]) { padding-right: 0.2em; }
.text-link:not([target])::after {
  content: "";
  width: 0.42em;
  height: 0.42em;
  margin-left: 0.4em;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.tag {
  display: inline-block;
  color: var(--signal);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.ticks { display: grid; gap: 0.5rem; }
.ticks li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.45;
  text-wrap: pretty;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.4em;
  width: 0.62rem;
  height: 0.34rem;
  border-left: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: rotate(-45deg);
}

/* ── Pictures of products ─────────────────────────── */

.shot {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  line-height: 0;
}
.shot img { display: block; width: 100%; height: auto; }

/* On the dark page a light screenshot would glare: pictures are dimmed a
   little and keep a hairline frame. */
:root[data-theme="dark"] .shot img { filter: brightness(0.82); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .shot img { filter: brightness(0.82); }
}

/* ── Hero ─────────────────────────────────────────── */

.hero { padding-block: clamp(3.5rem, 9vw, 7.5rem) clamp(3rem, 7vw, 6rem); }

.hero-copy,
.hero-page > .wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero-copy h1 { max-width: 11.5em; }
.lede {
  margin-top: 1.5rem;
  max-width: 43rem;
  color: var(--ink-2);
  font-size: clamp(1.125rem, 1rem + 0.7vw, 1.4375rem);
  line-height: 1.45;
  letter-spacing: -0.008em;
}
.hero .actions { margin-top: 2.25rem; justify-content: center; }
.hero-tag { margin-top: 1rem; }
.hero-tag + .lede { margin-top: 0.75rem; }

.hero-page { padding-bottom: clamp(2.5rem, 6vw, 5rem); }
.hero-page h1 {
  max-width: 13em;
  font-size: clamp(2.375rem, 1.4rem + 4.4vw, 4.5rem);
}
.hero-page .lede { max-width: 46rem; }
.hero-page .lede + .lede { margin-top: 1rem; }
.built-note { font-size: 1.0625rem; line-height: 1.55; letter-spacing: 0; }
.built-note strong { color: var(--ink); font-weight: 600; }

.crumbs {
  margin-bottom: 0.75rem;
  color: var(--ink-3);
  font-size: 0.9375rem;
}
.crumbs a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span { margin-inline: 0.5rem; }

/* ── Schedule board: a timetable of our own day ───── */

.board {
  max-width: 62rem;
  margin: clamp(3rem, 7vw, 5.5rem) auto 0;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 4vw, 3.25rem) clamp(1.25rem, 3vw, 2.25rem);
  background: var(--tile);
  border-radius: var(--radius-lg);
  font-variant-numeric: tabular-nums;
}

.board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}
.board-title {
  font-stretch: var(--display);
  font-weight: 650;
  font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.board-key { display: flex; flex-wrap: wrap; gap: 0.2rem 1.1rem; }

.who {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink-2);
  font-size: 0.875rem;
  font-weight: 550;
  white-space: nowrap;
}
.who::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--ink-3);
}
.who-agent::before { background: var(--action); }
.who-person::before { background: var(--person); border-radius: 2px; }

.board-row {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr) 6.25rem;
  gap: 1rem;
  align-items: baseline;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}
.board-when {
  font-stretch: var(--display);
  font-weight: 650;
  font-size: 1.125rem;
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.board-what { color: var(--ink-2); line-height: 1.4; text-wrap: pretty; }
.board-foot { margin-top: 1rem; color: var(--ink-3); font-size: 0.875rem; line-height: 1.45; }

@media (max-width: 639px) {
  .board-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.2rem 0.75rem;
    padding: 0.8rem 0;
  }
  .board-what { grid-column: 1 / -1; grid-row: 2; }
}

/* ── Bands (page sections) ────────────────────────── */

.band { padding-block: clamp(4rem, 10vw, 8.5rem); }
.band-alt { background: var(--paper-2); --tile: var(--surface); }

.band-head {
  max-width: 50rem;
  margin: 0 auto clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
}
.band-head p {
  margin-top: 1.25rem;
  color: var(--ink-2);
  font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
  line-height: 1.5;
}

/* The statement about how everything here is made */
.statement .wrap { max-width: 62rem; text-align: center; }
.statement h2 { font-size: clamp(2.25rem, 1.3rem + 4.4vw, 4.5rem); letter-spacing: -0.035em; }
.statement p {
  max-width: 47rem;
  margin-inline: auto;
  color: var(--ink-2);
  font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
  line-height: 1.5;
}
.statement .pin-a {
  margin-top: 1.75rem;
  color: var(--ink);
  font-stretch: var(--display);
  font-weight: 600;
  font-size: clamp(1.3125rem, 1.1rem + 1vw, 1.875rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.statement .pin-b { margin-top: 1.25rem; }
.statement .text-link { margin-top: 1.5rem; }
.footer-built { font-weight: 600; }

/* Built by AI agents: a terminal where an agent builds the section below it.
   Dark in both themes, like the code panel. js/site.js arms it (.is-armed),
   plays it, then raises the section (.is-built). */
.term {
  max-width: 46rem;
  margin: 0 auto 3rem;
  overflow: hidden;
  border: 1px solid #424245;
  border-radius: var(--radius);
  background: #1d1d1f;
  color: #f5f5f7;
  text-align: left;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.55);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.5rem;
  padding: 0 0.5rem 0 1rem;
  border-bottom: 1px solid #333336;
  background: #262628;
}
.term-dots { display: flex; gap: 0.4rem; }
.term-dots i { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #4a4a4d; }
.term-title { flex: 1; min-width: 0; overflow: hidden; color: #a1a1a6; font-size: 0.8125rem; text-align: center; white-space: nowrap; text-overflow: ellipsis; }
.term-replay {
  min-height: 2rem;
  padding: 0 0.75rem;
  border: 1px solid #424245;
  border-radius: 999px;
  background: transparent;
  color: #f5f5f7;
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}
.term-replay:not([aria-disabled]):hover { background: #333336; }
.term-replay:focus-visible { outline-color: #2997ff; }
.term-replay[aria-disabled] { opacity: 0.5; cursor: default; }
.term-replay[hidden] { display: inline-block; visibility: hidden; }
.term-body {
  padding: 1.125rem 1.25rem 1.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.75;
}
.term-line { margin: 0; padding-left: 2ch; text-indent: -2ch; }
.statement .term-line { max-width: none; color: inherit; font-size: inherit; line-height: inherit; }
.term-prompt { margin-bottom: 0.75rem; color: #f5f5f7; }
.term-caret { color: #2997ff; }
.term-step b { font-weight: 600; }
.term-mark { display: inline-block; width: 1ch; text-indent: 0; color: #62d29c; }
.term-arg, .term-out { color: #a1a1a6; }
.term-out::before { content: "\2192\00a0"; }
.term-done { margin-top: 0.75rem; }
.term-cursor { display: none; }

.agent-build.is-armed .term-line { visibility: hidden; }
.agent-build.is-armed .term-line.on { visibility: visible; }
.agent-build.is-armed .term-rest { visibility: hidden; }
.agent-build.is-armed .term-step .term-out { visibility: hidden; }
.agent-build.is-armed .term-step.ok .term-out { visibility: visible; }
.agent-build.is-armed .term-line.busy .term-mark { color: #f5f5f7; }
.agent-build.is-armed .term-line.typing .term-cursor {
  /* Out of flow, so it never changes where the prompt wraps. */
  position: absolute;
  display: inline-block;
  width: 0.55em;
  height: 1.15em;
  margin-top: 0.3em;
  background: #f5f5f7;
  animation: term-blink 1s steps(1) infinite;
}
@keyframes term-blink { 50% { opacity: 0; } }
/* Opacity only, so the words stay readable to screen readers and find-in-page. */
.agent-build.is-armed .agent-result > * {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.7s ease-out, transform 0.9s var(--ease);
}
.agent-build.is-armed.is-built .agent-result > * { opacity: 1; transform: none; }
.agent-build.is-built .agent-result > :nth-child(2) { transition-delay: 0.12s; }
.agent-build.is-built .agent-result > :nth-child(3) { transition-delay: 0.24s; }
.agent-build.is-built .agent-result > :nth-child(4) { transition-delay: 0.36s; }
@media (max-width: 599px) {
  .term { margin-bottom: 2.25rem; }
  .term-body { padding: 1rem; font-size: 0.75rem; }
  .term-title { text-align: left; }
}
@media (min-width: 900px) {
  .term-body { padding: 1.375rem 1.625rem 1.5rem; font-size: 0.9375rem; }
}


/* Services: one ruled row each, like a spec sheet */
.service {
  display: grid;
  gap: 1rem;
  padding-block: clamp(1.75rem, 4vw, 2.75rem);
  border-top: 1px solid var(--line);
}
.service:last-child { border-bottom: 1px solid var(--line); }
.service h3 { font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.25rem); letter-spacing: -0.028em; }
.service > p { color: var(--ink-2); }
.service .text-link { align-self: start; justify-self: start; }
@media (min-width: 900px) {
  .service {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr) minmax(0, 1.15fr);
    grid-template-rows: auto auto;
    column-gap: 3rem;
  }
  .service h3 { grid-row: 1 / 3; }
  .service > p { grid-row: 1 / 3; }
  .service .ticks { grid-column: 3; grid-row: 1; }
  .service .text-link { grid-column: 3; grid-row: 2; }
}

/* Systems we run: large tiles, a picture in each where we have one */
.systems { display: grid; gap: clamp(1rem, 2vw, 1.5rem); }
@media (min-width: 800px) { .systems { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.system {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--tile);
  border-radius: var(--radius-lg);
}
.system-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}
.system-head {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 0.35rem;
}
.system h3 { font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem); line-height: 1.05; letter-spacing: -0.03em; }
.system p { color: var(--ink-2); max-width: 34rem; }
.system .shot,
.system .system-points { margin-top: auto; }
.system .shot { width: 100%; }
.system-points { padding-top: 1.5rem; border-top: 1px solid var(--line); }
@media (min-width: 800px) {
  .system-wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 3.5rem; }
  .system-wide > * { flex: 1 1 0; min-width: 0; }
  .system-wide .shot { flex-grow: 1.35; margin-top: 0; }
  .system-wide .system-points { margin-top: 0; padding-top: 0; border-top: 0; }
}

/* A large statement: grey text, the figures in ink. */
.systems-more { max-width: 60rem; margin: clamp(3.5rem, 8vw, 6.5rem) auto 0; text-align: center; }
.systems-more p:first-child {
  color: var(--ink-3);
  font-stretch: var(--display);
  font-weight: 600;
  font-size: clamp(1.375rem, 1.05rem + 1.6vw, 2.25rem);
  line-height: 1.22;
  letter-spacing: -0.025em;
}
.systems-more strong { color: var(--ink); font-weight: inherit; }
@media (max-width: 479px) {
  .systems-more p:first-child { font-size: 1.1875rem; line-height: 1.35; letter-spacing: -0.015em; }
}
.systems-more p + p { margin-top: 1.5rem; color: var(--ink-2); }
.systems-more a { font-weight: 550; white-space: nowrap; }

/* Steps: a real sequence, so they are numbered */
.steps {
  display: grid;
  gap: 2.5rem 2.5rem;
  counter-reset: step;
}
@media (min-width: 640px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 640px) { .steps-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.steps li { counter-increment: step; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 1.25rem;
  color: var(--ink-3);
  font-stretch: var(--display);
  font-weight: 600;
  font-size: clamp(2.5rem, 2rem + 2vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.04em;
}
.steps h3 { margin-bottom: 0.6rem; }
.steps p { color: var(--ink-2); }

/* ── Contact ──────────────────────────────────────── */

.contact { background: var(--paper-2); }
.contact-grid { display: grid; gap: 2.5rem; }
@media (min-width: 900px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 4.5rem; align-items: start; }
}
.contact-copy h2 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); }
.contact-copy > p { margin-top: 1.25rem; color: var(--ink-2); max-width: 34rem; }
.contact-copy .contact-direct {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 1.75rem;
}
.contact-email {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  text-decoration: none;
}
.contact-email:hover { text-decoration: underline; }
.copy-btn {
  min-height: 2.75rem;
  padding: 0.25rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 550;
  cursor: pointer;
}
.copy-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.contact-copy .contact-where { font-size: 1rem; color: var(--ink-3); }

.contact-form {
  display: grid;
  gap: 1.1rem;
  padding: clamp(1.25rem, 3.5vw, 2.5rem);
  background: var(--surface);
  border-radius: var(--radius-lg);
}
.field-row { display: grid; gap: 1.1rem; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 0.35rem; min-width: 0; }
.field label { font-weight: 600; font-size: 0.9375rem; }
.optional { color: var(--ink-3); font-weight: 400; }

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--ink-3);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.field textarea { resize: vertical; min-height: 7.5rem; }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { outline-offset: 1px; border-color: var(--action); }

.form-error {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--danger);
  border-radius: 12px;
  color: var(--danger);
  font-weight: 600;
  font-size: 0.9375rem;
}
.field [aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
.form-fallback {
  display: grid;
  gap: 0.75rem;
  justify-items: start;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.form-fallback[hidden] { display: none; }
.form-fallback textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  resize: vertical;
}
.form-note { color: var(--ink-3); font-size: 0.875rem; line-height: 1.45; }

/* ── AI agents page ───────────────────────────────── */

.worktable { width: 100%; border-collapse: collapse; }
.worktable th,
.worktable td {
  padding: 1.5rem 2rem 1.5rem 0;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.worktable tbody tr:last-child th,
.worktable tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.worktable thead th {
  padding-block: 0 0.9rem;
  border-top: 0;
  color: var(--ink-3);
  font-size: 0.9375rem;
  font-weight: 550;
}
.worktable tbody th {
  width: 27%;
  font-stretch: var(--display);
  font-weight: 650;
  font-size: 1.4375rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.worktable td { color: var(--ink-2); text-wrap: pretty; }
.worktable td:last-child { width: 26%; padding-right: 0; color: var(--ink); }

@media (max-width: 759px) {
  .worktable, .worktable tbody, .worktable tr, .worktable th, .worktable td { display: block; width: auto; }
  .worktable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .worktable tr { padding-block: 1.5rem; border-top: 1px solid var(--line); }
  .worktable tbody tr:last-child { border-bottom: 1px solid var(--line); }
  .worktable tbody th { width: auto; }
  .worktable th, .worktable td, .worktable td:last-child,
  .worktable tbody tr:last-child th, .worktable tbody tr:last-child td { padding: 0; border: 0; width: auto; }
  .worktable td { margin-top: 0.75rem; }
  .worktable td::before {
    content: attr(data-label);
    display: block;
    color: var(--ink-3);
    font-size: 0.875rem;
    font-weight: 550;
  }
}

/* Agent systems and products: one large block each */
.case, .product {
  display: grid;
  gap: 1.5rem;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  background: var(--tile);
  border-radius: var(--radius-lg);
}
.casebook, .catalog { display: grid; gap: clamp(1rem, 2vw, 1.5rem); }
.case-title, .product-title {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 0.35rem;
  align-self: start;
}
.case h3, .product h3 { font-size: clamp(1.875rem, 1.4rem + 2vw, 3rem); line-height: 1.04; letter-spacing: -0.032em; }
.case-body, .product-body { display: grid; gap: 1.1rem; justify-items: start; align-content: start; }
.case-body > p, .product-body > p { color: var(--ink-2); max-width: 44rem; }
.product-body > p:first-child { color: var(--ink); font-size: 1.125rem; line-height: 1.5; }
.product-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; }
.case .shot, .product .shot { width: 100%; }
/* Long entries: the points run across the foot of the card. */
.product-facts { order: 3; display: grid; gap: 1.1rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .product-facts .ticks { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; } }
/* A product's pictures, one under another. */
.product-shots { display: grid; gap: 0.75rem; align-content: start; min-width: 0; }
@media (min-width: 900px) {
  .case, .product { grid-template-columns: minmax(0, 0.5fr) minmax(0, 1fr); column-gap: 3.5rem; }
  /* With a picture: copy on one side, picture on the other. */
  .has-shot { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
  .has-shot .product-title, .has-shot .case-title { grid-column: 1; }
  .has-shot .product-body, .has-shot .case-body { grid-column: 1; }
  .has-shot > .shot, .product-shots { grid-column: 2; }
  .has-shot.flip { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .has-shot.flip .product-title, .has-shot.flip .product-body { grid-column: 2; }
  .has-shot.flip .product-shots { grid-column: 1; }
  /* Pictures sit at the top of their card. Words shorter than the pictures
     sit level with their middle: the two spare rows share whatever height
     is left over. */
  .has-shot { grid-template-rows: 1fr auto auto 1fr; row-gap: 0; }
  .has-shot .product-title, .has-shot .case-title { grid-row: 2; margin-bottom: 1.5rem; }
  .has-shot .product-body, .has-shot .case-body { grid-row: 3; }
  .has-shot > .shot, .product-shots { grid-row: 1 / 5; }
  .has-shot .product-facts { grid-column: 1 / -1; grid-row: 5; margin-top: 2.5rem; }
  .product-facts .ticks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-facts.with-more { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); column-gap: 3.5rem; }
  .with-more .ticks { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .with-more p { max-width: none; }
  /* No picture: points and links under the name, description beside. */
  .text-card { grid-template-rows: auto 1fr; }
  .text-card .product-title { grid-column: 1; grid-row: 1; }
  .text-card .product-side { grid-column: 1; grid-row: 2; }
  .text-card .product-body { grid-column: 2; grid-row: 1 / 3; }
}
.product-side { display: grid; gap: 1.1rem; justify-items: start; align-content: start; }
.more-wide { display: none; }
.more-wide p, .more-narrow p { color: var(--ink-2); max-width: 44rem; }
.more-wide p + p, .more-narrow p + p { margin-top: 1.1rem; }
.more-narrow summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 2.75rem;
  color: var(--action);
  font-weight: 550;
  cursor: pointer;
  list-style: none;
}
.more-narrow summary::-webkit-details-marker { display: none; }
.more-narrow summary::after {
  content: "";
  width: 0.42em;
  height: 0.42em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
}
.more-narrow[open] summary::after { transform: rotate(-135deg) translate(-1px, -1px); }
.more-narrow[open] summary { margin-bottom: 0.25rem; }
@media (min-width: 640px) {
  .more-wide { display: block; }
  .more-narrow { display: none; }
}

/* Rules: one ruled row each, title beside its explanation */
.rules { max-width: 62rem; margin-inline: auto; }
.rules div {
  display: grid;
  gap: 0.4rem 3rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
}
.rules div:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 720px) {
  .rules div { grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr); }
}
.rules dt {
  font-stretch: var(--display);
  font-weight: 650;
  font-size: 1.4375rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.rules dd { color: var(--ink-2); max-width: 44rem; text-wrap: pretty; }

.pair { display: grid; gap: clamp(1rem, 2vw, 1.5rem); }
@media (min-width: 720px) { .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pair div { padding: clamp(1.5rem, 4vw, 3rem); background: var(--tile); border-radius: var(--radius-lg); }
.pair h3 { margin-bottom: 0.9rem; font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.25rem); letter-spacing: -0.028em; }
.pair p { color: var(--ink-2); }

.faq { max-width: 50rem; margin-inline: auto; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 0;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.3rem;
  border-right: 1.5px solid var(--ink-2);
  border-bottom: 1.5px solid var(--ink-2);
  transform: rotate(45deg) translate(-2px, -2px);
}
.faq details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq summary h3 { font-size: 1.3125rem; }
.faq details p { padding-bottom: 1.5rem; color: var(--ink-2); max-width: 44rem; }

/* ── Products page ────────────────────────────────── */

.pubs { display: grid; gap: clamp(1rem, 2vw, 1.5rem); }
@media (min-width: 620px) {
  .pubs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .pubs > li { grid-column: span 3; }
  .pubs .pub-odd, .pubs .pub-wide { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  .pubs > li, .pubs .pub-odd { grid-column: span 2; }
  .pubs .pub-half { grid-column: span 3; }
  .pubs .pub-full, .pubs .pub-wide { grid-column: 1 / -1; }
}
.pubs a {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100%;
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  background: var(--tile);
  border-radius: var(--radius-lg);
  color: var(--ink);
  text-decoration: none;
}
.pub-shots { display: grid; gap: 0.75rem; }
.pub-copy { display: flex; flex: 1; flex-direction: column; gap: 0.5rem; }
@media (min-width: 800px) {
  .pub-wide a { flex-direction: row-reverse; align-items: center; gap: 3.5rem; padding: clamp(1.5rem, 4vw, 3.5rem); }
  .pub-wide .pub-shots { flex: 1.3 1 0; min-width: 0; }
  .pub-wide .pub-copy { flex: 1 1 0; min-width: 0; }
  .pub-wide .pub-name { font-size: clamp(1.875rem, 1.4rem + 2vw, 3rem); letter-spacing: -0.032em; }
  .pub-wide .pub-desc { font-size: 1.125rem; line-height: 1.5; }
  .pub-wide .pub-stats { margin-top: 0.75rem; }
  /* A publication with no picture: one full-width row of text. */
  .pubs .pub-text { grid-column: 1 / -1; }
  .pub-text .pub-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 3.5rem; align-items: center; }
  .pub-text .pub-name, .pub-text .pub-desc, .pub-text .pub-domain { grid-column: 1; }
  .pub-text .pub-stats { grid-column: 2; grid-row: 1 / 4; margin-top: 0; padding-top: 0; }
  .pub-text a { padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.5rem, 4vw, 3.5rem); }
}
@media (min-width: 620px) { .pubs .pub-text { grid-column: 1 / -1; } }
.pub-copy .ticks { margin-block: 0.6rem 0.25rem; }
.pub-name {
  display: inline-flex;
  align-items: center;
  font-stretch: var(--display);
  font-weight: 650;
  font-size: 1.625rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.pubs a:hover .pub-name { color: var(--action); }
.pub-name .ext { color: var(--ink-3); }
.pub-desc { color: var(--ink-2); font-size: 1rem; line-height: 1.45; }
.pub-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.75rem;
  margin-top: auto;
  padding-top: 1rem;
  color: var(--ink-2);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.pub-stats strong {
  display: block;
  color: var(--ink);
  font-stretch: var(--display);
  font-weight: 650;
  font-size: 1.75rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.band-head .traffic-note { font-size: 1.0625rem; }
.traffic-note strong { color: var(--ink); font-weight: 600; }
.pub-domain { color: var(--action); font-size: 0.9375rem; font-weight: 550; }

.closing { text-align: center; }
.closing .wrap > * { margin-inline: auto; }
.closing > .wrap > p { margin-top: 1.25rem; color: var(--ink-2); font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem); line-height: 1.5; }
.closing .actions { margin-top: 2rem; justify-content: center; }
.closing > .wrap > .fineprint { font-size: 0.875rem; color: var(--ink-3); margin-top: 2rem; }

/* ── Legal and plain pages ────────────────────────── */

.legal-band { padding-top: clamp(2rem, 5vw, 3.5rem); }
.legal-band .narrow > * { margin-inline: auto; }
.legal h1 { font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem); }
.legal h2 { margin-top: 2.5rem; font-size: 1.625rem; }
.legal p, .legal ul { margin-top: 0.9rem; color: var(--ink-2); max-width: 44rem; }
.legal ul { padding-left: 1.25rem; list-style: disc; }
.legal li { margin-top: 0.4rem; }
.legal strong { color: var(--ink); }
.legal .legal-updated { color: var(--ink-3); font-size: 0.9375rem; }

.plain-links { display: grid; justify-items: center; margin-top: 1.5rem; font-size: 1.1875rem; font-weight: 550; }
.plain-links a { display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; }
.plain-links a:hover { text-decoration: underline; }

/* ── Footer ───────────────────────────────────────── */

.site-footer {
  background: var(--paper-2);
  padding-block: clamp(2.5rem, 5vw, 4rem) 1.5rem;
  font-size: 0.9375rem;
}
.contact + .site-footer, main:has(.contact:last-child) + .site-footer { border-top: 1px solid var(--line); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.site-footer nav li { line-height: 1.35; }
.footer-about { grid-column: 1 / -1; display: grid; gap: 0.5rem; justify-items: start; }
.footer-about p { color: var(--ink-2); max-width: 26rem; }
.footer-about p a { display: inline-flex; align-items: center; min-height: 2.75rem; }
@media (min-width: 860px) {
  .footer-grid { grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); }
  .footer-about { grid-column: auto; }
}
.site-footer h2 {
  margin-bottom: 0.4rem;
  font-stretch: normal;
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.4;
}
.site-footer nav a,
.footer-legal a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-block: 0.6rem;
  line-height: 1.3;
  color: var(--ink-2);
  text-decoration: none;
}
.site-footer nav a:hover,
.footer-legal a:hover { color: var(--ink); text-decoration: underline; }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1.5rem;
  margin-top: 2rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.875rem;
}
.footer-legal { display: flex; gap: 1.5rem; }
.loc-word { -webkit-user-select: none; user-select: none; }

/* ── Home: hero extras ────────────────────────────── */

:root { --ease: cubic-bezier(0.2, 0.7, 0.2, 1); }

.hero-home { padding-block: clamp(3rem, 7vw, 6rem) clamp(1rem, 3vw, 2.5rem); }
.eyebrow { margin-bottom: 1.25rem; color: var(--ink-2); font-weight: 600; font-size: 1rem; line-height: 1.4; }
.hero h1 span { display: inline-block; }
.hero-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1.75rem; margin-top: 1.25rem; }

.band-work { padding-top: clamp(2.5rem, 6vw, 5rem); }
.band-work .band-head { margin-bottom: clamp(1.75rem, 4vw, 3rem); }
.systems-more .actions { justify-content: center; margin-top: 2rem; }
.systems-more .btn { white-space: normal; }
.demo-actions { justify-content: center; margin-top: clamp(2rem, 4vw, 3rem); }

/* Products page: one-tap index of everything on the page */
.jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; max-width: 58rem; margin-top: 2rem; }
.jump a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.3rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
}
.jump a:hover { border-color: var(--ink); background: var(--paper-2); }

/* ── Our work: a grid of pictures ─────────────────── */

/* Every tile is a plain link, so the grid works with no script. The script
   (js/site.js) opens a tile in place: as a card that grows to the middle of
   the screen for a mouse on a wide screen, as a sheet that slides up over
   the page everywhere else. */
.work { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
@media (min-width: 640px) { .work { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; } }
@media (min-width: 900px) { .work { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.work-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--tile);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  color: var(--ink);
  text-decoration: none;
}
.work-tile:hover { color: var(--ink); }
.work-tile:focus-visible { border-radius: 18px; }
/* The deeper shadow of a lifted tile is drawn once and faded in. */
.work-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 22px 44px -22px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
}
.work-tile.is-out { opacity: 0; }
.work .shot { border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 18px 18px 0 0; }
.work .shot img, .work-pop-shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: left top; }
.work-pic, .work-pop-shot { position: relative; display: block; }
/* Says so on the picture when what it shows is made-up sample data. */
.work-note {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  padding: 0.15rem 0.45rem;
  border-radius: 99px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.work-pop-shot .work-note { right: 0.9rem; bottom: 0.9rem; padding: 0.25rem 0.7rem; font-size: 0.8125rem; }
.work-cap { display: grid; gap: 0.15rem; padding: 0.7rem 0.85rem 0.85rem; }
.work-name { font-size: 1rem; line-height: 1.2; letter-spacing: -0.015em; }
.work-kind { color: var(--ink-3); font-size: 0.8125rem; line-height: 1.3; }
@media (min-width: 900px) {
  .work-cap { padding: 0.85rem 1.1rem 1rem; }
  .work-name { font-size: 1.125rem; }
  .work-kind { font-size: 0.875rem; }
}
@media (max-width: 359px) {
  .work-cap { padding-inline: 0.7rem; }
  .work-name { font-size: 0.9375rem; }
}
/* The last tile leads to the whole catalog. */
.work-all .work-tile { justify-content: space-between; gap: 1rem; padding: 0.9rem; background: var(--btn); color: var(--btn-ink); }
.work-all-text {
  font-stretch: var(--display);
  font-weight: 650;
  font-size: clamp(1.0625rem, 0.8rem + 1.1vw, 1.5rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.work-all-go { align-self: flex-end; width: 2.25rem; height: 2.25rem; padding: 0.5rem; border-radius: 50%; background: var(--btn-ink); color: var(--btn); }
@media (min-width: 900px) { .work-all .work-tile { padding: 1.25rem; } }

/* The open entry. One element serves every tile. */
.work-back { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.55); }
.work-back[hidden], .work-pop[hidden] { display: none !important; }
.work-pop {
  position: absolute;
  z-index: 61;
  width: min(60rem, 72vw, max(30rem, (100vh - 17rem) * 1.6));
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 1.5rem);
  overflow: hidden;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 0 0 1px var(--line-soft), 0 40px 90px -30px rgba(0, 0, 0, 0.6);
  transform-origin: 0 0;
}
.work-pop:focus { outline: none; }
.work-pop.is-ghost { pointer-events: none; }
/* On a short screen the picture gives up height, so the words and links always fit. */
.work-pop-shot { flex: 0 1 auto; min-height: 6rem; aspect-ratio: 16 / 10; overflow: hidden; background: var(--tile) left top / cover no-repeat; border-bottom: 1px solid var(--line-soft); line-height: 0; }
.work-pop-shot img { position: absolute; inset: 0; display: block; height: 100%; aspect-ratio: auto; }
.work-pop-copy { flex: none; }
:root[data-theme="dark"] .work-pop-shot { filter: brightness(0.82); }
:root[data-theme="dark"] .work-pop-shot img { filter: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .work-pop-shot { filter: brightness(0.82); }
}
.work-pop-bar { position: absolute; z-index: 1; top: 0.75rem; right: 0.75rem; }
.work-close { background: var(--surface); color: var(--ink); box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3); }
.work-pop-copy {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.6fr);
  gap: 0.75rem 2.5rem;
  align-items: start;
  padding: 1.5rem 2rem 1.25rem;
}
.work-pop-head { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; }
.work-pop-head h3 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.125rem); line-height: 1.05; letter-spacing: -0.03em; }
.work-pop-body p { color: var(--ink-2); font-size: 1rem; line-height: 1.5; }
.work-links { display: flex; flex-wrap: wrap; gap: 0 1.75rem; margin-top: 0.4rem; }

/* As a sheet: phones, tablets and anything without a mouse. */
html.locked { overflow: hidden; }
.work-pop.is-sheet {
  position: fixed;
  inset: 0.75rem 0 0;
  display: block;
  max-height: none;
  width: min(100%, 46rem);
  margin-inline: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 20px 20px 0 0;
}
.is-sheet .work-pop-bar {
  position: sticky;
  top: 0;
  right: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 3.5rem;
  padding-inline: 0.5rem;
  background: var(--surface);
}
.is-sheet .work-pop-bar::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  left: calc(50% - 1.125rem);
  width: 2.25rem;
  height: 0.25rem;
  border-radius: 99px;
  background: var(--line);
}
.is-sheet .work-close { background: var(--paper-2); box-shadow: none; }
.is-sheet .work-pop-shot { margin-inline: 1rem; border: 1px solid var(--line); border-radius: var(--radius); }
.is-sheet .work-pop-copy { grid-template-columns: minmax(0, 1fr); gap: 0.9rem; padding: 1.25rem 1.25rem calc(1.75rem + env(safe-area-inset-bottom)); }
.is-sheet .work-pop-head h3 { font-size: 1.875rem; }
.is-sheet .work-pop-body p { font-size: 1.0625rem; }
.is-sheet .work-links { display: grid; gap: 0.6rem; margin-top: 1.25rem; }
.is-sheet .work-links a { justify-content: center; min-height: 3rem; padding-inline: 1rem; border: 1px solid var(--ink-3); border-radius: 999px; color: var(--ink); }
.is-sheet .work-links a:first-child { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.is-sheet .work-links a:hover { text-decoration: none; }
.is-sheet .work-links a::after { content: none; }

/* ── Demonstrations: an agent run and a dashboard ─── */

.demo-cap, .dash-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  font-stretch: var(--display);
  font-weight: 650;
  font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.demo-note { color: var(--ink-3); font-stretch: normal; font-size: 0.8125rem; font-weight: 550; letter-spacing: 0; white-space: nowrap; }

.flow { display: grid; gap: clamp(1rem, 2vw, 1.5rem); max-width: 68rem; margin-inline: auto; }
@media (min-width: 900px) { .flow { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
.flow-run, .code, .dash { padding: clamp(1.25rem, 3vw, 2.25rem); background: var(--tile); border-radius: var(--radius-lg); }
.flow-run { display: flex; flex-direction: column; }
.flow-run ol { display: grid; flex: 1; }
.flow-run li {
  display: grid;
  align-content: center;
  grid-template-columns: 5rem minmax(0, 1fr) auto;
  gap: 0.2rem 1rem;
  align-items: baseline;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}
.flow-run li:last-child { padding-bottom: 0; border-bottom: 0; }
.flow-title { font-stretch: var(--display); font-weight: 650; font-size: 1.125rem; letter-spacing: -0.015em; }
.flow-what { color: var(--ink-2); line-height: 1.4; text-wrap: pretty; }
@media (max-width: 639px) {
  .flow-run li { grid-template-columns: minmax(0, 1fr) auto; }
  .flow-what { grid-column: 1 / -1; grid-row: 2; }
}

/* The code panel is dark in both themes. */
.code { --line: #424245; --ink-3: #a1a1a6; background: #1d1d1f; color: #f5f5f7; }
.code pre {
  margin: 1.25rem 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.75;
  white-space: pre-wrap;
}
.code code { font: inherit; }
.code [data-s] { display: block; }
.c-k { color: #f5f5f7; }
.c-v { color: #6bb6ff; }

.dash { max-width: 68rem; margin-inline: auto; font-variant-numeric: tabular-nums; }
.dash span { color: var(--ink-2); font-size: 0.875rem; font-weight: 550; line-height: 1.3; }
.dash .dash-title { color: var(--ink); font-size: inherit; font-weight: inherit; }
.dash .demo-note { color: var(--ink-3); font-size: 0.8125rem; }
.dash-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1.25rem; }
.dash-charts { display: grid; gap: 0.75rem; margin-top: 0.75rem; }
@media (min-width: 760px) {
  .dash-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dash-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.dash-kpis div, .dash-card { min-width: 0; padding: 1rem 1.1rem; background: var(--surface); border-radius: var(--radius); }
.dash-kpis strong {
  display: block;
  margin-top: 0.25rem;
  font-stretch: var(--display);
  font-weight: 650;
  font-size: clamp(1.375rem, 1rem + 1.7vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.dash-bars { display: flex; align-items: flex-end; gap: 6px; height: 7rem; margin-top: 1rem; }
.dash-bars i {
  flex: 1;
  height: 100%;
  border-radius: 3px 3px 0 0;
  background: var(--action);
  transform: scaleY(var(--h, 0.5));
  transform-origin: bottom;
}
.dash-bars i:nth-child(1) { --h: 0.26; }
.dash-bars i:nth-child(2) { --h: 0.33; }
.dash-bars i:nth-child(3) { --h: 0.3; }
.dash-bars i:nth-child(4) { --h: 0.44; }
.dash-bars i:nth-child(5) { --h: 0.52; }
.dash-bars i:nth-child(6) { --h: 0.61; }
.dash-bars i:nth-child(7) { --h: 0.56; }
.dash-bars i:nth-child(8) { --h: 0.7; }
.dash-bars i:nth-child(9) { --h: 0.8; }
.dash-bars i:nth-child(10) { --h: 0.73; }
.dash-bars i:nth-child(11) { --h: 0.9; }
.dash-bars i:nth-child(12) { --h: 0.42; opacity: 0.55; }
.dash-line { height: 7rem; margin-top: 1rem; color: var(--action); }
.dash-line svg { display: block; width: 100%; height: 100%; max-width: none; }
.dash-sources { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; margin-top: 1.1rem; }
.dash-sources span { display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap; }
.dash-sources span::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ok); }

/* ── Phone: a "Start a project" button that stays in reach ─── */

.cta-bar { display: none; }
@media (max-width: 899px) {
  .js .cta-bar {
    position: fixed;
    z-index: 40;
    right: 1rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    left: 1rem;
    display: flex;
    max-width: 24rem;
    margin-inline: auto;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 12px 30px -8px rgba(0, 0, 0, 0.5);
    transform: translateY(calc(100% + 2rem));
    visibility: hidden;
  }
  .js .cta-bar.show { transform: none; visibility: visible; }
  body:has(.site-nav.open) .cta-bar { visibility: hidden; }
}

/* ── Phone layout ─────────────────────────────────── */

/* Deliberate choices for a small screen, not the wide layout squeezed: a
   shorter hero, services as rows that open with a tap, the picture ahead of
   the long text in each product, and a strip of product names to swipe. */
@media (max-width: 639px) {
  .hero { padding-block: 2.25rem 2.5rem; }
  .hero-home { padding-block: 2rem 0.5rem; }
  .eyebrow { margin-bottom: 0.9rem; font-size: 0.9375rem; }
  .lede { margin-top: 1.1rem; font-size: 1.0625rem; line-height: 1.5; }
  .hero .actions { margin-top: 1.5rem; }
  .hero-links { display: none; }
  .crumbs { margin-bottom: 0.25rem; }
  .band-head p { font-size: 1.0625rem; }
  .dash-bars, .dash-line { height: 5rem; }
  .flow-run li, .board-row { padding-block: 0.7rem; }

  .jump {
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-self: stretch;
    max-width: none;
    margin-inline: calc(-1 * clamp(1.25rem, 4vw, 2.5rem));
    padding-inline: clamp(1.25rem, 4vw, 2.5rem);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent);
  }
  .jump::-webkit-scrollbar { display: none; }
  .jump a { flex: none; }
}
/* Two buttons side by side where both labels fit. */
@media (min-width: 360px) and (max-width: 479px) {
  .hero-home .actions { flex-wrap: nowrap; align-self: stretch; }
  .hero-home .actions .btn { flex: 1 1 0; padding-inline: 0.5rem; font-size: 1rem; white-space: nowrap; }
}
@media (max-width: 899px) {
  /* Name, then the picture, then the words. */
  .product-shots, .case > .shot { order: 1; }
  .product-body, .case-body { order: 2; }

  .fold .service { gap: 0; padding-block: 0; }
  .fold .service h3 { font-size: 1.375rem; }
  .fold .service h3 button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    min-height: 4rem;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-align: left;
    cursor: pointer;
  }
  .fold .service h3 button::after {
    content: "";
    flex: none;
    width: 0.6rem;
    height: 0.6rem;
    margin-right: 0.3rem;
    border-right: 1.5px solid var(--ink-2);
    border-bottom: 1.5px solid var(--ink-2);
    transform: rotate(45deg) translate(-2px, -2px);
  }
  .fold .service.open h3 button::after { transform: rotate(-135deg) translate(-2px, -2px); }
  .fold .service:not(.open) > :not(h3) { display: none; }
  .fold .service.open { gap: 1rem; padding-bottom: 1.5rem; }
  .fold .service.open h3 { margin-bottom: -0.5rem; }
}

/* ── Motion ───────────────────────────────────────── */

/* All of it is optional. With reduced motion asked for, none of this
   applies and every page is still. Nothing below hides content unless the
   browser can also bring it back: the scroll effects are plain CSS where
   scroll timelines exist, and elsewhere the script marks the page (.io,
   .live, .arm) only after its observer is running. Only transform and
   opacity move. */
@media (prefers-reduced-motion: no-preference) {
  /* Page load: the hero arrives in order, top to bottom. */
  .hero-copy > *, .hero-page > .wrap > * { animation: rise 0.85s var(--ease) both; }
  .hero-copy > :nth-child(2), .hero-page > .wrap > :nth-child(2) { animation-delay: 0.08s; }
  .hero-copy > :nth-child(3), .hero-page > .wrap > :nth-child(3) { animation-delay: 0.2s; }
  .hero-copy > :nth-child(4), .hero-page > .wrap > :nth-child(4) { animation-delay: 0.3s; }
  .hero-copy > :nth-child(5), .hero-page > .wrap > :nth-child(5) { animation-delay: 0.4s; }
  .hero-copy > :nth-child(n+6), .hero-page > .wrap > :nth-child(n+6) { animation-delay: 0.5s; }
  .hero h1 span + span { animation: rise 0.85s var(--ease) 0.24s both; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(1.5rem); }
  }

  /* Scrolling: headings and pictures fade up as they enter, pictures
     settle from a slight zoom, and the rows of the schedule follow one
     another in. */
  @supports (animation-timeline: view()) {
    .reveal, .shot, .board-row, .work-item {
      animation: reveal ease-out both;
      animation-timeline: view();
      animation-range: entry 0% entry 100%;
    }
    .shot { animation-range: entry 0% cover 30%; }
    /* The schedule is taller than a phone screen: it is fully there soon after its top edge arrives. */
    .board.reveal { animation-range: entry 0% entry 25%; }
    .shot img {
      animation: zoom ease-out both;
      animation-timeline: view();
      animation-range: entry 0% cover 45%;
    }
    .work .shot, .work .shot img { animation: none; }
    @keyframes reveal {
      from { opacity: 0; transform: translateY(2rem); }
    }
    @keyframes zoom {
      from { transform: scale(1.06); }
    }

  }
  @supports not (animation-timeline: view()) {
    .io .reveal, .io .shot { opacity: 0; transform: translateY(2rem); transition: opacity 0.8s ease-out, transform 0.8s var(--ease); }
    .io .work .shot, .io .in { opacity: 1; transform: none; }
  }

  /* Our work: a tile lifts a little under the mouse. */
  @media (hover: hover) {
    .work-tile { transition: transform 0.35s var(--ease); }
    .work-tile::after { transition: opacity 0.35s ease-out; }
    .work-tile:hover:not(.is-out) { transform: translateY(-4px); }
    .work-tile:hover::after { opacity: 1; }
    .work-all-go { transition: transform 0.35s var(--ease); }
    .work-all .work-tile:hover .work-all-go { transform: translateX(3px); }
  }
  /* Wide screens with a mouse: a publication card lifts a little too. */
  @media (hover: hover) {
    .pubs a { transition: transform 0.35s var(--ease); }
    .pubs a:hover { transform: translateY(-4px); }
  }
  /* Phone: the bottom button slides in and out, and an opened service fades in. */
  .cta-bar { transition: transform 0.45s var(--ease), visibility 0s 0.45s; }
  .cta-bar.show { transition-delay: 0s; }
  .fold .service.open > :not(h3) { animation: rise 0.45s var(--ease) both; }

  /* Agent run: each step, and the lines of configuration behind it, light
     up in turn. */
  .flow.live [data-s] { opacity: 0.3; transition: opacity 0.5s ease-out; }
  .flow.live [data-s].on { opacity: 1; }
  .flow.live .now .who::before { animation: pulse 0.65s ease-in-out infinite alternate; }
  @keyframes pulse {
    to { opacity: 0.2; }
  }

  /* Dashboard: bars grow and the line fades up when it comes on screen. */
  .dash-bars i { transition: transform 0.9s var(--ease); }
  .dash-bars i:nth-child(n+4) { transition-delay: 0.12s; }
  .dash-bars i:nth-child(n+7) { transition-delay: 0.24s; }
  .dash-bars i:nth-child(n+10) { transition-delay: 0.36s; }
  .dash-line { transition: opacity 1.2s ease-out 0.5s, transform 1.2s var(--ease) 0.5s; }
  .dash.arm:not(.in) .dash-bars i { transform: scaleY(0); }
  .dash.arm:not(.in) .dash-line { opacity: 0; transform: translateY(1rem); }
}
