:root {
    --bg:        #0d1526;   /* navy más profundo que el actual #131d33 */
    --surface:   #131d33;
    --surface-2: #1a2b4c;
    --yellow:    #f1c40f;
    --yellow-2:  #ffd900;
    --yellow-strong: #a9790a; /* dorado oscuro, para texto sobre fondo claro */
    --violet:    #3b2d78;   /* morado del logo, para acentos secundarios */
    --text:      #f4f7f6;   /* texto claro, para usar SOLO sobre fondos oscuros (cards, navbar, footer) */
    --muted:     #8494b3;   /* texto secundario, para usar sobre fondos oscuros */
    --ink:       #1a2332;   /* texto oscuro, para usar sobre el fondo claro de la página */
    --muted-dark: #57607a;  /* texto secundario, para usar sobre el fondo claro de la página */
    --border-y:  rgba(241,196,15,0.15);
    --glow-y:    rgba(241,196,15,0.25);
    --grad:      linear-gradient(135deg, #f1c40f, #ffd900);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
    font-family: 'Montserrat', system-ui, sans-serif;
    background-color: #e7e6e2;
    background-image:
        radial-gradient(ellipse 60% 45% at 15% 20%, rgba(160,158,150,0.22), transparent 60%),
        radial-gradient(ellipse 55% 50% at 85% 15%, rgba(180,178,170,0.18), transparent 60%),
        radial-gradient(ellipse 65% 55% at 75% 85%, rgba(150,148,140,0.20), transparent 60%),
        radial-gradient(ellipse 50% 45% at 10% 90%, rgba(170,168,160,0.16), transparent 55%),
        radial-gradient(ellipse 70% 60% at 45% 50%, rgba(200,199,193,0.25), transparent 65%);
    background-attachment: fixed;
    color: var(--ink);
    line-height: 1.6;
    overflow-x: hidden;
}

#scroll-progress {
    position: fixed; top: 0; left: 0; width: 100%; height: 4px;
    background: var(--grad);
    box-shadow: 0 0 12px var(--glow-y);
    transform: scaleX(0); transform-origin: left;
    z-index: 2001; pointer-events: none;
}

#canvas-grid { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
#canvas-lightning { position: fixed; inset: 0; pointer-events: none; z-index: 1; }

main, footer { position: relative; z-index: 10; }

/* ===== NAVBAR ===== */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%; height: 72px;
    padding: 0 5%;
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(13,21,38,0.95); backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(241,196,15,0.1);
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.logo-bolt { width: 20px; height: 27px; fill: var(--yellow); filter: drop-shadow(0 0 6px var(--glow-y)); }
.logo-text { font-size: 0.9rem; font-weight: 800; letter-spacing: 0.06em; color: var(--text); text-decoration: none !important; border: none; }
.logo-text .accent { color: var(--yellow); }
.nav-links { display: flex; gap: 2rem; list-style: none; align-items: center; }
.nav-links a {
    color: rgba(244,247,246,0.7); text-decoration: none;
    font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase;
    font-weight: 600;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--yellow); }
.nav-links a.nav-cta {
    background: var(--grad); color: #0d1526; font-weight: 800;
    padding: 0.45rem 1.2rem; border-radius: 3px;
}
.burger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 6px; }
.burger div { width: 24px; height: 2px; background: var(--text); }

/* ===== HERO ===== */
.hero {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: space-between;
    gap: 3rem; max-width: 1100px; margin: 0 auto;
    padding: 10rem 2.5rem 4rem;
}
.hero-content { max-width: 560px; flex: 1; }

.hero-eyebrow {
    font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--yellow-strong); margin-bottom: 1.5rem;
    display: flex; align-items: center; gap: 0.75rem;
    opacity: 0; transform: translateY(12px); animation: fadeUp 0.7s 0.2s forwards;
}
.hero-eyebrow::before { content: ''; width: 2rem; height: 1px; background: var(--yellow-strong); }

