/* RIVAYO · Diseño de oficinas — "Cómo lo hacemos": las tres decisiones vistas en planta.
   Animación ligada al scroll. Sin librerías externas.
   Con "reducir movimiento" o sin JavaScript se muestra el plano final y los tres pasos en lista. */
/* =====================================================================
   PANEL DE AJUSTE — cambia la pieza sin tocar la lógica
   ===================================================================== */
.rv {
  /* Color */
  --rv-bg: #F4F6F8;          /* fondo de la sección (igual al de la web) */
  --rv-ink: #00294E;         /* azul RIVAYO: titulares, muros, mobiliario */
  --rv-ink-2: #3d4a5c;       /* texto de párrafo */
  --rv-muted: #6e7b8b;       /* números y línea secundaria (solo texto grande) */
  --rv-muted-text: #5d6a7a;  /* texto pequeño secundario (AA) */
  --rv-accent: #F77C0C;      /* naranja RIVAYO: interacción clave, circulación, marca */
  --rv-paper: #ffffff;       /* planta en blanco */
  --rv-wood: #ecdcc6;        /* piso de madera (identidad) */
  --rv-wood-dark: #c9a47b;   /* mesas y mostradores (identidad) */
  --rv-cool: #e3e8ee;        /* piso de salas privadas */
  --rv-stone: #ebe6de;       /* piso de recepción */
  --rv-sage: #c4d0c0;        /* plantas */
  --rv-sage-2: #98ad96;

  /* Tipografía */
  --rv-font-display: "gotham-medium", "Montserrat", -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, sans-serif;
  --rv-font-body: "Manrope", -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif;

  /* Curvas */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);

  /* Tiempos de los reveals por entrada en pantalla */
  --rv-reveal: 900ms;
  --rv-stagger: 90ms;

  /* Largo del recorrido fijado (más alto = scroll más lento) */
  --rv-scroll-length: 420vh;
  --rv-scroll-length-mobile: 360vh;

  /* Si la web tiene un header fijo, pon aquí su alto (ej. 72px) */
  --rv-header-offset: 0px;
  --rv-gutter: clamp(16px, 4vw, 48px);
}

/* =====================================================================
   BASE
   ===================================================================== */
.rv { background: var(--rv-bg); color: var(--rv-ink); font-family: var(--rv-font-body); -webkit-font-smoothing: antialiased; }
.rv *, .rv *::before, .rv *::after { box-sizing: border-box; }
.rv-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.rv-scroll { position: relative; height: var(--rv-scroll-length); }
.rv-stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  gap: clamp(16px, 3.2vh, 36px);
  padding: calc(var(--rv-header-offset) + clamp(20px, 4vh, 48px)) var(--rv-gutter) clamp(20px, 4vh, 40px);
  overflow: hidden;
}
.rv-grid {
  width: 100%; max-width: 1280px; margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 80px); align-items: center;
}

/* Columna de texto */
.rv-eyebrow {
  font: 600 12px/1.2 var(--rv-font-body); letter-spacing: .16em; text-transform: uppercase;
  color: var(--rv-muted-text); margin: 0 0 clamp(16px, 3vh, 32px);
}
.rv-caps { display: grid; }
.rv-cap { grid-area: 1 / 1; }
.rv-cap-title {
  font: 700 clamp(34px, 3.4vw, 54px)/1.05 var(--rv-font-display);
  letter-spacing: -0.03em; margin: 0 0 .45em; color: var(--rv-ink);
}
.rv-n { color: var(--rv-muted); }
.rv-cap-lead {
  font: 600 clamp(19px, 1.55vw, 24px)/1.3 var(--rv-font-body);
  letter-spacing: -0.01em; margin: 0 0 .6em; color: var(--rv-ink); text-wrap: balance;
}
.rv-cap-detail {
  font: 400 clamp(15px, 1.1vw, 17px)/1.55 var(--rv-font-body);
  color: var(--rv-ink-2); margin: 0; max-width: 34ch; text-wrap: pretty;
}
.rv-swatches { list-style: none; display: flex; gap: 8px; padding: 0; margin: 20px 0 0; }
.rv-swatches li { width: 28px; height: 28px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0, 41, 78, .12); }

