/* ═══════════════════════════════════════════════════════════════
   citeOS · "Citation Engine" animated hero
   Source logos (AI · crypto · social) wired into a live score.
   Fixed 1040×600 design, JS-scaled to fit. Cream / forest / lime.
   ═══════════════════════════════════════════════════════════════ */

.ce-wrap{position:relative;width:100%;max-width:1040px;margin:64px auto 0;}
.ce-scale{position:relative;width:1040px;height:600px;transform-origin:top center;}

/* ambient blooms behind the stage */
.ce-scale::before{content:'';position:absolute;inset:-80px -120px;z-index:0;pointer-events:none;
  background:
    radial-gradient(34% 40% at 78% 8%,rgba(200,238,63,.34),transparent 70%),
    radial-gradient(40% 46% at 12% 88%,rgba(15,61,44,.12),transparent 72%),
    radial-gradient(30% 36% at 96% 64%,rgba(200,238,63,.16),transparent 70%);}
html[data-texture="off"] .ce-scale::before{opacity:.35;}

/* ── connector wires ── */
.ce-svg{position:absolute;inset:0;width:1040px;height:600px;z-index:1;overflow:visible;pointer-events:none;}
.ce-wire{fill:none;stroke:rgba(15,61,44,.18);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;opacity:0;transition:opacity .4s ease;}
.ce-wire.on{opacity:1;}
.ce-pulse{fill:none;stroke:var(--lime);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;
  filter:drop-shadow(0 0 5px rgba(200,238,63,.9));stroke-dasharray:16 1400;stroke-dashoffset:1416;opacity:0;}
.ce-pulse.on{opacity:1;animation:cePulse 2.1s linear infinite;}
@keyframes cePulse{0%{stroke-dashoffset:1416;}100%{stroke-dashoffset:0;}}
html[data-motion="minimal"] .ce-pulse{display:none;}
@media (prefers-reduced-motion:reduce){.ce-pulse{display:none;}}
.ce-pulse.hot{stroke-width:3.6;filter:drop-shadow(0 0 9px rgba(200,238,63,1));}

/* ── intake landing glow at the score ── */
.ce-intake{position:absolute;left:610px;top:220px;width:60px;height:60px;border-radius:50%;z-index:1;pointer-events:none;opacity:0;
  background:radial-gradient(circle,rgba(200,238,63,.6),rgba(200,238,63,0) 70%);}
.ce-intake.on{animation:ceIntake .7s ease-out;}
@keyframes ceIntake{0%{opacity:0;transform:scale(.4);}30%{opacity:1;transform:scale(1);}100%{opacity:0;transform:scale(1.7);}}

/* ── logo nodes ── */
.ce-node{position:absolute;z-index:3;display:flex;flex-direction:column;align-items:center;gap:7px;width:96px;
  opacity:0;transform:translate(calc(-50% + var(--hx,0px)),calc(-50% + var(--hy,0px))) scale(.55);
  transition:opacity .4s ease,transform .4s ease;pointer-events:none;}
.ce-node.show{animation:cePop .6s cubic-bezier(.2,.8,.3,1) forwards;}
@keyframes cePop{from{opacity:0;transform:translate(calc(-50% + var(--hx,0px)),calc(-50% + var(--hy,0px))) scale(.55);}to{opacity:1;transform:translate(-50%,-50%) scale(1);}}
.ce-chip{width:58px;height:58px;border-radius:50%;background:#fff;display:grid;place-items:center;position:relative;
  box-shadow:0 10px 22px -8px rgba(15,61,44,.32),0 0 0 1px rgba(15,61,44,.07);
  transition:transform .3s cubic-bezier(.2,.7,.2,1),box-shadow .3s ease;}
