/* ===========================================================
   hackarte.es — hoja de estilos única
   Paleta por tokens. Tema oscuro por defecto, claro opcional.
   =========================================================== */

/* ---------- Tokens ---------- */
:root {
  --violet: #7c5cff;
  --violet-soft: #a08dff;
  --mint: #22d3a7;

  --bg: #080b10;
  --bg-alt: #0c1017;
  --surface: rgba(255, 255, 255, .034);
  --surface-solid: #11161f;
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .17);
  --text: #e9eef5;
  --text-soft: #b4bfcd;
  --text-dim: #7e8a9a;
  --accent: var(--violet-soft);
  --accent-ink: #0a0a12;
  --glow-a: rgba(124, 92, 255, .30);
  --glow-b: rgba(34, 211, 167, .17);
  --grid-line: rgba(255, 255, 255, .028);
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, .85);
  --card-top: rgba(255, 255, 255, .06);

  --max: 1140px;
  --radius: 18px;
  --radius-sm: 11px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.22, .68, .3, 1);
}

:root[data-theme="light"] {
  --bg: #fbfaf9;
  --bg-alt: #f3f1ee;
  --surface: rgba(16, 20, 30, .025);
  --surface-solid: #ffffff;
  --border: rgba(16, 20, 30, .10);
  --border-strong: rgba(16, 20, 30, .20);
  --text: #141821;
  --text-soft: #434d5c;
  --text-dim: #6b7585;
  --accent: #5b3df0;
  --accent-ink: #ffffff;
  --glow-a: rgba(124, 92, 255, .17);
  --glow-b: rgba(34, 211, 167, .13);
  --grid-line: rgba(16, 20, 30, .035);
  --shadow: 0 20px 44px -26px rgba(16, 20, 30, .30);
  --card-top: rgba(16, 20, 30, .03);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}

h1, h2, h3 { line-height: 1.12; letter-spacing: -.022em; margin: 0; font-weight: 700; }
h1 { font-size: clamp(2.5rem, 6.4vw, 4.1rem); font-weight: 800; letter-spacing: -.038em; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); letter-spacing: -.03em; }
h3 { font-size: 1.14rem; letter-spacing: -.012em; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 200;
  background: var(--accent); color: var(--accent-ink);
  padding: .7rem 1.1rem; border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { top: 1rem; }

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

/* ---------- Fondo decorativo ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse 110% 70% at 50% 0%, #000 35%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 110% 70% at 50% 0%, #000 35%, transparent 78%);
}
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(44rem 30rem at 12% -6%, var(--glow-a), transparent 65%),
    radial-gradient(38rem 26rem at 92% 10%, var(--glow-b), transparent 62%);
}

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  padding: .85rem 0;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), padding .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-stuck {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
  padding: .55rem 0;
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; }

/* brand y herramientas por encima del panel desplegable en móvil */
.brand, .header-tools { position: relative; z-index: 2; }

.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; }
.brand-mark { width: 30px; height: 30px; flex: none; color: var(--accent); stroke-width: 1.9; }
.brand-mark rect { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.brand-text { font-size: 1.12rem; letter-spacing: -.035em; }
.brand-dot { color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.site-nav a {
  padding: .5rem .72rem; border-radius: 9px; font-size: .925rem; font-weight: 500;
  color: var(--text-soft); transition: color .2s, background-color .2s;
}
.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a.is-active { color: var(--text); }
.site-nav .nav-cta {
  margin-left: .4rem; color: var(--text);
  border: 1px solid var(--border-strong); font-weight: 600;
}
.site-nav .nav-cta:hover { border-color: var(--accent); color: var(--accent); background: transparent; }

.header-tools { display: flex; align-items: center; gap: .5rem; }

.lang-switch {
  display: inline-flex; padding: 3px; gap: 2px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.lang-switch button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-family: var(--mono); font-size: .72rem; font-weight: 500; letter-spacing: .04em;
  color: var(--text-dim); padding: .3rem .48rem; border-radius: 7px;
  transition: color .2s, background-color .2s;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.icon-btn {
  appearance: none; cursor: pointer; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
  transition: color .2s, border-color .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-sun { display: none; }
:root[data-theme="light"] .icon-sun { display: block; }
:root[data-theme="light"] .icon-moon { display: none; }
.menu-btn { display: none; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .8rem 1.3rem; border-radius: 12px;
  font-weight: 600; font-size: .95rem; letter-spacing: -.005em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .22s var(--ease), background-color .2s, border-color .2s, color .2s;
}
.btn svg { width: 17px; height: 17px; }
.btn-lg { padding: .95rem 1.6rem; font-size: 1rem; }
.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 10px 26px -12px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -12px color-mix(in srgb, var(--accent) 75%, transparent); }
.btn-primary:hover svg:last-child { transform: translateX(3px); }
.btn-primary svg { transition: transform .2s var(--ease); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------- Hero ---------- */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 5vw, 4rem); }
.hero-grid {
  display: grid; grid-template-columns: 1.08fr .92fr;
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--mono); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 1.4rem;
  padding: .4rem .8rem; border: 1px solid var(--border); border-radius: 100px; background: var(--surface);
}
.dot-live {
  width: 6px; height: 6px; border-radius: 50%; background: var(--mint); flex: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--mint) 60%, transparent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mint) 55%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent), var(--mint));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--text-soft);
  max-width: 34rem; margin-top: 1.5rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

