/* ================================
   index.css — Diseño de Pantalla Dividida (Split-Screen)
   Este archivo controla la interacción visual de la página de inicio.
   ================================ */

body {
  background: #000;
}

/* ---- Contenedor Principal: Pantalla completa y fija ---- */
#split-container {
  position: fixed;
  inset: 0;
  display: flex;
  overflow: hidden;
}

/* ---- Paneles: Las dos secciones principales (Aires / Acero) ---- */
.panel {
  flex: 1;
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  transition: flex var(--t-slow);
  cursor: pointer;
}

#panel-aires {
  flex: 1;
}

#panel-acero {
  flex: 1;
}

/* Estados al pasar el ratón (Hover): Un panel se expande y el otro se contrae */
#split-container.hover-aires #panel-aires {
  flex: 1.6;
}

#split-container.hover-aires #panel-acero {
  flex: 0.4;
}

#split-container.hover-acero #panel-acero {
  flex: 1.6;
}

#split-container.hover-acero #panel-aires {
  flex: 0.4;
}

/* ---- Background layers ---- */
.panel__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform var(--t-slow), filter var(--t-slow);
  transform: scale(1.08);
}

.panel:hover .panel__bg {
  transform: scale(1);
}

#panel-aires .panel__bg {
  background-image: url('../img/fondo aires.png');
  filter: blur(12px) brightness(0.65);
}

#panel-acero .panel__bg {
  background-image: url('../img/fondo aceros.png');
  filter: blur(12px) brightness(0.6);
}

#panel-aires:hover .panel__bg,
#split-container.hover-aires #panel-aires .panel__bg {
  filter: blur(4px) brightness(0.4);
}

#panel-acero:hover .panel__bg,
#split-container.hover-acero #panel-acero .panel__bg {
  filter: blur(4px) brightness(0.35);
}

/* ---- Color Overlays ---- */
.panel__overlay {
  position: absolute;
  inset: 0;
  transition: opacity var(--t-slow), background var(--t-slow);
}

#panel-aires .panel__overlay {
  background: linear-gradient(160deg, rgba(10, 77, 143, 0.4) 0%, rgba(0, 201, 255, 0.15) 100%);
}

#split-container.hover-aires #panel-aires .panel__overlay {
  background: linear-gradient(160deg, rgba(2, 14, 28, 0.75) 0%, rgba(10, 77, 143, 0.45) 100%);
}

#panel-acero .panel__overlay {
  background: linear-gradient(20deg, rgba(26, 26, 46, 0.5) 0%, rgba(184, 115, 51, 0.1) 100%);
}

#split-container.hover-acero #panel-acero .panel__overlay {
  background: linear-gradient(20deg, rgba(11, 11, 14, 0.8) 0%, rgba(26, 26, 46, 0.5) 100%);
}

/* ---- Divider ---- */
#divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom,
      transparent 0%,
      rgba(255, 255, 255, 0.6) 20%,
      rgba(255, 255, 255, 0.9) 50%,
      rgba(255, 255, 255, 0.6) 80%,
      transparent 100%);
  z-index: 10;
  transition: left var(--t-slow), opacity var(--t-slow);
  pointer-events: none;
}

#divider::before {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  filter: blur(4px);
  opacity: 0.7;
}

/* Ajustes del divisor al interactuar con los paneles */
#split-container.hover-aires #divider {
  left: 62%;
  opacity: 0.3;
}

#split-container.hover-acero #divider {
  left: 38%;
  opacity: 0.3;
}

/* ---- Logo ---- */
#logo-center {
  position: fixed;
  z-index: 100;
  transition: all var(--t-slow);
  pointer-events: none;

  /* centered by default */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: clamp(150px, 18vw, 230px);

  filter: drop-shadow(0 0 20px rgba(0, 201, 255, 0.4)) drop-shadow(0 0 40px rgba(10, 77, 143, 0.3));
}

#logo-center img {
  width: 100%;
  height: auto;
  animation: float 4s ease-in-out infinite; /* Efecto de flotación suave */
}

/* Logo states on hover (triggered by JS classes) */
#logo-center.aires-mode {
  top: 8rem;
  left: 92%;
  transform: translate(-100%, 0) scale(0.5);
  filter: drop-shadow(0 0 15px var(--aires-glow));
  animation: none;
}

