/* Two ways to build intelligence: two living panels side by side, at every width */
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 820px; margin-inline: auto; }
@media (min-width: 720px) { .cmp-grid { gap: 20px; } }
.cmp { border: 1px solid var(--line); border-radius: 20px; padding: 12px 10px 14px; background: color-mix(in srgb, var(--surface) 80%, transparent); }
@media (min-width: 720px) { .cmp { padding: 24px 24px 20px; } }
.cmp .dg { overflow: hidden; display: block; }
.cmp figcaption { display: grid; gap: 2px; padding: 4px 6px 0; }
.cmp figcaption b { font-size: clamp(17px, 2vw, 22px); font-weight: 600; letter-spacing: -.01em; }
.cmp.new figcaption b { color: var(--delta-text); }
.cmp .gen { font: clamp(13px, 1.4vw, 15px) var(--mono); color: var(--dim); }
.cmp .ln { stroke: var(--control); stroke-width: 2; }
.cmp .nd { fill: var(--ink); }
.cmp .nd.lost { fill: var(--loss); }
.cmp.new .nd { fill: var(--delta); }
.cmp.new .nd.old { fill: var(--synapse); }
.cmp.new .ln.fresh { stroke: var(--delta); }
.cmp .base { stroke: var(--line); stroke-width: 1.5; }
.cmp .tl-line { fill: none; stroke-width: 4; stroke-linejoin: round; stroke: var(--control); }
.cmp.new .tl-line { stroke: var(--delta); }
.cmp .ph { fill: var(--ink); }
.cmp.new .ph { fill: var(--delta); }

/* Inside: a sticky stage you scroll into. Without motion it is a normal section with the final frame. */
.mind { position: relative; background: var(--paper); border-top: 1px solid var(--line); overflow: clip; }
.mind-stage { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; }
.motion .mind { height: 440svh; }
.motion .mind-stage { position: sticky; top: 0; height: 100svh; }
.mind-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, color-mix(in srgb, var(--delta) 5%, transparent) 3px 4px); }
#neural { position: absolute; inset: 0; width: 100%; height: 100%; }
.mind-stage::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(0deg, var(--paper) 30%, transparent 55%); }
@media (min-width: 901px) { .mind-stage::before { background: linear-gradient(90deg, var(--paper) 22%, color-mix(in srgb, var(--paper) 70%, transparent) 36%, transparent 52%); } }
.mind-copy { position: relative; z-index: 1; padding-top: 58svh; padding-bottom: 40px; width: 100%; pointer-events: none; }
.mind-steps { list-style: none; display: grid; margin-top: 16px; }
.mind-steps li { color: var(--dim); font-size: var(--fs-body); line-height: 1.5; }
.mind-steps b { color: var(--ink); font-weight: 600; display: block; }
.motion .mind-steps li { grid-area: 1 / 1; opacity: 0; transform: translateY(10px); transition: opacity .5s, transform .5s cubic-bezier(.23, 1, .32, 1); }
.motion .mind-steps li.on { opacity: 1; transform: none; }
@media (min-width: 901px) {
  .mind-stage { align-items: center; }
  .mind-copy { padding-top: 72px; padding-bottom: 24px; }
  .mind-copy > * { max-width: 420px; }
  .motion .mind-steps { gap: 0; }
  .motion .mind-steps li { grid-area: auto; opacity: .3; transform: none; padding: 12px 0 12px 16px; border-left: 2px solid var(--line); }
  .motion .mind-steps li.on { opacity: 1; border-left-color: var(--delta); }
  .motion .mind-steps li span { display: block; }
  .motion .mind-steps li:not(.on) span { display: none; }
}
/* Short laptop screens: the column starts under the header and stays put while the steps change. */
@media (min-width: 901px) and (max-height: 760px) {
  .mind-stage { align-items: flex-start; }
  .mind-copy { padding-top: 80px; }
  #mind .kicker { display: none; }
  .motion .mind-steps li { padding-top: 8px; padding-bottom: 8px; }
}
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; font: 13px var(--mono); color: var(--dim); }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend .n { background: var(--synapse); } .legend .s { background: var(--delta); }
.legend .f { border-radius: 2px; background: var(--ember); }
.legend .k { background: var(--synapse); box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--delta); }
.mind-count { margin-top: 14px; min-height: 1.5em; font: 500 13px var(--mono); color: var(--delta-text); font-variant-numeric: tabular-nums; }
.no-motion .mind-count { display: none; }

/* The Butterfly Curve: human stages along time, and the body that appears at the crossing */
.dg .tick { fill: var(--surface); stroke: var(--control); stroke-width: 1.5; }
.dg .tick.on { fill: var(--ember); stroke: var(--ember); }
.dg .tick.on:last-child { fill: var(--delta); stroke: var(--delta); }
.dg .bf-body ellipse { fill: var(--ink); }
.dg .bf-body path { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; }
.dg .pulse { fill: none; stroke: var(--delta); stroke-width: 1.5; opacity: 0; }
.curve-live .dg .bf-body { opacity: 0; }
/* Live curve: a small butterfly draws intelligence; at the end the chart's own wings unfold and fly off */
#butterfly { overflow-x: clip; }
#curveSvg { overflow: visible; }
.motion #curveSvg .int, .motion #curveSvg .eff { stroke-dashoffset: 1; }
.dg .glyph { display: none; }
.curve-live .dg .glyph { display: inline; }
.dg .glyph path { fill: var(--delta); }
.dg .glyph.e path { fill: var(--ember); }
.dg .glyph ellipse { fill: var(--ink); }
.dg .wingh { fill: url(#wingLine); stroke: url(#wingLine); stroke-width: 2; opacity: 0; transition: opacity .6s; }
#wingLine .l1 { stop-color: var(--ember); stop-opacity: .5; } #wingLine .l2 { stop-color: var(--synapse); stop-opacity: .45; }
#wingLine .l3 { stop-color: var(--delta); stop-opacity: .6; }
.flying .wingh { opacity: 1; }
.bf-stages { list-style: none; display: grid; gap: 6px; margin: 0 0 20px; font-size: var(--fs-small); color: var(--dim); }
.bf-stages b { font: 500 12px var(--mono); color: var(--ember); margin-right: 8px; }
.bf-stages .last b { color: var(--delta-text); }
.bf-stages.live li { opacity: .35; transition: opacity .4s; }
.bf-stages.live li.on { opacity: 1; color: var(--ink); }

/* After the curve: a migration swarm over the page, and the nature line under the chart. */
.swarm { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 34; pointer-events: none; }
.bf-migrate { margin-top: 14px; max-width: 520px; color: var(--dim); }
.bf-migrate b { color: var(--ink); font-weight: 600; }
/* The brain's caption: which of the two it is showing. */
#brainGl { position: relative; }
.gl-cap { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font: clamp(12px, 1.2vw, 15px)/1.45 var(--mono); color: var(--dim); }
