/* Nunito variable, servida desde la misma página (sin pedidos a terceros). */
@font-face {
  font-family: 'Nunito';
  src: url('assets/fonts/nunito.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   MARGEN · Hoja de estilos principal
   Mobile-first, diseño limpio y accesible, dark mode y reduced motion.
   ========================================================================== */

/* Variables de tema (Claro por defecto) */
:root {
  --bg: #F7F4EA;
  --bg-soft: #EFECE0;
  --text: #183E2C;
  --text-secondary: #4E5C51;
  --text-on-dark: #FFFFFF;
  --brand: #183E2C;
  --brand-light: #25583F;
  --brand-surface: rgba(24, 62, 44, 0.06);
  --lime: #D7F28B;
  --focus: #005FCC;
  --on-lime: #183E2C;
  --lavender: #E9E2F6;
  --lavender-dark: #2A2638;
  --peach: #FFE0C7;
  --peach-dark: #3A2B20;
  --card-bg: #FFFFFF;
  --card-border: rgba(24, 62, 44, 0.08);
  --card-shadow: 0 4px 20px rgba(24, 62, 44, 0.04), 0 1px 3px rgba(24, 62, 44, 0.02);
  --card-shadow-hover: 0 12px 32px rgba(24, 62, 44, 0.08);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --header-height: 72px;
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Modo Oscuro respetando prefers-color-scheme */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1510;
    --bg-soft: #141D16;
    --text: #EAF1E6;
    --text-secondary: #A7B4A8;
    --brand: #2F6B4B;
    --brand-light: #3D855E;
    --brand-surface: rgba(47, 107, 75, 0.2);
    --lime: #D7F28B;
    --focus: #8FCEFF;
    --on-lime: #183E2C;
    --lavender: #2A2638;
    --peach: #3A2B20;
    --card-bg: #162017;
    --card-border: rgba(234, 241, 230, 0.12);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    --card-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.4);
  }
}

/* Reset y caja */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: clip;
  position: relative;
  min-height: 100vh;
}

/* Enlace para lectores de pantalla / accesibilidad */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--brand);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  z-index: 9999;
  text-decoration: none;
  font-weight: 700;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 16px;
  outline: 3px solid var(--lime);
}

/* Tipografía base */
h1, h2, h3, h4 {
  color: var(--text);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

p {
  color: var(--text-secondary);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* Contenedor general */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 32px;
  }
}

/* ==========================================================================
   ENCABEZADO Y NAVEGACIÓN
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(247, 244, 234, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: background var(--transition-fast);
}

@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(15, 21, 16, 0.85);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text);
}

.brand-icon {
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.site-nav {
  display: none;
  align-items: center;
  gap: 24px;
}

.site-nav a {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

@media (min-width: 860px) {
  .site-nav {
    display: flex;
  }
}

.badge-tag {
  display: inline-block;
  padding: 6px 14px;
  background: var(--brand-surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 100px;
  border: 1px solid var(--card-border);
}

/* ==========================================================================
   1. HERO Y ANIMACIÓN DE CANVAS STICKY
   ========================================================================== */
.hero-section {
  position: relative;
  width: 100%;
  padding-top: var(--header-height);
}

.hero-scroll-track {
  position: relative;
  width: 100%;
}

.hero-sticky-stage {
  position: relative;
  width: 100%;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.hero-content {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: var(--brand-surface);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
  border: 1px solid var(--card-border);
}

.hero-title {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  line-height: 1.1;
  margin-bottom: 18px;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 30px;
}

/* Botones de Tiendas (Sin href, modo preview) */
.store-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto 28px;
}

@media (min-width: 540px) {
  .store-buttons {
    flex-direction: row;
    justify-content: center;
  }
}

@media (min-width: 900px) {
  .store-buttons {
    margin: 0 0 28px;
  }
}

.btn-store {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--brand);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(24, 62, 44, 0.2);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  cursor: default;
  opacity: 0.95;
  text-align: left;
  flex: 1;
}

.btn-store:disabled {
  cursor: default;
  opacity: 0.92;
}

.store-icon {
  flex-shrink: 0;
}

.btn-text {
  display: flex;
  flex-direction: column;
}

.btn-caption {
  font-size: 0.72rem;
  opacity: 0.8;
  line-height: 1.2;
}

.btn-label {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.25;
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
}

