/* ==========================================================================
   Intelec Ltda. — Electrodo de grafito
   Paleta: fondo #0A0B0D · panel #0C0D0F · texto #EDEDE9
           ámbar #F5B301 · bronce #B87333 · WhatsApp #25D366
   ========================================================================== */

:root {
  --bg: #0A0B0D;
  --panel: #0C0D0F;
  --txt: #EDEDE9;
  --amber: #F5B301;
  --bronze: #B87333;
  --wa: #25D366;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--amber); }
a:hover { color: #ffc93a; }
img { max-width: 100%; }
::selection { background: rgba(245, 179, 1, .28); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* --------------------------------------------------------------- animaciones */
@keyframes halo   { 0%,100% { opacity:.30; transform:scale(1) }  50% { opacity:.68; transform:scale(1.07) } }
@keyframes drift  { 0%,100% { transform:translate3d(0,0,0) }     50% { transform:translate3d(0,-16px,0) } }
@keyframes marquee{ from { transform:translateX(0) }             to  { transform:translateX(-50%) } }
@keyframes rise   { from { opacity:0; transform:translateY(30px) } to { opacity:1; transform:none } }
@keyframes pop    { 0%,100% { box-shadow:0 8px 30px rgba(37,211,102,.30) } 50% { box-shadow:0 8px 44px rgba(37,211,102,.55) } }

/* halo y pop son infinitas: corren mientras el elemento exista, aunque el
   usuario esté tres pantallas más abajo. app.js pone y quita esta clase con un
   único IntersectionObserver para congelarlas fuera de pantalla.

   El !important no es opcional: los halos y los CTA llevan la animación en el
   atributo style, y el shorthand inline `animation:` fija play-state en running
   con más peso que cualquier regla de hoja. */
.anim-paused { animation-play-state: paused !important; }

[data-reveal] { opacity: 1; }
@supports (animation-timeline: view()) {
  [data-reveal] {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 22%;
  }
}

/* ------------------------------------------------------------ grano de fondo */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ WhatsApp */
.wa { position: relative; overflow: hidden; isolation: isolate; }
.wa::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #1CA84F;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .32s cubic-bezier(.22,.7,.3,1);
  z-index: -1;
}
.wa:hover::before,
.wa:focus-visible::before { transform: scaleX(1); }

/* ----------------------------------------------------------------- navegación */
.nav-l {
  position: relative;
  padding: 7px 10px;
  border-radius: 5px;
  transition: color .28s ease, background .28s ease, box-shadow .28s ease, text-shadow .28s ease;
}
.nav-l::after {
  content: '';
  position: absolute;
  left: 10px; right: 10px; bottom: 2px;
  height: 1px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .3s cubic-bezier(.22,.7,.3,1);
}
.nav-l:hover { color: var(--amber); }
.nav-l:hover::after { transform: scaleX(1); }
.nav-l[data-active="1"] {
  color: var(--amber);
  background: rgba(245,179,1,.10);
  box-shadow: 0 0 0 1px rgba(245,179,1,.28), 0 0 18px rgba(245,179,1,.22);
  text-shadow: 0 0 12px rgba(245,179,1,.45);
}
.nav-l[data-active="1"]::after { transform: scaleX(1); }

/* ---------------------------------------------------------- costuras/secciones */
.seam { position: absolute; left: 0; right: 0; top: 0; height: 88px; pointer-events: none; z-index: 3; }
.seam-line {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,179,1,.22) 18%, rgba(245,179,1,.22) 82%, transparent);
}

.card-hover { transition: transform .4s cubic-bezier(.2,.7,.3,1), border-color .4s ease; }
.card-hover:hover { transform: translateY(-6px); }
.card-hover.bordered:hover { border-color: rgba(245,179,1,.45); }

/* ==========================================================================
   MOVING DOT CARD — cifras que suben (bajo el hero)
   ========================================================================== */
