/* ═══════════════════════════════════════════
   El embudo · Zenuva — estilos (un solo archivo)
   ═══════════════════════════════════════════ */

:root {
  --cream: #F8F4ED;
  --cream-card: #FFFCF7;
  --sand: #C4B5A3;
  --bark: #5C4A3A;
  --bark-mid: #9A7B5B;
  --terra: #C4785A;
  --terra-soft: #F5E8E2;
  --terra-dark: #A8614A;
  --olive: #7A8B6A;
  --olive-soft: #E8EDE4;
  --olive-dark: #5F6E52;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.33, 0.9, 0.4, 1);
  --font-display: "Fraunces", Georgia, serif;
  --font-sans: "DM Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  background: #1A1512;
  font-family: var(--font-sans);
  color: var(--bark);
  -webkit-font-smoothing: antialiased;
}

#app-shell {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  height: 100%;
  height: 100dvh;
  background: #1A1512;
  position: relative;
  overflow: hidden;
}

#deck-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  background: var(--deck-bg, #1A1512);
}

#deck {
  width: 100%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

@media (min-width: 480px) {
  body {
    background:
      radial-gradient(ellipse 50% 40% at 50% 20%, rgba(196, 120, 90, 0.1), transparent 60%),
      #14110F;
  }
  #app-shell {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 24px 80px rgba(0, 0, 0, 0.35);
  }
}

/* ─── Progress ─── */
#progress-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, -100%);
  width: 100%;
  max-width: 28rem;
  z-index: 50;
  padding: max(0.7rem, env(safe-area-inset-top)) 1rem 0.7rem;
  transition: transform 0.45s var(--ease-out), background 0.4s ease, border-color 0.4s ease;
  --bar-bg: rgba(248, 244, 237, 0.94);
  --bar-border: rgba(196, 181, 163, 0.35);
  --bar-label: #9A7B5B;
  --bar-track: rgba(196, 181, 163, 0.35);
  --bar-fill-a: #C4785A;
  --bar-fill-b: #7A8B6A;
  --bar-brand: #C4785A;
  background: var(--bar-bg);
  border-bottom: 1px solid var(--bar-border);
}

#progress-header.theme-dark {
  --bar-bg: rgba(30, 25, 22, 0.94);
  --bar-border: rgba(232, 196, 184, 0.12);
  --bar-label: rgba(232, 196, 184, 0.82);
  --bar-track: rgba(245, 232, 226, 0.12);
  --bar-fill-a: #E8C4B8;
  --bar-fill-b: #C4785A;
  --bar-brand: #F5C4B0;
}

#progress-header.is-visible { transform: translate(-50%, 0); }

.progress-row { display: flex; align-items: center; gap: 0.75rem; }

.progress-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bar-label);
  flex-shrink: 0;
}

.progress-track {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: var(--bar-track);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bar-fill-a), var(--bar-fill-b));
  transition: width 0.55s var(--ease-out);
}

.progress-brand {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--bar-brand);
  flex-shrink: 0;
}

/* ─── Slides ─── */
.slide {
  position: relative;
  display: flex;
  flex-direction: column;
  height: var(--vvh, 100dvh);
  width: 100%;
  overflow: hidden;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  flex-shrink: 0;
  contain: strict;
}

/* Soft vignette — depth without lag */
.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse 85% 75% at 50% 45%, transparent 45%, rgba(0, 0, 0, 0.14) 100%);
  opacity: 0.55;
}

.slide--light::after,
.slide--warm::after,
.slide--close::after {
  background: radial-gradient(ellipse 85% 75% at 50% 45%, transparent 50%, rgba(92, 74, 58, 0.08) 100%);
  opacity: 0.7;
}

.slide__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 24rem;
  margin: 0 auto;
  padding: 4.75rem 1.25rem 3.25rem;
  gap: 1rem;
  position: relative;
  z-index: 2;
}

