.xsiam-anim {
  --teal: #14f1cd;
  --soft: #9ff8ec;
  --purple: #c35aff;
  position: relative;
  overflow: hidden;
  width: var(--xsiam-width);
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
  height: var(--xsiam-height);
  min-height: 440px;
  border-radius: 22px;
  background: #020506;
  color: #e9fffb;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  isolation: isolate;
}

.xsiam-anim * {
  box-sizing: border-box;
}

.xsiam-grid {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(20, 241, 205, 0.12), transparent 26%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
  opacity: 0.9;
}

.xsiam-topbar {
  position: absolute;
  left: 48px;
  right: 28px;
  top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 0.02em;
  z-index: 6;
}

.xsiam-topbar a {
  font-size: 17px;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 0 18px rgba(20, 241, 205, 0.28);
}

.xsiam-topbar em {
  font-style: normal;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 7px 14px;
  color: rgba(255, 255, 255, 0.58);
  white-space: nowrap;
}

.xsiam-stage {
  position: absolute;
  inset: 86px 34px 56px 42px;
}

.xsiam-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: 1;
}

.xsiam-in-flow path,
.xsiam-out-flow path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  filter: url(#xsiamGlow);
  opacity: 0;
}

.xsiam-in-flow path {
  stroke: url(#xsiamIn);
  stroke-dasharray: 360;
  stroke-dashoffset: 360;
  animation: xsiam-in-line 9.8s ease-in-out infinite;
  animation-delay: calc(var(--n) * 0.48s);
}

.xsiam-out-flow path {
  stroke: url(#xsiamOut);
  stroke-dasharray: 360;
  stroke-dashoffset: 360;
  animation: xsiam-out-line 9.8s ease-in-out infinite;
  animation-delay: calc(4.95s + var(--n) * 0.28s);
}

.xsiam-left-list {
  position: absolute;
  left: 150px;
  top: 50%;
  transform: translateY(-50%);
  width: 265px;
  height: 245px;
  z-index: 4;
  padding: 18px 18px 18px 14px;
  border: 1px solid rgba(20, 241, 205, 0.14);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(2, 12, 12, 0.55), rgba(2, 12, 12, 0.22));
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.xsiam-right-list {
  position: absolute;
  right: 120px;
  top: 50%;
  transform: translateY(-50%);
  width: 370px;
  height: 245px;
  z-index: 4;
  padding: 18px 18px 18px 30px;
  border: 1px solid rgba(20, 241, 205, 0.13);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(2, 12, 12, 0.55), rgba(2, 12, 12, 0.2));
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.xsiam-left-list div,
.xsiam-right-list div {
  display: flex;
  align-items: center;
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  line-height: 1.2;
  text-shadow: 0 0 0 rgba(20, 241, 205, 0);
}

.xsiam-left-list div {
  gap: 10px;
  animation: xsiam-input-lit 9.8s ease-in-out infinite;
  animation-delay: calc(var(--n) * 0.48s);
}

.xsiam-left-list div span {
  min-width: 0;
}

.xsiam-left-list i {
  margin-left: auto;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(20, 241, 205, 0.42);
  box-shadow: 0 0 7px rgba(20, 241, 205, 0.25);
  animation: xsiam-dot-lit 9.8s ease-in-out infinite;
  animation-delay: calc(var(--n) * 0.48s);
}

.xsiam-right-list:before {
  content: "";
  position: absolute;
  left: 12px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: linear-gradient(180deg, rgba(20, 241, 205, 0.05), rgba(195, 90, 255, 0.55), rgba(20, 241, 205, 0.05));
  box-shadow: 0 0 16px rgba(195, 90, 255, 0.45);
}

.xsiam-right-list div {
  position: relative;
  gap: 10px;
  animation: xsiam-output-lit 9.8s ease-in-out infinite;
  animation-delay: calc(5.15s + var(--n) * 0.28s);
}

.xsiam-right-list i {
  position: absolute;
  left: -23px;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f06, #4bf);
  box-shadow: 0 0 14px rgba(195, 90, 255, 0.65);
  animation: xsiam-output-dot 9.8s ease-in-out infinite;
  animation-delay: calc(5.15s + var(--n) * 0.28s);
}

.xsiam-right-list span {
  padding-left: 0;
}

.xsiam-core-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-shadow: 0 0 18px rgba(20, 241, 205, 0.7);
  z-index: 5;
  animation: xsiam-core-label 9.8s ease-in-out infinite;
  color: #fff;
}

.xsiam-core-label span {
  color: var(--teal);
}

.xsiam-orb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 210px;
  height: 210px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 241, 205, 0.16), transparent 58%);
  animation: xsiam-core 9.8s ease-in-out infinite;
  z-index: 3;
}

.xsiam-orb:before,
.xsiam-orb:after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1px solid rgba(20, 241, 205, 0.16);
  box-shadow: 0 0 26px rgba(20, 241, 205, 0.2);
}

.xsiam-orb:after {
  inset: 43px;
  border-style: dashed;
  animation: xsiam-spin 18s linear infinite;
}

.xsiam-orb span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px var(--teal);
  transform: rotate(calc(var(--i) * 10deg)) translateX(calc(34px + (var(--i) % 3) * 18px));
  animation: xsiam-dot 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.07s);
}

@keyframes xsiam-in-line {
  0% { stroke-dashoffset: 360; opacity: 0; }
  8%, 26% { opacity: 0.95; }
  34%, 100% { stroke-dashoffset: 0; opacity: 0.22; }
}

