/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --fondo:        #0A0A0A;
  --superficie:   #141312;
  --texto:        #FFFFFF;
  --texto-suave:  #B5AFAA;
  --naranja:      #F97316;
  --linea:        #2A2724;

  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: clamp(3rem, 7vw, 4.5rem);
  --space-7: clamp(3.5rem, 10vw, 6rem);

  --container-w: 1120px;
  --prose-w: 640px;
  --radius: 10px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }

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

body {
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}

a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }

h1, h2, h3 {
  font-family: var(--display);
  text-wrap: balance;
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-weight: 600;
}

ul, ol { list-style: none; padding: 0; }

::selection { background: var(--naranja); color: var(--fondo); }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* =============================================================
   2b. Atmósfera (fondo vivo: resplandores + grano)
   ============================================================= */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.atmosphere .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
}

.atmosphere .blob-1 {
  width: 620px;
  height: 620px;
  top: -220px;
  right: -180px;
  background: radial-gradient(circle, color-mix(in srgb, var(--naranja) 18%, transparent), color-mix(in srgb, var(--naranja) 0%, transparent) 70%);
  animation: driftA 28s ease-in-out infinite alternate;
}

.atmosphere .blob-2 {
  width: 560px;
  height: 560px;
  bottom: -240px;
  left: -160px;
  background: radial-gradient(circle, color-mix(in srgb, var(--naranja) 12%, transparent), color-mix(in srgb, var(--naranja) 0%, transparent) 70%);
  animation: driftB 34s ease-in-out infinite alternate;
}

.atmosphere .vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 85% at 50% 0%, color-mix(in srgb, var(--fondo) 0%, transparent) 45%, var(--fondo) 100%);
}

.atmosphere .grain {
  position: absolute;
  inset: -10%;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes driftA {
  from { transform: translate(0, 0); }
  to   { transform: translate(-34px, 44px); }
}
@keyframes driftB {
  from { transform: translate(0, 0); }
  to   { transform: translate(40px, -34px); }
}

.site-header, main, .site-footer {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .atmosphere .blob { animation: none; }
}

/* =============================================================
   3. Utilities
   ============================================================= */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  padding: 0.7rem 1.1rem;
  background: var(--naranja);
  color: var(--fondo);
  z-index: 9999;
  border-radius: 8px;
  font-weight: 600;
  transition: top 0.25s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

.container {
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.prose { max-width: var(--prose-w); }
.center { text-align: center; margin-inline: auto; }

.section {
  padding-block: var(--space-7);
  border-top: 1px solid var(--linea);
}
.section:first-of-type { border-top: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--texto-suave);
  background: var(--superficie);
  border: 1px solid var(--linea);
  padding: 0.45rem 0.9rem 0.45rem 0.7rem;
  border-radius: 999px;
  margin-bottom: var(--space-3);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--naranja);
  flex: none;
}

/* =============================================================
   4. Typography
   ============================================================= */
h2 {
  font-size: clamp(1.6rem, 5.5vw, 2.4rem);
  margin-bottom: var(--space-4);
}

h3 {
  font-size: clamp(1.15rem, 3.5vw, 1.35rem);
}

.section > .container.prose > p,
.section-lead {
  color: var(--texto-suave);
  font-size: 1.05rem;
  margin-top: -0.75rem;
  margin-bottom: var(--space-4);
}

