/* =====================================================
   PROVOLTIA — Custom CSS (complemento a Tailwind CDN)
   Tipografía corporativa: Funnel Display + Funnel Sans
   ===================================================== */

/* ----- Tipografía variable local (no Google Fonts) ----- */
@font-face {
  font-family: 'Funnel Display';
  src: url('../fonts/FunnelDisplay-VariableFont_wght.ttf') format('truetype');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* Funnel Sans: cuerpo de texto (recta) y acentos editoriales (itálica). */
@font-face {
  font-family: 'Funnel Sans';
  src: url('../fonts/FunnelSans-VariableFont_wght.ttf') format('truetype');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Funnel Sans';
  src: url('../fonts/FunnelSans-Italic-VariableFont_wght.ttf') format('truetype');
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

/* Toda cursiva del sitio usa Funnel Sans Italic — aporta el carácter editorial
   que antes daba Fraunces, ahora con coherencia sans dentro de la marca. */
.italic {
  font-family: 'Funnel Sans', 'Funnel Display', system-ui, sans-serif;
}

/* ----- Base ----- */
html, body {
  background-color: #F4F0E6;
  color: #1A1D17;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ----- Enlaces de navegación con subrayado animado ----- */
.nav-link {
  position: relative;
  padding-bottom: 4px;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0%;
  background-color: #3D4A2A;
  transition: width 350ms cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link[aria-current="page"]::after {
  width: 100%;
}
.nav-link[aria-current="page"] {
  color: #3D4A2A;
}

/* ----- Navbar: transparente arriba, sólido al scrollear ----- */
.navbar {
  isolation: isolate;
  background-color: transparent;
  border-bottom: 1px solid transparent;
  will-change: background-color, box-shadow;
  transition:
    background-color 300ms cubic-bezier(0.22, 1, 0.36, 1),
    border-bottom-color 300ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 300ms cubic-bezier(0.22, 1, 0.36, 1);
}
.navbar--scrolled {
  background-color: #F4F0E6;
  border-bottom-color: rgba(61, 74, 42, 0.22);
  box-shadow:
    0 1px 2px rgba(26, 29, 23, 0.06),
    0 14px 30px -14px rgba(26, 29, 23, 0.16);
}

/* ----- Panel mobile: animación SOLO en breakpoints móviles ----- */
@media (max-width: 1023.98px) {
  .mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    transition: opacity 350ms cubic-bezier(0.22, 1, 0.36, 1),
                transform 350ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .mobile-menu[hidden] {
    display: block;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
  }
}

/* ----- Selección de texto ----- */
::selection {
  background-color: #A8B89A;
  color: #1A1D17;
}

/* ----- Inputs sin caja (estilo editorial) ----- */
.field-line {
  width: 100%;
  background-color: transparent;
  border: 0;
  border-bottom: 1px solid rgba(61, 74, 42, 0.20);
  padding: 0.75rem 0;
  font-size: 1rem;
  color: #1A1D17;
  transition: border-color 250ms cubic-bezier(0.22, 1, 0.36, 1);
}
.field-line::placeholder {
  color: rgba(26, 29, 23, 0.40);
}
.field-line:focus {
  outline: none;
  border-color: #3D4A2A;
}
.field-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(26, 29, 23, 0.72);
  margin-bottom: 0.5rem;
}

/* ----- Aparición suave al hacer scroll -----
   La clase .reveal la añade main.js. Sin JS, el contenido se ve normal (no se oculta). */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* =====================================================
   EXPERIMENTO VISUAL "WOW" (solo estética · reversible)
   ===================================================== */

/* Grano/textura sutil sobre toda la página */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Barra de progreso de scroll */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, #3D4A2A, #A8B89A);
  z-index: 60;
  pointer-events: none;
}

/* Resplandor que sigue al cursor (escritorio) */
#cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 460px;
  height: 460px;
  margin: -230px 0 0 -230px;
  border-radius: 9999px;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  transition: opacity 400ms ease;
  mix-blend-mode: multiply;
  background: radial-gradient(circle, rgba(168, 184, 154, 0.45), rgba(168, 184, 154, 0) 62%);
  will-change: transform;
}

/* Aurora del hero */
.hero-aurora {
  position: absolute;
  top: -30%;
  left: -10%;
  right: -10%;
  height: 620px;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(55% 55% at 28% 32%, rgba(168, 184, 154, 0.55), transparent 70%),
    radial-gradient(45% 45% at 78% 20%, rgba(61, 74, 42, 0.22), transparent 70%),
    radial-gradient(40% 40% at 60% 62%, rgba(201, 189, 157, 0.30), transparent 70%);
  filter: blur(70px);
  opacity: 0.7;
  animation: auroraFloat 16s ease-in-out infinite alternate;
}
@keyframes auroraFloat {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(2%, 3%, 0) scale(1.08); }
}