/* Plano */
.rv-figure { margin: 0; min-width: 0; display: flex; justify-content: center; }
.rv-plan { display: block; width: 100%; height: auto; max-height: 56vh; max-height: 56svh; overflow: visible; }

/* Título de la sección, fijo junto con la animación */
.rv-head { width: 100%; max-width: 1280px; margin-inline: auto; gap: clamp(8px, 1.4vh, 16px); }
.rv-head .titulo-l { font-size: clamp(30px, min(4.4vw, 6.4vh), 60px); }

/* Indicador de pasos */
.rv-track { width: min(100%, 560px); margin-inline: auto; }
.rv-track-line { position: relative; height: 2px; border-radius: 2px; background: rgba(0, 41, 78, .12); }
.rv-track-fill { position: absolute; inset: 0; border-radius: 2px; background: var(--rv-accent); transform-origin: left center; transform: scaleX(0); }
.rv-track-dot { position: absolute; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--rv-bg); box-shadow: inset 0 0 0 2px rgba(0, 41, 78, .22); }
.rv-track-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); margin: 12px 0 0; padding: 0; }
.rv-step { position: relative; font: 600 13px/1.2 var(--rv-font-body); letter-spacing: .01em; color: var(--rv-muted-text); }
.rv-step:nth-child(2) { text-align: center; }
.rv-step:nth-child(3) { text-align: right; }
.rv-step-on { position: absolute; inset: 0; color: var(--rv-ink); opacity: 0; }

/* Cierre */
.rv-outro {
  max-width: 1280px; margin-inline: auto; text-align: center;
  padding: clamp(16px, 3vh, 40px) var(--rv-gutter) clamp(96px, 14vh, 180px);
}
.rv-outro-title {
  font: 700 clamp(40px, 6.2vw, 96px)/1.05 var(--rv-font-display);
  letter-spacing: -0.035em; margin: 0; color: var(--rv-ink); text-wrap: balance;
}
.rv-line { display: block; overflow: hidden; padding-block: .04em .1em; }
.rv-line > span { display: inline-block; }
.rv-line--muted { color: var(--rv-muted); }
.rv-outro-note {
  font: 500 clamp(16px, 1.3vw, 19px)/1.5 var(--rv-font-body);
  color: var(--rv-ink-2); margin: clamp(20px, 3vh, 32px) 0 0;
}

/* =====================================================================
   SVG — estilos del plano
   ===================================================================== */
.rv-plan * { transform-box: fill-box; transform-origin: center; }
.rv-plan .f-paper { fill: var(--rv-paper); }
.rv-plan .f-wood { fill: var(--rv-wood); }
.rv-plan .st-plank { fill: none; stroke: rgba(125, 92, 52, .16); stroke-width: 1; }
.rv-plan .f-cool { fill: var(--rv-cool); }
.rv-plan .f-stone { fill: var(--rv-stone); }

.rv-link { fill: none; stroke: var(--rv-ink); stroke-opacity: .32; stroke-width: 1.5; stroke-linecap: round; }
.rv-link--accent { stroke: var(--rv-accent); stroke-opacity: 1; stroke-width: 2.5; }

.rv-b-shape { fill: rgba(0, 41, 78, .05); stroke: rgba(0, 41, 78, .28); stroke-width: 1.5; }
.rv-b-dots circle { fill: var(--rv-ink); }
.rv-b-label { font: 600 15px var(--rv-font-body); fill: var(--rv-ink); letter-spacing: -0.01em; }

.rv-wall { fill: none; stroke: var(--rv-ink); stroke-width: 6; stroke-linecap: butt; stroke-linejoin: miter; }
.rv-wall-part { stroke-width: 4; }

.rv-furn rect, .rv-furn circle { fill: var(--rv-paper); stroke: var(--rv-ink); stroke-width: 1.25; }
.rv-furn .f-ink { fill: var(--rv-ink); stroke: none; }
.rv-door { fill: none; stroke: var(--rv-ink); stroke-opacity: .45; stroke-width: 1; }