h1 {
    font-size: clamp(2.5rem, 5.2vw, 4.2rem);
    font-weight: 800; line-height: 1.08; letter-spacing: -0.02em;
    text-wrap: balance; margin-bottom: 1.5rem; color: var(--ink);
    opacity: 0; transform: translateY(16px); animation: fadeUp 0.7s 0.4s forwards;
}
.h1-accent {
    background: linear-gradient(135deg, #a9790a, #f1c40f);
    background-clip: text; -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    font-size: 1rem; color: var(--muted-dark); max-width: 500px;
    margin-bottom: 2.5rem; line-height: 1.75;
    opacity: 0; transform: translateY(12px); animation: fadeUp 0.7s 0.6s forwards;
}

/* ===== ENCABEZADO DE PÁGINAS SECUNDARIAS (Nosotros, Proyectos) =====
   Integrado con el fondo claro del sitio: la red eléctrica se ve detrás
   y un resplandor dorado enmarca el título. */
.page-header {
    background: transparent;
    text-align: center;
    padding: 10rem 2.5rem 4rem;
    position: relative; z-index: 10;
}
.page-header::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: radial-gradient(ellipse 60% 70% at 50% 35%, rgba(241,196,15,0.16), transparent 70%);
    pointer-events: none;
}
.page-header::after {
    content: ''; position: absolute; left: 50%; bottom: 2rem;
    width: 70px; height: 3px; transform: translateX(-50%);
    background: var(--grad); border-radius: 2px;
    box-shadow: 0 0 14px var(--glow-y);
}
.page-header .hero-content { max-width: 700px; margin: 0 auto; }
.page-header .hero-eyebrow { justify-content: center; color: var(--yellow-strong); }
.page-header .hero-eyebrow::before { background: var(--yellow-strong); }
.page-header h1 { color: var(--ink); }
.page-header .h1-accent { background: linear-gradient(135deg, #c99708, #a9790a); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.page-header .hero-sub { color: var(--muted-dark); margin-left: auto; margin-right: auto; }

/* Tarjeta para mostrar el logo institucional (Nosotros) */
.logo-card {
    display: flex; align-items: center; justify-content: center;
    background: #fff;
    border: 1px solid rgba(13,21,38,0.08);
    border-radius: 14px;
    padding: 2.5rem;
    box-shadow: 0 12px 34px rgba(13,21,38,0.10);
}
.logo-card img { max-width: 250px; width: 100%; height: auto; }

.cta-group {
    display: flex; gap: 1rem; flex-wrap: wrap;
    opacity: 0; transform: translateY(12px); animation: fadeUp 0.7s 0.8s forwards;
}
.cta-group.center { justify-content: center; }
.btn-primary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--grad); color: #0d1526;
    font-weight: 800; font-size: 0.875rem; letter-spacing: 0.04em;
    padding: 0.8rem 1.8rem; border-radius: 4px; text-decoration: none;
    transition: box-shadow 0.2s, transform 0.2s;
}
.btn-primary:hover { box-shadow: 0 0 28px var(--glow-y); transform: translateY(-1px); }
.btn-outline {
    display: inline-flex; align-items: center; gap: 0.5rem;
    color: var(--ink); font-size: 0.875rem; letter-spacing: 0.04em;
    padding: 0.8rem 1.8rem; border: 1px solid rgba(26,35,50,0.25);
    border-radius: 4px; text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}
.btn-outline:hover { border-color: var(--yellow-strong); color: var(--yellow-strong); }
.page-header .btn-outline { color: var(--text); border-color: var(--border-y); }
.page-header .btn-outline:hover { border-color: var(--yellow); color: var(--yellow); }

