/* Página de inicio (para vender Mirada). */

.home { overflow-x: hidden; }

.foot, .home main > section {
  width: min(100% - 2.5rem, 72rem);
  margin-inline: auto;
}

.home .topnav { --topnav-w: 72rem; }

.section-title { font-size: var(--step-4); text-wrap: balance; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem; align-items: center;
  padding: clamp(1.25rem, 3vw, 2.5rem) 0 clamp(3rem, 5vw, 4.5rem);
}
@media (min-width: 920px) { .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.hero-copy { display: grid; gap: 1.4rem; max-width: 36rem; }
/* Línea chica sobre el título: la palabra clave para Google ("QR para matrimonios y bodas"),
   en el lenguaje de papelería (mayúsculas espaciadas, color de detalle). Va dentro del H1. */
.hero-kicker {
  display: block; margin-bottom: 0.9rem;
  font: 700 0.8125rem/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
}
.hero-title {
  /* ancho y alto: en un notebook (pantalla baja) no crece de más */
  font-size: clamp(2.6rem, min(1.5rem + 3.6vw, 9.5svh), 4.6rem);
  font-weight: 500;
 
  line-height: 0.98;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero-body { font-size: 1.125rem; line-height: 1.5; color: var(--ink-2); max-width: 34em; text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; padding-top: 0.4rem; }
/* Franja de confianza: lo que más preguntan los novios, en una línea. */
.hero-trust {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.55rem 1.4rem;
  font-size: var(--step--1); font-weight: 600;
}
.hero-trust li { display: inline-flex; align-items: center; gap: 0.55rem; }
.hero-trust li::before {
  content: ''; flex: none; width: 0.38rem; height: 0.72rem; margin: -0.2rem 0.1rem 0 0.2rem;
  border: solid var(--ok); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* La fiesta de fondo, el teléfono al frente y dos fotos impresas "saliendo" de él. */
.hero-visual {
  position: relative; justify-self: center; width: min(100%, 32rem);
  display: grid; grid-template-columns: minmax(0, 1fr); justify-items: end; align-items: center; padding: 0.5rem 0;
}
/* la foto asoma a la izquierda del teléfono */
.hero-backdrop {
  --len: 30px; --w: 2px;
  position: absolute; inset: 12% 22% 12% 0; padding: 12px;
}
.hero-backdrop img { width: 100%; height: 100%; object-fit: cover; object-position: 30% center; border-radius: 20px; }
/* el teléfono mide el doble de alto que de ancho: se limita para que quepa en la pantalla (menú + márgenes ≈ 230 px) */
.hero-device { position: relative; z-index: 1; width: min(76%, 20.5rem, max(15rem, (100svh - 230px) / 2)); margin-right: 3%; }
.polaroid {
  position: absolute; z-index: 2; margin: 0;
  background: #fff; padding: 6px 6px 24px; border-radius: 3px;
  box-shadow: 0 22px 40px -20px rgb(20 30 50 / 0.6), 0 2px 6px rgb(20 30 50 / 0.12);
}
.polaroid img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.polaroid-a { width: clamp(6rem, 27%, 8.75rem); left: -0.75rem; bottom: 9%; transform: rotate(-7deg); }
/* La novia: misma diagonal que las manos (abajo-izquierda → arriba-derecha), pero apoyada
   en el marco del teléfono, nunca sobre la pantalla: así se lee el visor dorado y "…como la viste tú".
   Se ubica respecto al teléfono (está dentro de .hero-device), así no cambia según la pantalla. */
/* --pw: medida de la foto de la novia; la rama de flores se escala con ella para que queden proporcionadas. */
.hero-device { --pw: clamp(5rem, 33%, 7.75rem); }
.polaroid-b {
  width: var(--pw); transform: rotate(6deg);
  /* celular y tablet: sobre la esquina de arriba, por encima del marco dorado del visor */
  right: -0.5rem; bottom: calc(100% - 1.3rem);
}
/* Arreglo de rosas (foto PNG recortada, en espejo). El costado derecho del teléfono se lee como una
   sola pieza: la foto de la novia arriba y el ramo bajando DESDE ella (su punta asoma detrás de la
   foto) hasta cerca del final del teléfono. El tallo queda escondido detrás del teléfono (z-index -1),
   así nunca tapa la pantalla. Solo en computador (ver media query de 920 px). */
.hero-flowers { display: none; }
@media (max-width: 919px) {
  .hero-visual { padding-top: 4.25rem; } /* aire para la foto, sin chocar con el texto de arriba */
  .hero-device { --pw: clamp(5rem, 33%, 6.5rem); }
}
@media (min-width: 920px) {
  /* computador: al costado derecho, montada solo sobre el marco negro (10 px) */
  .polaroid-b { right: calc(6px - var(--pw)); bottom: auto; top: 7%; } /* a la altura de los nombres */
  /* Medidas del ramo en cqw = 1% del ANCHO del teléfono (su alto es siempre 200 cqw): así se puede
     sumar el alto de la foto de la novia (que depende del ancho) con posiciones verticales. */
  .hero-flowers {
    --pwq: clamp(5rem, 33cqw, 7.75rem);           /* = ancho de la foto de la novia */
    --top: calc(14cqw + var(--pwq) + 7px);         /* la foto termina en 14cqw + ancho + 23 px: el ramo asoma ~16 px detrás */
    --end: 134cqw;                                 /* dónde termina el ramo (200cqw = alto del teléfono); crece con la pantalla ↓ */
    display: block; position: absolute; z-index: -1; pointer-events: none;
    left: 100%; top: var(--top);
    height: calc(var(--end) - var(--top)); width: auto; max-width: none;
    transform: translateX(-28%);                   /* el 28% izquierdo (el tallo) queda tras el teléfono */
    filter: drop-shadow(0 14px 18px rgb(20 30 50 / 0.16));
  }
  /* Entre 920 y ~1400 px la columna es angosta y el teléfono queda pegado al borde: se corre
     un poco a la izquierda para que la foto no se corte ni quede apretada contra el borde
     (≥ 16 px de aire). En pantallas más anchas no cambia. */
  .hero-device { container-type: inline-size; margin-right: max(3%, min(5.75rem, calc((1420px - 100vw) / 1.6))); }
}
/* Lo que manda es que la punta nazca de la foto de la novia; cuánto baja depende del espacio a la
   derecha (más largo = más ancho). Valores medidos para dejar ≥ 16 px de aire con el borde. */
@media (min-width: 1280px) { .hero-flowers { --end: 162cqw; } } /* hasta el 81% del teléfono */
@media (min-width: 1500px) { .hero-flowers { --end: 186cqw; } } /* hasta el 93% */
.device {
  aspect-ratio: 390 / 780; width: 100%;
  border-radius: 44px; overflow: hidden;
  border: 10px solid #191d25; background: var(--paper);
  box-shadow: 0 50px 80px -50px rgb(20 30 50 / 0.6);
}
/* La demo se dibuja con el ancho de un celular real (375 px) y se achica para caber (home.js). */
.device iframe { width: 375px; height: 100%; border: 0; display: block; transform-origin: 0 0; visibility: hidden; }
/* home.js la muestra cuando terminó de cargar (con sus estilos); ver .is-ready */
.device iframe.is-ready { visibility: visible; }

/* ---------- cómo funciona ---------- */
.how { padding: clamp(2.5rem, 5vw, 4rem) 0; border-top: 1px solid var(--line); display: grid; gap: 2.5rem; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }
.steps li { display: grid; gap: 0.6rem; align-content: start; }
.step-n { font: italic 400 clamp(2.2rem, 1.4rem + 1.4vw, 2.7rem)/1 var(--display); color: var(--accent); }
.steps h3 { font-family: var(--sans); font-size: var(--step-1); font-weight: 700; letter-spacing: 0; }
.steps p { color: var(--ink-2); max-width: 32ch; }

/* ---------- drive ---------- */
.drive {
  padding: clamp(2.5rem, 5vw, 4rem) 0; border-top: 1px solid var(--line);
  display: grid; gap: 2.5rem; align-items: center;
}
@media (min-width: 880px) { .drive { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 4rem; } }
.drive-copy { display: grid; gap: 1rem; }
.drive-copy p { color: var(--ink-2); font-size: var(--step-1); max-width: 30ch; }

.drive-window {
  background: #fff; color: #1f1f1f; border-radius: 14px; overflow: hidden;
  border: 1px solid #dadce0; box-shadow: 0 30px 60px -40px rgb(20 30 50 / 0.5);
  font-family: var(--sans);
}
.drive-bar { display: flex; align-items: center; gap: 1rem; padding: 0.8rem 1rem; border-bottom: 1px solid #e8eaed; font-size: 0.875rem; color: #5f6368; }
.drive-dots { display: inline-flex; gap: 6px; }
.drive-dots i { width: 10px; height: 10px; border-radius: 50%; background: #dadce0; }
.drive-path { display: flex; align-items: baseline; min-width: 0; white-space: nowrap; }
.drive-path .crumb { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.drive-path strong { color: #1f1f1f; font-weight: 600; flex: none; }
.drive-path .sep { margin: 0 0.4rem; flex: none; }

/* Carpetas a la izquierda, la de "Tía Carmen" abierta a la derecha con sus fotos. */
.drive-body { display: grid; }
@media (min-width: 560px) { .drive-body { grid-template-columns: minmax(11rem, 0.8fr) minmax(0, 1.2fr); } }
.drive-list { list-style: none; margin: 0; padding: 0.4rem; border-bottom: 1px solid #e8eaed; }
@media (min-width: 560px) { .drive-list { border-bottom: 0; border-right: 1px solid #e8eaed; } }
/* nombre arriba y cantidad de archivos abajo, para que quepa en la columna angosta */
.drive-list li {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 0.7rem; align-items: center;
  padding: 0.5rem 0.7rem; font-size: 0.9375rem; line-height: 1.3; border-radius: 8px;
}
.drive-list li > span:not(.count) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-list li.is-open { background: #e8f0fe; color: #0b57d0; font-weight: 600; }
.drive-list li.is-open svg path { fill: #0b57d0; }
.drive-list svg { width: 20px; height: 20px; grid-row: span 2; }
.drive-list .count { color: #5f6368; font-size: 0.75rem; font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 559px) { .drive-list li:nth-child(n + 4) { display: none; } }

.drive-grid {
  list-style: none; margin: 0; padding: 0.9rem;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; align-content: start;
}
.drive-grid li { display: grid; gap: 0.3rem; min-width: 0; }
.drive-grid img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #f1f3f4; }
.drive-grid span { font-size: 0.72rem; color: #3c4043; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- privacidad ---------- */
.privacy { padding: clamp(2.5rem, 5vw, 4rem) 0; border-top: 1px solid var(--line); display: grid; gap: 2rem; }
@media (min-width: 880px) { .privacy { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 4rem; } }
.promises { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.promises li {
  position: relative; padding-left: 2.2rem; font-size: var(--step-1); line-height: 1.45; max-width: 38ch;
}
.promises li::before {
  content: ''; position: absolute; left: 0; top: 0.2em; width: 1.1rem; height: 1.1rem;
  --c: var(--accent); --len: 6px; --w: 1.5px;
  background:
    radial-gradient(circle, var(--c) 0 2.5px, transparent 3px) center / 100% 100%,
    linear-gradient(var(--c), var(--c)) top left / var(--len) var(--w),
    linear-gradient(var(--c), var(--c)) top left / var(--w) var(--len),
    linear-gradient(var(--c), var(--c)) top right / var(--len) var(--w),
    linear-gradient(var(--c), var(--c)) top right / var(--w) var(--len),
    linear-gradient(var(--c), var(--c)) bottom left / var(--len) var(--w),
    linear-gradient(var(--c), var(--c)) bottom left / var(--w) var(--len),
    linear-gradient(var(--c), var(--c)) bottom right / var(--len) var(--w),
    linear-gradient(var(--c), var(--c)) bottom right / var(--w) var(--len);
  background-repeat: no-repeat;
}

/* ---------- preguntas ---------- */
.faq { padding: clamp(2.5rem, 5vw, 4rem) 0; border-top: 1px solid var(--line); display: grid; gap: 2rem; }
@media (min-width: 880px) { .faq { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 4rem; } }
.faq-list { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 1.1rem 2.5rem 1.1rem 0; position: relative;
  font-weight: 600; font-size: var(--step-1); line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ''; position: absolute; right: 0.4rem; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { padding: 0 0 1.25rem; color: var(--ink-2); max-width: 60ch; }

/* ---------- cierre ---------- */
.home main > section.closing {
  width: 100%; max-width: none; color: var(--ink); padding: clamp(3.5rem, 7vw, 5.5rem) 1.25rem; margin-top: 2rem;
  /* la misma foto del salón (ya está en caché), oscurecida para que se lea el texto */
  background:
    linear-gradient(color-mix(in srgb, var(--paper) 84%, transparent), color-mix(in srgb, var(--paper) 93%, transparent)),
    url(/assets/photos/salon.jpg) center / cover var(--paper);
}
.closing-inner { --len: 34px; --w: 2px; width: min(100%, 44rem); margin: 0 auto; padding: 3.5rem 2rem; display: grid; gap: 1.75rem; justify-items: center; text-align: center; }
.closing h2 { font-style: italic; font-size: clamp(2rem, 1rem + 2.2vw, 3rem); text-wrap: balance; }

/* ---------- pie ---------- */
.foot { display: grid; gap: 1rem; padding: 2.5rem 0 3rem; grid-template-columns: 1fr; font-size: var(--step--1); color: var(--ink-2); }
@media (min-width: 760px) { .foot { grid-template-columns: auto 1fr auto; align-items: center; gap: 2rem; } }
.foot-links { display: flex; gap: 1.25rem; }
/* Idiomas como links normales (Google los sigue para descubrir /en y /pt) */
.foot-langs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; font-size: 0.8125rem; }
.foot-langs a { color: var(--ink-2); }
.foot-langs a[lang]:is(:hover, :focus-visible) { color: var(--ink); }

/* ---------- movimiento de la portada ----------
   (lenguaje y curva definidos en app.css → "movimiento")
   1) Al abrir: UN momento orquestado (~1,6 s). El título enfoca; el texto y los botones suben;
      la foto del salón se revela mientras sus esquinas doradas se dibujan; el teléfono sube;
      las polaroids se posan (manos, luego novia) y al final el ramo se acomoda desde el tallo.
   2) Al bajar: cada sección aparece cuando entra en pantalla (home.js le pone .is-in).
      Solo se esconden si hay JS (clase .js en <html>) y si no se pidió reducir movimiento. */
@media (prefers-reduced-motion: no-preference) {
  .hero-title   { animation: m-focus 1.1s var(--ease) both; }
  .hero-body    { animation: m-rise 0.9s var(--ease) 0.15s both; }
  .hero-actions { animation: m-rise 0.9s var(--ease) 0.25s both; }
  .hero-trust   { animation: m-rise 0.9s var(--ease) 0.35s both; }

  .hero-backdrop     { animation: m-corners 1.3s var(--ease) 0.25s both; }
  .hero-backdrop img { animation: m-develop 1.5s var(--ease) 0.15s both; }
  .hero-device  { animation: m-rise 1s var(--ease) 0.1s both; }
  .polaroid-a   { animation: m-place 0.9s var(--ease) 0.6s both; }
  .polaroid-b   { animation: m-place 0.9s var(--ease) 0.75s both; }
  /* el ramo se mece hasta su lugar girando desde el tallo (escondido tras el teléfono) */
  .hero-flowers { transform-origin: 24% 98%; animation: m-sway 1.4s var(--ease) 0.9s both; }
  @keyframes m-sway { from { opacity: 0; rotate: -9deg; } }

  /* ---- al bajar ---- */
  .js .reveal {
    opacity: 0; translate: 0 18px;
    transition: opacity 0.9s var(--ease), translate 0.9s var(--ease), filter 0.9s var(--ease);
    transition-delay: calc(var(--i, 0) * 110ms);
  }
  .js .section-title.reveal { filter: blur(6px); }   /* los títulos enfocan */
  .js .reveal.is-in { opacity: 1; translate: none; filter: none; }

  /* "Cómo funciona": el número dorado de cada paso enfoca después de que aparece el paso */
  .js .steps li.reveal .step-n { opacity: 0; }
  .js .steps li.is-in .step-n { opacity: 1; animation: m-focus 1s var(--ease) both; animation-delay: calc(var(--i, 0) * 110ms + 0.2s); }

  /* Drive: las carpetas se ordenan y las fotos "llegan" una a una, revelándose */
  .js .drive-window:not(.is-in) :is(.drive-list, .drive-grid) li { opacity: 0; }
  .drive-window.is-in .drive-list li { animation: m-rise 0.6s var(--ease) both; animation-delay: calc(0.25s + var(--k, 0) * 70ms); }
  .drive-window.is-in .drive-grid li { animation: m-develop 0.9s var(--ease) both; animation-delay: calc(0.45s + var(--k, 0) * 110ms); }
  :is(.drive-list, .drive-grid) li:nth-child(2) { --k: 1; }
  :is(.drive-list, .drive-grid) li:nth-child(3) { --k: 2; }
  :is(.drive-list, .drive-grid) li:nth-child(4) { --k: 3; }
  :is(.drive-list, .drive-grid) li:nth-child(5) { --k: 4; }
  :is(.drive-list, .drive-grid) li:nth-child(6) { --k: 5; }

  /* Cierre: el visor dorado se dibuja alrededor de la invitación final */
  .closing-inner.is-in { animation: m-corners 1.4s var(--ease) 0.15s both; }

  /* Preguntas: la respuesta baja suave al abrir */
  .faq details[open] p { animation: m-rise 0.45s var(--ease) both; }
}
