/* Estilos exclusivos del landing principal. */

@layer features {
html {
  scroll-behavior: smooth;
}

.hero {
  min-height: 100vh;
  min-height: 100svh;
  background: linear-gradient(180deg, #020408 0%, #050a11 62%, #06131b 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: var(--z-base);
  pointer-events: none;
}

.hero::before {
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 112%, rgba(0, 180, 220, 0.14) 0%, rgba(0, 82, 120, 0.07) 30%, transparent 58%),
    radial-gradient(ellipse at 18% 72%, rgba(24, 82, 210, 0.07) 0%, transparent 38%);
}

.hero::after {
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 38%, rgba(1, 4, 8, 0.18) 66%, rgba(0, 2, 5, 0.78) 100%);
}

/*
  Sin margen arriba (el hero es la primera sección, nada que tape la navbar
  ahí), pero con margen abajo: sin él, partículas cerca del borde inferior
  quedan detrás de la navbar (fixed, con blur al hacer scroll) al pasar de
  esta sección a la siguiente.
*/
.hero__particles {
  position: absolute;
  inset: 0 0 12% 0;
  z-index: var(--z-base);
  overflow: hidden;
  pointer-events: none;
}

/* El glow lo dibuja tsParticles por partícula (shadow en home.js); un filter
   sobre el canvas se re-aplicaría al lienzo completo en cada frame. */
.hero__particles canvas {
  opacity: 0.88;
}

.hero__logo-stage {
  position: relative;
  z-index: var(--z-content);
  isolation: isolate;
  display: grid;
  place-items: center;
  width: min(70vw, 114.96vh);
  aspect-ratio: 1432 / 872;
  opacity: 1;
  visibility: visible;
  transition: visibility 0s;
  animation:
    hero-logo-reveal 1.15s cubic-bezier(0.16, 1, 0.3, 1) both,
    hero-logo-float 4.2s ease-in-out 1.15s infinite;
}

.hero__logo-stage::before {
  content: "";
  position: absolute;
  inset: 7% 4% 10%;
  z-index: var(--z-base);
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(24, 82, 210, 0.42) 0%, rgba(24, 82, 210, 0.14) 34%, transparent 68%),
    radial-gradient(circle, color-mix(in srgb, var(--color-accent) 38%, transparent) 0%, color-mix(in srgb, var(--color-accent) 12%, transparent) 34%, transparent 68%);
  background-repeat: no-repeat;
  background-size: 62% 82%, 62% 82%;
  background-position: -22% 46%, 122% 54%;
  filter: blur(44px);
  animation:
    hero-logo-glow-in 1.25s ease-out 0.1s both,
    hero-logo-glow-pulse 6.2s ease-in-out 1.35s infinite alternate;
}

.hero__logo {
  position: relative;
  z-index: var(--z-elevated);
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: screen;
  opacity: 1;
  transform: scale(1) translateY(0);
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.hero__light-overlay {
  position: absolute;
  inset: 0;
  z-index: var(--z-highlight);
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.hero__light-path {
  fill: none;
  stroke: url("#logo-edge-beam-gradient");
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 3 5 18 74;
  stroke-dashoffset: 100;
  opacity: 0;
}

.hero__light-path--core {
  animation: hero-light-core 5.8s ease-in-out 0.3s infinite;
}

.hero__light-path--left,
.hero__light-path--right {
  animation: hero-light-outer 5.8s ease-in-out 0.3s infinite;
}

.hero__light-path--right {
  --hero-light-offset: -100;
}

.hero--logo-hidden .hero__logo {
  opacity: 0;
  transform: scale(0.8) translateY(-20px);
}

.hero--logo-hidden .hero__logo-stage {
  visibility: hidden;
  transition-delay: 0.5s;
}

@keyframes hero-logo-reveal {
  0% {
    opacity: 0;
    filter: blur(26px) brightness(0.55);
    transform: translateY(34px) scale(0.72);
  }

  68% {
    opacity: 1;
    filter: blur(0) brightness(1.22);
    transform: translateY(-6px) scale(1.05);
  }

  100% {
    opacity: 1;
    filter: blur(0) brightness(1);
    transform: translateY(0) scale(1);
  }
}

/* Animaciones infinitas solo con opacity/transform: animar filter o
   background-position fuerza un repaint del elemento en cada frame. */
@keyframes hero-logo-float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-14px) scale(1.018);
  }
}

