/* "Your Agents, Future-proofed." (CJ, 2026-11-01, after clickup.com's wall): a full-bleed white band after the
   opening. Four tiles in the middle (Brain, Body, Memory, Other Agents), each a mark and a small decorative product
   vignette, and 32 cells around them on light hairlines; every tile and cell is one link to Maker (build.py
   agent_grid, content/agent-grid.json). Wide screens get the 8x6 wall with faded outer columns, mid widths a 6x8 wall
   that keeps every cell beside its tile, phones the tiles as a 2x2 block above a 4-column grid. Nothing moves on its
   own: hover tints, focus rings. ASCII only. */

/* The band: white across the whole viewport while the section stays in the 1440px shell. The spread shadow paints
   the sides without adding scrollable overflow; the clip keeps it out of the sections above and below. */
.agent-grid {
  --ag-paper: #fff;
  --ag-ink: #1d1b23;
  --ag-title: #222027;
  --ag-title-fade: #8f8c99;
  --ag-text: #6c6a76;
  --ag-text-edge: #74727e;
  --ag-wordmark: #46444d;
  --ag-wash-cream: #eee7cc;
  --ag-wash-peach: #f1dcc4;
  --ag-hair: #e9e8ee;
  --ag-tint: #f6f5f9;
  --ag-icon: brightness(0) invert(.3);
  --ag-icon-strong: brightness(0) invert(.1);
  --ag-cols: 8;
  --ag-top-cols: 8;
  --ag-reach: clamp(40px, 4.4vw, 64px);
  --ag-label-size: clamp(13px, .42vw + 8.4px, 14px);
  --ag-icon-size: 24px;
  --ag-name-size: clamp(19px, 1.6vw, 23px);
  --ag-mark-size: clamp(24px, 2vw, 28px);
  position: relative;
  padding: clamp(72px, 7vw, 112px) var(--pad) clamp(64px, 6vw, 96px);
  background: var(--ag-paper);
  color: var(--ag-ink);
  color-scheme: light;
  box-shadow: 0 0 0 100vmax var(--ag-paper);
  clip-path: inset(0 -100vmax);
}
.agent-grid-title {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto -.04em;
  padding-bottom: .12em;
  color: var(--ag-title);
  font-family: Manrope, sans-serif;
  font-size: clamp(36px, 3.9vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.045em;
  text-align: center;
  text-wrap: balance;
}
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .agent-grid-title { background: linear-gradient(98deg, var(--ag-ink) 43%, var(--ag-title-fade) 92%); -webkit-background-clip: text; background-clip: text; color: transparent; }
}

/* The wall: 1px gaps over the hairline colour draw every line; the outer ends fade. The tiles' inner corners are
   rounded, so where the four meet the hairline colour shows as a small four-pointed star. */
.ag-wall {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--ag-cols), minmax(0, 1fr));
  gap: 1px;
  width: 100%;
  width: calc(round(down, 100% + 1px, calc(var(--ag-cols) * 1px)) - 1px);
  max-width: 1223px;
  margin: calc(var(--ag-reach) + clamp(24px, 2.6vw, 40px)) auto var(--ag-reach);
  padding: 1px 0;
  list-style: none;
  background: linear-gradient(90deg, transparent, var(--ag-hair) 12.5%, var(--ag-hair) 87.5%, transparent);
}
/* The column lines run on past the top and bottom rows and fade out. */
.ag-wall::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: var(--ag-reach);
  background: linear-gradient(90deg, transparent calc(100% - 1px), var(--ag-hair) calc(100% - 1px)) 0 0 / calc((100% + 1px) / var(--ag-top-cols)) 100% repeat-x;
  mask-image: linear-gradient(to top, #000, transparent);
  pointer-events: none;
}
.ag-wall::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: var(--ag-reach);
  background: linear-gradient(90deg, transparent calc(100% - 1px), var(--ag-hair) calc(100% - 1px)) 0 0 / calc((100% + 1px) / var(--ag-cols)) 100% repeat-x;
  mask-image: linear-gradient(#000, transparent);
  pointer-events: none;
}
.ag-item { display: grid; min-width: 0; }
.ag-item--tile { grid-row-end: span 2; grid-column-end: span 2; }

