/* ============ Variables ============ */
:root {
  --bg: #0a0f1c;
  --bg-alt: #0e1530;
  --card: #131c3a;
  --line: #22305c;
  --text: #e8ecf5;
  --muted: #9aa6c0;
  --yellow: #ffc933;
  --yellow-d: #e0a800;
  --blue: #3ea6ff;
  --gut: clamp(28px, 6vw, 70px);
  --radius: 16px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .7);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .6em; font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.container { width: min(1100px, 100% - 2 * var(--gut)); margin-inline: auto; }
.hl { color: var(--yellow); }
.eyebrow {
  text-transform: uppercase; letter-spacing: .18em; font-size: .78rem;
  color: var(--yellow); font-weight: 700; margin-bottom: 1rem;
}
.lead { color: var(--muted); font-size: 1.1rem; max-width: 56ch; }
.lead--center { margin-inline: auto; text-align: center; }

.section { padding: clamp(70px, 10vw, 130px) 0; position: relative; }
.section--alt { background: linear-gradient(180deg, var(--bg-alt), var(--bg)); }
.section h2 + .lead, .section h2 + .cards, .section h2 + .steps { margin-top: 2rem; }
#trabajos h2, #trabajos .eyebrow { text-align: center; }

/* ============ Botones ============ */
.btn {
  display: inline-block; padding: .9rem 1.6rem; border-radius: 999px;
  background: var(--yellow); color: #14110a; font-weight: 700; text-decoration: none;
  border: 2px solid var(--yellow); cursor: pointer; font-size: 1rem; font-family: inherit;
  transition: transform .2s, box-shadow .2s, background .2s;
  box-shadow: 0 0 0 0 rgba(255, 201, 51, .5);
}
.btn:hover, .btn:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 30px -8px rgba(255, 201, 51, .6); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--yellow); box-shadow: none; }
.btn--small { padding: .5rem 1.1rem; font-size: .9rem; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ============ Cable (scroll) ============ */
.cable { position: absolute; top: 0; left: 0; z-index: 40; pointer-events: none; overflow: visible; }
.cable path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.cable__base { stroke: rgba(255, 255, 255, .06); stroke-width: 5; }
.cable__wire { stroke-width: 5; }
.cable__wire--a { stroke: var(--yellow); filter: drop-shadow(0 0 6px rgba(255, 201, 51, .8)); }
.cable__wire--b { stroke: var(--blue); filter: drop-shadow(0 0 6px rgba(62, 166, 255, .8)); }
.cable__spark { fill: #fff; filter: drop-shadow(0 0 10px var(--yellow)) drop-shadow(0 0 18px var(--yellow)); }

/* ============ Header ============ */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 15, 28, .75); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 1rem; }
.brand img { height: 40px; width: auto; }
.nav { display: flex; align-items: center; gap: 1.8rem; }
.nav a:not(.btn) { text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem; transition: color .2s; }
.nav a:not(.btn):hover { color: var(--yellow); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; transition: transform .3s, opacity .3s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ Hero ============ */
.hero { position: relative; min-height: calc(100vh - 68px); display: flex; align-items: center; padding: 60px 0 90px; overflow: hidden; }
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(62, 166, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 166, 255, .07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 75%);
  animation: grid-move 14s linear infinite;
}
@keyframes grid-move { to { background-position: 48px 48px; } }
.hero__inner { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 2rem; align-items: center; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem; margin: 2rem 0; }
.hero__badges { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; padding: 0; margin: 0; color: var(--muted); font-size: .92rem; }