@keyframes hero-logo-glow-in {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }

  65% {
    opacity: 0.42;
    transform: scale(1.06);
  }

  100% {
    opacity: 0.34;
    transform: scale(1);
  }
}

@keyframes hero-logo-glow-pulse {
  0% {
    opacity: 0.22;
    transform: scale(0.98);
  }

  50% {
    opacity: 0.44;
    transform: scale(1.05);
  }

  100% {
    opacity: 0.26;
    transform: scale(1);
  }
}

@keyframes hero-light-core {
  0%,
  6% {
    opacity: 0;
    stroke-dashoffset: 100;
  }

  11% {
    opacity: 1;
  }

  36% {
    opacity: 1;
    stroke-dashoffset: 0;
  }

  43%,
  100% {
    opacity: 0;
    stroke-dashoffset: 0;
  }
}

@keyframes hero-light-outer {
  0%,
  24% {
    opacity: 0;
    stroke-dashoffset: var(--hero-light-offset, 100);
  }

  30% {
    opacity: 1;
  }

  72% {
    opacity: 1;
    stroke-dashoffset: 0;
  }

  80%,
  100% {
    opacity: 0;
    stroke-dashoffset: 0;
  }
}

/*
  Base común de las secciones del landing. align-content centra el contenido
  cuando sobra alto y lo deja crecer cuando lo excede, así que sirve tanto
  para una sección corta como para .services, que supera el viewport.
  El espacio del navbar lo reserva scroll-padding-top en html (styles.css).
*/
.home__section {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  /*
    minmax(0, 1fr) y no 1fr: sin el mínimo en 0 la pista se estira al
    max-content del hijo más ancho, y .carousel__track mide varios miles de
    píxeles por diseño. Eso arrastraría al resto del contenido fuera del
    viewport.
  */
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  padding-block: clamp(2.5rem, 6vw, 5rem);
  background-color: var(--color-background);
}

.about {
  position: relative;
  overflow: hidden;
  justify-items: center;
  padding-inline: 2rem;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 3s ease, transform 3s ease;
}

.about--visible {
  opacity: 1;
  transform: translateY(0);
}

/*
  Márgenes verticales para que las partículas nunca floten justo en el borde
  de la sección: si quedan ahí, la navbar (fixed, con blur al hacer scroll)
  las deja ver de fondo, borrosas, al pasar de esta sección a la siguiente.
*/
.about__particles {
  position: absolute;
  inset: 12% 0;
  z-index: var(--z-base);
}

.about__content {
  position: relative;
  z-index: var(--z-content);
  max-width: 900px;
}

.about__title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  background: var(--gradient-heading);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.about__description {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.services {
  padding-inline: 1.25rem;
}

.services__container {
  max-width: 1200px;
  margin: 0 auto;
}

.services__title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 60px;
  font-weight: 700;
}

.services__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
}

.services__card {
  flex: 0 1 260px;
  max-width: 260px;
  background-color: #111318;
  padding: 30px 10px;
  border-radius: 15px;
  box-shadow: var(--shadow-panel);
  text-align: center;
  opacity: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.services__card:hover {
  transform: translateY(-15px);
  z-index: var(--z-hover);
  box-shadow: 0 0 25px var(--color-accent-dark);
}

.services__card--visible {
  animation: services-fade-up 0.8s ease-out forwards;
}

.services__card--visible:nth-child(1) {
  animation-delay: 0.5s;
}

.services__card--visible:nth-child(2) {
  animation-delay: 1.2s;
}

.services__card--visible:nth-child(3) {
  animation-delay: 1.9s;
}

.services__card--visible:nth-child(4) {
  animation-delay: 2.5s;
}

.services__card-image {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1), 0 0 25px rgba(255, 255, 255, 0.25);
}

.services__card-title {
  margin-bottom: 15px;
  font-size: 1.3rem;
  font-weight: 600;
}

.services__card-description {
  font-size: 1rem;
  line-height: 1.5;
}

@keyframes services-fade-up {
  from {
    opacity: 0;
    translate: 0 30px;
  }

  to {
    opacity: 1;
    translate: 0 0;
  }
}

