/* =============================================================
   Gustavo López — Landing
   Arquetipo: Editorial Dark Warm
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #0E0E0D;
  --bg-2:      #171614;
  --line:      #2C2A26;
  --text:      #F5F1EA;
  --text-soft: #B3ACA1;
  --accent:    #C9A46A;   /* alternativa a probar: terracota #C9805A */
  --wa:        #25D366;
  --wa-hover:  #34E27A;
  --wa-text:   #06210F;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: 20px;
  --maxw: 1180px;
  --section-y: 72px;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
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; }
ul, ol { padding: 0; list-style: none; }
p { text-wrap: pretty; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.08; letter-spacing: -0.015em; text-wrap: balance; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; border-radius: 8px;
  background: var(--text); color: var(--bg); font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 780px; }
.center { text-align: center; }

.section { padding: var(--section-y) 0; }
.alt { background: var(--bg-2); }

.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}
.section-title { font-size: clamp(30px, 4.6vw, 48px); }
.section-title.big { font-size: clamp(38px, 6.4vw, 72px); }
.section-head { margin-bottom: 48px; }
.section-head .section-title { margin-top: 14px; }
.section-head .lead, .center .lead { margin-top: 18px; }
.lead { font-size: clamp(18px, 1.6vw, 20px); color: var(--text-soft); max-width: 62ch; }
.center .lead { margin-left: auto; margin-right: auto; }
.muted { color: var(--text-soft); }

/* Datos pendientes: visibles y fáciles de encontrar */
.todo {
  display: inline-block;
  padding: 0 .35em;
  border: 1px dashed var(--accent);
  border-radius: 4px;
  color: var(--accent);
  font-family: var(--sans);
  font-size: .8em;
  font-weight: 600;
  letter-spacing: 0;
}

/* =============================================================
   4. Botón WhatsApp (todos iguales)
   ============================================================= */
a.btn-wa, button.btn-wa {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 64px; padding: 0 36px;
  border-radius: 999px;
  background: var(--wa); color: var(--wa-text);
  font-family: var(--sans); font-weight: 700; font-size: 19px; line-height: 1.1;
  text-decoration: none; text-align: center;
  box-shadow: 0 10px 30px rgba(37, 211, 102, .28);
  transition: transform .2s ease, background .2s ease;
}
a.btn-wa:hover, button.btn-wa:hover { background: var(--wa-hover); transform: translateY(-2px); }
a.btn-wa::after, button.btn-wa::after {
  content: ""; position: absolute; z-index: -1; top: 0; left: -60%;
  width: 45%; height: 100%;
  background: linear-gradient(100deg, rgba(255,255,255,0), rgba(255,255,255,.6), rgba(255,255,255,0));
  transform: skewX(-20deg);
  animation: waShine 3s ease-in-out infinite;
}
a.btn-wa.sm, button.btn-wa.sm { min-height: 48px; padding: 0 22px; font-size: 15px; gap: 8px; box-shadow: none; }
.wa-ico { width: 24px; height: 24px; flex: none; }
.btn-wa.sm .wa-ico { width: 20px; height: 20px; }
@keyframes waShine { 0% { left: -60%; } 55%, 100% { left: 130%; } }
/* El reflejo NO se desactiva con prefers-reduced-motion (regla de la skill). */

/* =============================================================
   5. Header
   ============================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease-soft);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 21px; letter-spacing: -0.01em; }
.header-cta { display: none !important; }

/* =============================================================
   6. Secciones
   ============================================================= */