/* Titular del hero: aparición palabra a palabra */
.hero-title .hero-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.6em);
  animation: heroWord 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-title span:nth-of-type(1) { animation-delay: 0.10s; }
.hero-title span:nth-of-type(2) { animation-delay: 0.22s; }
.hero-title span:nth-of-type(3) { animation-delay: 0.36s; }
.hero-title span:nth-of-type(4) { animation-delay: 0.48s; }
@keyframes heroWord {
  to { opacity: 1; transform: none; }
}

/* Foto del hero con parallax (el transform lo aplica main.js) */
.hero-parallax {
  will-change: transform;
  transform: scale(1.08);
}

/* Tarjetas: elevación al pasar el ratón */
.grid .bg-crudo {
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 500ms cubic-bezier(0.22, 1, 0.36, 1);
}
.grid .bg-crudo:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -20px rgba(26, 29, 23, 0.28);
  position: relative;
  z-index: 1;
}

/* Cinta (marquee) de capacidades */
.marquee-band {
  overflow: hidden;
  padding: 0.9rem 0;
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 1.6rem;
  white-space: nowrap;
  will-change: transform;
  animation: marquee 34s linear infinite;
}
.marquee-track span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(61, 74, 42, 0.72);
}
.marquee-track .marquee-dot {
  color: rgba(168, 184, 154, 0.9);
  font-size: 8px;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Respeto a "reducir movimiento": desactiva las animaciones del experimento */
@media (prefers-reduced-motion: reduce) {
  .hero-aurora,
  .marquee-track { animation: none; }
  .hero-title .hero-word { opacity: 1; transform: none; animation: none; }
  .grid .bg-crudo:hover { transform: none; }
}

/* ----- Hero: canvas de red eléctrica ----- */
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}

/* ----- Intro de marca (una vez por sesión) ----- */
#intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #1A1D17;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}
#intro.intro-hide {
  opacity: 0;
  transform: translateY(-3%);
  pointer-events: none;
}
.intro-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.intro-logo {
  height: 56px;
  width: auto;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  animation: introLogo 550ms cubic-bezier(0.22, 1, 0.36, 1) 60ms forwards;
}
.intro-line {
  display: block;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #A8B89A, transparent);
  box-shadow: 0 0 16px rgba(168, 184, 154, 0.7);
  animation: introLine 650ms cubic-bezier(0.22, 1, 0.36, 1) 180ms forwards;
}
.intro-surge {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(168, 184, 154, 0.55), rgba(168, 184, 154, 0) 70%);
  opacity: 0;
  transform: scale(0.4);
  animation: introSurge 700ms cubic-bezier(0.22, 1, 0.36, 1) 420ms forwards;
}
@keyframes introLogo { to { opacity: 1; transform: none; } }
@keyframes introLine { to { width: 240px; } }
@keyframes introSurge {
  0% { opacity: 0; transform: scale(0.4); }
  55% { opacity: 0.7; }
  100% { opacity: 0; transform: scale(9); }
}
body.intro-lock { overflow: hidden; }

