/* =========================================================
   Eulogio Rivas - Landing de conversion
   Tema: claro minimalista · acento naranja
   Sistema de radios: botones = pill · tarjetas = 18px
   Un solo acento (#FF5B04) en toda la página
   ========================================================= */

:root {
  --bg: #FAFAF8;          /* hueso */
  --surface: #FFFFFF;
  --surface-2: #F3F1EC;   /* tinte cálido para bandas */
  --ink: #16130F;         /* casi negro cálido */
  --ink-soft: #57534C;    /* gris cálido, AA sobre --bg */
  --line: #E4E1DA;
  --accent: #FF5B04;      /* naranja brillante */
  --accent-deep: #E24E00; /* naranja hover */
  --accent-wash: #FFF1E8; /* naranja muy claro para fondos */

  --radius-card: 18px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 50px -24px rgba(60, 34, 10, 0.28);
  --shadow-lift: 0 26px 60px -22px rgba(226, 78, 0, 0.30);

  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;

  --wrap: 1180px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 12px 0;
}
.skip-link:focus { left: 0; }

.accent { color: var(--accent); }

/* Iconos SVG incrustados (heredan el color del texto) */
.ico { width: 1em; height: 1em; fill: currentColor; flex: none; vertical-align: -0.125em; }

/* Eyebrow (usado 1 sola vez en la página) */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 20px;
}

/* ---------- Botones ---------- */
.btn {
  --btn-bg: var(--accent);
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-body); font-weight: 700; font-size: 0.98rem;
  color: var(--ink); background: var(--btn-bg);
  padding: 12px 22px; border-radius: var(--radius-pill);
  border: 1px solid transparent; white-space: nowrap; cursor: pointer;
  transition: transform .35s var(--ease), background .3s var(--ease), box-shadow .35s var(--ease);
  will-change: transform;
}
.btn .ico { width: 1.2em; height: 1.2em; }
.btn:hover { background: var(--accent-deep); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn:active { transform: translateY(0) scale(.98); }
.btn--lg { font-size: 1.05rem; padding: 15px 30px; }
.btn--sm { font-size: 0.9rem; padding: 9px 16px; }
.btn--ghost {
  background: transparent; color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { background: var(--surface); border-color: var(--ink); box-shadow: none; color: var(--ink); }

/* Foco visible accesible */
a:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-pill);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 250, 248, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.nav.is-stuck { border-color: var(--line); box-shadow: 0 8px 30px -20px rgba(0,0,0,.25); }
.nav__inner { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.nav__brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; }
.nav__mark {
  display: grid; place-items: center; width: 34px; height: 34px;
  background: var(--ink); color: var(--bg); border-radius: 10px;
  font-family: var(--font-display); font-weight: 800; font-size: 0.82rem; letter-spacing: .02em;
}
.nav__name { font-size: 1.02rem; letter-spacing: -0.01em; }
.nav__actions { display: flex; align-items: center; gap: 26px; }
.nav__links { display: flex; gap: 30px; font-weight: 500; font-size: 0.96rem; }
.nav__toggle {
  display: none; align-items: center; justify-content: center;
  width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); cursor: pointer;
  transition: border-color .25s var(--ease);
}
.nav__toggle:hover { border-color: var(--ink); }
.nav__toggle .ico { width: 1.35rem; height: 1.35rem; }
.nav__toggle .ico--close { display: none; }
.nav__links a { color: var(--ink-soft); position: relative; padding: 4px 0; transition: color .25s var(--ease); }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--accent); transition: width .3s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 8vw, 104px); }
.hero__grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center;
}
.hero__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.6rem, 6.2vw, 4.6rem); line-height: 1.02;
  letter-spacing: -0.035em; margin-bottom: 22px;
}
.hero__sub { font-size: clamp(1.05rem, 2vw, 1.22rem); color: var(--ink-soft); max-width: 34ch; margin-bottom: 32px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* Foto */
.hero__photo { position: relative; }
.photo-frame {
  position: relative; aspect-ratio: 4 / 5; border-radius: 24px; overflow: hidden;
  background: linear-gradient(150deg, var(--accent-wash), var(--surface-2));
  border: 1px solid var(--line); box-shadow: var(--shadow-soft);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-frame__hint {
  position: absolute; inset: 0; display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; color: var(--ink-soft);
  font-size: 0.9rem; font-weight: 500;
}
.photo-frame__hint .ico { width: 2rem; height: 2rem; opacity: .6; }
.photo-frame.is-empty .photo-frame__hint { display: flex; }
.photo-badge {
  position: absolute; left: 18px; bottom: 18px;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--ink); color: var(--bg);
  padding: 9px 15px; border-radius: var(--radius-pill);
  font-size: 0.85rem; font-weight: 600; box-shadow: var(--shadow-soft);
}
.photo-badge .ico { color: var(--accent); width: 1.05em; height: 1.05em; }

/* ---------- Embudo ---------- */
.funnel { padding: clamp(56px, 9vw, 110px) 0; background: var(--surface-2); }
.funnel__intro { max-width: 62ch; margin-bottom: 40px; }
.funnel__intro h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -0.03em; margin-bottom: 18px;
}
.funnel__intro p { color: var(--ink-soft); font-size: 1.1rem; max-width: 46ch; }