#logo-center.acero-mode {
  top: 8rem;
  left: 8%;
  transform: translate(0, 0) scale(0.5);
  filter: drop-shadow(0 0 15px var(--acero-glow));
  animation: none;
}

/* ---- Panel Content ---- */
.panel__content {
  position: relative;
  z-index: 5;
  padding: 4rem 3.5rem;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t-smooth) 0.15s, transform var(--t-smooth) 0.15s;
  max-width: 520px;
}

#split-container.hover-aires #panel-aires .panel__content,
#split-container.hover-acero #panel-acero .panel__content {
  opacity: 1;
  transform: translateY(0);
}

.panel__icon {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  margin-bottom: 1.2rem;
  display: block;
  line-height: 1;
}

/* SVG icons: reset font-size influence, use explicit width */
.aires-icon,
.acero-icon {
  font-size: 0;
  width: 90px;
  margin-bottom: 1.5rem;
}

.panel__label {
  font-family: var(--font-head);
  font-size: clamp(0.7rem, 1vw, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  opacity: 0.7;
}

.panel__heading {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.1;
  margin-bottom: 1rem;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.panel__tagline {
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  line-height: 1.65;
  opacity: 0.82;
  margin-bottom: 2rem;
  font-weight: 300;
}

.panel__cta {
  margin-top: 0.5rem;
}

/* ---- Aires text colors ---- */
#panel-aires {
  color: #e8f4ff;
}

#panel-aires .panel__label {
  color: var(--aires-accent);
}

#panel-aires .panel__heading {
  color: #ffffff;
}

/* ---- Acero text colors ---- */
#panel-acero {
  color: #e8e0d8;
}

#panel-acero .panel__label {
  color: var(--acero-accent);
}

#panel-acero .panel__heading {
  color: #ffffff;
}

/* ---- Title labels (always visible, centered vertically) ---- */
.panel__title-static {
  position: absolute;
  z-index: 5;
  top: 50%;
  transform: translateY(-50%);
  transition: opacity var(--t-smooth), transform var(--t-smooth);
  pointer-events: none;
}

#panel-aires .panel__title-static {
  right: 160px;
  text-align: right;
}

#panel-acero .panel__title-static {
  left: 160px;
  text-align: left;
}

.panel__title-static .panel__name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
}

.panel__title-static .panel__sub {
  font-size: clamp(0.7rem, 1vw, 0.82rem);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-top: 0.3rem;
  max-width: 550px;
  /* Aumentado significativamente */
  margin-left: auto;
  /* Para alineación derecha en Aires */
}

#panel-acero .panel__sub {
  margin-left: 0;
  margin-right: auto;
}

#panel-aires .panel__title-static .panel__name {
  color: #fff;
}

#panel-acero .panel__title-static .panel__name {
  color: #fff;
}

/* hide static title when panel is active or the other panel is active */
#split-container.hover-aires #panel-aires .panel__title-static,
#split-container.hover-acero #panel-aires .panel__title-static,
#split-container.hover-acero #panel-acero .panel__title-static,
#split-container.hover-aires #panel-acero .panel__title-static {
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* ---- Particles (Aires) ---- */
.particles-aires {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
}

.particle {
  position: absolute;
  bottom: -20px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 201, 255, 0.9), transparent);
  opacity: 0;
  animation: rise linear infinite;
}

@keyframes rise {
  0% {
    transform: translateY(0) scale(0);
    opacity: 0;
  }

  15% {
    opacity: 0.8;
    transform: translateY(-15vh) scale(1);
  }

  80% {
    opacity: 0.3;
  }

  100% {
    transform: translateY(-80vh) scale(0.4);
    opacity: 0;
  }
}

#split-container.hover-acero .shimmer-overlay {
  opacity: 1;
}

/* Fallback safety */

/* ---- Welding Sparks (Acero) ---- */
.particles-acero {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
  opacity: 0.6;
  /* Visible by default */
  transition: opacity var(--t-smooth);
}

#split-container.hover-acero .particles-acero {
  opacity: 1;
}

.spark {
  position: absolute;
  background: #ffcc00;
  border-radius: 50%;
  box-shadow: 0 0 8px #fff, 0 0 15px #ff9900, 0 0 25px #ff6600;
  opacity: 0;
}