@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes bounceIn {
    from { opacity: 0; transform: scale(0.8) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== ANCLA DEL RAYO REALISTA (el rayo se dibuja en el canvas) ===== */
.bolt-stage {
    flex-shrink: 0;
    width: 300px; height: 440px;
}
.logo-img { height: 34px; width: auto; }

/* ===== STATS / BADGES ===== */
.stats {
    border-top: 1px solid var(--border-y); border-bottom: 1px solid var(--border-y);
    background: rgba(13,21,38,0.75); backdrop-filter: blur(10px);
    position: relative; z-index: 10;
}
.stats-inner {
    max-width: 1100px; margin: 0 auto; padding: 2.5rem;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem;
}
.stat { text-align: center; }
.stat-num {
    font-size: 1.7rem; font-weight: 800; letter-spacing: -0.01em;
    line-height: 1; margin-bottom: 0.4rem;
    background: var(--grad); background-clip: text;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }

/* ===== SECCIONES ===== */
.section { max-width: 1100px; margin: 0 auto; padding: 5rem 2.5rem; }
.section-label {
    display: inline-block;
    font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase;
    font-weight: 800; color: var(--bg); background: var(--yellow);
    padding: 0.3rem 0.9rem; border-radius: 20px; margin-bottom: 1rem;
}
h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 800;
    letter-spacing: -0.02em; text-wrap: balance; line-height: 1.15;
    margin-bottom: 1.5rem; color: var(--ink);
}
.section-sub { color: var(--muted-dark); max-width: 640px; line-height: 1.75; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.card {
    background: rgba(19,29,51,0.88); border: 1px solid var(--border-y);
    border-radius: 8px; padding: 1.75rem; backdrop-filter: blur(6px);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.card:hover { border-color: rgba(241,196,15,0.4); box-shadow: 0 0 30px rgba(241,196,15,0.08); transform: translateY(-3px); }
.card-icon { font-size: 1.5rem; margin-bottom: 1rem; }
.card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.6rem; color: var(--text); }
.card p { color: var(--muted); font-size: 0.875rem; line-height: 1.65; }
.card-img { width: 100%; height: 160px; object-fit: cover; border-radius: 6px; margin-bottom: 1rem; }

/* ===== Íconos Misión/Visión y avatares de equipo (usados en Nosotros) ===== */
.mv-icon {
    width: 56px; height: 56px; border-radius: 50%;
    background: rgba(241,196,15,0.12); color: var(--yellow);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; margin-bottom: 1.1rem;
}
.card.team { text-align: center; }
.team-avatar {
    width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 1rem;
    background: rgba(241,196,15,0.12); color: var(--yellow);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
}

/* ===== DOS COLUMNAS (quiénes somos, clientes, contacto) ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: center; }
.two-col h2 { margin-top: 0.5rem; }
.col-img img { width: 85%; margin: 0 auto; border-radius: 10px; display: block; border: 1px solid var(--border-y); }
.gallery img { width: 100%; border-radius: 10px; display: block; border: 1px solid var(--border-y); }
.clients-list { list-style: none; margin: 1.5rem 0; }
.clients-list li { color: var(--ink); margin-bottom: 0.75rem; }
.clients-list i { color: var(--yellow-strong); margin-right: 0.5rem; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.gallery-top { grid-column: 1 / -1; height: 220px; object-fit: cover; }
.gallery img:not(.gallery-top) { height: 150px; object-fit: cover; }

/* ===== EQUIPOS (nodos interactivos) ===== */
.energy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 2rem; position: relative; }
.energy-node {
    background: rgba(19,29,51,0.88); border: 1px solid var(--border-y);
    border-radius: 12px; padding: 2rem 1.5rem; text-align: center; cursor: pointer;
    color: var(--text); font-family: inherit;
    transform: scale(1);
    transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s, opacity 0.25s, background 0.25s;
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}
.energy-node:hover { border-color: var(--yellow); transform: translateY(-6px); box-shadow: 0 0 30px rgba(241,196,15,0.15); }
.energy-node.active {
    border-color: var(--yellow); border-width: 2px;
    background: rgba(241,196,15,0.1);
    transform: scale(1.08) translateY(-6px);
    box-shadow: 0 0 40px rgba(241,196,15,0.35);
    z-index: 2; position: relative;
}
.energy-node.dimmed { opacity: 0.5; transform: scale(0.95); }
.energy-node img { width: 80px; height: 80px; object-fit: contain; margin-bottom: 1rem; }
.energy-node.active img { filter: drop-shadow(0 0 10px rgba(241,196,15,0.5)); }
.energy-node h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; line-height: 1.3; }
.energy-node.active h4 { color: var(--yellow); }
.energy-node span { font-size: 0.8rem; color: var(--muted); }

