/* ==========================================================================
   Nyxel · nyxel.es
   Dark · editorial · mucho aire · grid 12 col · máx 1200 px
   ========================================================================== */

:root {
  --bg: #0B0F1A;
  --surface: #141A2B;
  --accent: #7C5CFF;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --text: #F2F2F5;
  --muted: rgba(242, 242, 245, 0.62);
  --faint: rgba(242, 242, 245, 0.40);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --radius: 14px;
  --font-head: "Manrope", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --container: 1200px;
  --gutter: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::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-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; font-family: var(--font-head); font-weight: 600; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip:focus { left: 8px; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
  row-gap: 40px;
  align-items: center;
}
.col-4, .col-5, .col-7, .col-8 { grid-column: span 12; }
@media (min-width: 900px) {
  .col-4 { grid-column: span 4; }
  .col-5 { grid-column: span 5; }
  .col-7 { grid-column: span 7; }
  .col-8 { grid-column: span 8; }
}
@media (min-width: 600px) { :root { --gutter: 32px; } }

.section { padding-block: 96px; }
@media (min-width: 900px) { .section { padding-block: 144px; } }
.section + .section { border-top: 1px solid var(--line); }

.section__head { max-width: 720px; margin-bottom: 56px; }
@media (min-width: 900px) { .section__head { margin-bottom: 72px; } }

/* ---------- Type ---------- */
.h1 {
  font-size: clamp(44px, 8vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.h2 {
  font-size: clamp(32px, 4.6vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.h3 {
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.lead { font-size: 20px; color: var(--muted); max-width: 60ch; }
@media (max-width: 599px) { .lead { font-size: 18px; } }

.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 20px;
}
.result {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--accent);
  font-weight: 500;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 17px;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #8B6FFF; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: rgba(255,255,255,0.32); background: rgba(255,255,255,0.03); }
.btn--sm { padding: 11px 16px; font-size: 15px; border-radius: 10px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}
.logo {
  display: inline-flex; align-items: center;
  font-family: var(--font-head); font-weight: 600; font-size: 22px;
  letter-spacing: 0.24em; text-transform: lowercase; line-height: 1;
  color: var(--text);
}
.logo__x { width: 0.8em; height: 0.74em; margin: 0.04em 0.18em 0 -0.04em; color: var(--text); flex: none; }
.nav__links { display: none; gap: 32px; font-size: 15px; font-weight: 500; color: var(--muted); }
.nav__links a:hover { color: var(--text); }
.nav__cta { display: none; }
.nav__burger {
  width: 44px; height: 44px; margin-right: -10px;
  background: none; border: 0; cursor: pointer;
  display: grid; place-content: center; gap: 6px;
}
@media (min-width: 900px) {
  .nav__links, .nav__cta { display: inline-flex; }
  .nav__burger { display: none; }
}
.nav__burger span { display: block; width: 22px; height: 1.5px; background: var(--text); transition: transform 200ms var(--ease), opacity 200ms; }
.nav__burger[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
.nav__mobile {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px var(--gutter) 24px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.nav__mobile[hidden] { display: none; }
.nav__mobile > a:not(.btn) { padding: 14px 0; font-size: 20px; font-family: var(--font-head); font-weight: 500; }
.nav__mobile .btn { margin-top: 16px; }

/* ---------- Hero ---------- */
.hero { padding-block: 72px 0; overflow: hidden; }
@media (min-width: 900px) { .hero { padding-top: 120px; } }
.hero__copy { max-width: 640px; }
.hero__sub { margin-top: 28px; font-size: 20px; color: var(--muted); max-width: 56ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.hero__actions .btn { flex: 1 1 auto; }
@media (min-width: 600px) { .hero__actions .btn { flex: 0 0 auto; } }
.hero__micro { margin-top: 20px; font-size: 15px; color: var(--faint); }

.hero__visual { display: flex; justify-content: center; }
@media (max-width: 899px) { .hero__visual { order: -1; margin-bottom: -8px; } }

/* Luna de píxeles */
.moon {
  --cell: 16px;
  --gap: 3px;
  --n: 16;
  display: grid;
  grid-template-columns: repeat(var(--n), var(--cell));
  grid-auto-rows: var(--cell);
  gap: var(--gap);
  width: max-content;
}
@media (min-width: 420px) { .moon { --cell: 18px; } }
@media (min-width: 600px) { .moon { --cell: 22px; } }
@media (min-width: 1100px) { .moon { --cell: 26px; } }
.moon i {
  display: block;
  border-radius: 3px;
  background: var(--accent);
  opacity: 0;
  transform: translate(var(--dx), var(--dy)) scale(0.6);
  transition:
    transform 1400ms var(--ease) var(--delay),
    opacity 1000ms ease-out var(--delay);
  will-change: transform, opacity;
}
.moon i[data-shade="1"] { background: #6A4DE6; }
.moon i[data-shade="2"] { background: #5A40C9; }
.moon.is-on i { opacity: 1; transform: translate(0, 0) scale(1); }
@media (prefers-reduced-motion: reduce) {
  .moon i { transition: none; opacity: 1; transform: none; }
}

/* Franja de datos */
.stats {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 80px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 720px) { .stats { grid-template-columns: repeat(3, 1fr); margin-top: 112px; } }
.stat { padding: 28px 0; display: flex; flex-direction: column; gap: 4px; }
@media (min-width: 720px) {
  .stats .stat { padding: 36px 32px; }
  .stats .stat + .stat { border-left: 1px solid var(--line); }
  .stats .stat:first-child { padding-left: 0; }
}
@media (max-width: 719px) { .stats .stat + .stat { border-top: 1px solid var(--line); } }
.stat__n {
  font-family: var(--font-head);
  font-size: clamp(40px, 5vw, 56px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stat__n small { font-size: 0.42em; font-weight: 500; color: var(--muted); letter-spacing: -0.01em; margin-left: 2px; }
.stat__n--accent { color: var(--accent); }
.stat__l { font-size: 15px; color: var(--muted); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: border-color 200ms var(--ease);
}
.card:hover { border-color: var(--line-strong); }
.card > p:not(.result) { color: var(--muted); font-size: 17px; }
.card .result { margin-top: auto; padding-top: 20px; }
.card > p:not(.result) { margin-bottom: 20px; }
@media (min-width: 900px) { .card { padding: 32px; } }

.cases {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) { .cases { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cases { grid-template-columns: repeat(3, 1fr); gap: 20px; } }

/* Grid 3 + 2 */
.services {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) { .services { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) {
  .services { grid-template-columns: repeat(6, 1fr); gap: 20px; }
  .services .card { grid-column: span 2; }
  .services .card:nth-child(4) { grid-column: 2 / span 2; }
  .services .card:nth-child(5) { grid-column: 4 / span 2; }
}

/* ---------- Dolor / Precio ---------- */
.section--pain .h2 { margin-bottom: 48px; }
.pain li {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(24px, 3.4vw, 36px);
  line-height: 1.25;
  letter-spacing: -0.015em;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  max-width: 20ch;
}
.pain li:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 900px) {
  .pain li { padding: 36px 0; padding-left: 64px; position: relative; max-width: 24ch; }
  .pain li::before {
    content: "";
    position: absolute; left: 0; top: 50%;
    width: 32px; height: 1px; background: var(--accent);
  }
}
#precio .h2 { margin-bottom: 48px; }
.pain--price li { max-width: 28ch; }

/* ---------- Pasos ---------- */
#proceso .h2 { margin-bottom: 56px; }
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { padding: 36px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) {
  .step { padding: 40px 32px 48px 0; border-bottom: 0; }
  .step + .step { padding-left: 32px; border-left: 1px solid var(--line); }
  .steps { border-bottom: 1px solid var(--line); }
}
.step__n {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}
.step p { color: var(--muted); }

.quote {
  margin: 96px 0 0;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  max-width: 30ch;
  padding-left: 28px;
  border-left: 2px solid var(--accent);
}
@media (min-width: 900px) { .quote { margin-top: 120px; } }

/* ---------- Quién ---------- */
.who { row-gap: 40px; }
.photo {
  aspect-ratio: 4 / 5;
  max-width: 440px;
  width: 100%;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-content: center;
  color: var(--faint);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.who__copy .lead { margin-bottom: 32px; }
.badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
}
.badge__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---------- Calculadora ---------- */
#calculadora .h2 { margin-bottom: 48px; }
.calc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
@media (min-width: 900px) {
  .calc {
    padding: 48px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 64px;
    row-gap: 32px;
    align-items: start;
  }
  .calc__inputs { grid-row: 1 / span 2; }
  .calc__note { grid-column: 2; margin-top: 0; }
  .calc > .btn { grid-column: 2; justify-self: start; }
}
.calc__inputs { display: flex; flex-direction: column; gap: 40px; }
.range { display: block; }
.range__label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  font-size: 16px; color: var(--muted); margin-bottom: 16px;
}
.range__label output {
  font-family: var(--font-head); font-weight: 600; font-size: 20px; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 24px; background: transparent; margin: 0; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px; background: linear-gradient(to right, var(--accent) var(--fill, 0%), var(--line-strong) var(--fill, 0%));
  border-radius: 2px;
}
input[type="range"]::-moz-range-track { height: 2px; background: var(--line-strong); border-radius: 2px; }
input[type="range"]::-moz-range-progress { height: 2px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: -10px;
  border-radius: 50%; background: var(--text); border: 4px solid var(--bg);
  box-shadow: 0 0 0 1px var(--line-strong);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 4px solid var(--bg);
  box-shadow: 0 0 0 1px var(--line-strong);
}
.calc__out {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 40px;
}
@media (min-width: 600px) { .calc__out { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .calc__out { margin-top: 0; } }
.calc__out .stat { padding: 20px 0; border-top: 1px solid var(--line); }
@media (min-width: 600px) {
  .calc__out .stat { padding: 0 24px; border-top: 0; }
  .calc__out .stat:first-child { padding-left: 0; }
  .calc__out .stat + .stat { border-left: 1px solid var(--line); }
}
.calc__out .stat__n { font-size: clamp(32px, 4vw, 44px); }
.calc__note { margin-top: 24px; font-size: 14px; color: var(--faint); }
.calc > .btn { margin-top: 24px; }

/* ---------- FAQ ---------- */
#faq .grid { align-items: start; }
#faq .h2 { margin-bottom: 0; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 24px 0;
  padding-right: 48px;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.01em;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute; right: 6px; top: 50%;
  width: 12px; height: 12px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 200ms var(--ease);
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.faq details p { color: var(--muted); padding-bottom: 28px; max-width: 60ch; }

/* ---------- Cierre ---------- */
.section--close .grid { align-items: start; }
.close__alt { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.close__mail {
  display: inline-block; margin-top: 24px; color: var(--muted); font-weight: 500;
  border-bottom: 1px solid var(--line-strong);
}
.close__mail:hover { color: var(--text); }

.form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex; flex-direction: column; gap: 20px;
}
@media (min-width: 900px) { .form { padding: 40px; } }
.form__row { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 600px) { .form__row { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 8px; }
.field span { font-size: 14px; font-weight: 500; color: var(--muted); }
.field input, .field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 17px;
  color: var(--text);
  resize: vertical;
  transition: border-color 160ms;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field input:user-invalid, .field textarea:user-invalid { border-color: #ff6b6b; }
.form .btn { align-self: flex-start; }
.form__status { font-size: 15px; color: var(--muted); min-height: 1.2em; }
.form__status:empty { display: none; }

.close__note {
  margin-top: 64px;
  font-style: italic;
  font-size: 15px;
  color: var(--faint);
  max-width: 64ch;
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0 120px; }
@media (min-width: 900px) { .footer { padding-bottom: 48px; } }
.footer__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
}
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 15px; color: var(--muted); }
.footer__links a:hover { color: var(--text); }
.footer__copy { font-size: 14px; color: var(--faint); width: 100%; }
@media (min-width: 900px) { .footer__copy { width: auto; } }

/* ---------- WhatsApp fijo (móvil) ---------- */
.wa-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid; place-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 180ms var(--ease);
}
.wa-fab svg { width: 28px; height: 28px; }
.wa-fab:active { transform: scale(0.96); }
@media (min-width: 900px) { .wa-fab { display: none; } }

/* ---------- Reveal (fade-up 250 ms) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 250ms ease-out, transform 250ms var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }
.cases .reveal:nth-child(2), .services .reveal:nth-child(2), .steps .reveal:nth-child(2), .pain .reveal:nth-child(2) { transition-delay: 60ms; }
.cases .reveal:nth-child(3), .services .reveal:nth-child(3), .steps .reveal:nth-child(3), .pain .reveal:nth-child(3) { transition-delay: 120ms; }
.cases .reveal:nth-child(4), .services .reveal:nth-child(4) { transition-delay: 180ms; }
.cases .reveal:nth-child(5), .services .reveal:nth-child(5) { transition-delay: 240ms; }
.cases .reveal:nth-child(6) { transition-delay: 300ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
