/* Diagrams: grey for what exists today, teal only for what is new. Final frame is the default; motion.js animates in. */
.dg { width: 100%; height: auto; overflow: visible; }
.dg text { font: 500 13px var(--mono); fill: var(--dim); text-anchor: middle; }
.dg .dr { stroke-dasharray: 1; stroke-dashoffset: 0; }

/* What we invented */
.inv-grid { display: grid; gap: 16px; }
@media (min-width: 820px) { .inv-grid { grid-template-columns: 1fr 1fr; gap: 20px; } }
@media (min-width: 1100px) { .inv-grid { grid-template-columns: repeat(3, 1fr); } }
.inv { border: 1px solid var(--line); border-radius: 20px; padding: 28px; background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(6px); }
.inv .dg { max-width: 360px; margin: 0 auto 28px; display: block; }
.inv h3 { font-size: 24px; margin-bottom: 10px; }
.inv p { color: var(--dim); font-size: var(--fs-small); }
.redact { margin-top: 18px; font: 13px var(--mono); display: flex; align-items: center; gap: 10px; color: var(--dim); }
.redact .bar { flex: 1; max-width: 200px; height: 14px; border-radius: 3px;
  background: repeating-linear-gradient(-45deg, var(--stratum-2) 0 6px, var(--stratum-1) 6px 12px); }

.dg .link { fill: none; stroke: var(--control); stroke-width: 1.5; }
.dg .link.wait { stroke-dasharray: 4 4; }
.dg .flow { stroke: var(--synapse); stroke-dasharray: 3 7; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -20; } }
.dg .chip rect { fill: var(--surface); stroke: var(--control); stroke-width: 1.5; }
.dg .chip text { fill: var(--ink); }
.dg .chip.next rect { stroke-dasharray: 4 4; }
.dg .chip.next text { fill: var(--dim); }
.dg .hub rect { fill: var(--delta); }
.dg .hub path { fill: #04211E; }
.dg .mem rect { fill: none; stroke: var(--delta); stroke-width: 1.5; }
.dg .mem text { fill: var(--delta-text); }
.dg .cell { fill: var(--stratum-2); }
.dg .cell.on { fill: var(--delta); }
.dg .cell.on.v { fill: var(--synapse); }
.dg .cell.on.a { fill: var(--ember); }
.dg .note { font-size: 12px; }
.dg .body { fill: var(--stratum-1); stroke: var(--control); stroke-width: 1.5; }
.dg .bl { fill: var(--ink); font-family: var(--sans); }
.dg .organ ellipse, .dg .organ circle, .dg .organ rect, .dg .organ path { fill: none; stroke: var(--delta); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dg .organ.o2 path { stroke: var(--synapse); }
.dg .organ.o3 rect, .dg .organ.o3 path { stroke: var(--ember); }
.dg .organ.wait circle { stroke: var(--control); stroke-dasharray: 4 4; }
.dg .organ.wait text { font-size: 16px; }
.dg .pop { transform-box: fill-box; transform-origin: center; }

@media (prefers-reduced-motion: reduce) { .dg .flow { animation: none; } }

/* Split rows: copy on one side, a particle scene on the other (WebGL only) */
.split { display: grid; gap: 24px; align-items: center; }
@media (min-width: 960px) { .split { grid-template-columns: 1fr 1fr; gap: 56px; } }
.gl-slot { display: none; aspect-ratio: 1; width: 100%; max-width: 460px; margin: 0 auto; }
.gl .gl-slot { display: block; }
#invented .split { margin-bottom: 40px; }
#invented .sec-head { margin-bottom: 0; }
@media (max-width: 959px) { .gl .gl-slot { order: -1; max-width: 340px; } }

/* The Butterfly Curve */
.bcurve { margin: 28px 0 20px; border: 1px solid var(--line); border-radius: 20px; padding: 20px;
  background: color-mix(in srgb, var(--surface) 80%, transparent); }
.dg .axis { stroke: var(--line); stroke-width: 1; fill: none; }
.dg .wingf { fill: url(#wingGrad); }
#wingGrad .s1 { stop-color: var(--ember); stop-opacity: .22; } #wingGrad .s2 { stop-color: var(--synapse); stop-opacity: .2; }
#wingGrad .s3 { stop-color: var(--delta); stop-opacity: .26; }
.dg .now { stroke: var(--ink); stroke-opacity: .35; stroke-width: 1; stroke-dasharray: 3 4; opacity: 0; }
.curve-live .dg .now { opacity: 1; }
.dg .int { fill: none; stroke: var(--delta); stroke-width: 3; stroke-linecap: round; }
.dg .eff { fill: none; stroke: var(--ember); stroke-width: 2.5; stroke-linecap: round; }
.dg .il { fill: var(--delta-text); font-size: 14px; }
.dg .el { fill: var(--ember); font-size: 14px; }
.dg .tl { font-size: 12px; }
.bf-note { color: var(--dim); max-width: 520px; }

/* Invention diagrams, alive while on screen: a signal runs along every link (live.js) and lights what it reaches.
   Chips light when the hub's signal arrives; awake cells and senses light as they send theirs. */
.dg .pk { fill: var(--delta); }
.dg .pk.dim { fill: var(--synapse); }
.live .chip rect { animation: iv-arrive 2.4s infinite; }
@keyframes iv-arrive { 0%, 36%, 72%, 100% { stroke: var(--control); } 42%, 58% { stroke: var(--delta); } }
.live .hub { transform-box: fill-box; transform-origin: center; animation: iv-hub .4s ease-in-out infinite alternate; }
@keyframes iv-hub { to { transform: scale(1.03); } }
.live .cell.on, .live .organ { animation: iv-send 2.4s infinite; }
@keyframes iv-send { 0%, 20% { opacity: 1; } 40%, 100% { opacity: .45; } }
.live .cell:not(.on) { animation: iv-sleep 4s ease-in-out infinite; }
.live .cell:nth-child(odd):not(.on) { animation-delay: -2s; }
@keyframes iv-sleep { 50% { opacity: .4; } }
.live .body { animation: iv-body .48s ease-in-out infinite alternate; }
@keyframes iv-body { from { stroke: var(--control); } to { stroke: var(--synapse); } }

/* Redaction bars: a light passes over them, as if something underneath is waiting. */
.fx .redact .bar { position: relative; overflow: hidden; }
.fx .redact .bar::after { content: ""; position: absolute; inset: 0; width: 40%;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ink) 18%, transparent), transparent);
  transform: translateX(-100%); animation: iv-scan 3.2s var(--ease-move) infinite; }
@keyframes iv-scan { 60%, 100% { transform: translateX(260%); } }

/* "reveal." in the closing heading: the bar slides off and the word turns teal. */
.fx .rv { position: relative; display: inline-block; transition: color .6s .9s; }
.fx .rv::after { content: ""; position: absolute; inset: .14em -.04em .1em; border-radius: 6px;
  background: repeating-linear-gradient(-45deg, var(--stratum-2) 0 10px, var(--stratum-1) 10px 20px);
  transform-origin: right; transition: transform 1s var(--ease-move) .5s; }
.fx .rv.on { color: var(--delta-text); }
.fx .rv.on::after { transform: scaleX(0); }
@media (prefers-reduced-motion: reduce) { .live *, .live { animation: none !important; } }