.scope-stage { margin-top: 0; padding-top: 1.5rem; grid-column: 1 / -1; position: relative; animation: slideDown 0.5s ease-out; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); max-height: 0; } to { opacity: 1; transform: translateY(0); max-height: 700px; } }
.scope-connector {
    position: absolute; top: 0; left: var(--arrow-pos, 50%);
    transform: translateX(-50%);
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    color: var(--yellow-strong); font-size: 1.1rem;
    animation: boltPulse 1.2s ease-in-out infinite;
}
@keyframes boltPulse {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.2); }
}
.scope-card {
    background: rgba(26,43,76,0.9); border: 2px solid var(--yellow);
    border-radius: 12px; padding: 2rem; text-align: center; color: var(--text);
    box-shadow: 0 0 30px rgba(241,196,15,0.2);
}
.scope-badge { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; color: var(--yellow); font-weight: 700; font-size: 0.9rem; }
.scope-card h4 { margin: 0.75rem 0 1rem; font-size: 1rem; text-align: center; color: var(--text); }
.scope-card ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.6rem; justify-content: center; }
.scope-card li {
    color: var(--text); font-size: 0.875rem; line-height: 1.5;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.scope-card li i { color: var(--yellow); font-size: 0.7rem; }

/* ===== MARCAS ===== */
.brand-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.75rem; margin-top: 2rem; max-width: 900px; margin-left: auto; margin-right: auto; }
.brand-card {
    background: #ffffff; border: 1px solid rgba(26,35,50,0.08);
    border-radius: 14px; padding: 2.5rem 2rem;
    display: flex; align-items: center; justify-content: center; height: 140px;
    box-shadow: 0 4px 18px rgba(26,35,50,0.06);
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.brand-card:hover {
    border-color: var(--yellow);
    box-shadow: 0 10px 32px rgba(241,196,15,0.25);
    transform: translateY(-6px);
}
.brand-card img {
    max-height: 70px; max-width: 160px; object-fit: contain;
    filter: grayscale(65%) opacity(0.75);
    transition: filter 0.3s;
}
.brand-card:hover img { filter: grayscale(0%) opacity(1); }

/* ===== GALERÍA DE PROYECTOS ===== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2.5rem; }
.filter-btn {
    background: #ffffff; border: 1px solid rgba(26,35,50,0.14); color: var(--ink);
    font-family: inherit; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.03em;
    padding: 0.55rem 1.3rem; border-radius: 20px; cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.filter-btn:hover { border-color: var(--yellow); }
.filter-btn.active { background: var(--grad); color: var(--bg); border-color: transparent; box-shadow: 0 4px 14px rgba(241,196,15,0.35); }

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.proj-card {
    position: relative; border-radius: 10px; overflow: hidden;
    background: var(--bg); aspect-ratio: 4 / 3;
    box-shadow: 0 4px 16px rgba(26,35,50,0.12);
}
.proj-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.proj-card:hover img { transform: scale(1.08); }
.proj-card figcaption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 1.5rem 0.9rem 0.8rem;
    background: linear-gradient(to top, rgba(13,21,38,0.95), transparent);
    color: var(--text); font-size: 0.76rem; line-height: 1.4;
}
.proj-card.filtered-out { display: none; }

/* ===== CUMPLIMIENTO ===== */
.compliance { text-align: center; }
.comp-icon { width: 80px; height: 80px; object-fit: contain; margin: 0 auto 1rem; display: block; }
.card-label { color: var(--yellow); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; margin-bottom: 0.6rem; }
.norm-tag { margin-top: 1rem; display: inline-block; background: rgba(241,196,15,0.12); color: var(--yellow); font-size: 0.72rem; padding: 0.3rem 0.8rem; border-radius: 20px; }
.repse-actions { margin-top: 1rem; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.repse-btn { background: var(--grad); color: #0d1526; font-weight: 700; font-size: 0.8rem; padding: 0.5rem 1rem; border-radius: 4px; text-decoration: none; }
.repse-qr { width: 90px; border-radius: 6px; }
.dc3-list { list-style: none; text-align: left; margin-top: 0.5rem; }
.dc3-list li { color: var(--muted); font-size: 0.82rem; margin-bottom: 0.4rem; }
.dc3-list i { color: var(--yellow); margin-right: 0.4rem; }

/* ===== CONTACTO ===== */
.contact-list { list-style: none; margin-top: 1.5rem; }
.contact-list li { color: var(--ink); margin-bottom: 0.9rem; display: flex; align-items: center; gap: 0.75rem; }
.contact-list i { color: var(--yellow-strong); width: 18px; text-align: center; }
.contact-list a { color: var(--ink); text-decoration: none; }
.contact-list a:hover { color: var(--yellow-strong); }
.contact-list .urgent { color: var(--yellow-strong); font-weight: 700; }
.form-card { background: rgba(19,29,51,0.9); border: 1px solid var(--border-y); border-radius: 12px; padding: 2rem; color: var(--text); }
.form-card h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 0.4rem; color: var(--text); }
.form-sub { color: var(--muted); font-size: 0.85rem; margin-bottom: 1.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-card input, .form-card select, .form-card textarea {
    width: 100%; margin-bottom: 0.75rem; padding: 0.75rem;
    background: var(--bg); border: 1px solid var(--border-y); border-radius: 6px;
    color: var(--text); font-family: inherit; font-size: 0.875rem;
}
.form-card input:focus, .form-card select:focus, .form-card textarea:focus { outline: none; border-color: var(--yellow); }
.btn-primary.full { width: 100%; justify-content: center; border: none; cursor: pointer; }

/* ===== FOOTER ===== */
footer {
    border-top: 1px solid var(--border-y); padding: 4rem 2rem 2rem; text-align: center;
    font-size: 0.82rem; color: var(--muted); background: rgba(13,21,38,0.8);
}
.footer-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr; align-items: center; justify-content: center; gap: 3rem; margin-bottom: 2rem; }
.footer-logo { height: 60px; }
.footer-info { text-align: left; display: flex; flex-direction: column; gap: 0.8rem; }
.footer-info p { margin-bottom: 0; line-height: 1.6; }
.footer-info i { color: var(--yellow); margin-right: 0.6rem; }
.footer-info a { color: var(--text); text-decoration: none; transition: color 0.2s; }
.footer-info a:hover { color: var(--yellow); }
.footer-copy { font-size: 0.72rem; opacity: 0.7; padding-top: 1.5rem; border-top: 1px solid var(--border-y); }

/* ===== REVEALS ===== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .stats-inner { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr; gap: 2.5rem; }
    .energy-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}
@media (max-width: 700px) {
    .nav-links {
        position: fixed; top: 72px; right: 0; width: 100%; height: calc(100vh - 72px);
        background: var(--bg); flex-direction: column;
        align-items: center; justify-content: center; gap: 2rem;
        transform: translateX(100%); transition: transform 0.3s ease;
    }
    .nav-links.nav-active { transform: translateX(0); }
    .burger { display: flex; }
    .hero { flex-direction: column-reverse; text-align: center; padding: 110px 8% 60px; gap: 1rem; }
    .hero-eyebrow, .cta-group { justify-content: center; }
    .bolt-stage { width: 200px; height: 300px; }
    .page-header { padding: 100px 8% 2.5rem; }
    .section { padding-left: 8%; padding-right: 8%; }
    .cards { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .energy-grid { grid-template-columns: 1fr; gap: 1rem; }
    .brand-row { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
    .footer-info { text-align: center; }
}