@media (min-width: 900px) {
  .hero-highlights {
    justify-content: flex-start;
  }
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.check-icon {
  color: var(--brand);
}

@media (prefers-color-scheme: dark) {
  .check-icon {
    color: var(--lime);
  }
}

/* ==========================================================================
   BACKGROUND VIDEO & CONTRAST OVERLAY
   ========================================================================== */
.bg-video {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
}

.video-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.55) 140px, rgba(0, 0, 0, 0.62) 100%);
}

/* Fallback visual cuando la fuente de video no es reproducible */
body.video-fallback {
  background: linear-gradient(180deg, #0d1a13 0%, #183e2c 50%, #0c1811 100%);
}

/* Si el video no carga, el elemento se queda igual: muestra su «poster», que es
   un cuadro del mismo clip. Antes se escondía y quedaba una pantalla negra. */
body.video-fallback .bg-video {
  display: block;
}

body.video-fallback .video-overlay {
  background: radial-gradient(circle at 70% 25%, rgba(37, 88, 63, 0.45) 0%, rgba(15, 21, 16, 0.85) 60%, #0a0f0b 100%);
}

.hero-container,
.section > .container,
.site-footer > .container {
  position: relative;
  z-index: 3;
}

/* ==========================================================================
   SECCIONES COMUNES
   ========================================================================== */
.section {
  padding: 80px 0;
  position: relative;
}

@media (min-width: 768px) {
  .section {
    padding: 120px 0;
  }
}

.bg-soft {
  background-color: var(--bg-soft);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px;
}

.section-tag {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
  background: var(--brand-surface);
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 14px;
}

@media (prefers-color-scheme: dark) {
  .section-tag {
    color: var(--lime);
  }
}

.section-title {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1.15rem;
  line-height: 1.6;
}

/* ==========================================================================
   2. DEMO DEL SISTEMA PROPIO
   ========================================================================== */
.demo-section {
  overflow: hidden;
}

.demo-shell {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
}

.demo-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 20px;
}

.demo-step {
  min-width: 0;
  padding: 8px 6px;
  border-radius: 100px;
  background: var(--bg-soft);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.demo-step.is-active {
  background: var(--brand);
  color: #fff;
}

.demo-status {
  min-height: 1.5em;
  margin-bottom: 18px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 700;
}

.demo-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.demo-panel[hidden] {
  display: none;
}

.demo-message {
  max-width: 92%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
}

.demo-message-label,
.demo-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.demo-message p {
  color: inherit;
  font-weight: 700;
}

.demo-message-user {
  align-self: flex-end;
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.demo-message-margo {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--lavender);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.demo-message-margo img {
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--card-bg);
}

.demo-button {
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 900;
  text-align: center;
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.demo-button-primary {
  background: var(--brand);
  color: #fff;
}

.demo-button-secondary {
  background: var(--bg-soft);
  border-color: var(--card-border);
  color: var(--text);
}

.demo-button:hover {
  transform: translateY(-1px);
}

.demo-review-heading,
.demo-confirmation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.demo-review-heading h3,
.demo-confirmation h3 {
  font-size: 1.25rem;
}

.demo-review-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 100px;
  background: var(--brand-surface);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 900;
}

.demo-proposals {
  display: grid;
  gap: 10px;
}

.demo-proposal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 14px;
  padding: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
}

.demo-proposal-category {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 900;
}

.demo-proposal-detail,
.demo-edit-note,
.demo-result-copy {
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.demo-amount-field {
  grid-row: span 2;
  grid-column: 2;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--text);
  font-weight: 900;
}

.demo-amount-field input {
  width: 72px;
  padding: 4px 2px;
  border: 0;
  border-bottom: 2px solid var(--brand);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 900;
}

.demo-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
}

.demo-confirmation {
  justify-content: flex-start;
}

.demo-confirmation-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lime);
  color: var(--on-lime);
  font-weight: 900;
}

.demo-margin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.demo-margin-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--brand);
  color: #fff;
}

.demo-margin-card span,
.demo-margin-card small {
  color: inherit;
  opacity: 0.82;
  font-size: 0.8rem;
  font-weight: 700;
}

.demo-margin-card strong {
  font-size: clamp(1.6rem, 8vw, 2.2rem);
  letter-spacing: -0.03em;
}

.demo-margin-card-light {
  background: var(--lime);
  color: var(--on-lime);
}