/* Terminal */
.terminal {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-solid); box-shadow: var(--shadow);
  overflow: hidden; font-family: var(--mono); font-size: .825rem; line-height: 1.75;
  transform: perspective(1400px) rotateY(-3.5deg) rotateX(1.5deg);
  transition: transform .5s var(--ease);
}
.terminal:hover { transform: perspective(1400px) rotateY(0deg) rotateX(0deg); }
.terminal-bar {
  display: flex; align-items: center; gap: .4rem;
  padding: .65rem .9rem; border-bottom: 1px solid var(--border);
  background: var(--card-top);
}
.tdot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); flex: none; }
.tdot:first-child { background: color-mix(in srgb, #ff5f57 80%, transparent); }
.terminal-title { margin-left: .6rem; font-size: .7rem; color: var(--text-dim); letter-spacing: .02em; }
.terminal-body { padding: 1.1rem 1.2rem 1.3rem; }
.tline { margin: 0 0 .5rem; color: var(--text-soft); }
.tprompt { color: var(--mint); }
.tcmd { color: var(--text); font-weight: 500; }
.tflag { color: var(--accent); }
.tquote {
  color: var(--text-dim); font-style: italic;
  border-left: 2px solid var(--border-strong); padding-left: .8rem; margin: .5rem 0 1.1rem;
}
.tsteps { margin: 0 0 1.1rem; display: grid; gap: .3rem; }
.tsteps li { display: flex; gap: .55rem; color: var(--text-soft); }
.tok { color: var(--mint); flex: none; }
.tresult {
  display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
  padding-top: .9rem; border-top: 1px dashed var(--border-strong);
  color: var(--text-dim); margin: 0;
}
.tarrow { color: var(--accent); }
.tresult strong { color: var(--mint); font-size: 1.15rem; }

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin-top: clamp(3rem, 7vw, 5rem);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--border); overflow: hidden;
}
.stats li {
  background: var(--bg); padding: 1.4rem 1.3rem;
  display: flex; flex-direction: column; gap: .3rem;
}
.stats strong {
  font-size: 1.75rem; font-weight: 800; letter-spacing: -.035em;
  color: var(--accent); line-height: 1;
}
.stats span { font-size: .83rem; color: var(--text-dim); line-height: 1.45; }

/* ---------- Secciones ---------- */
.section { padding: clamp(3.5rem, 9vw, 6.5rem) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }

.section-head { max-width: 42rem; margin-bottom: clamp(2.2rem, 5vw, 3.4rem); }
.kicker {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .85rem;
}
.section-sub { margin-top: 1.1rem; color: var(--text-soft); font-size: 1.04rem; }

/* ---------- Servicios ---------- */
/* Destacada a lo ancho, y los otros cuatro servicios en 2x2. */
.services { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
.service {
  position: relative; padding: 1.8rem 1.7rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-solid);
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.service:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.service-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--accent); margin-bottom: 1.1rem;
}
.service-icon svg { width: 21px; height: 21px; }
.service h3 { margin-bottom: .7rem; }
.service > p { color: var(--text-soft); font-size: .95rem; margin-bottom: 1.2rem; }


/* ---------- Proceso ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; counter-reset: s; }
.steps li {
  position: relative; padding: 1.7rem 1.5rem 1.6rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.steps li::after {
  content: ""; position: absolute; top: 2.55rem; right: -1.1rem; width: 1.1rem;
  border-top: 1px dashed var(--border-strong);
}
.steps li:last-child::after { display: none; }
.step-n {
  display: inline-block; font-family: var(--mono); font-size: .78rem; font-weight: 500;
  color: var(--accent); margin-bottom: .95rem;
  padding: .22rem .5rem; border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.steps h3 { margin-bottom: .55rem; }
.steps p { color: var(--text-soft); font-size: .92rem; }

/* ---------- CTA ---------- */
.cta-section { padding-bottom: clamp(4rem, 10vw, 7rem); }
.cta-box {
  position: relative; overflow: hidden;
  padding: clamp(2.4rem, 6vw, 4rem) clamp(1.6rem, 5vw, 3.4rem);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: calc(var(--radius) + 8px);
  background:
    radial-gradient(34rem 20rem at 15% 0%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 70%),
    radial-gradient(30rem 18rem at 95% 100%, var(--glow-b), transparent 68%),
    var(--surface-solid);
  text-align: center;
}
.cta-box .kicker, .cta-box h2 { position: relative; }
.cta-lede {
  max-width: 36rem; margin: 1.2rem auto 0; color: var(--text-soft);
  font-size: 1.06rem; position: relative;
}
.cta-actions {
  display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center;
  margin-top: 2.1rem; position: relative;
}
#mailLabel { font-family: var(--mono); font-size: .95rem; letter-spacing: -.01em; }
.cta-foot { margin-top: 1.6rem; font-size: .88rem; color: var(--text-dim); position: relative; }

/* ---------- Pie ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 2.2rem 0; background: var(--bg-alt); }
.footer-inner { font-size: .88rem; color: var(--text-dim); text-align: center; }

/* ---------- Animación de entrada ---------- */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .65s var(--ease), transform .65s var(--ease);
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 36rem; }
  .terminal { transform: none; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .steps li:nth-child(2)::after { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .menu-btn { display: grid; }
  .site-nav {
    position: fixed; inset: 0 0 auto; top: 0;
    flex-direction: column; align-items: stretch; gap: .25rem;
    padding: 5rem 1.2rem 1.6rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    transform: translateY(-102%);
    transition: transform .36s var(--ease);
    box-shadow: var(--shadow);
  }
  .site-nav.is-open { transform: translateY(0); }
  .site-nav a { padding: .8rem .9rem; font-size: 1.02rem; }
  .site-nav .nav-cta { margin: .5rem 0 0; text-align: center; }
  .header-tools { margin-left: auto; }
  .services, .steps { grid-template-columns: 1fr; }
  .steps li::after { display: none; }
  .stats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .terminal { transform: none; }
}

@media print {
  .site-header, .bg-grid, .bg-glow, .hero-actions, .cta-actions { display: none; }
  body { background: #fff; color: #000; }
}
