/* ============================================================
   FASE — Electricista autorizado · Proyecto de muestra
   Nivel 1 · Presencia. Hoja de estilos única, sin dependencias.
   ============================================================ */

/* ---------- 1. TOKENS ---------- */
:root {
  --bg:        #0C0E11;
  --bg-2:      #12151A;
  --bg-3:      #171B21;
  --panel:     #1B2028;

  --fg:        #EEF2F7;
  --fg-2:      #BCC5D1;
  --fg-mute:   #8A94A2;
  --fg-faint:  #5C6572;

  --amber:     #FFC531;
  --amber-2:   #FFA51F;
  --amber-soft:#FFE9A8;

  --line:      rgba(238, 242, 247, .12);
  --line-soft: rgba(238, 242, 247, .06);

  --ff-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ff-body:    "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ff-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1180px;
  --pad: clamp(1.15rem, 4vw, 2.5rem);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --nav-h: 68px;
  --r: 14px;
}

/* ---------- 2. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 14px);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ff-body);
  font-size: clamp(1rem, .96rem + .2vw, 1.06rem);
  line-height: 1.62;
  letter-spacing: -.008em;
  -webkit-font-smoothing: antialiased;
}

img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p, figure, dl, dd, ul, ol { margin: 0; }
ul, ol { list-style: none; padding: 0; }

::selection { background: var(--amber); color: #10130F; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--amber); color: #10130F;
  padding: .8rem 1.2rem; font-weight: 600;
}
.skip:focus { left: 0; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ---------- 3. TIPOGRAFÍA ---------- */
.kicker {
  font-family: var(--ff-mono);
  font-size: .705rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: .7rem;
}
.kicker::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--amber);
  flex: none;
  box-shadow: 0 0 12px var(--amber);
}
.kicker-light { color: var(--amber-soft); }

.hero-title, .h2 {
  font-family: var(--ff-display);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: .97;
  text-wrap: balance;
}
.hero-title em, .h2 em { font-style: normal; color: var(--amber); }
.hero-title { font-size: clamp(2.9rem, 1.5rem + 5.6vw, 5.4rem); }
.h2 { font-size: clamp(2.05rem, 1.2rem + 3.2vw, 3.3rem); }

h3 {
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.28;
}

.h2 + .lead, [data-split] + .lead { margin-top: 1.45rem; }
.lead {
  font-size: clamp(1.04rem, 1rem + .35vw, 1.16rem);
  color: var(--fg-2);
  max-width: 54ch;
}

.sec-head { max-width: 60ch; margin-bottom: clamp(2.2rem, 4.5vw, 3.4rem); }

/* ---------- 4. BOTONES ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .8rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: .93rem;
  letter-spacing: -.01em;
  cursor: pointer;
  position: relative;
  isolation: isolate;
  transition: transform .35s var(--ease), background-color .3s, color .3s, border-color .3s, box-shadow .35s var(--ease);
}
.btn svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.btn-primary {
  background: var(--amber);
  color: #12140F;
  box-shadow: 0 10px 30px -14px rgba(255, 197, 49, .8);
}
.btn-primary svg { fill: currentColor; stroke: none; }
.btn-primary:hover {
  background: var(--amber-2);
  transform: translateY(-2px);
  box-shadow: 0 16px 38px -14px rgba(255, 197, 49, .95);
}
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); transform: translateY(-2px); }
.btn-sm { padding: .58rem 1.05rem; font-size: .85rem; }
.btn-lg { padding: 1rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------- 5. FONDO TÉCNICO ---------- */
.grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 78%);
  pointer-events: none;
}
.grid-bg-soft { opacity: .55; }

/* ---------- 6. NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 90;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(12, 14, 17, .72);
  border-bottom: 1px solid transparent;
  transition: background .35s, border-color .35s, backdrop-filter .35s;
}
.nav.is-stuck {
  background: rgba(12, 14, 17, .88);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--line-soft);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: .68rem; }
.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--amber);
  flex: none;
}
.brand-mark svg { width: 19px; height: 19px; fill: #12140F; }
.brand-text strong {
  display: block;
  font-size: 1.06rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.05;
}
.brand-text em {
  display: block;
  font-family: var(--ff-mono);
  font-style: normal;
  font-size: .655rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-top: .18rem;
}

.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-right .btn { white-space: nowrap; }
@media (max-width: 460px) {
  .nav-right .btn { padding: .55rem .85rem; font-size: .78rem; }
  .brand-text em { font-size: .52rem; letter-spacing: .06em; white-space: nowrap; }
  .brand-mark { width: 32px; height: 32px; }
}
.estado {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--ff-mono);
  font-size: .72rem;
  color: var(--fg-2);
  padding: .38rem .8rem .38rem .65rem;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, .025);
}
.estado-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ADE80; flex: none;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, .55);
  animation: latido 2.6s infinite;
}
@keyframes latido {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, .5); }
  70%  { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
@media (max-width: 720px) { .estado { display: none; } }

/* ---------- 7. HERO ---------- */
.hero {
  position: relative;
  padding: clamp(2.6rem, 6vw, 5rem) 0 clamp(2.6rem, 5vw, 4.2rem);
  overflow: clip;
}
.hero-glow {
  position: absolute;
  top: -18%; right: -8%;
  width: min(760px, 78vw); aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255, 197, 49, .17), transparent 62%);
  filter: blur(18px);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  gap: clamp(2.2rem, 5vw, 4rem);
  align-items: center;
}
@media (min-width: 940px) {
  .hero-inner { grid-template-columns: 1.08fr .92fr; }
}

