/* ==========================================================
   1. COLORES, ESPACIADO Y ALTURA
========================================================== */

.icctv-hero {
  --hero-fondo: #DADBCF;
  --hero-tinta: #202720;
  --hero-secundario: #535C4E;
  --hero-oliva: #454F3E;
  --hero-acento: #D3FE52;

  --hero-ancho: 1600px;
  --hero-lateral: 5%;

  /* Espacio reservado para la cápsula flotante. */
  --hero-superior: 120px;

  /* Distancia de los botones al borde inferior. */
  --hero-inferior: 28px;

  position: relative;
  isolation: isolate;

  display: grid;

  /* Texto arriba, cámara en el espacio restante, botones abajo. */
  grid-template-rows: auto minmax(180px, 1fr) auto;

  width: 100%;
  max-width: none;
  min-width: 0;

  height: 100vh;
  height: 100svh;

  /* En ventanas muy bajas permite crecer sin cortar controles. */
  min-height: 700px;

  margin: 0;
  padding: var(--hero-superior) 0 var(--hero-inferior);

  color: var(--hero-tinta);
  background:
    radial-gradient(
      ellipse at 48% 52%,
      rgba(255, 255, 255, .4),
      transparent 62%
    ),
    radial-gradient(
      ellipse at 75% 80%,
      rgba(32, 39, 32, .08),
      transparent 58%
    ),
    var(--hero-fondo);

  font-family: "Inter", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
}

.icctv-hero *,
.icctv-hero *::before,
.icctv-hero *::after {
  box-sizing: border-box;
}

.icctv-hero * {
  min-width: 0;
}

.icctv-hero a {
  color: inherit;
  text-decoration: none;
}

