/* =============================================================
   RezPensa — landing de presentación
   Archetype: Editorial Dark Warm, adaptado al verde real de la app.
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  /* Paleta real de la app (modo oscuro) */
  --bg:        #0E1511;
  --bg-2:      #121C16;
  --surface:   #16201A;
  --surface-2: #1B2620;
  --border:    #243029;
  --cream:     #ECF4EC;   /* texto principal (nunca #fff) */
  --cream-2:   #CFE0D2;
  --cream-3:   #8AA897;   /* metadatos / muted */
  --accent:    #5BB04E;
  --accent-2:  #8FD48A;
  --accent-soft:#3E8E4F;
  --accent-glow: rgba(91,176,78,0.55);
  --on-accent: #0E1511;   /* texto sobre el verde (oscuro: el verde es brillante) */
  --warning:   #F59E0B;
  --danger:    #F87171;
  --line:      rgba(236,244,236,0.12);
  --nav-bg:    rgba(14,21,17,0.82);
  --card-float: rgba(22,32,26,0.96);
  --mesh-strength: 0.8;
  --grain-opacity: 0.05;
  --grain-blend: overlay;
  --phone-frame: #0a0f0c;
  --phone-bezel: #2b3a31;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft:  cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --container: 1180px;
  --radius: 18px;
}

/* ---- Tema claro (paleta clara real de la app) ---- */
[data-theme="light"] {
  --bg:        #EEF3EC;   /* blanco roto verdoso (no blanco puro) */
  --bg-2:      #E6EDE2;
  --surface:   #FBFCF9;   /* off-white para tarjetas, no #FFF puro */
  --surface-2: #F1F5EE;
  --border:    #D7E2D2;   /* más marcado para separar capas */
  --cream:     #15251A;   /* texto principal */
  --cream-2:   #314A38;
  --cream-3:   #556B59;   /* muted, oscurecido para AA */
  --accent:    #3E8E4F;
  --accent-2:  #2E7D40;
  --accent-soft:#2E7D40;
  --accent-glow: rgba(62,142,79,0.35);
  --on-accent: #FFFFFF;   /* texto sobre el verde en claro */
  --warning:   #C2670B;
  --danger:    #C42121;
  --line:      rgba(20,40,25,0.14);
  --nav-bg:    rgba(238,243,236,0.88);
  --card-float: rgba(251,252,249,0.97);
  --mesh-strength: 0.42;
  --grain-opacity: 0;
  --phone-frame: #0a0f0c;
  --phone-bezel: #2b3a31;
}

/* Tema claro: sombra sutil para separar tarjetas del fondo roto */
[data-theme="light"] .step,
[data-theme="light"] .benefit,
[data-theme="light"] .why-row,
[data-theme="light"] .faq-item,
[data-theme="light"] .pill,
[data-theme="light"] .store-badge,
[data-theme="light"] .theme-toggle {
  box-shadow: 0 1px 2px rgba(20,40,25,.05), 0 8px 22px -14px rgba(20,40,25,.18);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
}
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--cream);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; line-height: 1.06; letter-spacing: -0.015em; font-weight: 500; }
em { font-style: italic; }
::selection { background: var(--accent); color: var(--bg); }

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

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.4rem; }
.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; z-index: 9999;
  padding: .6rem 1rem; background: var(--accent); color: var(--bg);
  border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.kicker {
  font-size: 0.8rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent-2); font-weight: 600; margin-bottom: 0.9rem;
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  max-width: 20ch; margin-bottom: 2.6rem;
}

/* =============================================================
   4. Components — botones
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.95rem 1.6rem; border-radius: 999px; font-weight: 600;
  transition: transform .4s var(--ease-soft), box-shadow .4s var(--ease-soft), background-color .3s, border-color .3s;
}
.btn-primary {
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 10px 30px -10px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 45px -12px var(--accent-glow);
}
.btn-primary:active { transform: translateY(-1px); transition-duration: .12s; }
.btn-ghost { border: 1px solid var(--line); color: var(--cream); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-2); transform: translateY(-3px); }

/* Card base */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* =============================================================
   5. Cursor (decorativo, solo desktop con ratón)
   ============================================================= */