/* A cell: one icon over its label, ClickUp's proportions. */
.ag-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 100%;
  aspect-ratio: 152 / 140;
  position: relative;
  padding: 12px 8px;
  background-color: var(--ag-paper);
  color: var(--ag-text);
}
.ag-face { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.ag-icon { width: var(--ag-icon-size); height: var(--ag-icon-size); filter: var(--ag-icon); }
.ag-label { max-width: 100%; color: var(--ag-text); font-size: var(--ag-label-size); font-weight: 500; line-height: 1.3; letter-spacing: -.01em; text-align: center; text-wrap: balance; overflow-wrap: break-word; }
.ag-wordmark { display: block; color: var(--ag-wordmark); font-family: Manrope, sans-serif; font-size: 24px; font-weight: 700; line-height: 1; letter-spacing: -.05em; }
.ag-wordmark + .ag-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* A tile: a soft wash from its outer corner, the vignette above, the mark and name below. */
.ag-tile {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  aspect-ratio: 305 / 281;
  overflow: hidden;
  padding: clamp(14px, 1.4vw, 20px) clamp(12px, 1.1vw, 16px) clamp(18px, 1.8vw, 26px);
  background-color: var(--ag-paper);
  color: var(--ag-ink);
}
.ag-tile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ag-wash); opacity: .85; }
.ag-tile--brain { --ag-wash: radial-gradient(90% 80% at 6% 0%, var(--spectral-1), transparent 72%), radial-gradient(70% 60% at 92% 4%, var(--spectral-2), transparent 70%); border-bottom-right-radius: 12px; }
.ag-tile--body { --ag-wash: radial-gradient(90% 80% at 94% 0%, var(--spectral-2), transparent 72%), radial-gradient(70% 60% at 8% 4%, var(--spectral-3), transparent 70%); border-bottom-left-radius: 12px; }
.ag-tile--memory { --ag-wash: radial-gradient(90% 80% at 6% 0%, var(--spectral-3), transparent 72%), radial-gradient(70% 60% at 92% 4%, var(--ag-wash-cream), transparent 70%); border-top-right-radius: 12px; }
.ag-tile--agents { --ag-wash: radial-gradient(90% 80% at 94% 0%, var(--ag-wash-peach), transparent 72%), radial-gradient(70% 60% at 8% 4%, var(--spectral-1), transparent 70%); border-top-left-radius: 12px; }
.ag-visual { position: relative; flex: 1 1 0; min-height: 0; }
.ag-visual img { position: absolute; inset: 0; width: 100%; max-width: none; height: 100%; object-fit: contain; object-position: 50% 60%; }
.ag-tile-name { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: clamp(10px, 1.1vw, 16px); color: var(--ag-ink); font-family: Manrope, sans-serif; font-size: var(--ag-name-size); font-weight: 700; line-height: 1.2; letter-spacing: -.03em; }
.ag-mark { width: var(--ag-mark-size); height: var(--ag-mark-size); flex: none; }

/* Pointer and keyboard. The site's light lavender ring would vanish on white, so the band rings in ink. The skip
   link (first in the band) lets a keyboard pass the 36 links; it shows only while focused. */
