/* ——— Campo de territorio: luz difusa + rejilla de letras al azar + grano ———
   Lo usan la Home (sección Territorios) y el hero de /territorios. Cada territorio tiene su propia
   composición de luz (aquí) y su propio bloque de letras (krovee-field.js lo dibuja en el canvas).
   La composición está pensada a 720 × 900: el escenario mantiene esa proporción y cubre el
   contenedor (como background-size: cover), así no se deforma en paneles estrechos. */
.kfield {
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  container-type: size;
  background: var(--kf-base, #050505);
}
.kfield__stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100cqw, 80cqh);
  height: max(100cqh, 125cqw);
  container-type: size;
  transform: translate(calc(-50% + var(--kf-px, 0px)), calc(-50% + var(--kf-py, 0px)));
}
.kfield__shape {
  position: absolute;
  display: block;
}
.kfield__shape > i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: kf-drift-1 22s ease-in-out infinite alternate;
}
.kfield__shape--2 > i { animation-name: kf-drift-2; animation-duration: 28s; }
.kfield__shape--3 > i { animation-name: kf-drift-3; animation-duration: 34s; }
.kfield__type {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: blur(0.13cqw);           /* las letras no son nítidas: ~0,9 px a 720 */
}
.kfield__type--far {
  filter: blur(0.45cqw);           /* algunas, más lejos: ~3 px a 720 */
  opacity: 0.8;
}
.kfield::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.16;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.kfield.is-paused .kfield__shape > i {
  animation-play-state: paused;
}
@keyframes kf-drift-1 { from { transform: none; } to { transform: translate(4.7cqw, -2.4cqh) scale(1.05); } }
@keyframes kf-drift-2 { from { transform: scale(1.03); } to { transform: translate(-4.2cqw, 2cqh) scale(0.97); } }
@keyframes kf-drift-3 { from { transform: none; } to { transform: translate(3cqw, 3.1cqh) scale(1.08); } }
@media (prefers-reduced-motion: reduce) {
  .kfield__shape > i { animation: none; }
}

