/* RIVAYO · Diseño de oficinas — Proceso: "de la primera visita a la entrega de llaves".
   Animación ligada al scroll; la línea del proceso termina convertida en la llave. Sin librerías externas.
   Con "reducir movimiento" o sin JavaScript se muestra el estado final (titular + llave). */
/* =====================================================================
   PANEL DE AJUSTE — cambia la pieza sin tocar la lógica
   ===================================================================== */
.pc {
  /* Color */
  --pc-bg: #F4F6F8;          /* fondo de la sección (igual al de la web) */
  --pc-ink: #00294E;         /* azul RIVAYO */
  --pc-ink-2: #3d4a5c;       /* texto de párrafo */
  --pc-muted: #6e7b8b;       /* líneas secundarias grandes del titular final */
  --pc-muted-text: #5d6a7a;  /* texto pequeño secundario (AA) */
  --pc-accent: #F77C0C;      /* único acento: la línea del proceso, que se vuelve llave */
  --pc-paper: #ffffff;       /* tarjetas */
  --pc-line: rgba(0, 41, 78, .12);
  --pc-sketch: #9aa6b4;      /* oficina "como está hoy" */

  /* Tipografía */
  --pc-font-display: "gotham-medium", "Montserrat", -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, sans-serif;
  --pc-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);

  /* Reveal del primer paso al entrar en pantalla */
  --pc-reveal: 900ms;
  --pc-stagger: 90ms;

  /* Largo del recorrido fijado (más alto = scroll más lento) */
  --pc-scroll-length: 520vh;
  --pc-scroll-length-mobile: 440vh;

  /* Si la web tiene un header fijo, pon aquí su alto (ej. 72px) */
  --pc-header-offset: 0px;
  --pc-gutter: clamp(16px, 4vw, 48px);
  /* Espacio final entre la llave y la siguiente sección */
  --pc-end-gap: clamp(48px, 8vh, 96px);
}

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

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

/* Texto del paso */
.pc-eyebrow {
  font: 600 12px/1.2 var(--pc-font-body); letter-spacing: .16em; text-transform: uppercase;
  color: var(--pc-muted-text); margin: 0 0 clamp(12px, 2.4vh, 24px);
}
.pc-num {
  font: 700 clamp(56px, 6vw, 96px)/1.1 var(--pc-font-display);
  letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--pc-ink);
  margin: 0 0 clamp(8px, 1.6vh, 16px);
}
.pc-num-in { display: inline-block; }
.pc-digit-mask { display: inline-block; height: 1.1em; overflow: hidden; vertical-align: top; }
.pc-digits { display: block; }
.pc-digits span { display: block; height: 1.1em; }
.pc-caps { display: grid; }
.pc-cap { grid-area: 1 / 1; }
.pc-title {
  font: 700 clamp(28px, 2.6vw, 40px)/1.1 var(--pc-font-display);
  letter-spacing: -0.025em; margin: 0 0 .5em; color: var(--pc-ink);
}
.pc-lead {
  font: 500 clamp(17px, 1.4vw, 20px)/1.45 var(--pc-font-body);
  color: var(--pc-ink); margin: 0 0 .9em; max-width: 36ch; text-wrap: pretty;
}
.pc-get {
  font: 400 clamp(15px, 1.1vw, 17px)/1.5 var(--pc-font-body);
  color: var(--pc-ink-2); margin: 0; max-width: 38ch; text-wrap: pretty;
}
.pc-get strong { font-weight: 700; color: var(--pc-ink); }
.pc-note { font: 400 14px/1.5 var(--pc-font-body); color: var(--pc-muted-text); margin: .8em 0 0; max-width: 38ch; }

/* Escenas (entregables) */
.pc-figure { margin: 0; min-width: 0; display: flex; justify-content: center; }
.pc-scene { display: block; width: 100%; height: auto; max-height: 50vh; max-height: 50svh; overflow: visible; }

/* Titular final */
.pc-final {
  position: absolute; left: 0; right: 0; bottom: 100%;
  padding-bottom: clamp(24px, 5vh, 56px);
  text-align: center; pointer-events: none;
}
.pc-final-title {
  font: 700 clamp(40px, 5.6vw, 88px)/1.02 var(--pc-font-display);
  letter-spacing: -0.035em; margin: 0; color: var(--pc-ink);
}
.pc-mask { display: block; overflow: hidden; padding-block: .03em .09em; }
.pc-mask > span { display: inline-block; }
.pc-muted { color: var(--pc-muted); }
.pc-final-sub { font: 500 clamp(16px, 1.4vw, 20px)/1.5 var(--pc-font-body); color: var(--pc-ink-2); margin: clamp(16px, 2.6vh, 28px) 0 0; }