.ag-skip { position: absolute; top: 16px; left: 50%; z-index: 2; padding: 10px 18px; border-radius: 999px; background: var(--ag-ink); color: var(--ag-paper); font-size: 14px; transform: translate(-50%, calc(-100% - 40px)); }
.ag-skip:focus { color: var(--ag-paper); transform: translate(-50%, 0); }
.ag-cell:focus-visible, .ag-tile:focus-visible { outline: 2px solid var(--ag-ink); outline-offset: -4px; }
@media (hover: hover) {
  .ag-cell:hover { background-color: var(--ag-tint); color: var(--ag-ink); }
  .ag-cell:hover .ag-label { color: var(--ag-ink); }
  .ag-cell:hover .ag-icon { filter: var(--ag-icon-strong); }
  .ag-tile:hover { color: var(--ag-ink); }
  .ag-tile:hover::before { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .ag-cell { transition: background-color .18s ease, color .18s ease; }
  .ag-label { transition: color .18s ease; }
  .ag-icon, .ag-wordmark { transition: filter .18s ease, opacity .18s ease; }
  .ag-tile::before { transition: opacity .25s ease; }
  .ag-visual img { transition: transform .3s ease; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .ag-tile:hover .ag-visual img { transform: translateY(-4px); }
}

/* Wide: the 8x6 wall (build.py writes each item's row and column), the outer columns fading toward the edges. */
@media (min-width: 960px) {
  .ag-r1 { grid-row-start: 1; }
  .ag-r2 { grid-row-start: 2; }
  .ag-r3 { grid-row-start: 3; }
  .ag-r4 { grid-row-start: 4; }
  .ag-r5 { grid-row-start: 5; }
  .ag-r6 { grid-row-start: 6; }
  .ag-c1 { grid-column-start: 1; }
  .ag-c2 { grid-column-start: 2; }
  .ag-c3 { grid-column-start: 3; }
  .ag-c4 { grid-column-start: 4; }
  .ag-c5 { grid-column-start: 5; }
  .ag-c6 { grid-column-start: 6; }
  .ag-c7 { grid-column-start: 7; }
  .ag-c8 { grid-column-start: 8; }
}
@media screen and (min-width: 960px) and (forced-colors: none) {
  .ag-cell--start :is(.ag-icon, .ag-wordmark), .ag-cell--end :is(.ag-icon, .ag-wordmark) { opacity: .45; }
  .ag-cell--start .ag-label, .ag-cell--end .ag-label { color: var(--ag-text-edge); }
  .ag-cell--start:is(:hover, :focus-visible) :is(.ag-icon, .ag-wordmark), .ag-cell--end:is(:hover, :focus-visible) :is(.ag-icon, .ag-wordmark) { opacity: 1; }
}

/* Mid widths: six columns, eight rows (build.py agent_grid_medium). */
@media (min-width: 640px) and (max-width: 959.98px) {
  .agent-grid { --ag-cols: 6; --ag-top-cols: 6; --ag-reach: 40px; --ag-label-size: 13px; --ag-icon-size: 22px; --ag-name-size: 19px; --ag-mark-size: 24px; }
  .ag-mr1 { grid-row-start: 1; }
  .ag-mr2 { grid-row-start: 2; }
  .ag-mr3 { grid-row-start: 3; }
  .ag-mr4 { grid-row-start: 4; }
  .ag-mr5 { grid-row-start: 5; }
  .ag-mr6 { grid-row-start: 6; }
  .ag-mr7 { grid-row-start: 7; }
  .ag-mr8 { grid-row-start: 8; }
  .ag-mc1 { grid-column-start: 1; }
  .ag-mc2 { grid-column-start: 2; }
  .ag-mc3 { grid-column-start: 3; }
  .ag-mc4 { grid-column-start: 4; }
  .ag-mc5 { grid-column-start: 5; }
  .ag-mc6 { grid-column-start: 6; }
}

/* Phones: the four tiles as a 2x2 block, then the 32 cells four across, edge to edge (the source order). */
@media (max-width: 639.98px) {
  .agent-grid { --ag-cols: 4; --ag-top-cols: 2; --ag-reach: 32px; --ag-label-size: 12px; --ag-icon-size: 22px; --ag-name-size: 16px; --ag-mark-size: 22px; padding-top: 64px; padding-bottom: 56px; }
  .agent-grid-title { font-size: clamp(32px, 9vw, 40px); }
  .ag-wall { width: auto; margin: calc(var(--ag-reach) + 20px) max(calc(-1 * var(--pad)), calc((100% - 500px) / 2)) var(--ag-reach); }
  .ag-cell { padding: 8px 4px; }
  .ag-face { gap: 7px; }
  .ag-wordmark { font-size: 21px; }
  .ag-tile { padding: 10px 8px 14px; }
  .ag-tile-name { gap: 7px; margin-top: 8px; }
}
/* The narrowest phones: the longest single word ("Decentralized") still fits its cell. */
@media (max-width: 359.98px) {
  .agent-grid { --ag-label-size: 11px; --ag-name-size: 15px; --ag-mark-size: 20px; }
  .ag-label { letter-spacing: -.02em; }
}

@media (forced-colors: active) {
  .agent-grid-title { background: none; color: CanvasText; }
  .ag-wall { gap: 0; }
  .ag-wall::before, .ag-wall::after, .ag-tile::before { display: none; }
  .ag-cell, .ag-tile { border: 1px solid CanvasText; }
  .ag-cell:focus-visible, .ag-tile:focus-visible { outline-color: Highlight; }
}
@media (forced-colors: active) and (prefers-color-scheme: dark) {
  .ag-icon { filter: brightness(0) invert(1); }
}
@media print {
  .agent-grid { padding: 24px 0; box-shadow: none; clip-path: none; break-inside: avoid; }
  .agent-grid-title { background: none; color: var(--ag-ink); font-size: 24pt; }
  .ag-skip { display: none; }
  .ag-wall { margin: 16px auto 0; gap: 0; background: none; }
  .ag-wall::before, .ag-wall::after, .ag-tile::before { display: none; }
  .ag-cell, .ag-tile { border: .5pt solid #ccc; }
}
