/* ============================================================
   filocode.es — Sistema visual
   "El filo del código" · tech oscuro premium
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Manrope:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Color — fondo casi negro azulado */
  --bg:        oklch(0.15 0.014 265);
  --bg-2:      oklch(0.18 0.018 265);
  --surface:   oklch(0.21 0.020 265);
  --surface-2: oklch(0.25 0.022 265);
  --text:      oklch(0.97 0.006 265);
  --muted:     oklch(0.72 0.02 265);
  --faint:     oklch(0.55 0.02 265);
  --line:      oklch(0.30 0.02 265 / 0.7);
  --line-soft: oklch(0.40 0.02 265 / 0.35);

  /* Acentos — misma L/C, varía el tono (degradado eléctrico) */
  --c1: oklch(0.70 0.21 292);   /* violeta */
  --c2: oklch(0.72 0.19 248);   /* azul */
  --c3: oklch(0.78 0.16 196);   /* turquesa */

  --grad: linear-gradient(118deg, var(--c1), var(--c2) 52%, var(--c3));
  --grad-soft: linear-gradient(118deg, oklch(0.70 0.21 292 / 0.18), oklch(0.78 0.16 196 / 0.18));

  --glow-c1: oklch(0.70 0.21 292 / 0.55);
  --glow-c3: oklch(0.78 0.16 196 / 0.45);

  --maxw: 1200px;
  --radius: 18px;
  --radius-lg: 28px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: 'Manrope', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}
@media (hover: none), (pointer: coarse) { body { cursor: auto; } }

::selection { background: oklch(0.70 0.21 292 / 0.4); color: #fff; }

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; font-weight: 600; line-height: 1.04; letter-spacing: -0.02em; }

a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

.mono { font-family: 'JetBrains Mono', monospace; font-weight: 500; letter-spacing: 0.04em; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ============================================================
   FONDOS GLOBALES (canvas partículas + glow cursor)
   ============================================================ */
#particles {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
#cursor-glow {
  position: fixed; top: 0; left: 0; z-index: 1; pointer-events: none;
  width: 480px; height: 480px; border-radius: 50%;
  margin: -240px 0 0 -240px;
  background: radial-gradient(circle, oklch(0.70 0.21 292 / 0.16), transparent 65%);
  transition: opacity 0.4s; opacity: 0;
  will-change: transform; mix-blend-mode: screen;
}
@media (hover: none), (pointer: coarse) { #cursor-glow { display: none; } }

.cursor-dot {
  position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none;
  width: 9px; height: 9px; border-radius: 50%; background: var(--c3);
  margin: -4.5px 0 0 -4.5px; mix-blend-mode: screen;
  transition: transform 0.15s var(--ease-out), opacity 0.3s; opacity: 0;
}
.cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid oklch(0.78 0.16 196 / 0.55);
  margin: -19px 0 0 -19px; opacity: 0;
  transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out), opacity 0.3s, border-color 0.25s;
}
.cursor-ring.hover { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-color: var(--c1); }
@media (hover: none), (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }

main, header, footer { position: relative; z-index: 2; }

/* ============================================================
   NAV
   ============================================================ */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: padding 0.4s var(--ease), background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
  padding: 22px 0; border-bottom: 1px solid transparent;
}
header.scrolled {
  padding: 12px 0;
  background: oklch(0.15 0.014 265 / 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 11px; font-family: 'Space Grotesk'; font-weight: 700; font-size: 22px; letter-spacing: -0.03em; }
.logo .mark {
  width: 26px; height: 26px; position: relative; flex: none;
  background: var(--grad); border-radius: 7px;
  transform: rotate(45deg); box-shadow: 0 0 22px var(--glow-c1);
  transition: transform 0.5s var(--ease);
}
.logo:hover .mark { transform: rotate(135deg); }
.logo .mark::after {
  content: ''; position: absolute; inset: 7px; background: var(--bg); border-radius: 3px;
}
.logo b { font-weight: 700; }
.logo span { color: var(--c3); }

.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a:not(.btn) {
  font-size: 15px; color: var(--muted); font-weight: 500; position: relative; transition: color 0.25s;
}
.nav-links a:not(.btn)::after {
  content: ''; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--grad); transition: width 0.3s var(--ease);
}
.nav-links a:not(.btn):hover { color: var(--text); }
.nav-links a:not(.btn):hover::after { width: 100%; }

.btn {
  display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px;
  padding: 13px 24px; border-radius: 100px; border: none; cursor: none;
  position: relative; transition: transform 0.2s var(--ease-out), box-shadow 0.3s; will-change: transform;
}
@media (hover: none){ .btn { cursor: pointer; } }
.btn-primary { background: var(--grad); color: #0c0c14; font-weight: 700; box-shadow: 0 8px 30px oklch(0.70 0.21 292 / 0.35); }
.btn-primary:hover { box-shadow: 0 12px 44px oklch(0.70 0.21 292 / 0.55); }
.btn-ghost { background: oklch(0.97 0.006 265 / 0.05); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: oklch(0.97 0.006 265 / 0.1); border-color: var(--line-soft); }
.btn .arr { transition: transform 0.3s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }

.menu-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; flex-direction: column; gap: 5px; padding: 8px; }
.menu-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s; }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: 140px 0 80px; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; z-index: 0; will-change: transform; }
.blob.b1 { width: 540px; height: 540px; background: radial-gradient(circle, var(--c1), transparent 70%); top: -120px; right: -80px; }
.blob.b2 { width: 460px; height: 460px; background: radial-gradient(circle, var(--c3), transparent 70%); bottom: -140px; left: -100px; opacity: 0.4; }
.blob.b3 { width: 360px; height: 360px; background: radial-gradient(circle, var(--c2), transparent 70%); top: 40%; left: 45%; opacity: 0.3; }