/* Línea de tiempo / llave */
.pc-tl { position: relative; width: 100%; max-width: 1280px; margin-inline: auto; flex: 0 0 auto; }
.pc-key { display: block; width: 100%; height: auto; overflow: visible; }
.pc-labels { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); margin: clamp(6px, 1.4vh, 14px) 0 0; padding: 0; }
.pc-labels li { position: relative; text-align: center; font: 600 13px/1.2 var(--pc-font-body); color: var(--pc-muted-text); }
.pc-lab-on { position: absolute; inset: 0; color: var(--pc-ink); opacity: 0; }

/* =====================================================================
   SVG
   ===================================================================== */
/* Solo los elementos animados giran/escalan sobre su propio centro */
.pc svg [id], .pc svg .pc-node-a, .pc svg .pc-draw { transform-box: fill-box; transform-origin: center; }
.pc-t { font-family: var(--pc-font-body); fill: var(--pc-ink); }
.pc-t-title { font-size: 14px; font-weight: 700; }
.pc-t-small { font-size: 12px; font-weight: 500; fill: var(--pc-muted-text); }
.pc-t-strong { font-size: 12px; font-weight: 700; }
.pc-card { fill: var(--pc-paper); stroke: var(--pc-line); stroke-width: 1.5; }
.pc-bar { fill: var(--pc-line); }
.pc-ink { fill: var(--pc-ink); }
.pc-accent { fill: var(--pc-accent); }

.pc-sketch { fill: none; stroke: var(--pc-sketch); stroke-width: 2; stroke-dasharray: 6 5; }
.pc-sketch-solid { fill: none; stroke: var(--pc-sketch); stroke-width: 1.5; }
.pc-lens-glass { fill: rgba(255, 255, 255, .6); stroke: var(--pc-ink); stroke-width: 4; }
.pc-lens-handle { fill: none; stroke: var(--pc-ink); stroke-width: 7; stroke-linecap: round; }

