/* Hero diagram: people around a shared library, an agent that spots, files and tells. */

[data-diagram="hero"] { height: 480px; }
@media (min-width: 600px) { [data-diagram="hero"] { height: 460px; } }
@media (min-width: 900px) { [data-diagram="hero"] { height: 520px; } }

.dg-hero-root {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  container-type: inline-size;
  font-family: var(--font-do, "Geist", "Helvetica Neue", Arial, sans-serif);
  color: var(--ink, #0e3b2c);
}
.dg-hero-stage { position: relative; flex: 1 1 auto; min-height: 0; }
.dg-hero-svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: hidden; }

/* Drawing */
.dg-hero-t { font-family: var(--font-do, "Geist", "Helvetica Neue", Arial, sans-serif); fill: var(--ink, #0e3b2c); }
.dg-hero-soft { fill: var(--ink-soft, #4a6b5d); }
.dg-hero-halo { paint-order: stroke; stroke: var(--paper, #fff); stroke-width: 5px; stroke-linejoin: round; }
.dg-hero-num { font-variant-numeric: tabular-nums; }
.dg-hero-probe { opacity: 0; }

.dg-hero-orbit { fill: none; stroke: var(--line, #c4d6ca); stroke-width: 1.4px; }
.dg-hero-ripple { fill: none; stroke: var(--ink-soft, #4a6b5d); stroke-width: 1.6px; }
.dg-hero-path { fill: none; stroke: var(--ink-soft, #4a6b5d); stroke-width: 2px; stroke-linecap: round; stroke-dasharray: 0 6; }
.dg-hero-pulse { fill: var(--ink, #0e3b2c); }

.dg-hero-face { fill: var(--bar, #eaf3ea); stroke: var(--line-strong, #9fbba9); stroke-width: 1.2px; }
.dg-hero-ring { fill: none; stroke: var(--ink, #0e3b2c); stroke-width: 1.6px; }
.dg-hero-dot { fill: var(--ink, #0e3b2c); stroke: var(--paper, #fff); stroke-width: 2.5px; }
.dg-hero-pill { fill: var(--highlight, #ffe55c); }

.dg-hero-wall { fill: none; stroke: var(--line-strong, #9fbba9); stroke-width: 1.2px; stroke-linecap: round; stroke-linejoin: round; }
.dg-hero-back { fill: var(--paper, #fff); stroke: var(--line-strong, #9fbba9); stroke-width: 1.2px; stroke-linejoin: round; }
.dg-hero-front { fill: var(--bar, #eaf3ea); stroke: var(--ink, #0e3b2c); stroke-width: 1.6px; }
.dg-hero-holder { fill: var(--paper, #fff); stroke: var(--ink, #0e3b2c); stroke-width: 1.2px; }
.dg-hero-pull { fill: none; stroke: var(--ink, #0e3b2c); stroke-width: 1.6px; stroke-linecap: round; stroke-linejoin: round; }
.dg-hero-closed { fill: var(--paper, #fff); stroke: var(--line-strong, #9fbba9); stroke-width: 1.2px; }
.dg-hero-closed-in { fill: none; stroke: var(--line-strong, #9fbba9); stroke-width: 1.2px; stroke-linecap: round; stroke-linejoin: round; }

.dg-hero-card { fill: var(--paper, #fff); stroke: var(--ink, #0e3b2c); stroke-width: 1.6px; stroke-linejoin: round; }
.dg-hero-tab { fill: var(--paper, #fff); stroke: var(--ink, #0e3b2c); stroke-width: 1.4px; stroke-linejoin: round; }
.dg-hero-scribble { fill: none; stroke: var(--ink-soft, #4a6b5d); stroke-width: 1.6px; stroke-linecap: round; }

/* The spreadsheet selection: marching ants with a fill handle. Once in the drawing: it is the agent. */
.dg-hero-ants { fill: none; stroke: var(--ink, #0e3b2c); stroke-width: 1.6px; stroke-dasharray: 5 4; }
.dg-hero-ants-s { fill: var(--paper, #fff); stroke: var(--ink, #0e3b2c); stroke-width: 1.4px; stroke-dasharray: 3 2.5; }
.dg-hero-handle { fill: var(--ink, #0e3b2c); stroke: var(--paper, #fff); stroke-width: 1.5px; }
.dg-hero-run .dg-hero-ants { animation: dg-hero-march 0.75s linear infinite; }
.dg-hero-run .dg-hero-ants-s { animation: dg-hero-march-s 0.6s linear infinite; }
@keyframes dg-hero-march { to { stroke-dashoffset: -9; } }
@keyframes dg-hero-march-s { to { stroke-dashoffset: -5.5; } }

/* Caption and controls */
.dg-hero-foot { position: relative; flex: none; display: flex; align-items: flex-end; gap: 10px 32px; padding-top: 12px; }
.dg-hero-cap { flex: 1 1 auto; margin: 0; font-size: 17px; line-height: 1.45; color: var(--ink, #0e3b2c); text-wrap: pretty; }
.dg-hero-measure { position: absolute; left: 0; top: 0; visibility: hidden; pointer-events: none; }
.dg-hero-ctl { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dg-hero-stories { display: flex; gap: 6px; }

.dg-hero-story {
  position: relative;
  min-width: 64px; min-height: 44px;
  padding: 12px 4px 8px;
  border: 0; border-radius: 0; background: none;
  font: 500 15px/1.2 var(--font-do, "Geist", "Helvetica Neue", Arial, sans-serif);
  color: var(--ink-soft, #4a6b5d);
  text-align: left;
  cursor: pointer;
}
.dg-hero-story::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--grid, #dfe9e1); }
.dg-hero-story[aria-pressed="true"] { color: var(--ink, #0e3b2c); }
.dg-hero-bar { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--ink, #0e3b2c); transform-origin: 0 50%; transform: scaleX(0); }

.dg-hero-play {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; min-width: 44px; padding: 0 14px;
  border: 1px solid var(--line-strong, #9fbba9); border-radius: var(--radius-control, 6px);
  background: var(--paper, #fff);
  font: 500 15px/1 var(--font-do, "Geist", "Helvetica Neue", Arial, sans-serif);
  color: var(--ink, #0e3b2c);
  cursor: pointer;
}
.dg-hero-play svg { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6px; stroke-linecap: round; stroke-linejoin: round; }
.dg-hero-play:hover, .dg-hero-story:hover { color: var(--ink, #0e3b2c); }
.dg-hero-play:hover { border-color: var(--ink, #0e3b2c); }
.dg-hero-root button:focus-visible { outline: 2px solid var(--ink, #0e3b2c); outline-offset: 2px; }

@container (max-width: 859px) {
  .dg-hero-foot { flex-direction: column; align-items: stretch; }
  .dg-hero-cap { font-size: 16px; }
}
@container (max-width: 599px) {
  .dg-hero-cap { font-size: 15px; line-height: 1.42; }
  .dg-hero-story { min-width: 56px; }
}
@container (max-width: 479px) {
  .dg-hero-play { padding: 0; justify-content: center; width: 44px; }
  .dg-hero-play span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .dg-hero-run .dg-hero-ants, .dg-hero-run .dg-hero-ants-s { animation: none; }
}