.stats-band {
  position: relative;
  z-index: 2;
  background: var(--panel);
  border-top: 1px solid rgba(245,179,1,.22);
  border-bottom: 1px solid rgba(237,237,233,.08);
}
.stats-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(34px,5vw,56px) 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.dot-outer {
  position: relative;
  width: 100%;
  height: 176px;
  border-radius: 12px;
  padding: 1px;
  background: radial-gradient(circle 220px at 0% 0%, rgba(245,179,1,.55), #17181b 70%);
}

.dot-outer .dot {
  position: absolute;
  top: 10%;
  right: 10%;
  width: 5px;
  height: 5px;
  border-radius: 100px;
  background: var(--amber);
  box-shadow: 0 0 12px 2px var(--amber);
  z-index: 3;
  animation: moveDot 6s linear infinite;
}

@keyframes moveDot {
  0%, 100% { top: 10%;                  right: 10%; }
  25%      { top: 10%;                  right: calc(100% - 35px); }
  50%      { top: calc(100% - 30px);    right: calc(100% - 35px); }
  75%      { top: calc(100% - 30px);    right: 10%; }
}

.dot-card {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 11px;
  border: 1px solid rgba(237,237,233,.07);
  background: radial-gradient(circle 260px at 0% 0%, #1b1c20, #0A0B0D 72%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(20px, 3vw, 30px);
}

.dot-card .ray {
  position: absolute;
  top: -10%;
  left: -6%;
  width: 220px;
  height: 45px;
  border-radius: 100px;
  background: var(--amber);
  opacity: .16;
  box-shadow: 0 0 50px var(--amber);
  filter: blur(12px);
  transform-origin: 10%;
  transform: rotate(40deg);
  pointer-events: none;
}

.dot-card .value {
  position: relative;
  font-family: var(--mono);
  font-size: clamp(34px, 5.2vw, 48px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}
.dot-card .label {
  position: relative;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(237,237,233,.55);
}

.dot-card .line { position: absolute; background: rgba(237,237,233,.06); }
.dot-card .topl    { top: 10%;    left: 0;  width: 100%; height: 1px; }
.dot-card .bottoml { bottom: 10%; left: 0;  width: 100%; height: 1px; }
.dot-card .leftl   { left: 10%;   top: 0;   width: 1px;  height: 100%; }
.dot-card .rightl  { right: 10%;  top: 0;   width: 1px;  height: 100%; }

/* ==========================================================================
   ANIMATED GLOW CARD — la caja que sobresale (Especificación)
   Una luz ámbar recorre el perímetro: cada borde se enciende en su cuarto
   del ciclo. El filtro SVG #unopaq multiplica el alfa del rastro difuminado
   para que el resplandor se lea sobre el fondo negro.
   ========================================================================== */
.card-canvas { position: relative; }

.card-backdrop {
  position: absolute;
  inset: -60px;
  border-radius: 40px;
  background: radial-gradient(ellipse at 50% 50%, rgba(245,179,1,.10), transparent 68%);
  filter: blur(28px);
  pointer-events: none;
}

.glow-card {
  position: relative;
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(0,0,0,.72);
  transform-origin: center top;
  will-change: transform;
}
.glow-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(245,179,1,.16);
  pointer-events: none;
  z-index: 2;
}

.glow-card .card-content { position: relative; z-index: 1; padding: clamp(26px, 4vw, 56px); }

/* --- pistas del perímetro --- */
.border-element { position: absolute; pointer-events: none; z-index: 3; }
.border-top,
.border-bottom { left: 0; right: 0; height: 1px; }
.border-top    { top: 0; }
.border-bottom { bottom: 0; }
.border-left,
.border-right  { top: 0; bottom: 0; width: 1px; }
.border-left   { left: 0; }
.border-right  { right: 0; }

/* trazo nítido (::before) + resplandor difuminado (::after) */
.border-element::before,
.border-element::after {
  content: '';
  position: absolute;
  border-radius: 3px;
}
.border-element::after {
  filter: blur(5px) url(#unopaq);
  opacity: .9;
}

.border-top::before,
.border-bottom::before,
.border-top::after,
.border-bottom::after {
  top: 50%;
  width: 25%;
  height: 2px;
  margin-top: -1px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
}
.border-top::after,
.border-bottom::after { height: 4px; margin-top: -2px; }

.border-left::before,
.border-right::before,
.border-left::after,
.border-right::after {
  left: 50%;
  height: 25%;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(180deg, transparent, var(--amber), transparent);
}
.border-left::after,
.border-right::after { width: 4px; margin-left: -2px; }

/* recorrido: 8s en total, cada borde ocupa su cuarto */
.border-top::before,    .border-top::after    { animation: chase-x  8s linear infinite; }
.border-right::before,  .border-right::after  { animation: chase-y  8s linear infinite; animation-delay: 2s; }
.border-bottom::before, .border-bottom::after { animation: chase-xr 8s linear infinite; animation-delay: 4s; }
.border-left::before,   .border-left::after   { animation: chase-yr 8s linear infinite; animation-delay: 6s; }

@keyframes chase-x {
  0%   { transform: translateX(-100%); opacity: 0 }
  2%   { opacity: 1 }
  23%  { opacity: 1 }
  25%  { transform: translateX(400%);  opacity: 0 }
  100% { transform: translateX(400%);  opacity: 0 }
}
@keyframes chase-xr {
  0%   { transform: translateX(400%);  opacity: 0 }
  2%   { opacity: 1 }
  23%  { opacity: 1 }
  25%  { transform: translateX(-100%); opacity: 0 }
  100% { transform: translateX(-100%); opacity: 0 }
}
@keyframes chase-y {
  0%   { transform: translateY(-100%); opacity: 0 }
  2%   { opacity: 1 }
  23%  { opacity: 1 }
  25%  { transform: translateY(400%);  opacity: 0 }
  100% { transform: translateY(400%);  opacity: 0 }
}
@keyframes chase-yr {
  0%   { transform: translateY(400%);  opacity: 0 }
  2%   { opacity: 1 }
  23%  { opacity: 1 }
  25%  { transform: translateY(-100%); opacity: 0 }
  100% { transform: translateY(-100%); opacity: 0 }
}

/* ------------------------------------------------------------ ficha técnica */
.spec-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(237,237,233,.09);
}
.spec-key {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(237,237,233,.45);
}
.spec-val { font-family: var(--mono); font-size: 15px; color: var(--txt); text-align: right; }

/* ------------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
  .wa::before, .nav-l, .nav-l::after { transition: none; }
  [data-reveal] { animation: none !important; }
  .dot-outer .dot,
  .border-element::before,
  .border-element::after { animation: none; }
  .border-element::after { opacity: 0; }
  .dot-outer .dot { display: none; }
}
