.hero:has(.edf) { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }

.edf {
  --edf-cyan: #64e1f7;
  --edf-blue: #6b9eff;
  --edf-green: #69e8b2;
  margin: 0;
  min-width: 0;
  border: 1px solid #2e4b64;
  border-radius: 16px;
  background: linear-gradient(145deg, #101e2c, #0a131f);
  box-shadow: 0 24px 70px #050d1880, inset 0 1px #c4ebff17;
  overflow: hidden;
}

.edf-map {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr);
  isolation: isolate;
  padding: 20px;
  min-height: 425px;
  background: radial-gradient(circle at 50% 50%, #14557742, transparent 59%), radial-gradient(#9fc7ff29 .7px, transparent .9px) 0 0 / 17px 17px;
}

.edf-column { min-width: 0; display: flex; flex-direction: column; z-index: 1; }
.edf-column h2 { margin: 0 0 12px; font: 700 12px/1.24 system-ui, sans-serif; color: #a8cce4; letter-spacing: .055em; }
.edf-output h2 { color: #a3dcce; }
.edf-list { display: grid; gap: 6px; flex: 1; align-content: center; }

.edf-node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 9px;
  border: 1px solid #294863;
  border-radius: 7px;
  background: #122337f5;
  color: #e1f1ff;
  font: 650 clamp(11px, 1.02vw, 14px)/1.2 system-ui, sans-serif;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .2s, color .2s;
}

.edf-node::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: var(--edf-blue);
  box-shadow: 0 0 8px #6b9eff80;
}

.edf-output .edf-node { background: #10292df5; border-color: #2a544f; }
.edf-output .edf-node::before { background: var(--edf-green); box-shadow: 0 0 8px #69e8b280; }
.edf-node.is-active, .edf-node:hover { background: #173a4d; border-color: #70ddeb; color: white; box-shadow: 0 0 14px #64e1f730; }
.edf-node.is-muted { color: #a9bdcc; border-color: #23384a; }
.edf-node:focus-visible, .edf-clear:focus-visible { outline: 2px solid #b7f6ff; outline-offset: 2px; }

.edf-engine { position: relative; display: grid; place-items: center; min-width: 0; }
.edf-core {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(76%, 145px);
  aspect-ratio: 1;
  border: 1px solid #73e5fc;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 32%, #205775, #112a40 62%, #0c1828);
  box-shadow: 0 0 28px #46d7f358, inset 0 0 17px #67d7fc34;
  text-align: center;
  transform: translate(var(--edf-x, 0px), var(--edf-y, 0px));
}
.edf-mark { color: #88efff; font-size: clamp(20px, 2.5vw, 36px); line-height: 1; text-shadow: 0 0 13px #64e1f7a0; }
.edf-core strong { color: #f2fbff; font-size: clamp(9px, 1.1vw, 15px); letter-spacing: .08em; }
.edf-core small { color: #b1dfed; font-size: clamp(8px, .86vw, 12px); line-height: 1.2; max-width: 80%; }
.edf-ring { position: absolute; inset: -9%; border: 1px solid #6bdfff46; border-radius: 50%; pointer-events: none; }
.edf-ring:nth-child(2) { inset: -18%; border-color: #739fff34; border-top-color: #87caffbc; }
.edf-ring:nth-child(3) { inset: -27%; border-color: #66e7bc26; border-bottom-color: #69e8b288; }

.edf-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; overflow: visible; }
.edf-wire { color: var(--edf-wire, var(--edf-cyan)); transition: opacity .2s; }
.edf-wire.is-muted { opacity: .18; }
.edf-wire.is-active .edf-line { stroke-opacity: .8; }
.edf-wire path { fill: none; stroke: currentColor; vector-effect: non-scaling-stroke; }
.edf-line { stroke-width: 1; stroke-opacity: .34; }
.edf-signal { stroke-width: 1.25; stroke-dasharray: 1 12 3 26; stroke-linecap: round; stroke-opacity: .73; }
.edf-signal-back { stroke-width: 1; stroke-dasharray: 1 41; stroke-linecap: round; stroke-opacity: .52; }
.edf-output-wire { --edf-wire: var(--edf-green); }

.edf-packet { position: absolute; z-index: 2; color: #b0e7f8; font: 10px/1 ui-monospace, monospace; pointer-events: none; }
.edf-packet-in { top: 22%; left: 14%; }
.edf-packet-out { bottom: 20%; right: 9%; color: #a5ecca; }
.edf-packet span { display: block; padding: 4px 5px; background: #112539; border: 1px solid #395a72; border-radius: 4px; white-space: nowrap; }
.edf-packet span + span { margin-top: 4px; }

.edf-caption { display: flex; align-items: center; gap: 12px; justify-content: space-between; min-height: 96px; padding: 13px 17px; border-top: 1px solid #274253; background: #0d1a29; }
.edf-caption strong { color: #e5f8ff; font-size: 14px; }
.hero .edf-caption p { margin: 3px 0 0; font-size: 13px; line-height: 1.45; color: #b5cbd9; }
.edf-clear { flex: 0 0 auto; padding: 6px 8px; border: 1px solid #385b75; border-radius: 5px; background: #12293b; color: #d4f5ff; font: 600 12px/1.25 system-ui, sans-serif; cursor: pointer; }

@media (prefers-reduced-motion: no-preference) {
  .edf.is-in-view .edf-map { animation: edf-enter .55s ease-out both; }
  .edf.is-in-view .edf-signal { animation: edf-stream 2.5s linear infinite; }
  .edf.is-in-view .edf-signal-back { animation: edf-stream 3.4s linear infinite reverse; }
  .edf.is-in-view .edf-ring:nth-child(2) { animation: edf-orbit 10s linear infinite; }
  .edf.is-in-view .edf-ring:nth-child(3) { animation: edf-orbit 15s linear infinite reverse; }
  .edf.is-in-view .edf-mark { animation: edf-energy 3s ease-in-out infinite; }
  .edf.is-in-view .edf-packet { animation: edf-float 3.6s ease-in-out infinite alternate; }
}
@keyframes edf-enter { from { opacity: .55; translate: 0 7px; } to { opacity: 1; translate: 0 0; } }
@keyframes edf-stream { to { stroke-dashoffset: -84; } }
@keyframes edf-orbit { to { rotate: 360deg; } }
@keyframes edf-energy { 50% { opacity: .7; scale: .88; } }
@keyframes edf-float { to { translate: 0 -6px; } }

@media (max-width: 900px) {
  .hero:has(.edf) { grid-template-columns: minmax(0, 1fr); }
  .edf-node { font-size: 13px; }
}
@media (max-width: 540px) {
  .edf-map { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1fr); padding: 12px 8px; min-height: 390px; }
  .edf-node { font-size: 11px; padding: 5px; min-height: 36px; gap: 4px; }
  .edf-column h2 { font-size: 10px; }
  .edf-packet { font-size: 8px; }
  .edf-packet-in { left: 8%; }
  .edf-packet-out { right: 6%; }
  .edf-caption { flex-wrap: wrap; padding: 11px; }
  .edf-core { width: 86%; }
}
