/* ================= LIVING SYSTEM ================= */

#living-system {
  padding: 120px 0;
  background: radial-gradient(circle at top, #020617, #000);
  color: #fff;
  overflow: hidden;
}

.living-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 80px;
}

.living-header h2 {
  font-size: 2.6rem;
  font-weight: 700;
}

.living-header p {
  color: #94a3b8;
  font-size: 1.05rem;
}

/* ================= STAGE ================= */

.system-stage {
  position: relative;
  height: 520px;
  perspective: 1200px;
}

#systemCanvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.core-node {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #084184;
  padding: 22px 36px;
  border-radius: 999px;
  font-weight: 700;
  z-index: 3;
  box-shadow: 0 0 60px rgba(56,189,248,.6);
}

/* ================= NODES ================= */

.sys-node {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120px;
  padding: 16px;
  text-align: center;
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  z-index: 2;
  transition: all .35s ease;
}

.sys-node i {
  font-size: 1.6rem;
  margin-bottom: 6px;
  color: var(--primary);
}

.sys-node span {
  font-size: .85rem;
}

.sys-node:hover {
  transform: scale(1.08);
  box-shadow: 0 0 40px rgba(56,189,248,.5);
}

/* ================= MODAL (STACK SAFE) ================= */

.module-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999999; /* acima de tudo */
}

.module-modal.active {
  display: block;
}

/* backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
  z-index: 1;
}

/* box */
.modal-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.92);

  background: var(--light);
  backdrop-filter: blur(18px);

  border-radius: 24px;
  padding: 36px;
  width: min(420px, 92%);

  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 40px 120px rgba(0,0,0,.85);

  z-index: 2;
  opacity: 0;
  transition: all .35s ease;
}

.module-modal.active .modal-box {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.modal-box h3 {
  font-size: 1.45rem;
  margin-bottom: 12px;
}

.modal-box p {
  color: var(--font);
  line-height: 1.65;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.8rem;
  cursor: pointer;
}

/* ================= RESPONSIVO — LIVING SYSTEM ================= */

@media (max-width: 968px) {

  #living-system {
    padding: 80px 0;
  }

  /* Remove canvas (mas mantém conceito) */
  #systemCanvas {
    display: none;
  }

  .system-stage {
    position: relative;
    height: auto;
    perspective: none;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
  }

  @media (max-width: 968px) {

  .system-stage {
    padding: 0 16px; /* 👈 borda padrão do site */
  }

}


  /* Core permanece como centro visual */
  .core-node {
    position: relative;
    top: auto;
    left: auto;
    transform: none;

    margin-bottom: 20px;
    padding: 20px 34px;

    font-size: 1rem;
    box-shadow: 0 0 30px rgba(56,189,248,.45);
  }

  /* Nodes viram lista premium */
  .sys-node {
    position: relative;
    top: auto;
    left: auto;
    transform: none !important;

    width: 100%;
    max-width: 420px;

    display: flex;
    align-items: center;
    gap: 16px;

    padding: 18px 22px;
    border-radius: 20px;

    background: linear-gradient(
      135deg,
      rgba(255,255,255,.10),
      rgba(255,255,255,.04)
    );

    border: 1px solid rgba(255,255,255,.18);
    backdrop-filter: blur(14px);

    box-shadow:
      0 8px 24px rgba(0,0,0,.35);
  }

  .sys-node i {
    font-size: 1.6rem;
    color: #38bdf8;
    flex-shrink: 0;
  }

  .sys-node span {
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .2px;
  }

  .sys-node::after {
    content: "Ver detalhes";
    margin-left: auto;
    font-size: .75rem;
    color: #94a3b8;
    opacity: .7;
  }

  .sys-node:hover {
    box-shadow: 0 0 26px rgba(56,189,248,.45);
  }
}

/* MOBILE PEQUENO */
@media (max-width: 520px) {

  .sys-node {
    max-width: 100%;
  }

  .sys-node span {
    font-size: .9rem;
  }
}