.slide--dark {
  background:
    radial-gradient(ellipse 80% 55% at 50% 38%, rgba(196, 120, 90, 0.16), transparent 70%),
    linear-gradient(180deg, #1A1512 0%, #2A231E 50%, #352E28 100%);
  color: var(--terra-soft);
}

.slide--light {
  background:
    radial-gradient(ellipse 70% 50% at 50% 42%, rgba(122, 139, 106, 0.14), transparent 70%),
    linear-gradient(180deg, #E8EFE0 0%, #F4F7F0 45%, #F8F4ED 100%);
  color: #4A5C3A;
}

.slide--warm {
  background:
    radial-gradient(ellipse 65% 45% at 50% 40%, rgba(196, 120, 90, 0.09), transparent 68%),
    linear-gradient(180deg, #F5F0E6 0%, #F8F4ED 55%, #FDF8F0 100%);
  color: var(--bark);
}

.slide--close {
  background:
    radial-gradient(ellipse 70% 55% at 50% 45%, rgba(122, 139, 106, 0.16), transparent 65%),
    linear-gradient(180deg, #F8F4ED 0%, #F1F5EB 100%);
  color: var(--bark);
}

.slide__aura { display: none; }

/* ─── Type ─── */
.section-tag {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.55;
  text-align: center;
  margin: 0;
}

.slide--dark .section-tag { color: #E8C4B8; opacity: 0.72; }
.slide--light .section-tag { color: var(--olive); }
.slide--warm .section-tag { color: var(--bark-mid); }
.slide--close .section-tag { color: var(--olive-dark); opacity: 0.7; }

.headline {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 7vw, 2.15rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-align: center;
  max-width: 16rem;
  margin: 0;
  text-wrap: balance;
}

.headline em { font-style: normal; }

.slide--dark .headline { color: var(--terra-soft); }
.slide--dark .headline em { color: #E8C4B8; }
.slide--light .headline { color: #4A5C3A; }
.slide--light .headline em { color: var(--olive); }
.slide--warm .headline { color: var(--bark); }
.slide--warm .headline em { color: var(--olive); }
.slide--close .headline { color: var(--olive-dark); }

.whisper {
  font-size: clamp(0.8125rem, 3.5vw, 0.9375rem);
  font-weight: 500;
  text-align: center;
  line-height: 1.4;
  max-width: 15rem;
  opacity: 0.75;
  margin: 0;
}

.slide--dark .whisper { color: rgba(245, 232, 226, 0.55); opacity: 1; }
.slide--light .whisper { color: var(--olive-dark); }

.promise-line {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 4.8vw, 1.35rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: center;
  max-width: 17rem;
  margin: 0;
  text-wrap: balance;
}

.promise-line em { font-style: normal; color: var(--olive); }

.leak-counter {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bark-mid);
  margin: 0;
}

/* ─── Visuals ─── */
.visual-stage {
  position: relative;
  width: 100%;
  max-width: 16rem;
  min-height: 16.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-stage--tall { min-height: 20rem; max-width: 18rem; }
.visual-stage--wide { max-width: 20rem; min-height: 13rem; }

.funnel-wrap {
  position: relative;
  width: 100%;
  max-width: min(15rem, 78vw);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.funnel-svg {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
  z-index: 2;
  /* Soft shadow without heavy blur cost on mobile */
  filter: drop-shadow(0 10px 22px rgba(92, 74, 58, 0.16));
}

.slide--dark .funnel-svg {
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.35));
}

.funnel-glow {
  position: absolute;
  width: 72%;
  height: 44%;
  top: 12%;
  left: 14%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 120, 90, 0.4), transparent 70%);
  z-index: 0;
  pointer-events: none;
  opacity: 0.7;
}

.slide--light .funnel-glow,
.slide--warm .funnel-glow {
  background: radial-gradient(circle, rgba(122, 139, 106, 0.32), transparent 70%);
}

.funnel-glow--sealed {
  opacity: 0.9;
  background: radial-gradient(circle, rgba(122, 139, 106, 0.48), transparent 68%);
}

.water-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.slide:not(.is-active) .water-canvas {
  visibility: hidden;
}

/* Compare / leave */
.compare-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
}

.compare-col { text-align: center; flex: 1; max-width: 7.5rem; }
.compare-col .funnel-wrap { max-width: 5.75rem; margin: 0 auto; }
.compare-col .funnel-svg { filter: drop-shadow(0 6px 14px rgba(92, 74, 58, 0.12)); }

.compare-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.55rem;
}

.compare-label--bad { color: var(--terra-dark); }
.compare-label--ok { color: var(--olive-dark); }

.compare-arrow {
  font-size: 1.25rem;
  color: var(--olive);
  opacity: 0.45;
  padding-bottom: 3.1rem;
}

.leave-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
}

.leave-row .funnel-wrap { max-width: 5.75rem; }

.clienta { width: 2.85rem; height: auto; opacity: 0.92; }

.leave-arrow {
  font-size: 1.75rem;
  color: var(--terra);
  opacity: 0.75;
}

.slide.is-active .leave-arrow { animation: nudgeRight 2.4s var(--ease-soft) infinite; }
.slide.is-active .clienta { animation: walkAway 2.8s var(--ease-soft) infinite; }

@keyframes nudgeRight {
  0%, 100% { transform: translateX(0); opacity: 0.55; }
  50% { transform: translateX(7px); opacity: 0.95; }
}

@keyframes walkAway {
  0%, 100% { transform: translateX(0); opacity: 0.9; }
  50% { transform: translateX(10px); opacity: 0.55; }
}

/* Chips */
.pieces-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  max-width: 17rem;
  margin-top: 0.15rem;
  min-height: 1.6rem;
}