/* K/DG · Ingeniería: masa azul y cian con un borde violeta abajo */
.kfield--dg { --kf-base: #04040b; }
.kfield--dg .kfield__shape--1 { left: -16.67%; top: -17.78%; width: 97.22%; height: 84.44%; transform: rotate(-8deg); }
.kfield--dg .kfield__shape--1 > i {
  border-radius: 46% 54% 52% 48% / 42% 46% 54% 58%;
  background: linear-gradient(150deg, #2a36ff 0%, #3b2dff 38%, #1d9bff 72%, #19d3c5 100%);
  filter: blur(4.17cqw);
}
.kfield--dg .kfield__shape--2 { left: -8.33%; top: 57.78%; width: 91.67%; height: 33.33%; transform: rotate(-14deg); }
.kfield--dg .kfield__shape--2 > i {
  background: linear-gradient(90deg, #5b25ff, #8a3dff 60%, rgba(138, 61, 255, 0));
  opacity: 0.9;
  filter: blur(5cqw);
}
.kfield--dg .kfield__shape--3 { left: 58.33%; top: -4.44%; width: 41.67%; height: 57.78%; }
.kfield--dg .kfield__shape--3 > i {
  background: radial-gradient(closest-side, #1fc4ff, rgba(31, 196, 255, 0));
  opacity: 0.5;
  filter: blur(8.33cqw);
}

/* K/BR · Identidad: cúpula de luz marfil y champán */
.kfield--br { --kf-base: #0b0a09; }
.kfield--br .kfield__shape--1 { left: -31.94%; top: 13.33%; width: 163.89%; height: 111.11%; }
.kfield--br .kfield__shape--1 > i {
  border-radius: 50% 50% 46% 54% / 52% 52% 48% 48%;
  background: linear-gradient(180deg, #f6eddd 0%, #efdcb8 38%, #d7b07a 74%, #8a6236 100%);
  opacity: 0.97;
  filter: blur(4.72cqw);
}
.kfield--br .kfield__shape--2 { left: 55.56%; top: 20%; width: 58.33%; height: 46.67%; }
.kfield--br .kfield__shape--2 > i {
  background: radial-gradient(closest-side, #ffffff, rgba(255, 255, 255, 0));
  opacity: 0.5;
  filter: blur(8.33cqw);
}
.kfield--br .kfield__shape--3 { left: -16.67%; top: 13.33%; width: 50%; height: 33.33%; }
.kfield--br .kfield__shape--3 > i {
  background: radial-gradient(closest-side, #8a6a45, rgba(138, 106, 69, 0));
  opacity: 0.35;
  filter: blur(9.72cqw);
}

/* K/ST · Crecimiento: banda verde, lima y turquesa en diagonal */
.kfield--st { --kf-base: #030806; }
.kfield--st .kfield__shape--1 { left: -36.11%; top: 27.78%; width: 172.22%; height: 46.67%; transform: rotate(-38deg); }
.kfield--st .kfield__shape--1 > i {
  background: linear-gradient(90deg, #0e8f57 0%, #19c477 30%, #8fdc4a 62%, #11a8a0 100%);
  opacity: 0.95;
  filter: blur(4.44cqw);
}
.kfield--st .kfield__shape--2 { left: 45.83%; top: -13.33%; width: 72.22%; height: 46.67%; }
.kfield--st .kfield__shape--2 > i {
  background: radial-gradient(closest-side, #11a8a0, rgba(17, 168, 160, 0));
  opacity: 0.6;
  filter: blur(8.33cqw);
}
.kfield--st .kfield__shape--3 { left: -22.22%; top: 71.11%; width: 72.22%; height: 40%; }
.kfield--st .kfield__shape--3 > i {
  background: radial-gradient(closest-side, #0c6b42, rgba(12, 107, 66, 0));
  opacity: 0.7;
  filter: blur(8.33cqw);
}

/* Las tres luces en un solo campo (fondo del hero de /territorios): azul arriba, marfil en el
   centro y verde abajo. Las letras se invierten sobre la luz clara para que se lean en todo. */
.kfield--land { --kf-base: #050505; }
.kfield--land .kfield__type { mix-blend-mode: difference; }
.kfield--land .kfield__shape--1 { left: 2%; top: -12%; width: 72%; height: 56%; transform: rotate(-10deg); }
.kfield--land .kfield__shape--1 > i {
  border-radius: 46% 54% 52% 48% / 42% 46% 54% 58%;
  background: linear-gradient(150deg, #2a36ff 0%, #3b2dff 40%, #1d9bff 76%, #19d3c5 100%);
  filter: blur(4cqw);
}
.kfield--land .kfield__shape--2 { left: 30%; top: 28%; width: 86%; height: 50%; }
.kfield--land .kfield__shape--2 > i {
  border-radius: 50% 50% 46% 54% / 56% 56% 44% 44%;
  background: linear-gradient(180deg, #f6eddd 0%, #efdcb8 40%, #d7b07a 80%, rgba(138, 98, 54, 0) 100%);
  opacity: 0.95;
  filter: blur(4.6cqw);
}
.kfield--land .kfield__shape--3 { left: -12%; top: 66%; width: 120%; height: 30%; transform: rotate(-22deg); }
.kfield--land .kfield__shape--3 > i {
  background: linear-gradient(90deg, #0e8f57 0%, #19c477 34%, #8fdc4a 64%, #11a8a0 100%);
  opacity: 0.95;
  filter: blur(4.2cqw);
}

/* TEST iOS B3: en móvil las formas no se animan y el ruido no se mezcla (blur + blend + animación infinita saturan el compositor de Safari en scroll) */
@media (max-width: 900px) {
  .kfield__shape > i { animation: none !important; }
  .kfield::after { mix-blend-mode: normal; }
  .kfield--land .kfield__type { mix-blend-mode: normal; }
}