@keyframes xsiam-out-line {
  0% { stroke-dashoffset: 360; opacity: 0; }
  7%, 28% { opacity: 0.95; }
  38%, 100% { stroke-dashoffset: 0; opacity: 0.18; }
}

@keyframes xsiam-input-lit {
  0%, 7% { color: rgba(255, 255, 255, 0.5); text-shadow: none; }
  12%, 38% { color: #fff; text-shadow: 0 0 14px rgba(20, 241, 205, 0.65); }
  48%, 100% { color: rgba(255, 255, 255, 0.58); text-shadow: none; }
}

@keyframes xsiam-output-lit {
  0%, 8% { color: rgba(255, 255, 255, 0.5); text-shadow: none; }
  14%, 42% { color: #fff; text-shadow: 0 0 14px rgba(159, 248, 236, 0.65); }
  58%, 100% { color: rgba(255, 255, 255, 0.58); text-shadow: none; }
}

@keyframes xsiam-dot-lit {
  0%, 7% { background: rgba(20, 241, 205, 0.42); box-shadow: 0 0 7px rgba(20, 241, 205, 0.25); }
  12%, 38% { background: var(--teal); box-shadow: 0 0 18px var(--teal), 0 0 28px rgba(20, 241, 205, 0.45); }
  48%, 100% { background: rgba(20, 241, 205, 0.42); box-shadow: 0 0 7px rgba(20, 241, 205, 0.25); }
}

@keyframes xsiam-output-dot {
  0%, 8% { opacity: 0.65; transform: scale(0.85); }
  14%, 42% { opacity: 1; transform: scale(1.35); box-shadow: 0 0 20px rgba(195, 90, 255, 0.95), 0 0 12px rgba(20, 241, 205, 0.5); }
  58%, 100% { opacity: 0.65; transform: scale(0.85); }
}

@keyframes xsiam-core {
  0%, 34%, 100% { transform: translate(-50%, -50%) scale(0.92); opacity: 0.62; }
  42%, 56% { transform: translate(-50%, -50%) scale(1.13); opacity: 1; filter: drop-shadow(0 0 36px rgba(20, 241, 205, 0.72)); }
  70% { transform: translate(-50%, -50%) scale(0.98); opacity: 0.78; }
}

@keyframes xsiam-core-label {
  0%, 34%, 100% { opacity: 0.7; }
  42%, 58% { opacity: 1; text-shadow: 0 0 26px rgba(20, 241, 205, 0.95); }
}

@keyframes xsiam-spin {
  to { transform: rotate(360deg); }
}

@keyframes xsiam-dot {
  0%, 100% { opacity: 0.25; scale: 0.75; }
  50% { opacity: 1; scale: 1.45; }
}

/* Tablet: keep horizontal composition but shrink spacing. */
@media (max-width: 1200px) {
  .xsiam-anim {
    width: min(var(--xsiam-width), 100%);
  }

  .xsiam-stage {
    inset: 78px 18px 48px 18px;
  }

  .xsiam-left-list {
    left: 28px;
    width: 220px;
  }

  .xsiam-right-list {
    right: 28px;
    width: 300px;
  }

  .xsiam-left-list div,
  .xsiam-right-list div {
    font-size: 11px;
  }

  .xsiam-orb {
    width: 168px;
    height: 168px;
  }
}

/* Mobile: switch to stacked layout for readability. */
@media (max-width: 820px) {
  .xsiam-anim {
    width: 100%;
    height: auto;
    min-height: 0;
    border-radius: 16px;
  }

  .xsiam-topbar {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    padding: 16px 16px 8px;
  }

  .xsiam-topbar a {
    font-size: 14px;
    max-width: 60%;
    overflow-wrap: anywhere;
  }

  .xsiam-topbar em {
    font-size: 11px;
    padding: 6px 10px;
  }

  .xsiam-stage {
    position: relative;
    inset: auto;
    padding: 8px 14px 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .xsiam-lines {
    display: none;
  }

  .xsiam-left-list,
  .xsiam-right-list {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    transform: none;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 14px;
    gap: 9px;
  }

  .xsiam-right-list {
    padding-left: 22px;
  }

  .xsiam-left-list div,
  .xsiam-right-list div {
    font-size: 12px;
  }

  .xsiam-orb {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    margin: 4px auto;
    width: 128px;
    height: 128px;
    order: 2;
  }

  .xsiam-core-label {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    text-align: center;
    font-size: 15px;
    margin-top: -96px;
    margin-bottom: 84px;
    order: 2;
  }

  .xsiam-left-list {
    order: 1;
  }

  .xsiam-right-list {
    order: 3;
  }
}

@media (max-width: 480px) {
  .xsiam-topbar {
    padding: 14px 12px 6px;
    align-items: flex-start;
  }

  .xsiam-topbar a {
    font-size: 13px;
  }

  .xsiam-topbar em {
    font-size: 10px;
    padding: 5px 8px;
  }

  .xsiam-stage {
    padding: 8px 10px 14px;
    gap: 10px;
  }

  .xsiam-left-list,
  .xsiam-right-list {
    border-radius: 12px;
    padding: 12px;
  }

  .xsiam-right-list {
    padding-left: 20px;
  }

  .xsiam-left-list div,
  .xsiam-right-list div {
    font-size: 11px;
    line-height: 1.25;
  }

  .xsiam-orb {
    width: 110px;
    height: 110px;
  }

  .xsiam-core-label {
    font-size: 14px;
    margin-top: -84px;
    margin-bottom: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xsiam-anim * {
    animation: none !important;
  }

  .xsiam-in-flow path,
  .xsiam-out-flow path {
    opacity: 0.5;
    stroke-dashoffset: 0;
  }
}