.demo-disclaimer {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

@media (min-width: 600px) {
  .demo-shell {
    padding: 30px;
  }

  .demo-margin-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-color-scheme: dark) {
  .demo-review-count {
    color: var(--lime);
  }
}

/* ==========================================================================
   3. TU MARGEN DE UN VISTAZO (PHONE MOCKUP & CARDS)
   ========================================================================== */
.mockup-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

@media (min-width: 900px) {
  .mockup-grid {
    flex-direction: row;
    align-items: center;
    gap: 64px;
  }
}

.phone-mockup-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 380px;
}

.mockup-caption {
  margin-top: 14px;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

.phone-frame {
  width: 100%;
  background: #000000;
  padding: 12px;
  border-radius: 40px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.1);
  border: 4px solid #333333;
}

.phone-speaker {
  width: 80px;
  height: 6px;
  background: #222222;
  border-radius: 10px;
  margin: 6px auto 14px;
}

.phone-screen {
  background: var(--bg);
  border-radius: 32px;
  padding: 20px 16px 28px;
  overflow: hidden;
}

.app-header {
  margin-bottom: 20px;
}

.app-status-bar {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.app-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-brand-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
  font-size: 1.1rem;
}

.app-date-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--brand-surface);
  color: var(--text);
}

/* Tarjeta verde de Margen (Identidad visual de la app) */
.margin-card {
  background: #183E2C;
  color: #FFFFFF;
  padding: 24px 20px;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(24, 62, 44, 0.25);
  margin-bottom: 18px;
}

@media (prefers-color-scheme: dark) {
  .margin-card {
    background: #2F6B4B;
  }
}

.margin-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.margin-card-label {
  font-size: 0.88rem;
  font-weight: 700;
  opacity: 0.85;
}

.margin-badge {
  background: rgba(215, 242, 139, 0.25);
  color: var(--lime);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 100px;
  border: 1px solid rgba(215, 242, 139, 0.4);
}