/* =============================================================
   5. Components
   ============================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1;
  white-space: normal;
  text-align: center;
  border: 0.8px solid color-mix(in srgb, var(--texto) 16%, transparent);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), background 0.35s var(--ease-out);
}

.btn-whatsapp {
  background: linear-gradient(
    175deg,
    color-mix(in srgb, var(--naranja) 82%, var(--texto)) 0%,
    var(--naranja) 58%,
    color-mix(in srgb, var(--naranja) 82%, black) 100%
  );
  color: var(--fondo);
  box-shadow:
    inset 0 1px 0 0 color-mix(in srgb, var(--texto) 30%, transparent),
    0 12px 30px -12px color-mix(in srgb, var(--naranja) 55%, transparent);
}
@media (hover: hover) {
  .btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow:
      inset 0 1px 0 0 color-mix(in srgb, var(--texto) 38%, transparent),
      0 18px 42px -14px color-mix(in srgb, var(--naranja) 70%, transparent);
  }
}
.btn-whatsapp:active { transform: translateY(0); }

.btn-ghost {
  background: color-mix(in srgb, var(--superficie) 100%, transparent);
  color: var(--texto);
  border-color: color-mix(in srgb, var(--texto) 11%, transparent);
  box-shadow: inset 0 1px 0 0 color-mix(in srgb, var(--texto) 7%, transparent);
  padding: 0.75rem 1.3rem;
  font-size: 0.92rem;
}
@media (hover: hover) {
  .btn-ghost:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--naranja) 55%, transparent);
    color: var(--naranja);
    box-shadow:
      inset 0 1px 0 0 color-mix(in srgb, var(--texto) 10%, transparent),
      0 16px 36px -16px color-mix(in srgb, var(--naranja) 40%, transparent);
  }
}

.icon-wa {
  width: 18px;
  height: 18px;
  flex: none;
  fill: currentColor;
}

/* =============================================================
   6. Header
   ============================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--fondo) 92%, transparent);
  border-bottom: 1px solid var(--linea);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.85rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.brand img { border-radius: 6px; }
.brand-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

/* =============================================================
   7. Hero
   ============================================================= */
.hero {
  padding-block: clamp(2.5rem, 9vw, 5rem) clamp(1.5rem, 5vw, 2.5rem);
}

.hero-title {
  font-size: clamp(2rem, 8.5vw, 3.4rem);
  max-width: 15ch;
  margin-bottom: var(--space-3);
}

.hero-sub {
  color: var(--texto-suave);
  font-size: clamp(1.02rem, 3.2vw, 1.2rem);
  max-width: 46ch;
  margin-bottom: var(--space-4);
}

.hero-kicker,
.hero-title,
.hero-sub,
.hero-cta {
  animation: heroIn 0.75s var(--ease-out) both;
}
.hero-title { animation-delay: 0.08s; }
.hero-sub   { animation-delay: 0.18s; }
.hero-cta   { animation-delay: 0.28s; }

@keyframes heroIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-kicker, .hero-title, .hero-sub, .hero-cta {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* =============================================================
   8. El problema
   ============================================================= */
.problemas-list li {
  padding-block: var(--space-3);
  border-top: 1px solid var(--linea);
}
.problemas-list li:first-child { border-top: 0; }

.problema-titulo {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.problema-texto {
  color: var(--texto-suave);
}

/* =============================================================
   9. Diagnóstico gratis
   ============================================================= */
.diagnostico-section {
  background: var(--superficie);
  border-top: 1px solid var(--linea);
  border-bottom: 1px solid var(--linea);
  position: relative;
}
.diagnostico-section::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--naranja);
}

.diagnostico-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
  max-width: 460px;
}

.diagnostico-label {
  font-size: 0.88rem;
  color: var(--texto-suave);
}

.diagnostico-form input {
  width: 100%;
  padding: 0.95rem 1.1rem;
  background: var(--fondo);
  border: 1px solid var(--linea);
  border-radius: 8px;
  color: var(--texto);
  font-family: var(--sans);
  font-size: 1rem;
  transition: border-color 0.3s var(--ease-out);
}
.diagnostico-form input::placeholder { color: var(--texto-suave); }
.diagnostico-form input:focus { border-color: var(--naranja); }

.diagnostico-form .btn { width: 100%; }

/* =============================================================
   10. Qué hacemos
   ============================================================= */
.servicios {
  display: grid;
  gap: var(--space-5);
}

.servicio img {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: var(--space-2);
  border: 1px solid var(--linea);
}

.servicio h3 { margin-bottom: 0.5rem; }
.servicio p { color: var(--texto-suave); }

