/* ==========================================================================
   Mueblería — hoja de estilos mobile-first
   --------------------------------------------------------------------------
   Base = teléfono. Las pantallas grandes se construyen con min-width.
   Alturas de sección en svh: no cambian cuando iOS oculta la barra de
   direcciones, así el mapeo scroll→currentTime no da saltos.
   ========================================================================== */

:root {
  --bg: #0a0908;
  --fg: #f4efe8;
  --muted: rgba(244, 239, 232, .72);
  --line: rgba(255, 255, 255, .18);
  --warm: #d6a66f;
  --warm-strong: #e8b879;
  --header-h: 60px;

  /* Zonas seguras (notch / Dynamic Island / barra gestual). */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);

  /* Margen lateral seguro reutilizable. */
  --gutter: max(20px, var(--sal));
  --gutter-r: max(20px, var(--sar));

  --tap: 48px; /* mínimo táctil cómodo, por encima de los 44px de Apple */
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--fg);
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: clip; /* corta desbordes laterales sin crear contexto de scroll */
}

img, video { max-width: 100%; }
a { color: inherit; }

:where(a, button, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--warm-strong);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  top: calc(var(--sat) + 8px);
  left: 50%;
  transform: translate(-50%, -200%);
  z-index: 200;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--fg);
  color: #13100d;
  font-weight: 700;
  font-size: .85rem;
  text-decoration: none;
  transition: transform .2s ease;
}
.skip-link:focus { transform: translate(-50%, 0); }

/* --------------------------------------------------------------------------
   CABECERA
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  z-index: 50;
  top: 0; left: 0; right: 0;
  min-height: calc(var(--header-h) + var(--sat));
  padding: var(--sat) var(--gutter-r) 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .62), transparent);
  pointer-events: none;
}
.site-header a { pointer-events: auto; text-decoration: none; }

.brand {
  font-size: .72rem;
  letter-spacing: .22em;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 15px;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.1;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 9, 8, .42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  white-space: nowrap;
}
.header-cta span { color: var(--warm-strong); }

.top-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  z-index: 80;
  background: rgba(255, 255, 255, .08);
}
.top-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left center;
}

/* --------------------------------------------------------------------------
   ESCENAS CON SCRUB
   El recorrido móvil es más corto: se navega con el pulgar, no con rueda.
   -------------------------------------------------------------------------- */
.scrub-section {
  position: relative;
  height: 520vh;
  height: 520svh;
  background: #000;
}
.scrub-section--kitchen {
  height: 470vh;
  height: 470svh;
}

.sticky-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  /* Nunca más alto que la pantalla: si el sticky supera el viewport deja de
     pegarse y la escena "salta". Crítico en teléfono en horizontal. */
  min-height: min(520px, 100svh);
  overflow: hidden;
  background: #000;
  isolation: isolate;
}

/* object-position por video: cada escena tiene su zona de interés.
   Calibrado mirando los fotogramas reales, no a ojo. */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--ox, 50%) var(--oy, 50%);
  background: #000;
  transform: none !important;   /* sin zoom CSS falso, nunca */
  filter: none;
  z-index: 0;
}

/* Vertical 1080x1920 en un teléfono: el recorte es solo horizontal (~9%).
   Video 1 → el mesón final queda ligeramente a la derecha.
   Video 2 → estantes y cajón caen a la izquierda del cuadro. */
#arrivalVideo { --ox: 54%; --oy: 50%; }
#kitchenVideo { --ox: 46%; --oy: 46%; }

.cinematic-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(0deg, rgba(0, 0, 0, .74) 0%, rgba(0, 0, 0, .28) 26%, transparent 52%),
    linear-gradient(180deg, rgba(0, 0, 0, .42), transparent 24%);
}

/* --------------------------------------------------------------------------
   TEXTOS SOBRE VIDEO
   En móvil van abajo, sobre el suelo/zona limpia, nunca sobre los muebles.
   -------------------------------------------------------------------------- */
.copy {
  position: absolute;
  z-index: 4;
  left: var(--gutter);
  right: var(--gutter-r);
  bottom: calc(var(--sab) + 76px);
  max-width: none;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .24s linear, transform .24s ease;
  pointer-events: none;
  text-shadow: 0 2px 26px rgba(0, 0, 0, .55);
}
.copy.is-visible { opacity: 1; transform: translateY(0); }