.margin-card-amount {
  font-size: clamp(2rem, 6vw, 2.6rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.margin-card-amount .currency {
  font-size: 1.6rem;
  font-weight: 800;
  opacity: 0.9;
}

.margin-card-daily {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  line-height: 1.35;
  background: rgba(0, 0, 0, 0.18);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.app-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.summary-chip {
  background: var(--card-bg);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chip-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.chip-val {
  font-size: 0.9rem;
  font-weight: 800;
}

.chip-val.positive { color: #2B7A4B; }
.chip-val.negative { color: #A83232; }
.chip-val.pending { color: #8A5310; }
.chip-val.reserve { color: #58488A; }

@media (prefers-color-scheme: dark) {
  .chip-val.positive { color: #6ED398; }
  .chip-val.negative { color: #F57C7C; }
  .chip-val.pending { color: #E5A352; }
  .chip-val.reserve { color: #BDA8F5; }
}

.feature-bullets {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.bullet-card {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: var(--card-bg);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
}

.bullet-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bullet-icon.brand-tint {
  background: var(--brand-surface);
  color: var(--brand);
}

.bullet-icon.lime-tint {
  background: rgba(215, 242, 139, 0.4);
  color: var(--on-lime);
}

.bullet-icon.lavender-tint {
  background: var(--lavender);
  color: #58488A;
}

@media (prefers-color-scheme: dark) {
  .bullet-icon.brand-tint { color: var(--lime); }
  .bullet-icon.lavender-tint { color: #BDA8F5; }
}

.bullet-body h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

/* ==========================================================================
   3. CONTALE UN GASTO A MARGO (CHAT)
   ========================================================================== */
.split-layout {
  display: flex;
  flex-direction: column;
  gap: 48px;
  align-items: center;
}

@media (min-width: 900px) {
  .split-layout {
    flex-direction: row;
    justify-content: space-between;
  }

  .split-layout.reverse {
    flex-direction: row-reverse;
  }
}

.split-content {
  flex: 1;
  max-width: 520px;
}

.split-visual {
  flex: 1;
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: center;
}

.chat-highlights {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.chat-rule {
  background: var(--card-bg);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-rule strong {
  font-size: 1rem;
  color: var(--text);
}

.chat-rule span {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.security-note {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  background: var(--brand-surface);
  border-color: rgba(24, 62, 44, 0.12);
}

.security-note svg {
  color: var(--brand);
  flex-shrink: 0;
}

@media (prefers-color-scheme: dark) {
  .security-note svg {
    color: var(--lime);
  }
}

/* Simulación visual de Chat */
.chat-card-wrap {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-bubble {
  border-radius: 18px;
  padding: 14px 18px;
  font-size: 0.95rem;
  max-width: 88%;
}

.user-bubble {
  align-self: flex-end;
  background: var(--brand);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-bubble p {
  color: #FFFFFF;
}

.chat-time {
  font-size: 0.7rem;
  opacity: 0.75;
  align-self: flex-end;
}

.chat-response-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.chat-avatar {
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--lavender);
  padding: 2px;
}

.margo-bubble {
  background: var(--lavender);
  color: var(--text);
  border-bottom-left-radius: 4px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.margo-greeting {
  font-weight: 700;
  color: var(--text);
}

.proposal-card {
  background: var(--card-bg);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
}

.proposal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 0.95rem;
}

.prop-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.proposal-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn-mock {
  padding: 8px 14px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 800;
  display: inline-block;
}

.btn-mock.confirm {
  background: var(--brand);
  color: #FFFFFF;
}

.btn-mock.edit {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--card-border);
}

/* ==========================================================================
   4. TUS PAGOS LLEGAN SOLOS (GRID & BANNER)
   ========================================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

@media (min-width: 768px) {
  .cards-grid.three-cols {
    grid-template-columns: repeat(3, 1fr);
  }
}

.info-card {
  background: var(--card-bg);
  padding: 32px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.card-icon-badge {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--brand-surface);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (prefers-color-scheme: dark) {
  .card-icon-badge {
    color: var(--lime);
  }
}

.info-card h3 {
  font-size: 1.25rem;
}

.inbox-banner {
  background: var(--lavender);
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

@media (min-width: 768px) {
  .inbox-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.inbox-banner-text strong {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.inbox-badge {
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 100px;
  white-space: nowrap;
}

/* ==========================================================================
   5. MARGO LEE TUS TICKETS
   ========================================================================== */
.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 28px;
}

.check-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  padding-left: 28px;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--brand);
  font-weight: 900;
  font-size: 1.1rem;
}

@media (prefers-color-scheme: dark) {
  .check-list li::before {
    color: var(--lime);
  }
}

.check-list strong {
  font-size: 1.05rem;
}

.ticket-visual-card {
  width: 100%;
  background: #FFFFFF;
  color: #183E2C;
  border: 1px dashed rgba(24, 62, 44, 0.25);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--card-shadow);
  font-family: 'Courier New', Courier, monospace;
}

.ticket-top {
  text-align: center;
  margin-bottom: 18px;
}

.ticket-store {
  display: block;
  font-weight: 900;
  font-size: 1.05rem;
}

.ticket-date {
  font-size: 0.78rem;
  opacity: 0.7;
}

.ticket-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
}

.ticket-row {
  display: flex;
  justify-content: space-between;
}

.ticket-divider {
  border-top: 1px dashed rgba(24, 62, 44, 0.3);
  margin: 16px 0;
}

.ticket-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 900;
  font-size: 1.15rem;
}

.total-badge {
  background: #D7F28B;
  color: #183E2C;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.ocr-badge-row {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-family);
  font-size: 0.82rem;
  font-weight: 700;
  background: #F7F4EA;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.margo-mini {
  border-radius: 50%;
  flex-shrink: 0;
}

/* ==========================================================================
   6. GASTOS FIJOS Y ESTADÍSTICAS
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.stats-card {
  background: var(--card-bg);
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
}

.stats-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stats-title {
  font-size: 1.25rem;
  font-weight: 900;
}

.stats-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--brand-surface);
  color: var(--text);
}

.stats-explainer {
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.recurring-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recurring-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.rec-price {
  font-weight: 900;
  color: var(--brand);
}

@media (prefers-color-scheme: dark) {
  .rec-price {
    color: var(--lime);
  }
}

.bars-chart {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bar-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
}

.bar-track {
  height: 10px;
  background: var(--bg);
  border-radius: 100px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 100px;
}

@media (prefers-color-scheme: dark) {
  .bar-fill {
    background: var(--brand-light);
  }
}

.comfort-banner {
  background: var(--peach);
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 18px;
}

.support-avatar {
  border-radius: 50%;
  flex-shrink: 0;
}

.comfort-text strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 2px;
}

.comfort-text p {
  font-size: 0.92rem;
}

/* ==========================================================================
   7. CAMINO AL AHORRO
   ========================================================================== */
.steps-wrapper {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 560px) {
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .steps-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.step-card {
  background: var(--card-bg);
  padding: 24px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: transform var(--transition-fast);
}

.step-card:hover {
  transform: translateY(-2px);
}

.step-card.completed {
  border-color: var(--brand);
}

.step-card.completed .step-num {
  background: var(--brand);
  color: #FFFFFF;
}

.step-card.current {
  border-color: var(--lime);
  background: var(--card-bg);
  box-shadow: 0 0 0 2px var(--lime);
}

.step-card.current .step-num {
  background: var(--lime);
  color: var(--on-lime);
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 900;
}

.step-card h4 {
  font-size: 1.05rem;
}

.step-card p {
  font-size: 0.85rem;
}

.celebrate-callout {
  background: var(--lavender);
  padding: 20px 28px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 20px;
}

.celebrate-img {
  flex-shrink: 0;
}

.celebrate-callout strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 2px;
}

/* ==========================================================================
   8. PRIVACIDAD
   ========================================================================== */
.privacy-box {
  background: var(--card-bg);
  padding: 48px 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .privacy-box {
    padding: 64px 48px;
  }
}

.privacy-shield {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: var(--brand-surface);
  color: var(--brand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (prefers-color-scheme: dark) {
  .privacy-shield {
    color: var(--lime);
  }
}

.privacy-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 16px;
}

.privacy-lead {
  font-size: 1.15rem;
  max-width: 620px;
  margin: 0 auto 40px;
}

.privacy-features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  text-align: left;
  margin-bottom: 40px;
}

@media (min-width: 680px) {
  .privacy-features-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.pf-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg);
  padding: 20px;
  border-radius: var(--radius-md);
}

.pf-check {
  font-weight: 900;
  color: var(--brand);
  font-size: 1.2rem;
}

@media (prefers-color-scheme: dark) {
  .pf-check {
    color: var(--lime);
  }
}

.pf-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1rem;
}

.pf-item p {
  font-size: 0.88rem;
}

.btn-link {
  display: inline-block;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--brand);
  border-bottom: 2px solid var(--brand);
  padding-bottom: 4px;
  transition: opacity var(--transition-fast);
}

@media (prefers-color-scheme: dark) {
  .btn-link {
    color: var(--lime);
    border-color: var(--lime);
  }
}

.btn-link:hover {
  opacity: 0.8;
}

/* ==========================================================================
   9. PLANES
   ========================================================================== */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  max-width: 880px;
  margin: 0 auto 32px;
}

@media (min-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
}

.plan-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  border: 1px solid var(--card-border);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--card-shadow);
  position: relative;
}

.plan-card.featured {
  border: 2px solid var(--brand);
  box-shadow: 0 16px 40px rgba(24, 62, 44, 0.12);
}

@media (prefers-color-scheme: dark) {
  .plan-card.featured {
    border-color: var(--lime);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  }
}

.plan-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--lime);
  color: var(--on-lime);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 14px;
  border-radius: 100px;
  white-space: nowrap;
}

.plan-header {
  margin-bottom: 28px;
}

.plan-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.margo-pro-avatar {
  border-radius: 50%;
  margin-top: -10px;
}

.plan-name {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.plan-pitch {
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.price-val {
  font-size: 2.3rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.03em;
}

.price-period {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.plan-benefits {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
  flex-grow: 1;
}

.plan-benefits li {
  font-size: 0.92rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.plan-benefits li span {
  color: var(--brand);
  font-weight: 900;
}

@media (prefers-color-scheme: dark) {
  .plan-benefits li span {
    color: var(--lime);
  }
}

.plan-benefits-compact {
  gap: 16px;
  margin-bottom: 20px;
}

.plan-benefits-compact li {
  line-height: 1.45;
}

.benefit-check {
  margin-top: 1px;
  flex-shrink: 0;
}

.plan-note {
  font-size: 0.83rem;
  color: var(--text-secondary);
  background: var(--brand-surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: auto;
  margin-bottom: 24px;
  line-height: 1.4;
  text-align: center;
}

.lead-benefit {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.92rem;
}

.pro-benefits-list {
  gap: 12px;
  margin-bottom: 24px;
}

.pro-feature-card {
  background: var(--brand-surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.pro-feature-icon {
  color: var(--brand);
  font-size: 1rem;
  line-height: 1.3;
  flex-shrink: 0;
  font-weight: 900;
}

@media (prefers-color-scheme: dark) {
  .pro-feature-icon {
    color: var(--lime);
  }
}

.pro-feature-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pro-feature-title {
  font-size: 0.93rem;
  color: var(--text);
  font-weight: 800;
  line-height: 1.3;
}

.pro-feature-desc {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.38;
}

.btn-plan {
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
  transition: opacity var(--transition-fast);
}

.btn-plan:disabled {
  cursor: default;
  opacity: 0.85;
}

.btn-plan.primary {
  background: var(--brand);
  color: #FFFFFF;
}

.btn-plan.secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--card-border);
}

.whatsapp-clarification {
  max-width: 880px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.whatsapp-clarification svg {
  flex-shrink: 0;
  color: var(--brand);
}

@media (prefers-color-scheme: dark) {
  .whatsapp-clarification svg {
    color: var(--lime);
  }
}

/* ==========================================================================
   10. PREGUNTAS FRECUENTES (FAQ)
   ========================================================================== */
.faq-accordion {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: border-color var(--transition-fast);
}

.faq-item[open] {
  border-color: var(--brand);
}

@media (prefers-color-scheme: dark) {
  .faq-item[open] {
    border-color: var(--lime);
  }
}

.faq-question {
  list-style: none;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-icon {
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--brand);
  transition: transform var(--transition-fast);
}

@media (prefers-color-scheme: dark) {
  .faq-icon {
    color: var(--lime);
  }
}

.faq-item[open] .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 24px 24px;
}

.faq-answer p {
  font-size: 0.98rem;
  line-height: 1.6;
}

/* ==========================================================================
   11. PIE DE PÁGINA
   ========================================================================== */
.site-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--card-border);
  padding: 64px 0 40px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.footer-character {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.footer-brand-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text);
}

.footer-margo {
  border-radius: 50%;
  background: var(--lavender);
  padding: 6px;
}

.footer-tagline {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  font-style: italic;
}

.footer-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-links {
    grid-template-columns: repeat(3, 1fr);
    text-align: left;
  }
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col-title {
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.footer-col a {
  font-size: 0.92rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-col a:hover {
  color: var(--text);
}

.footer-contact-info {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.footer-contact-link {
  font-size: 0.92rem;
  color: var(--brand);
  font-weight: 700;
}

@media (prefers-color-scheme: dark) {
  .footer-contact-link {
    color: var(--lime);
  }
}

.footer-bottom {
  border-top: 1px solid var(--card-border);
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   REDUCED MOTION (prefers-reduced-motion)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-scroll-track {
    height: auto !important;
  }

  .hero-sticky-stage {
    position: relative !important;
    height: auto !important;
    padding: 40px 0 !important;
  }


  .info-card:hover,
  .step-card:hover {
    transform: none !important;
  }
}

/* El hero va sobre el video: su texto tiene que leerse igual de bien que el
   resto de la página, así que va en claro y con una sombra suave. */
.hero-section .hero-title,
.hero-section .hero-subtitle,
.hero-section .hero-badge,
.hero-section .highlight-item {
  color: #FFFFFF;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

.hero-section .hero-badge {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
}

.hero-section .check-icon {
  color: var(--lime, #D7F28B);
}

/* El encabezado queda sobre el video: se apoya en el oscurecido de arriba. */
.site-header {
  background: rgba(15, 21, 16, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.site-header .brand-name,
.site-header .site-nav a {
  color: #FFFFFF;
}

.site-header .site-nav a:hover,
.site-header .site-nav a:focus-visible {
  opacity: 0.6;
}

.site-header .badge-tag {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
  color: #FFFFFF;
}

/* ==========================================================================
   ASÍ SE VE EN TU TELÉFONO · el recorrido avanza con el scroll
   ========================================================================== */
.app-scroll-section {
  position: relative;
  background-color: var(--bg-soft);
}

/* El recorrido dura tres pantallas de scroll: eso da el avance del video. */
.app-scroll-track {
  position: relative;
  height: 300vh;
}

.app-scroll-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px 0;
}

.app-scroll-canvas {
  width: 100%;
  max-width: 1100px;
  flex: 1;
  min-height: 0;
}

.app-scroll-caption {
  max-width: 560px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  min-height: 2.6em;
}

.app-scroll-hint {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0;
}

/* Sin el canvas (menos movimiento o sin JS), queda el dibujo quieto. */
.app-scroll-still {
  display: none;
  width: 100%;
  max-width: 900px;
  height: auto;
  border-radius: var(--radius-xl);
}

.app-scroll-canvas[hidden] + .app-scroll-still,
.reduced-motion .app-scroll-still {
  display: block;
}

/* ==========================================================================
   HERO SOBRE EL VIDEO NUEVO: que se lea el texto y se vea Margo
   ========================================================================== */

/* En pantallas anchas el oscurecido va de izquierda a derecha: el texto queda
   sobre la parte oscura y Margo, con los billetes y las letras de la pared,
   se ve limpio a la derecha. */
@media (min-width: 900px) {
  .video-overlay {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.18) 160px, rgba(0, 0, 0, 0.18) 100%),
      linear-gradient(90deg, rgba(8, 18, 12, 0.92) 0%, rgba(8, 18, 12, 0.82) 34%, rgba(8, 18, 12, 0.35) 56%, rgba(8, 18, 12, 0.12) 72%, rgba(8, 18, 12, 0.05) 100%);
  }

  .hero-container {
    justify-content: flex-start;
  }

  .hero-content {
    text-align: left;
    max-width: 560px;
    margin: 0;
  }

  .hero-content .store-buttons,
  .hero-content .hero-highlights {
    justify-content: flex-start;
  }
}

/* En pantallas angostas el video se ve entero detrás: el oscurecido es parejo
   para que el texto centrado se lea igual. */
@media (max-width: 899px) {
  .video-overlay {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.78) 0%, rgba(8, 18, 12, 0.62) 30%, rgba(8, 18, 12, 0.72) 100%);
  }
}

/* El video arranca debajo del encabezado: así la cabeza de Margo y las letras
   de la pared no quedan nunca tapadas por la barra de arriba. */
.bg-video,
.video-overlay {
  top: var(--header-height);
  height: calc(100% - var(--header-height));
}

/* En pantallas angostas, recortar un video apaisado deja un primer plano donde
   no se entiende nada. Se muestra entero, como una franja arriba, y el texto
   arranca abajo: se ve a Margo completo y las letras de la pared se leen. */
@media (max-width: 899px) {
  .bg-video {
    object-fit: contain;
    object-position: center top;
  }

  .video-overlay {
    background:
      linear-gradient(180deg, rgba(8, 18, 12, 0.35) 0%, rgba(8, 18, 12, 0.35) 26vh, rgba(8, 18, 12, 0.93) 34vh, rgba(8, 18, 12, 0.97) 100%);
  }

  .hero-content {
    padding-top: 26vh;
  }
}

/* ==========================================================================
   MENÚ DE PANTALLAS ANGOSTAS
   ========================================================================== */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  background: none;
  border: 0;
  cursor: pointer;
}

.hamburger-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: #FFFFFF;
  border-radius: 2px;
  transition: transform 300ms ease, opacity 300ms ease;
}

.hamburger-btn[aria-expanded="true"] .bar-top {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-btn[aria-expanded="true"] .bar-middle {
  opacity: 0;
}

.hamburger-btn[aria-expanded="true"] .bar-bottom {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  padding: 0 32px;
  background: rgba(8, 18, 12, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.mobile-menu.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.mobile-menu-nav a {
  font-size: 1.9rem;
  font-weight: 800;
  color: #FFFFFF;
}

.mobile-menu-nav a:hover,
.mobile-menu-nav a:focus-visible {
  opacity: 0.6;
}

body.menu-open {
  overflow: hidden;
}

@media (max-width: 859px) {
  .hamburger-btn {
    display: flex;
  }
}

@media (min-width: 860px) {
  .mobile-menu {
    display: none;
  }
}

/* Todos los enlaces del menú se leen igual: ni el foco ni el visitado los apagan. */
.mobile-menu .mobile-menu-nav a,
.mobile-menu .mobile-menu-nav a:visited,
.mobile-menu .mobile-menu-nav a:focus,
.mobile-menu .mobile-menu-nav a:focus-visible {
  color: #FFFFFF;
  opacity: 1;
}

.mobile-menu .mobile-menu-nav a:focus-visible {
  outline: 2px solid var(--lime, #D7F28B);
  outline-offset: 4px;
  border-radius: 6px;
}

/* En el teléfono, el botón del menú ocupa el lugar de la etiqueta. */
@media (max-width: 859px) {
  .header-cta .badge-tag {
    display: none;
  }
}

/* Barra de avance del scroll, pegada al borde de abajo del encabezado. */
.header-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.14);
}

.header-progress-bar {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--lime, #D7F28B);
  transition: width 90ms linear;
}

.site-header {
  position: fixed;
}

/* En la computadora el video ocupa todo el ancho. El clip es 16:9, igual que
   casi cualquier monitor, así que lo que se recorta es una franja de piso:
   anclado arriba, Margo y las letras de la pared quedan enteros. Mostrarlo con
   «contain» dejaba barras negras a los costados. */
@media (min-width: 900px) {
  .bg-video {
    object-fit: cover;
    object-position: center top;
  }
}

/* El video es el fondo del hero, no de toda la página. Sin esto, se ve por
   detrás de cada sección y el texto queda ilegible sobre el verde. */
.section,
.app-scroll-section,
.site-footer {
  position: relative;
  z-index: 1;
  background-color: var(--bg);
}

.section.bg-soft,
.app-scroll-section {
  background-color: var(--bg-soft);
}

/* El hero es el único que deja ver el video. */
.hero-section {
  position: relative;
  z-index: 1;
  background-color: transparent;
}

/* En monitores grandes el recorrido puede ocupar más ancho sin estirarse:
   los cuadros anchos dan detalle de sobra. */
@media (min-width: 1500px) {
  .app-scroll-canvas {
    max-width: 1400px;
  }
}

/* ==========================================================================
   LAS SECCIONES ENTRAN AL LLEGAR
   ========================================================================== */

/* Solo se oculta si revelar.js marcó el documento: si el JS falla, todo se ve. */
.con-revelado [data-revelar] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 420ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.con-revelado [data-revelar][data-revelado] {
  opacity: 1;
  transform: none;
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  .con-revelado [data-revelar] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ==========================================================================
   PIEZAS ANIMADAS DE SECCIÓN (renderizadas con HyperFrames)
   ========================================================================== */
.pieza {
  margin: 0 0 40px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
}

.pieza-video {
  display: block;
  width: 100%;
  height: auto;
  background: var(--bg);
}

.pieza-pie {
  padding: 16px 22px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}

/* El dibujo quieto es para quien pide menos movimiento; ahí el video no va. */
.pieza-quieta {
  display: none;
  width: 100%;
  height: auto;
}

@media (prefers-reduced-motion: reduce) {
  .pieza-video { display: none; }
  .pieza-quieta { display: block; }
}

/* ==========================================================================
   ENTRADA DE LA PÁGINA
   ========================================================================== */

/* El velo nace escondido: si el JS no corre, nunca tapa nada. */
.velo {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0F1510;
  opacity: 1;
  transition: opacity 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

.velo[hidden] { display: none; }

.velo[data-fuera] {
  opacity: 0;
  pointer-events: none;
}

.velo-icono {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  animation: velo-latido 1.6s ease-in-out infinite;
}

/* En computadora el velo muestra a Margo moviéndose: ya se mueve solo, así que
   no necesita el latido, y va más grande. */
.velo-icono.velo-margo {
  width: auto;
  height: 300px;
  border-radius: 0;
  animation: none;
}

@keyframes velo-latido {
  0%, 100% { transform: scale(1); opacity: 0.92; }
  50% { transform: scale(1.07); opacity: 1; }
}

/* Mientras está el velo no se puede arrastrar la página por atrás. */
.con-velo body { overflow: hidden; }

/* El hero entra en orden. Solo se esconde si intro.js marcó el documento. */
.con-intro .hero-content [data-entra] {
  opacity: 0;
  transform: translateY(18px);
}

.hero-content [data-entra] {
  transition: opacity 520ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-content [data-entra][data-entro] {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .velo { display: none !important; }
  .con-intro .hero-content [data-entra] { opacity: 1; transform: none; }
  .velo-icono { animation: none; }
}