.hero-inner { position: relative; z-index: 3; max-width: 920px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; font-size: 13px;
  padding: 8px 16px; border-radius: 100px; border: 1px solid var(--line);
  background: oklch(0.97 0.006 265 / 0.04); color: var(--muted); margin-bottom: 30px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c3); box-shadow: 0 0 10px var(--c3); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{ opacity:1; } 50%{ opacity:0.35; } }

.hero h1 { font-size: clamp(44px, 8.5vw, 104px); font-weight: 700; margin-bottom: 28px; }
.hero h1 .line { display: block; }
.hero h1 .line > span { display: block; animation: heroFade 0.95s var(--ease) both; }
.hero h1 .line:nth-child(1) > span { animation-delay: 0.1s; }
.hero h1 .line:nth-child(2) > span { animation-delay: 0.24s; }

.hero p.lead {
  font-size: clamp(17px, 2.1vw, 21px); color: var(--muted); max-width: 620px; margin-bottom: 40px;
  animation: heroFade 0.9s var(--ease) 0.5s both;
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; animation: heroFade 0.9s var(--ease) 0.65s both; }
@keyframes heroFade { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* Stats / counters */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 72px;
  animation: heroFade 0.9s var(--ease) 0.8s both; }
.stat .num { font-family: 'Space Grotesk'; font-size: clamp(30px, 4vw, 44px); font-weight: 700; line-height: 1; }
.stat .lbl { font-size: 13.5px; color: var(--faint); margin-top: 8px; }
.stat { padding-left: 18px; border-left: 1px solid var(--line); }

/* ============================================================
   MARQUEE
   ============================================================ */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0; overflow: hidden; background: var(--bg-2); }
.marquee-track { display: flex; gap: 0; width: max-content; animation: scroll-x 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-family: 'Space Grotesk'; font-weight: 600; font-size: clamp(22px, 3vw, 34px); padding: 0 30px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 60px; }
.marquee-track span::before { content: '◆'; color: var(--c1); font-size: 0.5em; }
@keyframes scroll-x { to { transform: translateX(-50%); } }

/* ============================================================
   SECCIONES GENÉRICAS
   ============================================================ */
section.block { padding: 120px 0; position: relative; }
.sec-head { max-width: 720px; margin-bottom: 64px; }
.sec-tag { font-size: 13px; color: var(--c3); margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.sec-tag::before { content: ''; width: 28px; height: 1px; background: var(--c3); }
.sec-head h2 { font-size: clamp(32px, 5vw, 58px); margin-bottom: 20px; }
.sec-head p { font-size: clamp(16px, 1.8vw, 19px); color: var(--muted); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }
.reveal[data-d="4"] { transition-delay: 0.32s; }

/* ============================================================
   SERVICIOS
   ============================================================ */
.services { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.svc {
  position: relative; padding: 38px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line);
  overflow: hidden; transition: transform 0.4s var(--ease), border-color 0.4s;
}
.svc::before {
  content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity 0.5s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), oklch(0.70 0.21 292 / 0.14), transparent 60%);
}
.svc:hover { transform: translateY(-6px); border-color: var(--line-soft); }
.svc:hover::before { opacity: 1; }
.svc .ico {
  width: 56px; height: 56px; border-radius: 15px; display: grid; place-items: center;
  background: var(--grad-soft); border: 1px solid var(--line-soft); margin-bottom: 26px;
  position: relative; z-index: 1; transition: transform 0.4s var(--ease);
}
.svc:hover .ico { transform: scale(1.08) rotate(-4deg); }
.svc .ico svg { width: 26px; height: 26px; stroke: var(--c3); }
.svc h3 { font-size: 25px; margin-bottom: 12px; position: relative; z-index: 1; }
.svc p { color: var(--muted); position: relative; z-index: 1; font-size: 15.5px; }
.svc .idx { position: absolute; top: 30px; right: 34px; font-size: 13px; color: var(--faint); z-index: 1; }

/* ============================================================
   PROCESO
   ============================================================ */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: step; }
.step { position: relative; padding-top: 34px; }
.step .bar { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; margin-bottom: 28px; }
.step .bar i { display: block; height: 100%; width: 0; background: var(--grad); transition: width 1.1s var(--ease); }
.step.in .bar i { width: 100%; }
.step .n { font-family: 'JetBrains Mono'; font-size: 14px; color: var(--c3); margin-bottom: 14px; }
.step h3 { font-size: 23px; margin-bottom: 12px; }
.step p { color: var(--muted); font-size: 15px; }