.cursor { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; display: none; mix-blend-mode: difference; opacity: 0; transition: opacity .25s var(--ease-out); }
.cursor.is-ready { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .cursor { display: block; } }
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; will-change: transform; }
.cursor-dot { width: 5px; height: 5px; margin: -2.5px; background: #fff; border-radius: 50%; }
.cursor-ring { width: 30px; height: 30px; margin: -15px; border: 1px solid #fff; border-radius: 50%; transition: width .35s var(--ease-out), height .35s var(--ease-out), margin .35s var(--ease-out); }
.cursor.is-interactive .cursor-ring { width: 50px; height: 50px; margin: -25px; }
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }

/* =============================================================
   6. Mesh gradient (toques de luz verdes)
   ============================================================= */
.section-mesh { position: relative; overflow: clip; isolation: isolate; }
.section-mesh::before {
  content: ""; position: absolute; inset: -25%; z-index: -1;
  /* Gradiente ESTÁTICO: solo animamos transform (compositor) → barato */
  background:
    radial-gradient(42% 42% at 30% 34%, rgba(91,176,78,.30), transparent 70%),
    radial-gradient(46% 46% at 72% 66%, rgba(143,212,138,.18), transparent 72%);
  filter: blur(60px) saturate(120%);
  opacity: var(--mesh-strength);
  will-change: transform;
  transform: translateZ(0);
  animation: meshDrift 32s ease-in-out infinite alternate;
}
@keyframes meshDrift {
  from { transform: translate3d(-4%, -3%, 0) scale(1.05); }
  to   { transform: translate3d(5%, 4%, 0) scale(1.16); }
}

/* =============================================================
   7. NAV
   ============================================================= */
.nav { position: fixed; top: 0; inset-inline: 0; z-index: 100; transition: background-color .4s var(--ease-out), backdrop-filter .4s, box-shadow .4s; }
.nav.is-scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding-block: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 600; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--accent); }
.brand-text { font-family: var(--serif); font-size: 1.25rem; letter-spacing: -0.01em; }
.nav-links { display: none; align-items: center; gap: 1.8rem; }
@media (min-width: 860px) { .nav-links { display: flex; } }
.nav-link { position: relative; color: var(--cream-2); font-size: 0.95rem; padding-block: 0.3rem; }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1.5px;
  background: var(--accent); transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease-soft);
}
.nav-link:hover { color: var(--cream); }
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-cta {
  background: var(--accent); color: var(--on-accent); padding: 0.5rem 1.1rem;
  border-radius: 999px; font-weight: 600;
}
.nav-cta::after { display: none; }
.nav-cta:hover { color: var(--on-accent); background: var(--accent-2); }
.nav-right { display: flex; align-items: center; gap: 1.2rem; }
.theme-toggle {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--cream-2);
  transition: border-color .3s, color .3s, transform .3s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* =============================================================
   8. HERO
   ============================================================= */
.hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding-top: 6.5rem; padding-bottom: 4rem; }
.hero-grain {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: var(--grain-opacity); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
}
.hero-inner { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 980px) { .hero-inner { grid-template-columns: 1.05fr 0.95fr; gap: 2rem; } }

.hero-hook { color: var(--cream-3); font-size: 1.02rem; margin-bottom: 1.3rem; }
.hero-hook em { color: var(--cream); font-family: var(--serif); }
.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.3rem, 6.2vw, 4.3rem);
  line-height: 1.02; max-width: 16ch; margin-bottom: 1.4rem;
}
.hero-title em { color: var(--accent-2); }
.hero-sub { color: var(--cream-2); font-size: clamp(1rem, 1.4vw, 1.18rem); max-width: 46ch; margin-bottom: 2rem; }
.hero-sub strong { color: var(--cream); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 1.4rem; }
.hero-note { color: var(--cream-3); font-size: 0.9rem; }

