/**
 * Cognitive Terrain — portable hero background
 * Dependency-free and fully scoped to .ct-terrain.
 */

.ct-terrain {
  --ct-background: #101a3b;
  --ct-foreground: #f3efe5;
  --ct-line: rgba(243, 239, 229, 0.11);
  --ct-line-accent: rgba(244, 111, 77, 0.27);
  --ct-star: rgba(243, 239, 229, 0.38);
  --ct-star-accent: rgba(217, 255, 87, 0.78);
  --ct-orbit: rgba(243, 239, 229, 0.16);
  --ct-orbit-far: rgba(243, 239, 229, 0.08);
  --ct-orbit-accent: rgba(244, 111, 77, 0.58);
  --ct-noise-opacity: 0.055;
  position: relative;
  isolation: isolate;
  min-block-size: max(680px, 100svh);
  overflow: hidden;
  background: var(--ct-background);
  color: var(--ct-foreground);
}

.ct-terrain::before {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  opacity: var(--ct-noise-opacity);
  background-image: var(--ct-noise, none);
  background-size: 148px 148px;
  mix-blend-mode: soft-light;
}

.ct-terrain::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: rgba(9, 17, 40, 0.06);
}

.ct-terrain__canvas {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ct-terrain__orbit {
  position: absolute;
  z-index: 1;
  border: 1px solid var(--ct-orbit);
  border-radius: 50%;
  pointer-events: none;
}

.ct-terrain__orbit--near {
  width: clamp(420px, 38vw, 720px);
  aspect-ratio: 1;
  top: 2vh;
  right: 6vw;
}

.ct-terrain__orbit--far {
  width: clamp(600px, 52vw, 980px);
  aspect-ratio: 1;
  top: -5vh;
  right: -1vw;
  border-color: var(--ct-orbit-far);
}

.ct-terrain__orbit--accent {
  width: clamp(260px, 24vw, 460px);
  aspect-ratio: 1;
  top: 18vh;
  right: 13vw;
  border-color: var(--ct-orbit-accent);
  transform: rotate(-10deg) scaleY(0.82);
}

.ct-terrain__content {
  position: relative;
  z-index: 2;
}

/* Optional starter layout. Remove this class if the target hero already has one. */
.ct-terrain__content--demo {
  display: grid;
  align-content: center;
  width: min(100% - 3rem, 1180px);
  min-block-size: max(680px, 100svh);
  margin-inline: auto;
  padding-block: 8rem 6rem;
}

@media (max-width: 760px) {
  .ct-terrain { min-block-size: 760px; }
  .ct-terrain__orbit--near { top: auto; right: -45%; bottom: 6%; }
  .ct-terrain__orbit--far { top: auto; right: -62%; bottom: -5%; }
  .ct-terrain__orbit--accent { top: auto; right: -12%; bottom: 19%; }
}

@media (prefers-reduced-motion: reduce) {
  .ct-terrain__orbit { transform: none; }
}

@media print {
  .ct-terrain { min-block-size: auto; background: #101a3b !important; }
  .ct-terrain__canvas,
  .ct-terrain__orbit { display: none !important; }
}