.hero-sub {
  margin-top: 1.5rem;
  font-size: clamp(1.03rem, 1rem + .4vw, 1.18rem);
  color: var(--fg-2);
  max-width: 46ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.hero-line {
  position: relative;
  height: 1px;
  margin: 2.6rem 0 1.6rem;
  background: linear-gradient(90deg, var(--line), transparent);
  overflow: visible;
}
.hero-line-pulse {
  position: absolute; top: -2px; left: 0;
  width: 64px; height: 5px; border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--amber));
  box-shadow: 0 0 18px 2px rgba(255, 197, 49, .55);
  animation: corriente 4.4s cubic-bezier(.5, 0, .5, 1) infinite;
}
@keyframes corriente {
  0%   { transform: translateX(-70px); opacity: 0; }
  12%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translateX(calc(100% + 100vw)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-line-pulse, .estado-dot { animation: none; }
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.8rem, 2.5vw, 1.8rem);
}
.hero-facts li { display: flex; flex-direction: column; gap: .28rem; }
.hero-facts strong {
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -.045em;
  color: var(--amber);
  line-height: 1;
}
.hero-facts span {
  font-size: .8rem;
  color: var(--fg-mute);
  line-height: 1.35;
}
.hero-facts em {
  font-family: var(--ff-mono);
  font-style: normal;
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* Figura */
.frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--r);
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
}
.frame::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(12, 14, 17, .55));
  pointer-events: none;
}
.frame img { width: 100%; height: 100%; object-fit: cover; }

.hero-figure { position: relative; }
@media (min-width: 940px) {
  .hero-figure .frame { aspect-ratio: 4 / 4.6; }
  .hero-figure .frame img { height: 100%; }
}
.hero-figure .frame { transform: perspective(1400px) rotateY(-3.5deg) rotateX(1.4deg); box-shadow: -22px 34px 70px -34px rgba(0, 0, 0, .9); }
.hero-figure figcaption {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-top: 1rem;
  font-family: var(--ff-mono);
  font-size: .72rem;
  color: var(--fg-mute);
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); flex: none; }

/* ---------- 8. SECCIONES ---------- */
.section { padding: clamp(3.4rem, 8vw, 6.5rem) 0; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--line-soft); }

/* Servicios */
.servicios { display: grid; gap: 0; border-top: 1px solid var(--line-soft); }
.srv {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: clamp(1rem, 3vw, 2.4rem);
  align-items: start;
  padding: clamp(1.5rem, 3.4vw, 2.3rem) 0;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  transition: background .4s var(--ease);
}
.srv::before {
  content: "";
  position: absolute; left: calc(var(--pad) * -1); right: calc(var(--pad) * -1);
  top: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(255, 197, 49, .07), transparent 60%);
  opacity: 0;
  transition: opacity .4s var(--ease);
  pointer-events: none;
}
.srv:hover::before { opacity: 1; }
.srv-n {
  font-family: var(--ff-mono);
  font-size: .76rem;
  color: var(--amber);
  padding-top: .3rem;
  letter-spacing: .06em;
}
.srv p { margin-top: .5rem; color: var(--fg-mute); max-width: 62ch; font-size: .97rem; }
.srv-ico {
  width: 28px; height: 28px;
  fill: none; stroke: var(--fg-faint);
  stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke .4s var(--ease), transform .5s var(--ease);
}
.srv:hover .srv-ico { stroke: var(--amber); transform: translateX(4px); }
@media (max-width: 640px) { .srv-ico { display: none; } }

/* Perfil */
.perfil {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
@media (min-width: 900px) { .perfil { grid-template-columns: .8fr 1.2fr; } }
.perfil-foto .frame { max-width: 420px; }

.datos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem 1.2rem;
  margin-top: 2.4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line-soft);
}
.datos dt {
  font-family: var(--ff-mono);
  font-size: .655rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: .45rem;
}
.datos dd { color: var(--fg-2); font-size: .93rem; line-height: 1.5; }