.eyebrow {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .82);
  margin: 0 0 10px;
}

.copy h1, .copy h2, .bridge h2, .quote-card h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -.02em;
  margin: 0;
  line-height: 1.02;
  text-wrap: balance;
}
.copy h1 { font-size: clamp(2.4rem, 11vw, 3.4rem); }
.copy h2 { font-size: clamp(1.9rem, 8.4vw, 2.9rem); }

.copy > p:last-child {
  font-size: clamp(.92rem, 3.8vw, 1.05rem);
  line-height: 1.55;
  color: rgba(255, 255, 255, .86);
  margin: 14px 0 0;
  max-width: 46ch;
}

.scroll-cue {
  position: absolute;
  z-index: 5;
  left: var(--gutter);
  bottom: calc(var(--sab) + 22px);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .64rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .78);
  transition: opacity .35s ease;
}
.scroll-cue span {
  display: block;
  width: 28px;
  height: 1px;
  background: currentColor;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 50% { width: 46px; opacity: .45; } }

.chapter-progress {
  position: absolute;
  right: 0; top: 0;
  width: 2px;
  height: 100%;
  background: rgba(255, 255, 255, .08);
  z-index: 5;
}
.chapter-progress span {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .86);
  transform: scaleY(0);
  transform-origin: top center;
}

/* --------------------------------------------------------------------------
   PUENTE EDITORIAL
   -------------------------------------------------------------------------- */
.bridge {
  min-height: 58svh;
  padding: 84px var(--gutter-r) 84px var(--gutter);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: radial-gradient(circle at 75% 30%, #201810 0%, #0a0908 44%, #070706 100%);
}
.bridge h2 { font-size: clamp(2.1rem, 9vw, 3.2rem); max-width: 20ch; }
.bridge__lead {
  margin: 18px 0 0;
  max-width: 52ch;
  line-height: 1.65;
  color: var(--muted);
  font-size: clamp(.95rem, 3.8vw, 1.05rem);
}

/* --------------------------------------------------------------------------
   COTIZACIÓN
   -------------------------------------------------------------------------- */
.quote-section {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 72px var(--gutter-r) calc(72px + var(--sab)) var(--gutter);
  background: linear-gradient(145deg, #090807, #18120e);
}

.quote-card {
  width: min(980px, 100%);
  padding: 28px 22px 32px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 24px;
  background: rgba(255, 255, 255, .035);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  text-align: left;
}
.quote-card h2 { font-size: clamp(2.2rem, 9.5vw, 3.4rem); }
.quote-card h2 strong { font-weight: 400; color: var(--warm-strong); }
.quote-lead {
  max-width: 62ch;
  margin: 18px 0 0;
  line-height: 1.65;
  color: var(--muted);
  font-size: clamp(.95rem, 3.8vw, 1.05rem);
}

.configurator { margin-top: 26px; display: grid; gap: 22px; }
.configurator fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.configurator legend, .field > span {
  display: block;
  margin-bottom: 10px;
  padding: 0;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .78);
}
.field > span small { font-weight: 500; letter-spacing: .02em; text-transform: none; opacity: .7; }

/* 2 columnas en teléfono: botones anchos y fáciles de acertar con el pulgar. */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.choice {
  appearance: none;
  display: flex;
  align-items: center;
  min-height: var(--tap);
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .03);
  color: var(--fg);
  border-radius: 14px;
  padding: 13px 14px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: .94rem;
  line-height: 1.25;
  transition: border-color .2s ease, background .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.choice:hover { border-color: rgba(255, 255, 255, .38); }
.choice.is-selected {
  border-color: rgba(232, 184, 121, .85);
  background: rgba(232, 184, 121, .14);
}

.field--text { display: block; }
.field textarea {
  width: 100%;
  resize: vertical;
  min-height: 104px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(0, 0, 0, .3);
  color: var(--fg);
  padding: 14px;
  font: inherit;
  font-size: 16px; /* < 16px hace que iOS Safari haga zoom al enfocar */
  outline: none;
}
.field textarea:focus { border-color: rgba(232, 184, 121, .72); box-shadow: 0 0 0 3px rgba(232, 184, 121, .1); }

.quote-summary { border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 18px; }
.summary-list { margin: 0; display: grid; gap: 8px; }
.summary-row { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; }
.summary-row dt {
  font-size: .74rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .58);
  flex: none;
}
.summary-row dd { margin: 0; text-align: right; color: var(--fg); line-height: 1.5; }