/* ----- Timeline: del proyecto a la puesta en servicio ----- */
.timeline {
  position: relative;
  padding-left: 2.25rem;
  list-style: none;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: rgba(61, 74, 42, 0.15);
}
.timeline::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  width: 2px;
  height: 0;
  background: linear-gradient(180deg, #3D4A2A, #A8B89A);
  transition: height 1400ms cubic-bezier(0.22, 1, 0.36, 1);
}
.timeline.is-active::after { height: calc(100% - 12px); }
.timeline-step {
  position: relative;
  padding-bottom: 2.75rem;
}
.timeline-step:last-child { padding-bottom: 0; }
.timeline-node {
  position: absolute;
  left: -34px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background: #F4F0E6;
  border: 2px solid rgba(61, 74, 42, 0.3);
  transition: background 400ms ease, border-color 400ms ease, box-shadow 400ms ease;
}
.timeline-step.is-active .timeline-node {
  background: #3D4A2A;
  border-color: #3D4A2A;
  box-shadow: 0 0 0 4px rgba(168, 184, 154, 0.35);
}
.timeline-index {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(61, 74, 42, 0.6);
  margin-bottom: 0.4rem;
}
.timeline-title { margin-bottom: 0.5rem; }
.timeline--anim .timeline-step {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}
.timeline--anim .timeline-step.is-active {
  opacity: 1;
  transform: none;
}

/* Foto del hero con tratamiento duotono de marca */
.hero-figure img {
  filter: grayscale(0.65) contrast(1.05) brightness(1.02);
}

/* ----- "El hilo de corriente" (solo home, escritorio) ----- */
#current-rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 26px;
  width: 2px;
  z-index: 45;
  pointer-events: none;
  display: none;
}
@media (min-width: 1024px) {
  #current-rail { display: block; }
}
.current-track {
  position: absolute;
  inset: 0;
  background: rgba(61, 74, 42, 0.12);
}
.current-fill {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  transform-origin: top center;
  transform: scaleY(0);
  background: linear-gradient(180deg, #3D4A2A, #A8B89A);
}
.current-head {
  position: absolute;
  left: 50%;
  top: 0;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 9999px;
  background: #A8B89A;
  box-shadow: 0 0 14px 3px rgba(168, 184, 154, 0.65);
}
@media (prefers-reduced-motion: reduce) {
  .current-head { box-shadow: none; }
}

/* ----- Cabecera: grande arriba, compacta al hacer scroll ----- */
#site-header nav {
  transition: height 350ms cubic-bezier(0.22, 1, 0.36, 1);
}
#site-header nav a img {
  transition: height 350ms cubic-bezier(0.22, 1, 0.36, 1), transform 500ms ease;
}
.navbar--scrolled nav { height: 3.75rem; }
.navbar--scrolled nav a img { height: 2.25rem; }
@media (min-width: 1024px) {
  .navbar--scrolled nav { height: 5rem; }
  .navbar--scrolled nav a img { height: 3rem; }
}

/* ----- Etiquetas de sección en monoespaciada (lenguaje técnico) · solo home ----- */
main span.inline-flex.tracking-extra-wide {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0.12em;
}

/* ----- Nodos del hilo: se energizan cuando la corriente los alcanza ----- */
.current-node {
  position: absolute;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 9999px;
  background: #F4F0E6;
  border: 1px solid rgba(61, 74, 42, 0.4);
  transition: background 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}
.current-node.lit {
  background: #A8B89A;
  border-color: #A8B89A;
  box-shadow: 0 0 10px 2px rgba(168, 184, 154, 0.6);
}

/* =====================================================
   HERO "ENERGIZAR" — portada a pantalla completa
   ===================================================== */
.hero-power {
  background: radial-gradient(120% 120% at 72% 18%, #262b21 0%, #1A1D17 62%);
  color: #F4F0E6;
}
#energy-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(26, 29, 23, 0.82) 0%, rgba(26, 29, 23, 0.45) 52%, rgba(26, 29, 23, 0.12) 100%);
}
.hero-accent {
  color: #A8B89A;
  text-shadow: 0 0 34px rgba(168, 184, 154, 0.45);
}
.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  width: 22px;
  height: 36px;
  border: 1px solid rgba(244, 240, 230, 0.35);
  border-radius: 12px;
  z-index: 10;
}
.hero-scroll-dot {
  position: absolute;
  left: 50%;
  top: 7px;
  width: 3px;
  height: 7px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: #A8B89A;
  animation: heroScroll 1.8s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
@keyframes heroScroll {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(14px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-scroll-dot { animation: none; top: 12px; }
}

/* Fotos de banner con duotono de marca en toda la web (cohesión + no "stock pegado") */
main figure {
  isolation: isolate;
}
main figure img {
  filter: grayscale(0.85) contrast(1.06) brightness(0.98);
}
main figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(61, 74, 42, 0.42);
  mix-blend-mode: multiply;
  pointer-events: none;
}