/* ---- Mockup del móvil ---- */
.hero-visual { position: relative; display: grid; place-items: center; min-height: 480px; }
.phone {
  position: relative; width: 250px; aspect-ratio: 9 / 19.2;
  background: var(--phone-frame); border: 2px solid var(--phone-bezel); border-radius: 38px;
  padding: 12px; box-shadow: 0 50px 90px -30px rgba(0,0,0,.7), 0 0 0 1px rgba(91,176,78,.12), 0 0 80px -30px var(--accent-glow);
  transform: perspective(1200px) rotateY(-12deg) rotateX(4deg);
  transition: transform .25s linear;
}
.phone-notch { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 90px; height: 18px; background: var(--phone-frame); border-radius: 0 0 12px 12px; z-index: 3; }
.phone-screen {
  position: relative; height: 100%; border-radius: 28px; overflow: hidden;
  background: #0b1410; border: 1px solid var(--border);
}
/* Capturas reales que se alternan en crossfade */
.app-shot {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center;
  opacity: 0; animation: shotCycle 13.5s ease-in-out infinite;
}
.shot-1 { animation-delay: 0s; }
.shot-2 { animation-delay: 4.5s; }
.shot-3 { animation-delay: 9s; }
/* Visibilidad por tema: oscuro por defecto, claro con [data-theme="light"] */
.shot-light { display: none; }
[data-theme="light"] .shot-dark { display: none; }
[data-theme="light"] .shot-light { display: block; }
@keyframes shotCycle {
  0%    { opacity: 0; }
  4%    { opacity: 1; }
  30%   { opacity: 1; }
  34%   { opacity: 0; }
  100%  { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shot { animation: none; opacity: 0; }
  .app-shot.is-active { opacity: 1; }
}

/* ---- Tarjetas flotantes ---- */
.float-card {
  position: absolute; display: flex; align-items: center; gap: 0.6rem;
  background: var(--card-float); border: 1px solid var(--border); border-radius: 14px;
  padding: 0.65rem 0.85rem;
  box-shadow: 0 20px 40px -18px rgba(0,0,0,.6); max-width: 215px;
  will-change: transform;
  animation: floatY 6s ease-in-out infinite;
}
.float-card .fc-icon { font-size: 1.2rem; }
.float-card div { display: flex; flex-direction: column; line-height: 1.25; }
.float-card strong { font-size: 0.78rem; }
.float-card span { font-size: 0.68rem; color: var(--cream-3); }
.float-card--spend { top: 4%; left: -4%; animation-delay: 0s; }
.float-card--item  { top: 42%; right: -8%; animation-delay: 1.2s; }
.float-card--list  { bottom: 3%; left: 2%; animation-delay: 2.4s; }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@media (max-width: 540px) {
  .float-card { position: relative; inset: auto; max-width: none; width: 100%; margin-top: 0.7rem; animation: none; }
  .hero-visual { min-height: auto; }
  .float-card--spend, .float-card--item, .float-card--list { left: auto; right: auto; top: auto; bottom: auto; }
}

/* =============================================================
   9. Secciones genéricas
   ============================================================= */
.section { padding-block: clamp(4rem, 9vw, 7rem); position: relative; }

/* ---- Pasos ---- */
.steps-grid { list-style: none; display: grid; gap: 1.2rem; grid-template-columns: 1fr; counter-reset: none; }
@media (min-width: 640px) { .steps-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .steps-grid { grid-template-columns: repeat(4, 1fr); } }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem 1.4rem; position: relative; }
.step-num { font-family: var(--serif); font-size: 0.9rem; color: var(--accent); letter-spacing: .1em; }
.step-icon { display: block; font-size: 1.7rem; margin: 0.6rem 0 0.8rem; }
.step h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.step p { color: var(--cream-3); font-size: 0.92rem; }

/* ---- Beneficios ---- */
.benefits-grid { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .benefits-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .benefits-grid { grid-template-columns: repeat(3, 1fr); } }
.benefit { padding: 1.8rem 1.5rem; transition: transform .5s var(--ease-soft), border-color .4s, box-shadow .5s; }
.benefit-icon { display: block; font-size: 1.9rem; margin-bottom: 0.9rem; }
.benefit h3 { font-size: 1.15rem; margin-bottom: 0.55rem; }
.benefit p { color: var(--cream-3); font-size: 0.95rem; }
.benefit:hover { border-color: rgba(91,176,78,.4); box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); }

/* ---- Tilt (cards 3D) ---- */
.has-tilt { --rx: 0deg; --ry: 0deg; transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d; transition: transform .55s var(--ease-soft); }
.has-tilt:hover { transition-duration: .15s; }

/* =============================================================
   10. Para qué sirve (dolor → solución) + FAQ
   ============================================================= */
.why-list { list-style: none; display: flex; flex-direction: column; gap: 0.9rem; }
.why-row {
  display: grid; gap: 0.4rem 1rem; align-items: center;
  grid-template-columns: 1fr; padding: 1.3rem 1.5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.why-pain { font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--cream); }