.rv-fc rect, .rv-fc circle { stroke: var(--rv-ink); stroke-width: 1.25; }
.rv-fc .c-accent { fill: var(--rv-accent); }
.rv-fc .c-ink { fill: var(--rv-ink); }
.rv-fc .c-wood { fill: var(--rv-wood-dark); }

.rv-plant .p1 { fill: var(--rv-sage); }
.rv-plant .p2 { fill: var(--rv-sage-2); }
#rv-brand rect { fill: var(--rv-accent); transform-origin: left center; }

.rv-flow-path { fill: none; stroke: var(--rv-accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.rv-flow-dot { fill: var(--rv-accent); stroke: var(--rv-paper); stroke-width: 2; paint-order: stroke; }

/* Trazos que se dibujan (solo en modo animado) */
.rv--live .rv-wall, .rv--live .rv-link, .rv--live .rv-flow-path { stroke-dasharray: 1; }

/* El escenario mide lo que su contenido y se fija centrado en la pantalla (--rv-top lo calcula el JS).
   Así no queda espacio vacío antes del título ni después de la animación. */
.rv--live .rv-stage { height: auto; top: var(--rv-top, 0px); }

/* =====================================================================
   MODO ESTÁTICO — sin JS o con prefers-reduced-motion: estado final
   ===================================================================== */
.rv--static .rv-scroll { height: auto; }
.rv--static .rv-stage { position: relative; height: auto; padding-block: 0 clamp(32px, 5vh, 56px); gap: clamp(40px, 6vh, 72px); }
.rv--static .rv-caps { display: flex; flex-direction: column; gap: clamp(28px, 4vh, 44px); }
.rv--static .rv-track,
.rv--static .rv-b-shape,
.rv--static .rv-b-dots,
.rv--static #rv-links { display: none; }
.rv--static .rv-b-label { transform: translate(calc(var(--lx) * 1px), calc(var(--ly) * 1px)) scale(.86); }

/* =====================================================================
   REVEAL POR ENTRADA EN PANTALLA (texto): sube + máscara + blur 8→0
   ===================================================================== */
.rv--live [data-reveal] {
  opacity: 0; transform: translateY(32px); filter: blur(8px);
  transition:
    opacity var(--rv-reveal) var(--ease-out),
    transform var(--rv-reveal) var(--ease-out),
    filter var(--rv-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--rv-stagger));
}
.rv--live .is-in [data-reveal] { opacity: 1; transform: none; filter: blur(0); }
.rv--live [data-reveal-group]:not(.is-done) [data-reveal] { will-change: transform, opacity, filter; }

/* will-change solo mientras la sección está en pantalla */
.rv--live.is-active .rv-cap,
.rv--live.is-active .rv-track-fill,
.rv--live.is-active .rv-step-on { will-change: transform, opacity; }

/* =====================================================================
   RESPONSIVE — en móvil la composición se apila: texto arriba, plano abajo
   ===================================================================== */
@media (max-width: 899px) {
  .rv-scroll { height: var(--rv-scroll-length-mobile); }
  .rv-stage { gap: clamp(20px, 4vh, 40px); padding-top: calc(var(--rv-header-offset) + clamp(20px, 4vh, 48px)); }
  .rv-grid { grid-template-columns: 1fr; gap: clamp(16px, 3.5vh, 40px); }
  .rv-eyebrow { margin-bottom: 12px; }
  .rv-cap-title { font-size: clamp(30px, 7.4vw, 44px); margin-bottom: .3em; }
  .rv-cap-lead { font-size: clamp(17px, 4.4vw, 21px); margin-bottom: .4em; }
  .rv-cap-detail { font-size: 15px; max-width: 46ch; }
  .rv-swatches { margin-top: 12px; }
  .rv-swatches li { width: 20px; height: 20px; border-radius: 6px; }
  .rv-plan { max-height: 44svh; }
  .rv-head .titulo-l { font-size: clamp(28px, 7.4vw, 40px); }
  .rv-track { width: auto; margin-inline: 0 72px; } /* deja libre el botón flotante de WhatsApp */
  .rv-outro { text-align: left; }
}
@media (max-width: 599px) {
  .rv-b-label { font-size: 19px; }
}
@media (max-width: 899px) and (max-height: 740px) {
  .rv--live .rv-cap-detail { display: none; }
}