/* ---------- 9. CTA / FORMULARIO ---------- */
.cta {
  position: relative;
  padding: clamp(3.4rem, 8vw, 6.5rem) 0;
  background: var(--bg-3);
  border-top: 1px solid var(--line-soft);
  overflow: clip;
}
.cta-inner {
  position: relative;
  display: grid;
  gap: clamp(2.2rem, 5vw, 4rem);
  align-items: start;
}
@media (min-width: 940px) { .cta-inner { grid-template-columns: 1fr .95fr; } }
.cta-lead { margin-top: 1.4rem; color: var(--fg-2); max-width: 46ch; }

.cta-directo { display: grid; gap: .8rem; margin-top: 2.2rem; }
.cta-tel {
  display: flex; align-items: center; gap: .9rem;
  padding: .9rem 1.1rem;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, .02);
}
.cta-tel svg {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: var(--amber); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.cta-tel em {
  display: block; font-style: normal;
  font-family: var(--ff-mono);
  font-size: .64rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--fg-faint);
}
.cta-tel strong { font-weight: 500; font-size: .95rem; color: var(--fg-2); }

.form {
  display: grid;
  gap: 1rem;
  padding: clamp(1.5rem, 3.4vw, 2.2rem) clamp(1.4rem, 3.4vw, 2.1rem) clamp(1.7rem, 3.6vw, 2.3rem);
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, .9);
}
.field { display: block; }
.field > span {
  display: block;
  font-family: var(--ff-mono);
  font-size: .66rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: .45rem;
}
.field input, .field textarea {
  width: 100%;
  padding: .82rem .95rem;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--fg);
  transition: border-color .25s, background .25s, box-shadow .25s;
  font-size: .97rem;
}
.field textarea { resize: vertical; min-height: 92px; }
.field input::placeholder, .field textarea::placeholder { color: var(--fg-faint); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--amber);
  background: rgba(255, 197, 49, .05);
  box-shadow: 0 0 0 3px rgba(255, 197, 49, .13);
}
.field.is-error input, .field.is-error textarea { border-color: #F87171; }

.check { display: flex; gap: .65rem; align-items: flex-start; font-size: .84rem; color: var(--fg-mute); }
.check input { margin-top: .22rem; accent-color: var(--amber); width: 16px; height: 16px; flex: none; }
.check a { color: var(--fg-2); text-decoration: underline; text-underline-offset: 3px; }
.check.is-error span { color: #F87171; }

.form-note {
  font-family: var(--ff-mono);
  font-size: .7rem;
  color: var(--fg-faint);
  text-align: center;
}
.form-note.is-ok { color: #4ADE80; }
.form-note.is-error { color: #F87171; }

.btn-check { width: 0; opacity: 0; transition: width .3s, opacity .3s; }
.form.is-sent .btn-check { width: 18px; opacity: 1; }
.form.is-sending .btn-primary { opacity: .7; pointer-events: none; }

/* ---------- 10. FOOTER ---------- */
.foot { padding: clamp(2.4rem, 5vw, 3.6rem) 0 calc(1.6rem + env(safe-area-inset-bottom)); background: var(--bg); }
.foot-inner {
  display: flex; flex-wrap: wrap; gap: 1.6rem;
  justify-content: space-between; align-items: center;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--line-soft);
}
.foot-brand { display: flex; align-items: center; gap: .75rem; }
.foot-brand p { font-size: .86rem; color: var(--fg-mute); line-height: 1.35; }
.foot-brand strong { color: var(--fg); font-size: 1rem; letter-spacing: -.02em; }
.foot-legal { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: .82rem; color: var(--fg-mute); }
.foot-legal a:hover { color: var(--amber); }
.foot-bottom {
  display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between;
  margin-top: 1.4rem;
  font-family: var(--ff-mono);
  font-size: .68rem;
  color: var(--fg-faint);
}

/* ---------- 11. DOCK MÓVIL ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 88;
  display: none;
  gap: .55rem;
  padding: .6rem var(--pad) calc(.6rem + env(safe-area-inset-bottom));
  background: rgba(12, 14, 17, .93);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line-soft);
}
.dock-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .75rem;
  border-radius: 11px;
  font-size: .87rem; font-weight: 600;
  background: rgba(255, 255, 255, .05);
  color: var(--fg);
}
.dock-btn svg { width: 17px; height: 17px; fill: currentColor; }
.dock-btn-primary { background: var(--amber); color: #12140F; }
@media (max-width: 760px) {
  .dock { display: flex; }
  body { padding-bottom: 66px; }
}

/* ---------- 12. REVEALS ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Las palabras sólo existen si el JS ha corrido: si falla, el titular
   se queda tal cual estaba en el HTML y se lee igual. */
.split-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(.55em) rotate(1.5deg);
}
[data-split].is-visible .split-word {
  animation: aparece .72s var(--ease) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes aparece { to { opacity: 1; transform: none; } }

/* Red de seguridad: navegador sin JavaScript */
@media (scripting: none) {
  .reveal { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .split-word { animation: none !important; opacity: 1 !important; transform: none !important; }
  .hero-figure .frame { transform: none; }
}