.ce-chip svg{width:26px;height:26px;display:block;}
.ce-chip img{width:60%;height:60%;object-fit:contain;display:block;-webkit-user-drag:none;}
/* dark chip for white-mark logos (e.g. Perplexity) */
.ce-node.dark .ce-chip{background:#0f0e0a;}
.ce-node.dark .ce-chip img{width:62%;height:62%;}
/* wordmark pill (e.g. CoinDesk, The Block) */
.ce-node.word{width:auto;}
.ce-node.word .ce-chip{width:auto;height:58px;border-radius:30px;padding:0 20px;}
.ce-node.word .ce-chip img{width:auto;height:42%;}
.ce-chip .ce-spark-dot{position:absolute;top:-2px;right:-2px;width:11px;height:11px;border-radius:50%;background:var(--lime);border:2px solid #fff;opacity:0;transform:scale(.4);transition:opacity .3s ease,transform .3s ease;}
/* channel LIGHTS UP as it appears + sends its citation */
.ce-node.fuel-on .ce-chip{transform:scale(1.18);
  box-shadow:0 0 0 4px rgba(200,238,63,.7),0 0 26px 4px rgba(200,238,63,.6),0 16px 30px -8px rgba(15,61,44,.5),0 0 0 1px rgba(15,61,44,.07);}
.ce-node.show .ce-chip{animation:ceLight .7s cubic-bezier(.2,.7,.2,1);}
@keyframes ceLight{0%{box-shadow:0 0 0 0 rgba(200,238,63,0),0 10px 22px -8px rgba(15,61,44,.32),0 0 0 1px rgba(15,61,44,.07);}45%{box-shadow:0 0 0 6px rgba(200,238,63,.55),0 0 34px 8px rgba(200,238,63,.75),0 16px 30px -8px rgba(15,61,44,.5),0 0 0 1px rgba(15,61,44,.07);}}
html[data-motion="minimal"] .ce-node.show .ce-chip{animation:none;}
@media (prefers-reduced-motion:reduce){.ce-node.show .ce-chip{animation:none;}}
.ce-node.fuel-on .ce-spark-dot{opacity:1;transform:scale(1);}
.ce-node.fuel-on .ce-tag{color:var(--p);}
.ce-tag{font-family:var(--m);font-size:9.5px;font-weight:600;letter-spacing:.6px;color:var(--w3);text-transform:uppercase;white-space:nowrap;text-align:center;line-height:1;}
.ce-tag small{display:block;font-size:8px;letter-spacing:.8px;color:var(--w4);margin-top:2px;font-weight:500;}

/* ── glass cards ── */
.ce-card{position:absolute;z-index:2;border-radius:18px;
  background:linear-gradient(150deg,rgba(255,255,255,.92),rgba(255,255,255,.74));
  backdrop-filter:blur(14px) saturate(130%);-webkit-backdrop-filter:blur(14px) saturate(130%);
  border:1px solid rgba(255,255,255,.85);
  box-shadow:0 1px 0 rgba(255,255,255,.7) inset,0 26px 50px -26px rgba(15,61,44,.4),0 10px 22px -16px rgba(15,61,44,.3);
  padding:22px 24px;}
.ce-card .ce-h{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:10px;}
.ce-card .ce-h .t{font-family:var(--d);font-size:16px;font-weight:700;color:var(--wh);letter-spacing:-.4px;white-space:nowrap;}
.ce-card .ce-h .s{font-family:var(--m);font-size:10px;color:var(--w4);letter-spacing:.4px;text-transform:lowercase;}

/* number roll */
.ce-big{font-family:var(--d);font-weight:700;letter-spacing:-2.5px;line-height:1;color:var(--wh);font-variant-numeric:tabular-nums;}

/* SCORE card (hub) */
.ce-score{left:556px;top:150px;width:430px;}
.ce-score .ce-big{font-size:74px;}
.ce-score .ce-big .u{font-size:30px;color:var(--w4);font-weight:300;letter-spacing:-1px;margin-left:4px;}
.ce-grade{display:inline-flex;align-items:center;gap:7px;font-family:var(--m);font-size:10px;font-weight:700;letter-spacing:1.2px;text-transform:uppercase;color:var(--p);background:var(--lime);padding:5px 11px;border-radius:3px;margin:6px 0 20px;}
.ce-metric{margin-bottom:15px;}
.ce-metric .ml{display:flex;justify-content:space-between;align-items:baseline;font-family:var(--m);font-size:10.5px;letter-spacing:.5px;text-transform:uppercase;color:var(--w3);margin-bottom:7px;}
.ce-metric .ml b{font-family:var(--d);font-size:13px;color:var(--wh);letter-spacing:0;font-weight:700;}
.ce-bar{height:8px;border-radius:6px;background:rgba(15,61,44,.09);overflow:hidden;}
.ce-bar i{display:block;height:100%;width:0;border-radius:6px;transition:width 1.4s cubic-bezier(.2,.7,.2,1);}
.ce-bar i.lime{background:linear-gradient(90deg,var(--lime-d),var(--lime));box-shadow:0 0 10px rgba(200,238,63,.5);}
.ce-bar i.forest{background:linear-gradient(90deg,#16513a,var(--p));}
.ce-score .foot{margin-top:18px;padding-top:14px;border-top:1px solid rgba(15,61,44,.1);font-family:var(--m);font-size:10px;color:var(--w3);letter-spacing:.4px;display:flex;align-items:center;gap:8px;}
.ce-score .foot b{color:var(--p);font-weight:700;}
/* score reacts when a channel's citation lands */
.ce-big.bump{animation:ceBump .5s ease;}
@keyframes ceBump{0%,100%{transform:none;text-shadow:none;}42%{transform:scale(1.045);text-shadow:0 0 24px rgba(200,238,63,.55);}}
/* floating "+N · Channel" contribution rising into the score */
.ce-float{position:absolute;left:150px;top:62px;z-index:5;font-family:var(--m);font-size:11px;font-weight:700;letter-spacing:.4px;padding:4px 11px;border-radius:100px;pointer-events:none;white-space:nowrap;box-shadow:0 8px 18px -8px rgba(15,61,44,.4);animation:ceFloatUp 1.15s cubic-bezier(.2,.7,.2,1) forwards;}
.ce-float.ai{color:var(--p);background:var(--lime);}
.ce-float.pr{color:#fff;background:var(--p);}
@keyframes ceFloatUp{0%{opacity:0;transform:translateY(8px) scale(.85);}16%{opacity:1;transform:translateY(0) scale(1);}100%{opacity:0;transform:translateY(-30px) scale(1);}}
.ce-live{width:7px;height:7px;border-radius:50%;background:var(--lime);box-shadow:0 0 0 0 rgba(200,238,63,.7);animation:pulseChip 2.4s infinite;}

/* TREND card */
.ce-trend{left:54px;top:64px;width:430px;}
.ce-trend .ce-big{font-size:40px;margin:6px 0 0;}
.ce-trend .ce-big .pct{font-size:26px;color:var(--w4);font-weight:400;letter-spacing:-1px;}
.ce-spark{margin-top:14px;width:100%;height:118px;display:block;overflow:visible;}
.ce-spark .grid{stroke:rgba(15,61,44,.08);stroke-width:1;}
.ce-spark .area{fill:url(#ceArea);opacity:0;transition:opacity 1.2s ease .5s;}
.ce-stage.go .ce-spark .area{opacity:1;}
.ce-spark .line{fill:none;stroke:var(--p);stroke-width:3;stroke-linecap:round;stroke-linejoin:round;}
.ce-spark .dot{fill:var(--p);opacity:0;transition:opacity .3s ease 1.5s;}
.ce-stage.go .ce-spark .dot{opacity:1;}
.ce-spark .dot.ping{animation:ceDotPing .6s ease;}
@keyframes ceDotPing{0%,100%{r:4.5;}42%{r:7.5;}}
.ce-spark .glab{font-family:var(--m);font-size:9px;fill:var(--w4);}

/* SHARE / donut card */
.ce-share{left:54px;top:332px;width:430px;}
.ce-share .sub{font-size:11.5px;color:var(--w3);line-height:1.4;margin:2px 0 0;max-width:230px;}
.ce-share .body{display:flex;align-items:center;gap:22px;margin-top:14px;}
.ce-donut{width:130px;height:130px;flex-shrink:0;}
.ce-donut .track,.ce-donut .seg{fill:none;stroke-width:15;stroke-linecap:round;}
.ce-donut .track{stroke:rgba(15,61,44,.08);}
.ce-donut .seg{transition:stroke-dashoffset 1.4s cubic-bezier(.2,.7,.2,1),stroke-width .3s ease,filter .3s ease;}
.ce-donut .seg.pop{stroke-width:17.5;filter:drop-shadow(0 0 6px rgba(200,238,63,.85));}
.ce-donut .seg:nth-of-type(3){transition-delay:.18s;}
.ce-donut .seg:nth-of-type(4){transition-delay:.32s;}
.ce-donut .seg:nth-of-type(5){transition-delay:.46s;}
.ce-mono{font-family:var(--m);font-size:14px;font-weight:700;color:var(--p);letter-spacing:-.5px;}
.ce-legend{flex:1;display:flex;flex-direction:column;gap:11px;}
.ce-leg{display:flex;align-items:center;gap:9px;font-size:12.5px;color:var(--w2);opacity:0;transform:translateX(8px);transition:opacity .5s ease,transform .5s ease;}
.ce-stage.go .ce-leg{opacity:1;transform:none;}
.ce-stage.go .ce-leg:nth-child(2){transition-delay:.7s;}
.ce-stage.go .ce-leg:nth-child(3){transition-delay:.85s;}
.ce-stage.go .ce-leg:nth-child(4){transition-delay:1s;}
.ce-leg .sw{width:11px;height:11px;border-radius:3px;flex-shrink:0;}
.ce-leg .nm{font-weight:600;color:var(--wh);}
.ce-leg .vv{margin-left:auto;font-family:var(--m);font-size:11px;color:var(--w3);font-weight:600;}

/* ── responsive: scale wrapper set by JS; mobile stacks ── */
.ce-stage.ce-mobile .ce-scale{width:100%;height:auto;transform:none!important;display:flex;flex-direction:column;gap:16px;}
.ce-stage.ce-mobile .ce-flight,.ce-stage.ce-mobile .ce-intake{display:none;}
.ce-stage.ce-mobile .ce-card{position:static;width:100%!important;}
.ce-stage.ce-mobile .ce-scale::before{inset:0;}

/* logo-stream toggle (Tweaks) */
html[data-wires="off"] .ce-flight,html[data-wires="off"] .ce-intake{display:none;}
