/* Homepage illustration. All phases share a 10s clock; text stays readable at rest.
   0–1s input; 1–2s hub; 2–5s capabilities; 5–8s outputs; 8–10s network/reset. */
.di-graphic {
  --di-accent: var(--ui-v2-primary, #9766f6);
  --di-border: #e5e7eb;
  --di-surface: #fff;
  --di-muted: #6b7280;
  container-type: inline-size;
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  color: var(--ui-v2-text, #111318);
}
.di-scene { position: relative; height: 520px; background: radial-gradient(ellipse at 49% 46%, #9766f612, transparent 65%); }
.di-connectors { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.di-line { fill: none; stroke: #9766f640; stroke-width: 1; }
.di-packet { fill: none; stroke: var(--di-accent); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 7 100; stroke-dashoffset: 7; opacity: 0; animation: di-flow 10s linear var(--di-delay) infinite; }
.di-input { position: absolute; top: 44px; left: 34%; width: 32%; height: 48px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--di-surface); border: 1px solid var(--di-border); border-radius: 8px; box-shadow: 0 4px 16px #0f172a06; font-size: 12px; font-weight: 600; }
.di-input .material-symbols-outlined { font-size: 18px; color: var(--di-accent); }
.di-domain { animation: di-domain 10s ease-in-out infinite; }
.di-input-arrow { margin-left: auto; color: var(--di-muted); }
.di-capabilities { position: absolute; top: 128px; left: 0; width: 29%; display: grid; gap: 8px; }
.di-card { min-width: 0; background: var(--di-surface); border: 1px solid var(--di-border); border-radius: 12px; padding: 12px; box-shadow: 0 4px 16px #0f172a04; animation: di-card 10s ease-in-out var(--di-delay) infinite; }
.di-card strong { display: block; font-size: 12px; line-height: 16px; font-weight: 700; }
.di-card p { margin: 5px 0 0; font-size: 11px; line-height: 16px; color: var(--di-muted); }
.di-capability { position: relative; height: 80px; padding: 8px 9px; }
.di-capability strong { padding-left: 27px; }
.di-capability p { margin-top: 5px; line-height: 14px; }
.di-icon { position: absolute; top: 7px; left: 9px; color: var(--di-accent); font-size: 21px; }
.di-hub { position: absolute; top: 198px; left: 36.4%; width: 25%; height: 108px; border: 1px solid #9766f670; border-radius: 12px; background: #0f172a; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 12px 30px #0f172a20; animation: di-hub 10s ease-in-out infinite; }
.di-hub-icon { color: #c0a2f9; font-size: 26px; }
.di-hub strong { font-size: 14px; letter-spacing: -.035em; }
.di-hub-subtitle { font-size: 9px; color: #cbd5e1; }
.di-hub-lights { display: flex; gap: 4px; margin-top: 2px; }
.di-hub-lights i { width: 3px; height: 3px; background: #c0a2f9; border-radius: 50%; }
.di-outputs { position: absolute; top: 108px; right: 0; width: 33.2%; display: grid; grid-template-rows: 134px 88px 88px 62px; gap: 10px; }
.di-card-heading { display: flex; align-items: center; gap: 6px; }
.di-card-heading .material-symbols-outlined { font-size: 17px; color: var(--di-accent); }
.di-json { height: 134px; }
.di-json pre { margin: 9px 0 0; font: 10px/14px ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: #475569; }
.di-json code > span { color: #824ef5; }
.di-change { min-height: 78px; }
.di-change .material-symbols-outlined { color: #c2410c; }
.di-change small { font-size: 10px; color: var(--di-muted); }
.di-webhook { min-height: 84px; }
.di-endpoint { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.di-delivered { display: inline-block; color: #15803d; font-size: 10px; font-weight: 600; margin-top: 5px; }
.di-email { min-height: 62px; }
.di-network { position: absolute; top: 359px; left: 33%; width: 32%; height: 130px; color: #9766f650; }
.di-network svg { width: 100%; height: 100%; }
.di-network-nodes { animation: di-network 10s ease-in-out infinite; }
.di-network-domain { position: absolute; background: var(--di-surface); border: 1px solid var(--di-border); border-radius: 4px; padding: 2px 5px; color: var(--di-muted); font: 9px/14px ui-monospace, monospace; }
.di-network-domain--one { top: 25px; left: 0; }
.di-network-domain--two { top: 46px; right: 0; }
.di-network-domain--three { bottom: 2px; left: 30%; }
@keyframes di-flow { 0% { opacity: 0; stroke-dashoffset: 7; } 2% { opacity: .8; } 8% { opacity: .8; stroke-dashoffset: -100; } 10%, 100% { opacity: 0; stroke-dashoffset: -100; } }
@keyframes di-domain { 0%, 100% { opacity: .55; } 6%, 90% { opacity: 1; } }
@keyframes di-card { 0%, 18%, 100% { border-color: var(--di-border); box-shadow: 0 4px 16px #0f172a04; } 5%, 11% { border-color: #9766f699; box-shadow: 0 4px 18px #9766f61a; } }
@keyframes di-hub { 0%, 10%, 35%, 100% { transform: scale(1); box-shadow: 0 12px 30px #0f172a20; } 18%, 26% { transform: scale(1.02); box-shadow: 0 12px 32px #9766f645; } }
@keyframes di-network { 0%, 80%, 100% { opacity: .5; } 88%, 94% { opacity: 1; fill: var(--di-accent); } }
/* Reflow cards instead of shrinking text when the hero column gets narrow. */
@container (min-width: 440px) and (max-width: 499px) {
  .di-card strong { font-size: 11px; }
  .di-card { padding: 10px; }
  .di-capability { padding: 8px 9px; }
  .di-json pre { font-size: 9px; }
  .di-input { padding-inline: 8px; gap: 5px; }
  .di-hub strong { font-size: 12px; }
}
@container (max-width: 439px) {
  .di-scene { height: auto; padding: 24px 0 36px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 10px; }
  .di-connectors { display: none; }
  .di-input, .di-hub, .di-capabilities, .di-outputs, .di-network { position: relative; inset: auto; width: auto; }
  .di-input { grid-column: 1 / -1; justify-self: center; width: 180px; }
  .di-hub { grid-column: 1 / -1; grid-row: 2; justify-self: center; width: 180px; height: 106px; }
  .di-input::after, .di-hub::after { content: ''; position: absolute; top: 100%; left: 50%; height: 21px; border-left: 1px solid #9766f660; }
  .di-capabilities { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .di-capability { height: auto; min-height: 76px; }
  .di-outputs { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .di-json { grid-column: 1 / -1; height: auto; }
  .di-json pre { font-size: 11px; line-height: 16px; }
  .di-email { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
  .di-email .di-delivered { margin: 0; }
  .di-network { display: none; }
}
.dark .di-graphic { --di-surface: #1e293b; --di-border: #374151; --di-muted: #9ca3af; color: #f3f4f6; }
.dark .di-json pre { color: #cbd5e1; }
.dark .di-json code > span { color: #c0a2f9; }
.dark .di-delivered { color: #4ade80; }
.dark .di-change .material-symbols-outlined { color: #fb923c; }
@media (prefers-reduced-motion: reduce) {
  .di-graphic *, .di-graphic *::after { animation: none !important; }
  .di-packet { display: none; }
  .di-domain, .di-network-nodes { opacity: 1; }
}