/* Colores compartidos por fase (leyenda, puntos de circuito y segmentos) */
.dot[data-stage="1"], .ldot[data-stage="1"] { background: #C9C4BA; fill: #C9C4BA; }
.dot[data-stage="2"], .ldot[data-stage="2"] { background: #F5A66B; fill: #F5A66B; }
.dot[data-stage="3"], .ldot[data-stage="3"] { background: #FF7A33; fill: #FF7A33; }
.dot[data-stage="4"], .ldot[data-stage="4"] { background: var(--accent); fill: var(--accent); }
.fstage[data-stage="1"] { fill: #C9C4BA; }
.fstage[data-stage="2"] { fill: #F5A66B; }
.fstage[data-stage="3"] { fill: #FF7A33; }
.fstage[data-stage="4"] { fill: var(--accent); }
.circuit[data-stage="1"] { stroke: #C9C4BA; }
.circuit[data-stage="2"] { stroke: #F5A66B; }
.circuit[data-stage="3"] { stroke: #FF7A33; }
.circuit[data-stage="4"] { stroke: var(--accent); }
.pulse[data-stage="1"] { fill: #C9C4BA; }
.pulse[data-stage="2"] { fill: #F5A66B; }
.pulse[data-stage="3"] { fill: #FF7A33; }
.pulse[data-stage="4"] { fill: var(--accent); }

/* Segmentos del embudo (comunes a escritorio y móvil) */
.fstage {
  opacity: 0; transform: translateY(-8px); transform-origin: center;
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.flabel {
  fill: #fff; font-family: var(--font-display); font-weight: 800;
  text-anchor: middle; dominant-baseline: middle;
  letter-spacing: 0.06em; opacity: 0; transition: opacity .5s var(--ease);
}
/* Estado animado de los segmentos (lo activa el JS al entrar en pantalla) */
.funnel-anim-svg.is-in .fstage { opacity: 1; transform: translateY(0); }
.funnel-anim-svg.is-in .fstage[data-stage="2"] { transition-delay: .12s; }
.funnel-anim-svg.is-in .fstage[data-stage="3"] { transition-delay: .24s; }
.funnel-anim-svg.is-in .fstage[data-stage="4"] { transition-delay: .36s; }
.funnel-anim-svg.is-in .flabel { opacity: 1; transition-delay: .5s; }

/* --- Diagrama de escritorio: circuito con pulso de luz --- */
.funnel__circuit { display: none; }
.circuit-svg { width: 100%; overflow: visible; }
.circuit-svg .flabel { font-size: 25px; }
.circuit-svg .flabel[y="429"] { font-size: 21px; }

.circuit { fill: none; stroke-width: 2.5; opacity: .55; }
.ldot { stroke: var(--surface-2); stroke-width: 3; }
.label-text {
  fill: var(--ink); font-family: var(--font-body); font-weight: 600; font-size: 19px;
}

/* Pulso de luz: recorre la traza y regresa, en bucle infinito y lento */
.pulse { offset-rotate: 0deg; animation: pulse-travel 3.6s ease-in-out infinite; }
@keyframes pulse-travel {
  0%   { offset-distance: 0%;   opacity: 0; }
  8%   { opacity: 1; }
  50%  { offset-distance: 100%; opacity: 1; }
  92%  { opacity: 1; }
  100% { offset-distance: 0%;   opacity: 0; }
}

/* --- Versión móvil: apilada, sin circuitos --- */
.funnel__mobile { display: grid; gap: 32px; justify-items: center; }
.funnel__legend { list-style: none; display: grid; gap: 14px; width: 100%; max-width: 360px; }
.funnel__legend li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.funnel__legend .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.funnel-svg-mobile { width: 100%; max-width: 320px; overflow: visible; }
.funnel-svg-mobile .flabel { font-size: 17px; }
.funnel-svg-mobile .flabel--pop { font-size: 15px; }

@media (min-width: 860px) {
  .funnel__circuit { display: block; }
  .funnel__mobile { display: none; }
}

/* ---------- Método ---------- */
.method { padding: clamp(56px, 9vw, 110px) 0; }
.section-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -0.03em;
  margin-bottom: 48px; max-width: 18ch;
}
.method__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 34px 28px 30px;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.step:hover { transform: translateY(-6px); box-shadow: var(--shadow-soft); border-color: #D8D3C8; }
.step__num {
  font-family: var(--font-display); font-weight: 800; font-size: 0.9rem;
  color: var(--accent); letter-spacing: .05em;
}
.step__icon { display: block; width: 2.1rem; height: 2.1rem; color: var(--ink); margin: 16px 0 14px; }
.step h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.28rem; letter-spacing: -0.01em; margin-bottom: 8px; }
.step p { color: var(--ink-soft); font-size: 1rem; }

/* ---------- Proyectos (carrusel infinito) ---------- */
.showcase { padding: clamp(48px, 8vw, 88px) 0 clamp(56px, 9vw, 96px); background: var(--surface-2); }
.showcase .section-title { margin-bottom: 32px; }

/* Pista con desvanecido en los bordes, para que el carrusel entre/salga con suavidad */
.marquee {
  overflow: hidden; width: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee__track {
  display: flex; gap: 28px; width: max-content; padding: 4px 24px 14px;
  animation: marquee-loop 34s linear infinite;
}
.marquee:hover .marquee__track, .marquee:focus-within .marquee__track { animation-play-state: paused; }
@keyframes marquee-loop { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.project {
  flex: none; width: min(80vw, 480px);
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); overflow: hidden;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.project:hover { transform: translateY(-6px); box-shadow: var(--shadow-soft); }
.project__shot {
  position: relative; height: 300px; overflow: hidden; padding: 22px;
  background: linear-gradient(150deg, var(--accent-wash), #ECE7DE);
  display: grid; place-items: center;
}
.project__shot img { width: 100%; height: 100%; object-fit: contain; transition: transform .5s var(--ease); }
.project:hover .project__shot img { transform: scale(1.03); }
.project__meta { padding: 24px 26px 26px; }
.project__meta h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; letter-spacing: -0.01em; margin-bottom: 8px; }
.project__meta p { color: var(--ink-soft); margin-bottom: 16px; }
.project__link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent-deep); }
.project__link .ico { transition: transform .3s var(--ease); }
.project:hover .project__link .ico { transform: translate(3px, -3px); }

/* ---------- Madrid ---------- */
.local { padding: clamp(64px, 10vw, 120px) 0; text-align: center; }
.local__inner { max-width: 640px; margin-inline: auto; }
.local__pin { width: 2.4rem; height: 2.4rem; color: var(--accent); margin-bottom: 18px; display: inline-block; }
.local h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.08; letter-spacing: -0.03em; margin-bottom: 18px; }
.local p { color: var(--ink-soft); font-size: 1.15rem; }

/* ---------- CTA final ---------- */
.cta { padding: clamp(40px, 6vw, 64px) 0 clamp(64px, 9vw, 110px); }
.cta__inner {
  background: var(--ink); color: var(--bg); border-radius: 28px;
  padding: clamp(44px, 7vw, 76px) 28px; text-align: center;
  position: relative; overflow: hidden;
}
.cta__inner::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% -10%, rgba(255,91,4,.32), transparent 60%);
  pointer-events: none;
}
.cta__inner > * { position: relative; }
.cta h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 14px; }
.cta p { color: rgba(250,250,248,.72); font-size: 1.15rem; margin-bottom: 30px; }

/* ---------- Contacto (formulario) ---------- */
.contact { padding: clamp(40px, 6vw, 64px) 0 clamp(72px, 10vw, 130px); }
.contact__grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: start; }
.contact__copy h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.08; letter-spacing: -0.03em;
  margin-bottom: 16px; max-width: 14ch;
}
.contact__copy p { color: var(--ink-soft); font-size: 1.08rem; max-width: 38ch; }

.contact__card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 32px 30px;
  box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; gap: 18px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cfield { display: flex; flex-direction: column; gap: 7px; }
.cfield span { font-size: 0.88rem; font-weight: 600; color: var(--ink); }
.cfield span em { font-weight: 500; color: var(--ink-soft); font-style: normal; }
.cfield input, .cfield textarea {
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 14px; resize: vertical;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.cfield input:focus, .cfield textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash);
}
.cfield--hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn--block { width: 100%; justify-content: center; }

.contact__status { font-size: 0.92rem; color: var(--ink-soft); }
.contact__status--error { color: var(--accent-deep); }
.contact__success {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 32px 30px; text-align: center; font-family: var(--font-display); font-weight: 600;
  font-size: 1.1rem; box-shadow: var(--shadow-soft);
}

@media (max-width: 900px) {
  .contact__grid { grid-template-columns: 1fr; gap: 28px; }
  .contact__copy p { max-width: 100%; }
}
@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
  .contact__card { padding: 26px 22px; }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer__brand { display: flex; align-items: center; gap: 12px; }
.footer__brand strong { font-family: var(--font-display); display: block; }
.footer__brand span { font-size: 0.9rem; color: var(--ink-soft); }
.footer__links { display: flex; gap: 24px; font-weight: 500; }
.footer__links a { color: var(--ink-soft); transition: color .25s var(--ease); }
.footer__links a:hover { color: var(--accent-deep); }
.footer__copy { font-size: 0.88rem; color: var(--ink-soft); }

/* ---------- Animaciones de entrada ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: translateY(0); }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .hero__photo { order: -1; max-width: 380px; }
  .hero__sub { max-width: 46ch; }

  /* Nav móvil: los enlaces pasan a un panel desplegable */
  .nav__toggle { display: inline-flex; }
  .nav__links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 2px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 10px 24px 18px; box-shadow: var(--shadow-soft);
  }
  .nav__links a { padding: 12px 0; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .nav__links a:last-child { border-bottom: 0; }
  .nav__links a::after { display: none; }
  .nav.is-open .nav__links { display: flex; animation: navdrop .22s var(--ease); }
  .nav.is-open .nav__toggle .ico--open { display: none; }
  .nav.is-open .nav__toggle .ico--close { display: inline; }
}

@keyframes navdrop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 620px) {
  .wrap { padding-inline: 18px; }
  .nav__actions { gap: 12px; }
  .nav__wa span { display: none; }        /* botón WhatsApp solo icono, para caber en una línea */
  .nav__wa { padding: 9px 12px; }
  .method__grid { grid-template-columns: 1fr; }
  .hero { padding-top: 36px; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { justify-content: center; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

/* =========================================================
   ACCESIBILIDAD: movimiento reducido
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .reveal, .fstage, .flabel { opacity: 1 !important; transform: none !important; transition: none !important; }
  .btn:hover, .step:hover, .project:hover { transform: none !important; }
  .pulse { display: none !important; } /* el haz de luz se detiene: quedan las trazas estáticas */
  .circuit { opacity: .8 !important; }

  /* Carrusel de proyectos: se convierte en una fila estática, sin loop */
  .marquee { overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .marquee__track { animation: none !important; width: auto; flex-wrap: wrap; transform: none !important; }
  .marquee__track a[aria-hidden="true"] { display: none !important; }
}