.servicio-sin-imagen {
  padding-top: var(--space-2);
  border-top: 1px dashed var(--linea);
}

/* =============================================================
   11. Antes y después
   ============================================================= */
.comparativa {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.comparativa-item img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--linea);
}

.comparativa-item figcaption {
  margin-top: 0.6rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--texto-suave);
  text-align: center;
}

.comparativa-puntos li {
  position: relative;
  padding-left: 1.4rem;
  padding-block: 0.6rem;
  color: var(--texto-suave);
}
.comparativa-puntos li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.15rem;
  width: 8px;
  height: 2px;
  background: var(--naranja);
}

/* =============================================================
   12. Planes
   ============================================================= */
.planes {
  display: grid;
  gap: var(--space-3);
}

.plan {
  border: 1px solid var(--linea);
  background: var(--superficie);
  border-radius: var(--radius);
  padding: var(--space-4);
  transition: transform 0.35s var(--ease-out), border-color 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
@media (hover: hover) {
  .plan:hover {
    transform: translateY(-4px);
    border-color: var(--naranja);
    box-shadow: 0 24px 48px -24px color-mix(in srgb, var(--naranja) 35%, transparent);
  }
}

.plan-name {
  font-size: 1.15rem;
  margin-bottom: var(--space-2);
}

.plan-price {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--texto-suave);
  font-size: 1.02rem;
  line-height: 1.7;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--linea);
}

.plan-price .cifra {
  color: var(--naranja);
  font-weight: 600;
}

.plan-incluye li {
  position: relative;
  padding-left: 1.2rem;
  padding-block: 0.35rem;
  color: var(--texto-suave);
  font-size: 0.92rem;
}
.plan-incluye li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 7px;
  height: 2px;
  background: var(--naranja);
}

.planes-nota {
  margin-top: var(--space-3);
  color: var(--texto-suave);
  font-size: 0.88rem;
  max-width: var(--prose-w);
}

/* =============================================================
   13. Qué pasa y cuándo (timeline)
   ============================================================= */
.timeline {
  position: relative;
  padding-left: 2.6rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--naranja);
}

@supports (animation-timeline: view()) {
  .timeline::before {
    transform: scaleY(0);
    transform-origin: top;
    animation: growTimeline linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 65%;
  }
}

@keyframes growTimeline {
  to { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
  .timeline::before { animation: none; transform: scaleY(1); }
}

.timeline-step {
  position: relative;
  padding-bottom: var(--space-5);
}
.timeline-step:last-child { padding-bottom: 0; }

.timeline-number {
  position: absolute;
  left: -2.6rem;
  top: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--fondo);
  background: var(--naranja);
  border-radius: 50%;
}

.timeline-step h3 { margin-bottom: 0.35rem; }
.timeline-step p { color: var(--texto-suave); }

.timeline-disclaimer {
  margin-top: var(--space-5);
  padding: var(--space-3);
  border: 1px solid var(--linea);
  border-left: 3px solid var(--naranja);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--texto-suave);
  font-size: 0.95rem;
  max-width: var(--prose-w);
}

/* =============================================================
   14. Por qué con nosotros
   ============================================================= */
.reasons-list li {
  padding-block: var(--space-3);
  border-top: 1px solid var(--linea);
  max-width: var(--prose-w);
}
.reasons-list li:first-child { border-top: 0; }

/* =============================================================
   15. Testimonios
   ============================================================= */
.testimonios-grid {
  display: grid;
  gap: var(--space-3);
}

.testimonio {
  border: 1px solid var(--linea);
  border-radius: var(--radius);
  padding: var(--space-3);
}
.testimonio p { margin-bottom: var(--space-2); }
.testimonio-autor {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--texto-suave);
}

/* =============================================================
   16. FAQ
   ============================================================= */
.faq-item {
  border-top: 1px solid var(--linea);
}
.faq-item:first-child { border-top: 0; }