/* ============================================================
   PRECIOS
   ============================================================ */
.pricing { position: relative; }
.price-card {
  position: relative; max-width: 720px; margin: 0 auto; text-align: center;
  padding: 64px 48px; border-radius: var(--radius-lg); overflow: hidden;
  background: linear-gradient(160deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
}
.price-card::before {
  content: ''; position: absolute; inset: 0; padding: 1px; border-radius: var(--radius-lg);
  background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0.6; pointer-events: none;
}
.price-glow { position: absolute; width: 420px; height: 420px; border-radius: 50%; filter: blur(90px);
  background: var(--grad); opacity: 0.22; top: -160px; left: 50%; transform: translateX(-50%); }
.price-card .from { font-size: 14px; color: var(--muted); position: relative; z-index: 1; }
.price-card .amount { font-family: 'Space Grotesk'; font-weight: 700; font-size: clamp(72px, 14vw, 130px); line-height: 1; margin: 8px 0 6px; position: relative; z-index: 1; }
.price-card .amount .cur { font-size: 0.5em; vertical-align: super; }
.price-card .sub { color: var(--muted); max-width: 460px; margin: 0 auto 36px; position: relative; z-index: 1; }
.includes { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 40px; position: relative; z-index: 1; }
.includes li { list-style: none; font-size: 14px; color: var(--text); padding: 8px 16px; border-radius: 100px; background: oklch(0.97 0.006 265 / 0.05); border: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.includes li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--c3); box-shadow: 0 0 8px var(--c3); }

/* ============================================================
   CONTACTO
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: start; }
.contact-info h2 { font-size: clamp(32px, 5vw, 56px); margin-bottom: 22px; }
.contact-info p { color: var(--muted); font-size: 18px; margin-bottom: 38px; max-width: 420px; }
.info-list { display: flex; flex-direction: column; gap: 16px; }
.info-item { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: transform 0.3s var(--ease), border-color 0.3s; }
.info-item:hover { transform: translateX(6px); border-color: var(--line-soft); }
.info-item .ii { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-soft); flex: none; }
.info-item .ii svg { width: 20px; height: 20px; stroke: var(--c3); }
.info-item .k { font-size: 12.5px; color: var(--faint); }
.info-item .v { font-weight: 600; font-size: 16px; }
.wa { background: oklch(0.72 0.16 155 / 0.12); border-color: oklch(0.72 0.16 155 / 0.4); }
.wa .ii { background: oklch(0.72 0.16 155 / 0.16); }
.wa .ii svg { stroke: oklch(0.80 0.16 155); }

form { padding: 38px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 9px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 14px 16px; border-radius: 12px; background: var(--bg-2);
  border: 1px solid var(--line); color: var(--text); font-family: inherit; font-size: 15px;
  transition: border-color 0.25s, box-shadow 0.25s; cursor: none;
}
@media (hover:none){ .field input,.field textarea,.field select { cursor: auto; } }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--c2); box-shadow: 0 0 0 3px oklch(0.72 0.19 248 / 0.18);
}
.field textarea { resize: vertical; min-height: 110px; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a0a0b0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
.field.invalid input, .field.invalid textarea { border-color: oklch(0.65 0.2 25); }
.form-msg { padding: 14px 18px; border-radius: 12px; background: oklch(0.72 0.16 155 / 0.14); border: 1px solid oklch(0.72 0.16 155 / 0.4); color: oklch(0.85 0.12 155); font-size: 14.5px; margin-top: 18px; display: none; }
.form-msg.show { display: block; animation: fadeUp 0.5s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
form .btn-primary { width: 100%; justify-content: center; }

/* ============================================================
   FOOTER
   ============================================================ */
footer { border-top: 1px solid var(--line); padding: 56px 0 40px; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.foot .logo { font-size: 20px; }
.foot-links { display: flex; gap: 28px; }
.foot-links a { color: var(--muted); font-size: 14.5px; transition: color 0.25s; }
.foot-links a:hover { color: var(--text); }
.copyright { color: var(--faint); font-size: 13.5px; margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .nav-links { position: fixed; inset: 0 0 0 auto; width: min(82vw, 360px); flex-direction: column; justify-content: center; align-items: flex-start; gap: 28px; padding: 0 40px; background: oklch(0.15 0.014 265 / 0.97); backdrop-filter: blur(20px); transform: translateX(100%); transition: transform 0.5s var(--ease); border-left: 1px solid var(--line); }
  .nav-links.open { transform: none; }
  .nav-links a:not(.btn) { font-size: 22px; }
  .menu-toggle { display: flex; z-index: 110; }
  .menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle.open span:nth-child(2) { opacity: 0; }
  .menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .services, .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 28px 20px; }
  .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  section.block { padding: 86px 0; }
  body { cursor: auto; }
  .cursor-dot, .cursor-ring, #cursor-glow { display: none; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 20px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .price-card { padding: 44px 26px; }
  form { padding: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .hero h1 .line > span { transform: none; }
}