/* --- Hero --- */
.hero { padding: 56px 0 64px; }
.hero-title {
  margin-top: 20px;
  font-size: clamp(38px, 9.4vw, 84px);
  line-height: 1.04;
  max-width: 15ch;
}
.hero-title .w { display: inline-block; }
.hl { position: relative; display: inline-block; white-space: nowrap; }
.hl-line {
  position: absolute; left: -2%; bottom: -.16em;
  width: 104%; height: .32em;
  overflow: visible; pointer-events: none;
}
.hl-line path {
  fill: none; stroke: var(--accent); stroke-width: 5;
  stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.hero-sub { margin-top: 28px; font-size: clamp(18px, 1.8vw, 21px); color: var(--text-soft); max-width: 46ch; }
.hero-cta { margin-top: 36px; display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.cta-note { font-size: 15px; color: var(--text-soft); text-align: center; }

.hero-video { position: relative; margin-top: 48px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bg-2); max-width: 720px; }
.hero-video video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.video-sound {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  padding: 10px 18px; border-radius: 999px;
  background: rgba(14,14,13,.85); color: var(--text); font-size: 15px; font-weight: 600;
  border: 1px solid var(--line);
}

/* --- Barra de prueba --- */
.proof { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.proof-list { display: grid; grid-template-columns: 1fr 1fr; }
.proof-item { padding: 28px 12px 28px 0; display: flex; flex-direction: column; gap: 6px; }
.proof-item:nth-child(odd) { padding-right: 16px; }
.proof-item:nth-child(n+3) { border-top: 1px solid var(--line); }
.proof-item:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
.proof-num { font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 4vw, 44px); line-height: 1; color: var(--text); }
.proof-num .todo { font-size: 15px; line-height: 1.6; white-space: nowrap; }
.proof-label { font-size: 15px; color: var(--text-soft); line-height: 1.4; }

/* --- Dolores (marquesina en desktop, lista en mobile) --- */
.pains .section-title { margin-bottom: 36px; }
.marquee { padding: 0 var(--gutter); }
.marquee-track { max-width: var(--maxw); margin: 0 auto; }
.marquee-list li {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  font-size: 18px; color: var(--text);
}
.marquee-list li:last-child { border-bottom: 1px solid var(--line); }
.marquee-list[aria-hidden="true"] { display: none; }

/* --- Diagnóstico --- */
.diag-grid { display: grid; gap: 40px; }
.diag-photo { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); max-width: 520px; }
.diag-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 30%; }
.diag-body .lead { margin-top: 20px; color: var(--text); }
.diag-body .muted { margin-top: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 32px; }
.tags li {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--accent);
}

/* --- Sistema de 4 piezas --- */
.journey {
  position: relative;
  display: grid; gap: 0;
  margin-bottom: 56px;
  padding-left: 4px;
}
.journey-step {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 0;
  font-weight: 600; font-size: 18px;
  color: var(--text);
}
.journey-step:not(:last-child)::after {
  content: ""; position: absolute; left: 7px; top: 50%; height: 100%; width: 2px;
  background: var(--accent);
}
.journey-dot {
  position: relative; z-index: 1;
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--accent);
}
.journey-step.is-last { color: var(--accent); }
.journey-step.is-last .journey-dot { box-shadow: 0 0 0 6px rgba(201,164,106,.18); }

.pieces { display: grid; gap: 16px; }
.piece {
  padding: 28px 24px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px;
}
.piece-num { font-family: var(--serif); font-weight: 700; font-size: 15px; color: var(--accent); letter-spacing: .04em; }
.piece h3 { margin-top: 14px; font-size: 26px; }
.piece p { margin-top: 10px; color: var(--text-soft); }

/* --- Casos --- */
.cases-grid { display: grid; gap: 24px; }
.case { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; padding-bottom: 24px; }
.case-video { background: #000; }
.case-video video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; }
.case h3 { margin: 20px 20px 0; font-size: 22px; }
.case-meta { margin: 4px 20px 0; color: var(--text-soft); font-size: 15px; }
.case-data { margin: 16px 20px 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; }
.case-data dt { color: var(--accent); font-weight: 600; }

/* --- Segunda invitación y cierre --- */
.invite .lead, .close .lead { margin-bottom: 36px; }
.invite .btn-wa, .close .btn-wa { width: 100%; }