@keyframes spark-float {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

/* ---- Mobile (≤768px) ---- */
@media (max-width: 768px) {

  /* Diseño específico para móviles: Los paneles se apilan verticalmente */
  #split-container {
    flex-direction: column;
    position: fixed;
    inset: 0;
    height: 100svh;
    overflow: hidden;
  }

  /* Each panel takes exactly 50% of the viewport height */
  .panel {
    flex: none !important;
    width: 100%;
    height: 50svh !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Backgrounds: Fixed and centered */
  .panel__bg {
    transform: scale(1) !important;
  }

  #panel-aires .panel__bg {
    filter: blur(0px) brightness(0.4) !important;
  }

  #panel-acero .panel__bg {
    filter: blur(0px) brightness(0.35) !important;
  }

  /* Hide elements that would cause scroll */
  #divider {
    display: none;
  }

  .panel__title-static {
    display: none !important;
  }

  .panel__tagline {
    display: none !important;
  }

  /* Taglines occupy too much space on single screen mobile */

  /* Panel content: centered and compact */
  .panel__content {
    opacity: 1 !important;
    transform: none !important;
    padding: 1.5rem !important;
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .panel__icon {
    font-size: 1.8rem !important;
    margin: 0 !important;
  }

  .panel__label {
    font-size: 0.65rem !important;
    margin-bottom: 0.2rem !important;
    letter-spacing: 0.2em;
  }

  .panel__heading {
    font-size: 1.7rem !important;
    margin-bottom: 0.5rem !important;
    line-height: 1;
    text-transform: uppercase;
  }

  .panel__cta {
    margin-top: 0.8rem !important;
    padding: 10px 20px !important;
    font-size: 0.85rem !important;
    width: auto !important;
    pointer-events: all;
  }

  /* Logo: Perfectly centered on the split line */
  #logo-center {
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 70px !important;
    z-index: 500;
    pointer-events: none;
    animation: float 4s ease-in-out infinite;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 50%;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Force logo to stay centered regardless of JS modes */
  #logo-center.aires-mode,
  #logo-center.acero-mode {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(1) !important;
    width: 70px !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   PANEL ICONS — PROFESSIONAL SVG ICONS
══════════════════════════════════════════════════════════════ */

/* ── Shared SVG rendering ── */
.aires-svg,
.acero-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* ── AIRES: LED power indicator ── */
.ac-led {
  animation: led-pulse 2s ease-in-out infinite;
}

/* ── AIRES: Airflow wave lines ── */
.af-line {
  stroke-dasharray: 30 10;
  stroke-dashoffset: 0;
  animation: airflow-drift 2s linear infinite;
}
.af2 { animation-delay: -0.7s; }
.af3 { animation-delay: -1.4s; }

@keyframes airflow-drift {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -40px; }
}

@keyframes led-pulse {
  0%, 100% { opacity: 1; r: 4; }
  50%       { opacity: 0.4; r: 3; }
}

/* ── ACERO: Central arc electric core ── */
.arc-core {
  fill: #fff;
  animation: arc-pop 0.25s ease-in-out infinite alternate;
}

.arc-glow {
  fill: rgba(255, 160, 0, 0.25);
  animation: arc-pop 0.25s ease-in-out infinite alternate-reverse;
}

@keyframes arc-pop {
  from { opacity: 0.7; transform: scale(1); }
  to   { opacity: 1;   transform: scale(1.25); filter: drop-shadow(0 0 10px #ffcc00); }
}

/* ── ACERO: Sparks on hover ── */
.a-spark {
  stroke: #ffcc00;
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0;
}

#panel-acero:hover .a-spark {
  animation: spark-shoot 0.55s ease-out infinite;
}

.sp1 { animation-delay: 0s; }
.sp2 { animation-delay: 0.14s; }
.sp3 { animation-delay: 0.28s; }
.sp4 { animation-delay: 0.42s; }

@keyframes spark-shoot {
  0%   { opacity: 1;   stroke-dasharray: 0 30; stroke-dashoffset: 0; }
  100% { opacity: 0;   stroke-dasharray: 30 0; stroke-dashoffset: -30px; }
}