.bulb { width: 100%; max-width: 420px; margin-inline: auto; display: block; }
.bulb__glow { animation: pulse 3.2s ease-in-out infinite; transform-origin: 200px 170px; }
.bulb__ring { fill: none; stroke: var(--yellow); stroke-opacity: .25; stroke-width: 1.5; stroke-dasharray: 6 10; transform-origin: 200px 170px; }
.bulb__ring--1 { animation: spin 30s linear infinite; }
.bulb__ring--2 { animation: spin 45s linear infinite reverse; stroke: var(--blue); }
.bulb__glass { fill: rgba(255, 201, 51, .12); stroke: var(--yellow); stroke-width: 4; }
.bulb__bolt { fill: var(--yellow); filter: drop-shadow(0 0 12px rgba(255, 201, 51, .9)); animation: flicker 4s infinite; }
.bulb__base { fill: #2a3358; stroke: var(--line); stroke-width: 2; }
.bulb__wire { fill: none; stroke: var(--yellow); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 10 8; animation: flow 1.2s linear infinite; }
@keyframes pulse { 0%, 100% { transform: scale(.92); opacity: .8; } 50% { transform: scale(1.05); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flow { to { stroke-dashoffset: -36; } }
@keyframes flicker { 0%, 92%, 100% { opacity: 1; } 93% { opacity: .4; } 95% { opacity: 1; } 97% { opacity: .6; } }

.scroll-hint { position: absolute; left: 50%; bottom: 24px; width: 26px; height: 42px; border: 2px solid var(--muted); border-radius: 14px; transform: translateX(-50%); }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--yellow); animation: wheel 1.6s ease-in-out infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ============ Cards ============ */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.4rem; }
.card {
  background: linear-gradient(160deg, var(--card), #0e1530);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem;
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
.card:hover { transform: translateY(-6px); border-color: var(--yellow); box-shadow: var(--shadow); }
.card p { color: var(--muted); margin: 0; }
.card__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 201, 51, .12); margin-bottom: 1.1rem; }
.card__icon svg { width: 26px; height: 26px; fill: none; stroke: var(--yellow); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ============ Proceso / muñecos ============ */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.6rem; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.4rem 1.8rem; position: relative; }
.step p { color: var(--muted); margin: 0; }
.step__num { position: absolute; top: 1rem; right: 1.2rem; font-size: 2.4rem; font-weight: 800; color: rgba(255, 201, 51, .18); }
.step__scene { background: radial-gradient(circle at 50% 100%, #1a2650, #0c1226); border-radius: 12px; margin-bottom: 1.2rem; overflow: hidden; }
.step__scene svg { width: 100%; display: block; }

.step__scene .ground { stroke: #33427a; stroke-width: 3; }
.step__scene .ceiling { stroke: #33427a; stroke-width: 3; }
.step__scene .body { stroke: #dfe6f7; stroke-width: 5; stroke-linecap: round; fill: none; }
.step__scene .head { fill: #f2c9a0; stroke: none; }
.step__scene .helmet { fill: var(--yellow); stroke: var(--yellow); stroke-width: 3; stroke-linejoin: round; }
.step__scene .tool { stroke: var(--blue); stroke-width: 4; stroke-linecap: round; }
.step__scene .panel { fill: #2a3358; stroke: #4a5a98; stroke-width: 3; }
.step__scene .panel__door { fill: #1a2244; }
.step__scene .led { fill: #2e8b57; }
.step__scene .breaker { fill: #3a4678; }
.step__scene .ladder { stroke: #8f7a52; stroke-width: 4; stroke-linecap: round; }
.step__scene .cord { stroke: #6e7bb0; stroke-width: 2.5; }
.step__scene .lamp { fill: #cfd6ee; }
.step__scene .lamp__bulb { fill: #fff6c9; }
.step__scene .beam { fill: rgba(255, 201, 51, .12); opacity: 0; }
.step__scene .sparkles path { fill: var(--yellow); opacity: 0; }
.step__scene .wire-draw { fill: none; stroke: var(--yellow); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 260; stroke-dashoffset: 260; }
.step__scene .glow-dot { fill: rgba(255, 201, 51, .35); opacity: 0; }
.step__scene .bulb-s { fill: #3a4678; transition: fill .4s; }
.step__scene .bolt-s { fill: #6e7bb0; }
.step__scene .socket { fill: #6e7bb0; }

/* Animaciones activadas al entrar en pantalla (.in-view) */
.arm--panel { transform-origin: 105px 106px; }
.arm--lamp { transform-origin: 122px 70px; }
.arm--pull { transform-origin: 75px 106px; }

.step.in-view .arm--panel { animation: wiggle 1.1s ease-in-out infinite; }
.step.in-view .led--1 { animation: blink 1.6s infinite; }
.step.in-view .led--2 { animation: blink 1.6s .5s infinite; }
.step.in-view .led--3 { animation: blink 1.6s 1s infinite; fill: #e0a800; }
.step.in-view .sparkles path { animation: spark 1.1s ease-in-out infinite; }

.step.in-view .arm--lamp { animation: reach 2s ease-in-out infinite; }
.step.in-view .beam { animation: beam 2s ease-in-out infinite; }

.step.in-view .wire-draw { animation: draw 3.6s ease-in-out infinite; }
.step.in-view .arm--pull { animation: pull 3.6s ease-in-out infinite; }
.step.in-view .glow-dot { animation: lit 3.6s ease-in-out infinite; }
.step.in-view .bulb-s { animation: bulbOn 3.6s ease-in-out infinite; }
.step.in-view .bolt-s { animation: boltOn 3.6s ease-in-out infinite; }

@keyframes wiggle { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .25; } }
@keyframes spark { 0%, 100% { opacity: 0; transform: scale(.5); } 50% { opacity: 1; transform: scale(1.3) translateY(-4px); } }
@keyframes reach { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(6deg); } }
@keyframes beam { 0%, 40% { opacity: 0; } 60%, 100% { opacity: 1; } }
@keyframes draw { 0% { stroke-dashoffset: 260; } 55%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 260; } }
@keyframes pull { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 50% { transform: rotate(8deg); } }
@keyframes lit { 0%, 55% { opacity: 0; } 65%, 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bulbOn { 0%, 55% { fill: #3a4678; } 65%, 85% { fill: #fff2a8; } 100% { fill: #3a4678; } }
@keyframes boltOn { 0%, 55% { fill: #6e7bb0; } 65%, 85% { fill: var(--yellow); } 100% { fill: #6e7bb0; } }

/* ============ Galería ============ */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.2rem; margin-top: 2.5rem; }
.gallery__item {
  position: relative; padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: zoom-in; background: var(--card); font: inherit; color: inherit; aspect-ratio: 4 / 3;
}
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.gallery__item:hover img, .gallery__item:focus-visible img { transform: scale(1.08); }
.gallery__cap {
  position: absolute; inset: auto 0 0 0; padding: 2.2rem 1rem .9rem; text-align: left; font-weight: 700;
  background: linear-gradient(transparent, rgba(5, 8, 18, .92));
  transform: translateY(40%); opacity: 0; transition: transform .3s, opacity .3s;
}
.gallery__item:hover .gallery__cap, .gallery__item:focus-visible .gallery__cap { transform: none; opacity: 1; }

.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1000px, 94vw); color: var(--text); }
.lightbox::backdrop { background: rgba(3, 6, 14, .92); }
.lightbox img { width: 100%; max-height: 80vh; object-fit: contain; border-radius: 12px; }
.lightbox p { text-align: center; margin: .8rem 0 0; color: var(--muted); }
.lightbox__close {
  position: absolute; top: -14px; right: -6px; width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: var(--yellow); color: #14110a; font-size: 1.8rem; line-height: 1; cursor: pointer; z-index: 2;
}

/* ============ Nosotros ============ */
.about { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.about p:not(.eyebrow) { color: var(--muted); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1rem; text-align: center; }
.stat strong { display: block; font-size: clamp(2rem, 4vw, 2.8rem); color: var(--yellow); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .9rem; }

/* ============ Contacto ============ */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.contact__info > p:not(.eyebrow) { color: var(--muted); }
.contact__list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .9rem; }
.contact__list span { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .14em; color: var(--yellow); }
.contact__list a { text-decoration: none; font-weight: 600; font-size: 1.1rem; }
.contact__list a:hover { color: var(--yellow); }
.form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; display: grid; gap: 1.1rem; }
.form label { display: grid; gap: .4rem; font-weight: 600; font-size: .9rem; }
.form input, .form textarea {
  background: #0b1228; border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem;
  color: var(--text); font: inherit; width: 100%;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 201, 51, .2); }
.form__error { color: #ff8a8a; margin: 0; font-size: .9rem; }
.form__note { color: var(--muted); font-size: .8rem; margin: 0; }

/* ============ Footer ============ */
.footer { border-top: 1px solid var(--line); padding: 2.2rem 0; color: var(--muted); font-size: .9rem; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.footer__inner p { margin: 0; }
.footer a { text-decoration: none; color: var(--yellow); font-weight: 600; }
.footer img { height: 34px; width: auto; }

/* ============ Reveal ============ */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in-view { opacity: 1; transform: none; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .hero__inner, .about, .contact { grid-template-columns: 1fr; }
  .hero__art { order: -1; max-width: 260px; margin-inline: auto; }
  .hero { min-height: auto; }
  .scroll-hint { display: none; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(10, 15, 28, .97); padding: .6rem var(--gut) 1.2rem; border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .8rem 0; }
  .nav .btn { text-align: center; margin-top: .5rem; }
}

/* ============ Accesibilidad: menos movimiento ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .step__scene .wire-draw { stroke-dashoffset: 0; }
  .step__scene .beam, .step__scene .glow-dot { opacity: 1; }
}

/* ============ Testimonios ============ */
.testimonials { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; margin-top: 2rem; }
.testimonial {
  margin: 0; background: linear-gradient(160deg, var(--card), #0e1530); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.8rem; display: flex; flex-direction: column; gap: 1rem; position: relative;
}
.testimonial::before { content: "\201C"; position: absolute; top: .4rem; right: 1.2rem; font-size: 5rem; line-height: 1; color: rgba(255, 201, 51, .15); font-family: Georgia, serif; }
.stars { color: var(--yellow); letter-spacing: .15em; font-size: 1.1rem; }
.testimonial blockquote { margin: 0; color: var(--text); flex: 1; }
.testimonial figcaption { display: flex; align-items: center; gap: .9rem; }
.testimonial figcaption strong { display: block; }
.testimonial figcaption small { color: var(--muted); }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); color: #14110a; font-weight: 800; flex: none; }

/* ============ WhatsApp / Instagram ============ */
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; margin-right: .5rem; }
.btn svg .dot { fill: currentColor; stroke: none; }
.btn--wa { background: #25d366; border-color: #25d366; color: #06210f; }
.btn--wa:hover, .btn--wa:focus-visible { box-shadow: 0 10px 30px -8px rgba(37, 211, 102, .6); }
.btn--insta { background: transparent; border-color: #e1306c; color: var(--text); }
.btn--insta:hover, .btn--insta:focus-visible { background: linear-gradient(45deg, #f09433, #dc2743 50%, #bc1888); border-color: transparent; box-shadow: 0 10px 30px -8px rgba(220, 39, 67, .6); }
.gallery__more { text-align: center; margin-top: 2.5rem; }
.contact__social { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }

.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 58px; height: 58px; border-radius: 50%;
  background: #25d366; color: #06210f; display: grid; place-items: center;
  box-shadow: 0 10px 30px -6px rgba(37, 211, 102, .7); transition: transform .2s;
  animation: wa-pulse 2.4s infinite;
}
.wa-float:hover, .wa-float:focus-visible { transform: scale(1.1); }
.wa-float svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@keyframes wa-pulse { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .55), 0 10px 30px -6px rgba(37, 211, 102, .7); } 70%, 100% { box-shadow: 0 0 0 18px rgba(37, 211, 102, 0), 0 10px 30px -6px rgba(37, 211, 102, .7); } }