/* --- Al escribirme recibís --- */
.gets .section-title { margin-bottom: 40px; }
.gets-grid { display: grid; gap: 16px; }
.get { padding: 28px 24px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; }
.get-when { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.get h3 { margin-top: 12px; font-size: 24px; }
.get p:last-child { margin-top: 10px; color: var(--text-soft); }

/* --- Filtro --- */
.filter {
  padding: 28px 20px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 20px;
}
.filter-progress { margin-bottom: 24px; }
.filter-step-label { font-size: 14px; font-weight: 600; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; }
.filter-bar { margin-top: 10px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.filter-bar span { display: block; height: 100%; width: 33.34%; background: var(--accent); border-radius: 4px; transition: width .4s var(--ease-out); }

.filter-step { border: 0; padding: 0; min-width: 0; }
.filter-step + .filter-step { margin-top: 36px; }
.filter-step legend { font-family: var(--serif); font-weight: 700; font-size: clamp(22px, 3vw, 28px); line-height: 1.2; margin-bottom: 18px; padding: 0; }
.options { display: grid; gap: 10px; }
.option {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  min-height: 56px; padding: 14px 18px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.option:hover { border-color: #4a463f; }
.option input {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px; flex: none; margin: 0;
  border: 2px solid var(--text-soft); border-radius: 50%;
  display: grid; place-content: center;
  cursor: pointer;
}
.option input::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .15s ease; }
.option input:checked { border-color: var(--accent); }
.option input:checked::before { transform: scale(1); }
.option input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.option:has(input:checked) { border-color: var(--accent); background: rgba(201,164,106,.07); }

.other-field { display: grid; gap: 8px; margin-top: 14px; font-size: 15px; color: var(--text-soft); }
.other-field input {
  min-height: 52px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--text);
  font: inherit; font-size: 17px;
}
.other-field input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

.filter-error { min-height: 1.6em; margin-top: 16px; color: #F0A58C; font-size: 15px; font-weight: 600; }
.filter-nav { margin-top: 8px; display: flex; flex-direction: column-reverse; gap: 12px; }
.filter-nav .btn-wa { width: 100%; }
.filter-back {
  min-height: 48px; padding: 0 18px;
  color: var(--text-soft); font-weight: 600; text-decoration: underline; text-underline-offset: 4px;
}
.filter-back:hover { color: var(--text); }

.direct { margin-top: 20px; text-align: center; font-size: 15px; }
.direct a { color: var(--text-soft); text-decoration: underline; text-underline-offset: 4px; }
.direct a:hover { color: var(--text); }

/* Modo por pasos: solo cuando el JS tomó el control del formulario */
.filter:not(.is-stepped) .filter-progress { display: none; }
.filter.is-stepped .filter-step { display: none; }
.filter.is-stepped .filter-step.is-current { display: block; }
.filter.is-stepped .filter-step + .filter-step { margin-top: 0; }
.filter.is-stepped .other-field:not(.is-open) { display: none; }

/* --- FAQ --- */
.faq .section-title { margin-bottom: 32px; }
.faq-list details { border-top: 1px solid var(--line); }
.faq-list details:last-child { border-bottom: 1px solid var(--line); }
.faq-list summary {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 64px; padding: 18px 0;
  font-size: 18px; font-weight: 600; cursor: pointer; list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+"; flex: none; font-family: var(--serif); font-size: 28px; line-height: 1; color: var(--accent);
  transition: transform .3s var(--ease-out);
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { padding: 0 0 22px; color: var(--text-soft); max-width: 62ch; }

/* --- Footer --- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 112px; }
.footer-inner { display: grid; gap: 14px; }
.footer-brand { font-family: var(--serif); font-weight: 700; font-size: 18px; }
.legal { font-size: 14px; color: var(--text-soft); max-width: 72ch; }

/* --- Botón fijo (mobile: barra a todo el ancho) --- */
.sticky-cta.btn-wa {
  position: fixed; z-index: 60;
  left: 12px; right: 12px; bottom: 12px;
  width: auto;
  transition: transform .35s var(--ease-out), opacity .35s var(--ease-out), background .2s ease;
}
.sticky-cta.is-hidden { transform: translateY(150%); opacity: 0; pointer-events: none; }

/* =============================================================
   7. Efectos (solo cuando hay JS; sin JS todo se ve)
   ============================================================= */

/* Título: palabra por palabra (100% CSS, no depende de main.js) */
.js .hero-title .w {
  opacity: 0; transform: translateY(.35em);
  animation: wordIn .7s var(--ease-out) forwards;
  animation-delay: calc(var(--i) * 80ms + 150ms);
}
@keyframes wordIn { to { opacity: 1; transform: none; } }

/* Subrayado dibujado después de las palabras */
.js .hl-line path {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: drawLine .9s var(--ease-out) 1.05s forwards;
}
@keyframes drawLine { to { stroke-dashoffset: 0; } }

/* Aparición de secciones */
.js [data-reveal] {
  opacity: 0; transform: translateY(28px);
  transition: opacity .8s var(--ease-soft), transform .8s var(--ease-soft);
}
.js [data-reveal].is-revealed { opacity: 1; transform: none; }
/* Red de seguridad: si main.js no arranca, todo aparece a los 3 s */
.js:not(.js-ready) [data-reveal] { animation: revealSafety .01s 3s forwards; }
@keyframes revealSafety { to { opacity: 1; transform: none; } }
/* Regla defensiva de la skill */
.reveal[data-split] { opacity: 1; transform: none; }

/* Recorrido: cada paso se enciende con el scroll */
.js-ready .journey-step { color: var(--text-soft); transition: color .5s var(--ease-soft); }
.js-ready .journey-dot { background: var(--bg); border-color: var(--line); transition: background .5s var(--ease-soft), border-color .5s var(--ease-soft), box-shadow .5s var(--ease-soft); }
.js-ready .journey-step:not(:last-child)::after { background: var(--line); transition: background .5s var(--ease-soft); }
.js-ready .journey-step.is-on { color: var(--text); }
.js-ready .journey-step.is-on .journey-dot { background: var(--accent); border-color: var(--accent); }
.js-ready .journey-step.is-on:not(:last-child)::after { background: var(--accent); }
.js-ready .journey-step.is-last.is-on { color: var(--accent); }
.js-ready .journey-step.is-last.is-on .journey-dot { box-shadow: 0 0 0 6px rgba(201,164,106,.18); }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {
  :root { --gutter: 28px; }
  .hero-cta { align-items: flex-start; }
  .cta-note { text-align: left; }
  .filter { padding: 36px 32px; }
  .invite .btn-wa, .close .btn-wa { width: auto; }
}

@media (min-width: 720px) {
  :root { --section-y: 96px; }
  .header-cta { display: inline-flex !important; }
  .proof-list { grid-template-columns: repeat(4, 1fr); }
  .proof-item, .proof-item:nth-child(odd), .proof-item:nth-child(even) { padding: 36px 24px; border-top: 0; border-left: 1px solid var(--line); }
  .proof-item:first-child { border-left: 0; padding-left: 0; }

  /* Marquesina */
  .marquee {
    padding: 0; overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  }
  .marquee-track { display: flex; width: max-content; max-width: none; margin: 0; animation: marquee 60s linear infinite; }
  .marquee:hover .marquee-track { animation-play-state: paused; }
  .marquee-list, .marquee-list[aria-hidden="true"] { display: flex; }
  .marquee-list li {
    flex: none; padding: 22px 28px; margin-right: 16px;
    border: 1px solid var(--line); border-radius: 999px;
    background: var(--bg-2);
    font-size: 19px; white-space: nowrap;
  }
  .marquee-list li:last-child { border-bottom: 1px solid var(--line); }

  .pieces, .gets-grid { grid-template-columns: 1fr 1fr; }
  .cases-grid { grid-template-columns: repeat(3, 1fr); }
  .filter-nav { flex-direction: row; justify-content: space-between; align-items: center; }
  .filter-nav .btn-wa { width: auto; margin-left: auto; }

  /* Botón fijo abajo a la derecha */
  .sticky-cta.btn-wa { left: auto; right: 24px; bottom: 24px; }
  .site-footer { padding-bottom: 64px; }
}
@keyframes marquee { to { transform: translateX(-50%); } }

@media (min-width: 960px) {
  :root { --section-y: 112px; }
  .hero { padding: 96px 0 112px; }
  .diag-grid { grid-template-columns: 5fr 6fr; align-items: center; gap: 72px; }

  .journey { grid-template-columns: repeat(4, 1fr); padding-left: 0; margin-bottom: 64px; }
  .journey-step { flex-direction: column; align-items: flex-start; gap: 18px; padding: 0 24px 0 0; font-size: 19px; }
  .journey-step:not(:last-child)::after { left: 16px; right: 0; top: 7px; width: auto; height: 2px; }

  .pieces { grid-template-columns: repeat(4, 1fr); }
  .gets-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
  :root { --gutter: 40px; }
}

/* =============================================================
   9. Reduced motion — solo efectos intrusivos
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* El reflejo de los botones, las apariciones y la marquesina lenta se mantienen. */
}