.piece-chip {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #E8DDD0;
  background: var(--cream-card);
  color: var(--bark-mid);
  opacity: 0.35;
  transform: scale(0.92);
  transition: background 0.35s ease, border-color 0.35s ease, color 0.35s ease, opacity 0.35s ease, transform 0.35s var(--ease-out);
}

.piece-chip.is-sealed {
  background: var(--olive-soft);
  border-color: var(--olive);
  color: var(--olive-dark);
  opacity: 1;
  transform: scale(1);
}

.build-step.is-active .visual-stage {
  animation: sealPop 0.5s var(--ease-soft);
}

@keyframes sealPop {
  0% { transform: scale(0.97); opacity: 0.9; }
  60% { transform: scale(1.015); }
  100% { transform: scale(1); opacity: 1; }
}

/* CTA */
.qualify-box {
  width: 100%;
  max-width: 18.5rem;
  padding: 1.65rem 1.35rem 1.4rem;
  border-radius: 1.35rem;
  text-align: center;
  background: linear-gradient(160deg, rgba(255, 252, 247, 0.98), rgba(244, 247, 240, 0.95));
  border: 1.5px solid #B8C9A8;
  box-shadow: 0 20px 48px rgba(92, 74, 58, 0.12);
  position: relative;
  overflow: hidden;
}

.qualify-box::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 70%;
  background: radial-gradient(ellipse at center, rgba(122, 139, 106, 0.14), transparent 65%);
  pointer-events: none;
}

.qualify-question {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 6vw, 1.8rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #4A5C3A;
  margin: 0 0 0.55rem;
  position: relative;
  text-wrap: balance;
}

.cta-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  position: relative;
  margin-top: 1.35rem;
}

.btn-choice {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1rem 0.75rem;
  min-height: 48px;
  border-radius: 999px;
  transition: transform 0.18s var(--ease-out), background 0.18s ease;
}

.btn-choice:active { transform: scale(0.97); }

.btn-choice--yes {
  background: var(--olive);
  color: var(--cream);
  box-shadow: 0 10px 24px rgba(122, 139, 106, 0.3);
}

.btn-choice--no {
  background: transparent;
  color: var(--bark-mid);
  border: 1.5px solid rgba(154, 123, 91, 0.35);
}

.cta-panel.is-hidden { display: none; }
.cta-panel.is-entering { animation: ctaEnter 0.5s var(--ease-out); }

@keyframes ctaEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.cta-yes-mark {
  width: 3.15rem;
  height: 3.15rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--olive);
  color: var(--cream);
  font-size: 1.25rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(122, 139, 106, 0.32);
}

.cta-soft {
  font-size: 0.75rem;
  color: var(--bark-mid);
  margin: 0.85rem 0 0;
  opacity: 0.8;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: max(1.15rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  opacity: 0.35;
  z-index: 3;
  pointer-events: none;
  animation: hintBob 2.2s ease-in-out infinite;
}

.slide--dark .scroll-hint { color: #E8C4B8; }
.slide--light .scroll-hint,
.slide--warm .scroll-hint,
.slide--close .scroll-hint { color: var(--bark-mid); }

@keyframes hintBob {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.28; }
  50% { transform: translateX(-50%) translateY(5px); opacity: 0.55; }
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}

.slide.is-active .reveal { opacity: 1; transform: translateY(0); }
.slide.is-active .reveal-d1 { transition-delay: 0.08s; }
.slide.is-active .reveal-d2 { transition-delay: 0.18s; }
.slide.is-active .reveal-d3 { transition-delay: 0.28s; }

.funnel-hole { fill: none; stroke: var(--terra); stroke-width: 1.6; }
.funnel-hole--focus { animation: funnelHolePulse 1.15s ease-in-out infinite; }

@keyframes funnelHolePulse {
  0%, 100% { stroke-opacity: 1; }
  50% { stroke-opacity: 0.28; }
}

.funnel-seal-disk { transform-origin: center; transform-box: fill-box; }
.slide.is-active .funnel-seal-disk--new { animation: sealLand 0.65s var(--ease-soft) both; }

@keyframes sealLand {
  0% { transform: scale(0); opacity: 0; }
  55% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.slide#build-done.is-active .funnel-wrap {
  animation: doneRise 0.65s var(--ease-out);
}

@keyframes doneRise {
  from { transform: translateY(6px); opacity: 0.92; }
  to { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .scroll-hint,
  .leave-arrow,
  .clienta,
  .funnel-hole--focus,
  .funnel-seal-disk--new,
  .slide#build-done.is-active .funnel-wrap,
  .build-step.is-active .visual-stage {
    animation: none !important;
  }
}