.icctv-hero a,
.icctv-hero button {
  font-family: inherit;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.icctv-hero a:focus-visible,
.icctv-hero button:focus-visible {
  outline: 3px solid var(--hero-oliva);
  outline-offset: 5px;
}

/* ==========================================================
   2. TITULAR Y DESCRIPCIÓN
========================================================== */

.icctv-hero .icctv-masthead {
  position: relative;
  z-index: 2;

  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(0, 240px);
  align-items: end;
  justify-content: space-between;
  gap: 40px;

  width: 100%;
  max-width: var(--hero-ancho);
  margin: 0 auto;
  padding: 0 var(--hero-lateral);
}

.icctv-hero .icctv-eyebrow {
  margin: 0 0 17px;
  color: var(--hero-secundario);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.icctv-hero .icctv-title {
  margin: 0;
  padding: 0;

  color: var(--hero-tinta);
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(42px, 4.3vw, 68px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.055em;
  text-transform: none;
  word-break: normal;
}

.icctv-hero .icctv-title-mask {
  display: block;
  overflow: hidden;
  padding-bottom: .08em;
  margin-bottom: -.08em;
}

.icctv-hero .icctv-title-line {
  display: block;
}

.icctv-hero .icctv-title-muted {
  color: var(--hero-secundario);
}

.icctv-hero .icctv-description {
  max-width: 240px;
  margin: 0 0 4px;

  color: var(--hero-secundario);
  font-size: 16px;
  line-height: 1.65;
}

.icctv-hero .icctv-description strong {
  display: block;
  margin-bottom: 8px;
  color: var(--hero-tinta);
  font-weight: 500;
}

/* ==========================================================
   3. CÁMARA

   No tiene una altura vh independiente.
   Ocupa el espacio que queda entre texto y botones.
========================================================== */

.icctv-hero .icctv-stage-wrap {
  position: relative;
  align-self: stretch;

  width: 100%;
  max-width: var(--hero-ancho);
  min-height: 0;
  margin: 0 auto;
  padding: 0;
}

.icctv-hero .icctv-stage {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;
  min-height: 0;

  margin: 0;
  padding: 0;
  touch-action: pan-y;
}

.icctv-hero .icctv-stage::before {
  content: "";
  position: absolute;
  top: 33%;
  left: 62%;

  width: 13%;
  height: 36%;

  border-radius: 50%;
  background: rgba(32, 39, 32, .12);
  filter: blur(35px);
  pointer-events: none;
}

.icctv-hero .icctv-stage canvas {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.icctv-hero .icctv-stage canvas[hidden] {
  display: none;
}

.icctv-hero .icctv-status {
  position: absolute;
  top: 50%;
  left: 50%;

  width: 90%;
  max-width: 420px;
  margin: 0;
  transform: translate(-50%, -50%);

  color: var(--hero-secundario);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.icctv-hero .icctv-status[hidden] {
  display: none;
}

/* ==========================================================
   4. BOTONES Y CONTROLES
========================================================== */

.icctv-hero .icctv-bottom {
  position: relative;
  z-index: 2;

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 24px;

  width: 100%;
  max-width: var(--hero-ancho);
  margin: 0 auto;
  padding: 12px var(--hero-lateral) 0;
}

.icctv-hero .icctv-actions {
  text-align: left;
}

.icctv-hero .icctv-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;

  min-height: 54px;
  padding: 17px 27px;

  border: 1px solid var(--hero-tinta);
  border-radius: 40px;

  background: var(--hero-tinta);
  color: var(--hero-acento);

  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;

  transition:
    background-color .2s ease,
    color .2s ease,
    border-color .2s ease;
}

.icctv-hero .icctv-cta:hover {
  border-color: var(--hero-acento);
  background: var(--hero-acento);
  color: var(--hero-tinta);
}

.icctv-hero .icctv-note {
  color: var(--hero-secundario);
  font-size: 12px;
  line-height: 1.6;
  text-align: right;
}

.icctv-hero .icctv-note b {
  color: var(--hero-tinta);
  font-weight: 500;
  letter-spacing: 1px;
}

.icctv-hero .icctv-motion {
  display: inline-block;
  min-height: 44px;
  margin: 7px 0 0;
  padding: 10px 14px;

  border: 1px solid rgba(32, 39, 32, .3);
  border-radius: 24px;

  background: transparent;
  color: var(--hero-tinta);

  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
}

.icctv-hero .icctv-motion:hover {
  background: rgba(32, 39, 32, .05);
  color: var(--hero-tinta);
}

.icctv-hero .icctv-motion:disabled {
  opacity: .65;
  cursor: default;
}

/* ==========================================================
   5. ESCRITORIOS CON POCA ALTURA

   Reduce espacios y titulares antes de hacer crecer el hero.
========================================================== */

@media (min-width: 901px) and (max-height: 800px) {
  .icctv-hero {
    --hero-superior: 104px;
    --hero-inferior: 20px;
  }

  .icctv-hero .icctv-title {
    font-size: clamp(40px, 3.7vw, 56px);
  }

  .icctv-hero .icctv-eyebrow {
    margin-bottom: 12px;
  }
}

/* ==========================================================
   6. TABLET Y MÓVIL

   Mantiene al menos una pantalla, pero permite crecer cuando
   los textos y controles necesitan más espacio.
========================================================== */

@media (max-width: 900px) {
  .icctv-hero {
    --hero-superior: 112px;

    height: auto;
    min-height: 100vh;
    min-height: 100svh;

    grid-template-rows: auto minmax(300px, 1fr) auto;
  }

  .icctv-hero .icctv-masthead {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .icctv-hero .icctv-title {
    font-size: clamp(38px, 5.5vw, 52px);
  }

  .icctv-hero .icctv-description {
    max-width: 560px;
    margin: 0;
  }

  .icctv-hero .icctv-description strong {
    margin-bottom: 4px;
  }
}

@media (max-width: 650px) {
  .icctv-hero {
    --hero-lateral: 6%;
    --hero-superior: 108px;
    --hero-inferior: 24px;

    grid-template-rows: auto minmax(280px, 1fr) auto;
  }

  .icctv-hero .icctv-eyebrow {
    margin-bottom: 14px;
    font-size: 12px;
    letter-spacing: 1px;
  }

  .icctv-hero .icctv-title {
    font-size: clamp(36px, 8.5vw, 42px);
    line-height: 1.1;
  }

  .icctv-hero .icctv-description {
    max-width: 360px;
    font-size: 16px;
  }

  .icctv-hero .icctv-bottom {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding-top: 8px;
  }

  .icctv-hero .icctv-actions,
  .icctv-hero .icctv-note {
    text-align: center;
  }

  .icctv-hero .icctv-stage::before {
    filter: blur(20px);
  }
}

/* Compensa la barra de administración al estar conectado. */
body.admin-bar .icctv-hero {
  padding-top: calc(var(--hero-superior) + 32px);
}

@media (max-width: 782px) {
  body.admin-bar .icctv-hero {
    padding-top: calc(var(--hero-superior) + 46px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .icctv-hero .icctv-cta {
    transition: none;
  }
}