.technology {
  padding-inline: 1.25rem;
  text-align: center;
  overflow: hidden;
}

.technology__title {
  font-size: 2.5rem;
  margin-bottom: 40px;
  background: var(--gradient-heading);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.technology__description {
  font-size: 1.1rem;
  max-width: 800px;
  margin: 0 auto 3rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.technology__carousels {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.carousel {
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0%, black 20%, black 80%, transparent 100%);
}

.carousel__track {
  display: flex;
  animation: carousel-scroll-left 50s linear infinite;
  width: max-content;
}

.carousel__group {
  display: flex;
  gap: 60px;
  padding-right: 60px;
}

.carousel__track--reverse {
  animation-direction: reverse;
}

.carousel__track--paused {
  animation-play-state: paused;
}

.carousel__item {
  height: 80px;
  filter: brightness(1.2);
  transition: transform 0.3s ease;
}

.carousel__item:hover {
  transform: scale(1.1);
}

@keyframes carousel-scroll-left {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-25%);
  }
}

.contact {
  padding-inline: 1.5rem;
}

.contact__panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.05));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 40px rgba(0, 255, 255, 0.05);
  padding: 60px;
  backdrop-filter: blur(8px);
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 60px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.contact__info {
  flex: 1 1 40%;
  min-inline-size: 0;
}

.contact__title {
  font-size: 2.4rem;
  margin-bottom: 1rem;
  background: var(--gradient-heading);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.contact__description {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.contact__form {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-inline-size: 0;
}

.contact__row {
  display: flex;
  gap: 1rem;
}

.contact__row > * {
  min-inline-size: 0;
}

.contact__field-group {
  flex: 1;
  min-inline-size: 0;
}

.contact__submit {
  align-self: flex-start;
}

.footer {
  background-color: var(--color-background-deep);
  color: var(--color-text-muted);
  padding: 40px 20px;
  text-align: center;
  border-top: var(--border-subtle);
  font-size: 0.95rem;
  margin-top: 60px;
}

.footer__container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2.5rem;
  text-align: left;
}

.footer__logo {
  height: 50px;
  filter: brightness(1.2);
  margin-bottom: 0.5rem;
}

.footer__detail {
  margin: 0.3rem 0;
  overflow-wrap: anywhere;
}

.footer__link {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer__link:hover {
  color: var(--color-accent);
}

.footer__brand {
  flex: 1 1 240px;
}

.footer__column {
  flex: 0 1 160px;
  min-inline-size: 0;
  max-inline-size: 100%;
}

.footer__column--wide {
  flex-basis: 230px;
}

.footer__heading {
  font-size: 0.95rem;
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

.footer__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer__link--pending {
  color: var(--color-text-subtle);
  cursor: default;
}

.footer__bottom {
  max-width: 1000px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: var(--border-subtle);
  text-align: center;
}

.footer__copyright {
  color: var(--color-text-subtle);
  font-size: 0.8rem;
  line-height: 1.6;
}

.footer__copyright + .footer__copyright {
  margin-top: 0.3rem;
}

@media (max-width: 760px) {
  .contact__panel {
    padding: 30px;
    flex-direction: column;
    /* Sin esto, el flex-wrap:wrap de la regla base (pensado para la fila de
       desktop) combina con flex-basis:100% de los hijos —que en dirección
       columna es 100% de ALTO, no de ancho— y el segundo hijo termina
       envuelto en una columna aparte a la derecha, empujando scroll
       horizontal en vez de apilarse debajo. */
    flex-wrap: nowrap;
    gap: 40px;
  }

  .contact__info,
  .contact__form {
    flex: 1 1 100%;
  }

  .footer__container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
  }

  .footer__list {
    align-items: center;
  }

  .contact__row {
    flex-direction: column;
  }
}

@media (max-width: 360px) {
  .contact {
    padding-inline: 1rem;
  }

  .contact__panel {
    padding: 1.25rem;
  }

  .contact__title {
    font-size: 2rem;
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero__logo-stage,
  .hero__logo-stage::before,
  .hero__light-path--core,
  .hero__light-path--left,
  .hero__light-path--right,
  .carousel__track {
    animation: none;
  }

  .hero__logo {
    transition: none;
  }

  .services__card--visible {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
}