.faq-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  text-align: left;
  padding-block: var(--space-3);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.02rem;
}

.faq-icon {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
}
.faq-icon::before, .faq-icon::after {
  content: "";
  position: absolute;
  background: var(--naranja);
  transition: transform 0.3s var(--ease-out);
}
.faq-icon::before {
  left: 0; top: 50%; width: 100%; height: 2px;
  transform: translateY(-50%);
}
.faq-icon::after {
  top: 0; left: 50%; width: 2px; height: 100%;
  transform: translateX(-50%);
}
.faq-item:not(.is-collapsed) .faq-icon::after { transform: translateX(-50%) scaleY(0); }
.faq-item:not(.is-collapsed) .faq-trigger { color: var(--naranja); }

.faq-panel {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.35s var(--ease-out);
}
.faq-item.is-collapsed .faq-panel { grid-template-rows: 0fr; }

.faq-panel-inner {
  overflow: hidden;
  min-height: 0;
}
.faq-panel-inner p {
  color: var(--texto-suave);
  padding-bottom: var(--space-3);
  max-width: var(--prose-w);
}

/* =============================================================
   17. Cierre
   ============================================================= */
.cierre-section .container { text-align: center; }
.cierre-section h2 { margin-inline: auto; }

/* =============================================================
   18. Footer
   ============================================================= */
.site-footer {
  border-top: 1px solid var(--linea);
  padding-block: var(--space-5);
  color: var(--texto-suave);
  font-size: 0.92rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: var(--space-3);
}
.footer-brand img { border-radius: 6px; }
.footer-brand span {
  font-family: var(--display);
  color: var(--texto);
  font-weight: 600;
}

.footer-datos p { margin-bottom: 0.4rem; }
.footer-datos a { text-decoration: underline; text-underline-offset: 2px; }
@media (hover: hover) {
  .footer-datos a:hover { color: var(--naranja); }
}

.footer-legal {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--linea);
  font-size: 0.8rem;
}
.footer-legal p { margin-bottom: 0.3rem; }

/* =============================================================
   19. Aviso de privacidad (página secundaria)
   ============================================================= */
.legal-content h1 {
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  margin-bottom: var(--space-2);
}

.legal-content h2 {
  font-size: 1.3rem;
  margin-top: var(--space-5);
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content p { color: var(--texto-suave); margin-bottom: var(--space-2); max-width: var(--prose-w); }
.legal-content .actualizado {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--texto-suave);
  margin-bottom: var(--space-5);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: var(--space-5);
  color: var(--naranja);
  font-weight: 600;
}

/* =============================================================
   19b. Movimiento ligado al scroll (progresivo, con caída segura)
   ============================================================= */
@supports (animation-timeline: view()) {
  main h2,
  .problemas-list li,
  .servicio,
  .comparativa-item,
  .reasons-list li,
  .faq-item,
  .timeline-step,
  .diagnostico-form {
    opacity: 0.35;
    transform: translateY(28px);
    animation: emerge linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 45%;
  }

  /* Los planes ya tienen su propio transform en :hover; solo animamos opacidad
     para no pelear con esa transición. */
  .plan {
    opacity: 0.35;
    animation: emergeFade linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 45%;
  }
}

@keyframes emerge {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes emergeFade {
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  main h2,
  .problemas-list li,
  .servicio,
  .comparativa-item,
  .reasons-list li,
  .faq-item,
  .timeline-step,
  .diagnostico-form,
  .plan {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* =============================================================
   20. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .servicios { grid-template-columns: 1fr 1fr; }
  .servicio-sin-imagen { grid-column: 1 / -1; border-top: 0; padding-top: 0; }
}

@media (min-width: 720px) {
  .planes { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 960px) {
  .servicios { grid-template-columns: repeat(3, 1fr); }
  .servicio-sin-imagen { grid-column: auto; border-top: 0; padding-top: 0; }
  .testimonios-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1280px) {
  .hero-title { max-width: 18ch; }
}