.primary-cta {
  border: 0;
  border-radius: 999px;
  min-height: 56px;
  padding: 16px 24px;
  font-weight: 800;
  font-size: 1rem;
  background: var(--fg);
  color: #13100d;
  cursor: pointer;
  box-shadow: 0 16px 45px rgba(0, 0, 0, .32);
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.primary-cta:active { transform: translateY(1px); }
.primary-cta[disabled] { opacity: .55; cursor: not-allowed; }

.microcopy {
  font-size: .8rem;
  color: rgba(255, 255, 255, .62); /* contraste AA sobre el fondo del card */
  margin: 14px 0 0;
  letter-spacing: .04em;
  text-align: center;
}
.microcopy.is-warning { color: #f6c37a; font-weight: 600; }

/* --------------------------------------------------------------------------
   PIE Y AUXILIARES
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 34px var(--gutter-r) calc(34px + var(--sab)) var(--gutter);
  background: #070706;
  color: rgba(255, 255, 255, .55);
  font-size: .82rem;
  text-align: center;
}
.site-footer p { margin: 0 0 6px; }
.site-footer__note { color: var(--warm-strong); }

.noscript {
  position: relative;
  z-index: 90;
  margin: 0;
  padding: 16px var(--gutter);
  background: var(--warm-strong);
  color: #13100d;
  font-weight: 600;
  text-align: center;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #090807;
  transition: opacity .45s ease, visibility .45s ease;
}
.loader.is-hidden { opacity: 0; visibility: hidden; }
.loader[hidden] { display: none; }
.loader__inner { width: min(320px, 70vw); text-align: center; color: rgba(255, 255, 255, .75); }
.loader__line {
  display: block;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--warm), transparent);
  animation: load 1.35s ease-in-out infinite;
}
.loader p { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; margin-top: 18px; }
@keyframes load {
  0% { transform: scaleX(.08); opacity: .3; }
  50% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(.08); opacity: .3; }
}

/* ==========================================================================
   TABLET
   ========================================================================== */
@media (min-width: 600px) {
  :root { --gutter: max(32px, var(--sal)); --gutter-r: max(32px, var(--sar)); }
  .choice-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quote-card { padding: 44px 38px; }
  .copy > p:last-child { font-size: 1.05rem; }
  .summary-row dt { min-width: 120px; }
}

/* ==========================================================================
   ESCRITORIO — recupera exactamente el comportamiento que ya funcionaba
   ========================================================================== */
@media (min-width: 769px) {
  :root { --header-h: 72px; --gutter: max(clamp(22px, 6vw, 90px), var(--sal)); --gutter-r: max(clamp(22px, 6vw, 90px), var(--sar)); }

  .scrub-section { height: 680vh; }
  .scrub-section--kitchen { height: 620vh; }
  .sticky-stage { min-height: min(560px, 100svh); }

  /* En pantalla ancha el recorte es vertical y fuerte: centrado es lo correcto. */
  #arrivalVideo { --ox: 50%; --oy: 50%; }
  #kitchenVideo { --ox: 50%; --oy: 50%; }

  .brand { font-size: .78rem; letter-spacing: .24em; }
  .header-cta { font-size: .76rem; padding: 11px 16px; }

  .cinematic-vignette {
    background:
      linear-gradient(90deg, rgba(0, 0, 0, .48) 0%, rgba(0, 0, 0, .10) 40%, rgba(0, 0, 0, .12) 70%, rgba(0, 0, 0, .35) 100%),
      linear-gradient(0deg, rgba(0, 0, 0, .34), transparent 34%, rgba(0, 0, 0, .16));
  }

  .copy {
    right: auto;
    max-width: min(680px, 76vw);
    bottom: clamp(80px, 12vh, 140px);
    transform: translateY(26px);
    filter: blur(6px);
    transition: opacity .24s linear, transform .24s ease, filter .24s ease;
  }
  .copy.is-visible { filter: blur(0); }
  .copy--hero { bottom: clamp(82px, 13vh, 150px); }
  .copy--left { left: var(--gutter); }
  .copy--right { left: auto; right: var(--gutter-r); text-align: right; }
  .copy--right > p:last-child { margin-left: auto; }

  .copy h1 { font-size: clamp(3rem, 8.2vw, 8.6rem); max-width: 900px; }
  .copy h2 { font-size: clamp(2.4rem, 6vw, 6.8rem); }
  .copy > p:last-child { font-size: clamp(.95rem, 1.4vw, 1.22rem); max-width: 520px; margin-top: 22px; }

  .eyebrow { font-size: .72rem; letter-spacing: .24em; margin-bottom: 14px; }

  .scroll-cue { left: auto; right: var(--gutter-r); bottom: 34px; font-size: .68rem; }
  .chapter-progress { width: 3px; }

  .bridge { min-height: 62vh; padding: 120px var(--gutter-r) 120px var(--gutter); }
  .bridge h2 { font-size: clamp(3rem, 7vw, 8rem); max-width: 1050px; }

  .quote-section { padding: 90px 24px; }
  .quote-card { padding: clamp(34px, 6vw, 86px); border-radius: 30px; text-align: center; }
  .quote-card h2 { font-size: clamp(3rem, 7vw, 7.2rem); }
  .quote-lead { margin: 28px auto 0; }
  .configurator { margin-top: 42px; text-align: left; gap: 28px; }
  .choice { border-radius: 16px; padding: 16px 14px; }
  .primary-cta { font-size: 1.05rem; }
}

/* ==========================================================================
   PANTALLA BAJA / TELÉFONO EN HORIZONTAL
   Va DESPUÉS del bloque de escritorio a propósito: a 844x390 también coincide
   min-width:769px, así que este bloque tiene que poder ganarle.

   Con 390px de alto el recorte pasa a ser vertical y muy agresivo (~62% del
   fotograma fuera). Se reencuadra cada video sobre su zona de acción y se
   reduce el texto para no tapar la escena.
   ========================================================================== */
@media (max-height: 560px) {
  .scrub-section { height: 420svh; }
  .scrub-section--kitchen { height: 380svh; }

  /* Video 1: la acción (puerta, hall, mesón) vive en la franja central-alta. */
  #arrivalVideo { --ox: 50%; --oy: 45%; }
  /* Video 2: deja fuera el suelo vacío y conserva estantes + cajón. */
  #kitchenVideo { --ox: 50%; --oy: 32%; }

  .copy {
    left: var(--gutter);
    right: var(--gutter-r);
    max-width: none;
    bottom: calc(var(--sab) + 40px);
    transform: translateY(12px);
    filter: none;
  }
  .copy--right { text-align: left; }
  .copy--right > p:last-child { margin-left: 0; }
  .copy.is-visible { filter: none; }
  .copy h1 { font-size: clamp(1.7rem, 5.2vw, 2.4rem); max-width: none; }
  .copy h2 { font-size: clamp(1.45rem, 4.4vw, 2rem); }
  .copy > p:last-child { display: none; } /* taparía la cocina */
  .eyebrow { margin-bottom: 6px; font-size: .64rem; }

  .scroll-cue { left: var(--gutter); right: auto; bottom: calc(var(--sab) + 10px); }
  .bridge { min-height: 0; padding-block: 52px; }
  .bridge h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
  .quote-section { min-height: 0; padding-block: 56px; }
  .quote-card h2 { font-size: clamp(1.9rem, 5.4vw, 2.8rem); }
}

/* ==========================================================================
   MOVIMIENTO REDUCIDO
   No se elimina la experiencia: el scrub lo controla el usuario, no es
   animación autónoma. Se quita todo lo decorativo (pulsos, desenfoques,
   desplazamientos) y se acorta el recorrido para exigir menos scroll.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .scrub-section { height: 300svh; }
  .scrub-section--kitchen { height: 280svh; }
  .copy { transition: opacity .01ms linear; transform: none; filter: none; }
  .copy.is-visible { transform: none; filter: none; }
  .scroll-cue span, .loader__line { animation: none; }
  .loader__line { transform: scaleX(1); opacity: .6; }
  .choice, .primary-cta, .skip-link, .header-cta { transition: none; }
}
.reduce-motion .scrub-section { height: 300svh; }
.reduce-motion .scrub-section--kitchen { height: 280svh; }
.reduce-motion .copy { transition: opacity .01ms linear; transform: none; filter: none; }
.reduce-motion .scroll-cue span, .reduce-motion .loader__line { animation: none; }