.pc-plan-line { fill: none; stroke: var(--pc-ink); stroke-width: 2.5; stroke-linejoin: miter; }
.pc-plan-furn rect { fill: var(--pc-paper); stroke: var(--pc-ink); stroke-width: 1.2; }
.pc-render-bg { fill: #e9edf2; }
.pc-render-line { fill: none; stroke: var(--pc-ink); stroke-opacity: .35; stroke-width: 1.2; }
.pc-render-desk { fill: var(--pc-paper); stroke: var(--pc-ink); stroke-width: 1.2; }

.pc-track { fill: rgba(0, 41, 78, .08); }
.pc-tick { stroke: rgba(0, 41, 78, .25); stroke-width: 1.5; }
.pc-dash { fill: none; stroke: var(--pc-ink); stroke-opacity: .4; stroke-width: 1.5; stroke-dasharray: 3 4; }
.pc-check { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

#pc-base { fill: rgba(0, 41, 78, .14); }
#pc-blade, .pc-tooth { fill: var(--pc-accent); }
.pc svg .pc-tooth { transform-box: fill-box; transform-origin: top center; }
#pc-shoulder { transform-origin: center; }
#pc-ring { fill: none; stroke: var(--pc-accent); stroke-width: 14; }
#pc-fill { transform-origin: left center; }
.pc-node-bg { fill: var(--pc-paper); stroke: rgba(0, 41, 78, .16); stroke-width: 1.5; }
.pc-node-on { fill: none; stroke: var(--pc-accent); stroke-width: 2.5; opacity: 0; }
.pc-ic { fill: none; stroke: var(--pc-ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pc-node-num { display: none; font: 700 30px var(--pc-font-display); fill: var(--pc-ink); letter-spacing: -0.02em; }

/* Trazos que se dibujan (solo en modo animado) */
.pc--live .pc-draw { stroke-dasharray: 1; }

/* =====================================================================
   MODO ESTÁTICO — sin JS o con prefers-reduced-motion: estado final
   ===================================================================== */
.pc--static .pc-scroll { height: auto; }
/* La sección siguiente se acerca hasta quedar a una distancia fija bajo la llave */
.pc--live .pc-scroll { margin-bottom: calc(-1 * var(--pc-tail, 0px)); }
/* El margen negativo deja la caja de la animación encima del botón que sigue: se sube el botón */
.seccion--pc > .contenedor { position: relative; z-index: 1; }
.pc--live .pc-stage { pointer-events: none; }
.pc--static .pc-stage { position: relative; height: auto; padding-block: clamp(64px, 10vh, 120px); }
.pc--static .pc-grid,
.pc--static .pc-node,
.pc--static #pc-base { display: none; }
.pc--static .pc-final { position: static; }
.pc--static .pc-lab-on { opacity: 1; }

/* =====================================================================
   REVEAL DEL PRIMER PASO AL ENTRAR EN PANTALLA
   ===================================================================== */
.pc--live [data-reveal] {
  opacity: 0; transform: translateY(32px); filter: blur(8px);
  transition:
    opacity var(--pc-reveal) var(--ease-out),
    transform var(--pc-reveal) var(--ease-out),
    filter var(--pc-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--pc-stagger));
}
.pc--live .is-in [data-reveal] { opacity: 1; transform: none; filter: blur(0); }
.pc--live [data-reveal-group]:not(.is-done) [data-reveal] { will-change: transform, opacity, filter; }

.pc--live.is-active .pc-cap,
.pc--live.is-active .pc-mask > span,
.pc--live.is-active .pc-digits { will-change: transform, opacity; }

/* =====================================================================
   RESPONSIVE — móvil: texto arriba, entregable al medio, llave abajo
   ===================================================================== */
@media (max-width: 899px) {
  .pc-scroll { height: var(--pc-scroll-length-mobile); }
  .pc-stage { gap: clamp(16px, 3vh, 32px); padding-top: calc(var(--pc-header-offset) + clamp(20px, 4vh, 48px)); }
  .pc-grid { grid-template-columns: 1fr; gap: clamp(12px, 2.6vh, 28px); }
  .pc-eyebrow { margin-bottom: 8px; }
  .pc-num { font-size: clamp(44px, 11vw, 64px); margin-bottom: 2px; }
  .pc-title { font-size: clamp(24px, 6.4vw, 34px); margin-bottom: .35em; }
  .pc-lead { font-size: 16px; margin-bottom: .5em; max-width: 48ch; }
  .pc-get { font-size: 15px; max-width: 48ch; }
  .pc-note { display: none; }
  .pc-scene { max-height: 34svh; }
  .pc-final-title { font-size: clamp(36px, 10vw, 56px); }
}
@media (max-width: 599px) {
  .pc-ic { display: none; }
  .pc-node-num { display: block; }
  .pc-labels li { font-size: 11px; }
}
@media (max-width: 899px) and (max-height: 620px) {
  .pc--live .pc-lead { display: none; }
}

/* =====================================================================
   INTEGRACIÓN RIVAYO
   - El título de la sección va dentro del escenario y queda fijo con la animación.
   - El escenario mide lo que su contenido y se fija centrado en la pantalla
     (--pc-top lo calcula el JS), para no dejar espacio vacío antes ni después.
   ===================================================================== */
.pc-head { width: 100%; max-width: 1280px; margin-inline: auto; flex: 0 0 auto; gap: clamp(8px, 1.4vh, 16px); }
.pc-head .titulo-l { font-size: clamp(30px, min(4.4vw, 6.4vh), 60px); }
.pc--live .pc-stage { height: auto; top: var(--pc-top, 0px); }
.pc--static .pc-stage { padding-top: 0; }
/* Modo estático (reducir movimiento / sin JS): los tres pasos se leen en columnas, sin las escenas */
.pc--static .pc-grid { display: block; }
.pc--static .pc-figure, .pc--static .pc-num, .pc--static .pc-eyebrow { display: none; }
.pc--static .pc-caps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); }
.pc--static .pc-cap { grid-area: auto; }
.pc--static .pc-title { font-size: clamp(22px, 1.8vw, 28px); }
@media (max-width: 899px) {
  .pc-head .titulo-l { font-size: clamp(28px, 7.4vw, 40px); }
  .pc-tl { width: auto; margin-inline: 0 64px; } /* deja libre el botón flotante de WhatsApp */
}
@media (max-width: 899px) {
  .pc--static .pc-caps { grid-template-columns: 1fr; }
}
@media (max-width: 899px) and (max-height: 720px) {
  .pc-scene { max-height: 27svh; }
  .pc--live .pc-get { font-size: 14px; }
}

/* Cierre de la sección: título, texto, botón y alternativa por WhatsApp */
.pc-cierre { max-width: 600px; margin: clamp(40px, 6vw, 72px) auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pc-cierre__titulo { margin: 0; font-family: var(--titulos); font-size: clamp(24px, 3vw, 30px); line-height: 1.2; color: var(--marina); }
.pc-cierre__texto { margin: 0 0 8px; font-size: 15px; line-height: 1.6; color: var(--texto-suave); }
.pc-cierre__nota { margin: 0; font-size: 13px; color: var(--texto-suave); }
.pc-cierre__nota a { color: var(--marina); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