.why-arrow { display: none; color: var(--accent); font-weight: 600; }
.why-fix { color: var(--cream-3); }
.why-fix strong { color: var(--accent-2); font-weight: 600; }
@media (min-width: 800px) {
  .why-row { grid-template-columns: 1fr auto 1fr; }
  .why-arrow { display: inline; font-size: 1.3rem; }
}

/* FAQ (acordeón nativo <details>) */
.faq-inner { max-width: 780px; margin-inline: auto; }
.faq-list { display: flex; flex-direction: column; gap: 0.7rem; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 0 1.3rem; transition: border-color .3s;
}
.faq-item[open] { border-color: rgba(91,176,78,.4); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 1.1rem 0;
  font-weight: 600; font-size: 1.02rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1;
  transition: transform .3s var(--ease-out); flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { color: var(--cream-3); padding-bottom: 1.2rem; max-width: 62ch; }
.faq-item p strong { color: var(--cream-2); }

/* =============================================================
   11. Próximamente
   ============================================================= */
.coming { text-align: center; }
.coming-inner { max-width: 640px; margin-inline: auto; }
.coming-badge { display: inline-block; font-size: 0.75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-2); border: 1px solid var(--line); padding: 0.4rem 0.9rem; border-radius: 999px; margin-bottom: 1.4rem; }
.coming-title { font-family: var(--serif); font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 1rem; }
.coming-sub { color: var(--cream-2); font-size: 1.05rem; margin-bottom: 1.8rem; }
.store-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; margin-bottom: 1.8rem; }
.store-badge {
  display: inline-flex; align-items: center; gap: 0.6rem; text-align: left;
  padding: 0.6rem 1.1rem; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--cream); cursor: default; opacity: .85;
}
.store-badge-ico { display: grid; place-items: center; color: var(--cream); }
.store-badge small { display: block; font-size: 0.62rem; color: var(--cream-3); letter-spacing: .04em; text-transform: uppercase; }
.store-badge strong { font-size: 0.98rem; }
.coming-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.pill { font-size: 0.85rem; color: var(--cream-2); background: var(--surface); border: 1px solid var(--border); padding: 0.5rem 0.95rem; border-radius: 999px; }

/* Lista de espera (Tally) */
.waitlist {
  margin-top: 2.6rem; padding: 1.8rem 1.6rem 1.4rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  scroll-margin-top: 90px;
}
.waitlist-title { font-family: var(--serif); font-size: clamp(1.4rem, 3.5vw, 1.9rem); margin-bottom: 0.5rem; }
.waitlist-sub { color: var(--cream-2); font-size: 0.98rem; margin-bottom: 1.4rem; }
.waitlist-form { max-width: 460px; margin-inline: auto; }
.waitlist-form iframe { display: block; width: 100%; border: 0; }

/* =============================================================
   12. Footer
   ============================================================= */
.footer { border-top: 1px solid var(--border); padding-top: 3rem; padding-bottom: 1.5rem; background: var(--bg-2); }
.footer-inner { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer-inner { grid-template-columns: 1.4fr 1fr auto; align-items: start; } }
.footer-brand .brand-text { font-size: 1.4rem; }
.footer-brand p { color: var(--cream-3); font-size: 0.92rem; margin-top: 0.5rem; max-width: 30ch; }
.footer-links { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-links a { color: var(--cream-2); font-size: 0.92rem; width: max-content; position: relative; }
.footer-links a:hover { color: var(--accent-2); }
.footer-social { display: flex; gap: 0.6rem; }
.social { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); color: var(--cream-2); transition: border-color .3s, color .3s, transform .3s; }
.social:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; margin-top: 2.5rem; padding-top: 1.4rem; border-top: 1px solid var(--border); color: var(--cream-3); font-size: 0.82rem; }
.footer-mute { color: var(--cream-3); opacity: .7; }

/* =============================================================
   13. Reveal on scroll
   ============================================================= */
/* Solo se oculta si hay JS (.js en <html>); sin JS el contenido se ve siempre */
.js [data-reveal] { opacity: 0; transform: translateY(34px); transition: opacity .8s var(--ease-soft), transform .8s var(--ease-soft); }
.js [data-reveal].is-revealed { opacity: 1; transform: none; }

/* =============================================================
   14. Reduced-motion — solo lo intrusivo
   (NO se desactivan hovers, tilt, reveals, mesh)
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .float-card { animation: none; }
}
