/* =============================================================================
   Nidus — estilo propio de la landing.
   Base: la línea de PyH (encabezado translúcido, píldoras, secciones que alternan) con
   la identidad de Nidus: Fraunces en títulos, Manrope en texto, crema, terracota y
   verde bosque, y fotos del lugar.
   ========================================================================== */
:root {
  --bg: #f6f1e8;
  --surface: #efe7da;
  --card: #fffdf9;
  --ink: #2e2824;
  --ink-2: #675d54;
  --rule: rgba(46, 40, 36, .12);
  --accent: #a25f35;
  --accent-ink: #8a4e28;      /* terracota para texto chico sobre crema (≥ 4.5:1) */
  --peach: #f0c39c;
  --pine: #243029;
  --pine-2: #2c3a31;
  --on-pine: #f6f1e8;
  --on-pine-2: #c5ccbf;
  --pine-rule: rgba(246, 241, 232, .16);

  --shadow-sm: 0 0 0 1px rgba(46, 40, 36, .06), 0 3px 10px rgba(46, 40, 36, .05);
  --shadow-md: 0 0 0 1px rgba(46, 40, 36, .05), 0 18px 48px rgba(46, 40, 36, .12);
  --radius: 20px;
  --radius-sm: 12px;
  --pill: 999px;

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --max: 1160px;
  --gutter: clamp(18px, 4.5vw, 40px);
  --header-h: 62px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
section[id] { scroll-margin-top: calc(var(--header-h) + 12px); }
::selection { background: var(--accent); color: #fff; }
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 200; background: var(--card); padding: 10px 14px; border-radius: 8px; }

/* ---------- tipografía ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.08; letter-spacing: -0.012em; margin: 0; overflow-wrap: break-word; text-wrap: balance; }
h3 { font-weight: 600; font-size: 1.3rem; line-height: 1.2; }
.display { font-size: clamp(2.5rem, 7.4vw, 5.4rem); letter-spacing: -0.022em; line-height: 1.02; }
.display em { font-style: italic; color: var(--peach); }
.h2 { font-size: clamp(1.8rem, 4.4vw, 3rem); }
.lead { font-size: clamp(1.06rem, 1.6vw, 1.25rem); line-height: 1.55; color: var(--ink-2); max-width: 38em; margin: 16px 0 0; }
.label { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 14px; }
.muted { color: var(--ink-2); }
.dev { display: inline-block; vertical-align: middle; margin-left: 6px; font-family: var(--sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: var(--pill); background: #f4e2d3; color: #7b4322; white-space: nowrap; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 13px 26px;
  border: 0; border-radius: var(--pill); font: 700 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  background: var(--accent); color: #fff; transition: background .18s ease, transform .18s ease; }
.btn:hover { background: var(--accent-ink); }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 3px solid var(--peach); outline-offset: 3px; }
.btn-ghost { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5); }
.btn-ghost:hover { background: rgba(255, 255, 255, .24); }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rule); }
.btn-line:hover { background: var(--surface); }
.btn-wide { width: 100%; }

/* ---------- encabezado translúcido ---------- */
header.top { position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px); border-bottom: 1px solid var(--rule); }
@media (prefers-reduced-transparency: reduce) { header.top { background: var(--bg); backdrop-filter: none; } }
.nav { height: 100%; display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
.nav-links { display: flex; gap: 28px; margin-left: auto; }
.nav-links a { text-decoration: none; font-size: .92rem; font-weight: 600; color: var(--ink-2); }
.nav-links a:hover { color: var(--ink); }
.nav .btn { min-height: 42px; padding: 9px 18px; font-size: .9rem; }
.burger { display: none; margin-left: auto; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; padding: 12px; }
.burger span { display: block; height: 1.6px; background: var(--ink); border-radius: 2px; }
.burger span + span { margin-top: 6px; }
.drawer { position: fixed; inset: var(--header-h) 0 auto 0; z-index: 99; background: var(--bg); border-bottom: 1px solid var(--rule);
  padding: 8px var(--gutter) 24px; display: flex; flex-direction: column; box-shadow: 0 20px 40px rgba(46, 40, 36, .12); }
.drawer[hidden] { display: none; }
.drawer a { display: flex; align-items: center; min-height: 54px; text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--rule); }
.drawer .btn { margin-top: 16px; border: 0; }
@media (max-width: 860px) {
  .nav-links, .nav > .btn { display: none; }
  .burger { display: block; }
}

/* ---------- portada con fotos que rotan ---------- */
.hero { position: relative; min-height: min(92vh, 860px); display: flex; align-items: flex-end; color: #fff; overflow: hidden; background: var(--pine); }
.hero__fotos { position: absolute; inset: 0; }
.hero__fotos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: rota 24s infinite; }
.hero__fotos img:nth-child(2) { animation-delay: 8s; }
.hero__fotos img:nth-child(3) { animation-delay: 16s; }
/* cada foto entra en ~1 s, queda unos 7 s con un zoom lento y se funde con la siguiente */
@keyframes rota { 0% { opacity: 0; transform: scale(1.03); } 4% { opacity: 1; } 33% { opacity: 1; } 38% { opacity: 0; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .hero__fotos img { animation: none; } .hero__fotos img:first-child { opacity: 1; } }
.hero::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(20, 26, 22, .72), rgba(20, 26, 22, .35) 55%, rgba(20, 26, 22, .05) 85%),
              linear-gradient(to top, rgba(20, 26, 22, .75), transparent 45%); }
.hero__body { position: relative; z-index: 1; width: 100%; padding-block: calc(var(--header-h) + 40px) clamp(48px, 8vh, 96px); }
.hero .label { color: var(--peach); text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
.hero .lead { color: rgba(255, 255, 255, .88); max-width: 34em; }
.hero__acciones { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__nota { margin-top: 28px; font-size: .9rem; color: rgba(255, 255, 255, .78); max-width: 36em; }

/* ---------- secciones ---------- */
.section { padding-block: clamp(64px, 9vw, 112px); }
.tint { background: var(--surface); }
.pine { background: var(--pine); color: var(--on-pine); }
.pine .label { color: var(--peach); }
.pine .lead, .pine .muted { color: var(--on-pine-2); }
.head { max-width: 46em; margin-bottom: clamp(32px, 5vw, 56px); }
.head--centro { margin-inline: auto; text-align: center; }
.head--centro .lead { margin-inline: auto; }

/* para quién */
.rubros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.rubro { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 26px 22px; }
.rubro svg { width: 34px; height: 34px; color: var(--accent); margin-bottom: 18px; }
.rubro p { margin: 10px 0 0; font-size: .97rem; color: var(--ink-2); }

/* captura principal */
.pantalla { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); background: var(--card); }
.pantalla img { width: 100%; }

/* filas de funciones */
.fila { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.fila + .fila { margin-top: clamp(64px, 8vw, 104px); }
.fila--inv .fila__texto { order: 2; }
.fila__texto p { color: var(--ink-2); margin: 14px 0 0; }
.puntos { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.puntos li { position: relative; padding-left: 24px; }
.puntos li::before { content: ""; position: absolute; left: 0; top: .62em; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.pine .puntos li::before { background: var(--peach); }

/* celulares: recortados abajo a propósito, como si salieran del borde */
.celulares { display: flex; gap: 22px; justify-content: center; align-items: flex-start; }
.celular { width: min(270px, 44vw); height: min(400px, 66vw); overflow: hidden; border-radius: 34px 34px 0 0;
  -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
.celular img { width: 100%; height: auto; }
.celular + .celular { margin-top: 48px; }

/* pasos */
.pasos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: paso; }
.paso { counter-increment: paso; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 28px 26px; }
.paso::before { content: counter(paso); display: block; font-family: var(--serif); font-style: italic; font-size: 2.6rem; line-height: 1; color: var(--accent); margin-bottom: 18px; }
.paso p { margin: 10px 0 0; color: var(--ink-2); font-size: .97rem; }

/* sus datos */
.datos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--pine-rule); }
.dato { padding: 28px 24px 8px 0; }
.dato + .dato { padding-left: 24px; border-left: 1px solid var(--pine-rule); }
.dato p { margin: 10px 0 0; color: var(--on-pine-2); font-size: .97rem; }

/* estado del proyecto */
.estado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.estado > div { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 26px; }
.estado .label { margin-bottom: 10px; }
.estado p { margin: 10px 0 0; color: var(--ink-2); font-size: .97rem; }

/* versión gratuita */
.gratis { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.gratis .celulares { justify-content: flex-start; }

/* preguntas */
.faq { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; align-items: center;
  padding: 22px 0; font-family: var(--serif); font-size: 1.2rem; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--sans); font-size: 1.4rem; color: var(--accent); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 22px; color: var(--ink-2); max-width: 44em; }

/* contacto */
.contacto { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
.form { background: var(--card); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: clamp(22px, 3vw, 34px); display: grid; gap: 14px; }
.form .dos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.campo { display: grid; gap: 6px; font-size: .9rem; font-weight: 600; }
.input { width: 100%; min-height: 48px; padding: 11px 14px; border: 1.5px solid var(--rule); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink); font: 500 1rem var(--sans); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #f4e2d3; }
.input[aria-invalid="true"] { border-color: #a12f28; }
textarea.input { min-height: 96px; resize: vertical; }
.hp { position: absolute; left: -9999px; }
.form__msg { margin: 0; min-height: 1.2em; font-size: .92rem; font-weight: 600; }
.form__msg.ok { color: #4f5b38; }
.form__msg.err { color: #a12f28; }
.form__legal { margin: 0; font-size: .8rem; color: var(--ink-2); }

/* pie */
footer.pie { padding-block: 56px 32px; border-top: 1px solid var(--rule); font-size: .92rem; }
.pie__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.pie__grid h3 { font-family: var(--sans); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 12px; }
.pie__grid a { display: block; text-decoration: none; padding: 4px 0; }
.pie__grid a:hover { color: var(--accent-ink); }
.pie__abajo { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--rule); color: var(--ink-2); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.creditos { margin-top: 14px; font-size: .75rem; color: var(--ink-2); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .rubros, .datos { grid-template-columns: 1fr 1fr; }
  .dato:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 860px) {
  .fila, .fila--inv, .gratis, .contacto { grid-template-columns: 1fr; }
  .fila--inv .fila__texto { order: 0; }
  .pasos, .estado { grid-template-columns: 1fr; }
  .pie__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .rubros, .datos, .form .dos, .pie__grid { grid-template-columns: 1fr; }
  .dato, .dato + .dato { padding-left: 0; border-left: 0; }
  .hero__acciones .btn { width: 100%; }
}

/* ---------- un día en su complejo: video fijo en PC, video por paso en el celular ---------- */
.dia__grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(32px, 5vw, 72px); }
.dia__paso { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; padding-block: 24px;
  opacity: .32; transition: opacity .5s ease; }
.dia__paso.activo { opacity: 1; }
.dia__paso p { color: var(--ink-2); margin: 14px 0 0; }
.dia__hora { font-family: var(--serif); font-style: italic; font-size: 1.6rem; color: var(--accent); margin-bottom: 10px; }
.dia__paso .h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.dia__paso .dia__video { display: none; }
.dia__escena { position: relative; }
.dia__marco { position: sticky; top: calc(var(--header-h) + 14vh); aspect-ratio: 16 / 9; border-radius: var(--radius);
  overflow: hidden; background: var(--card); box-shadow: var(--shadow-md); }
.dia__marco video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  transform: scale(1.015); transition: opacity .6s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.dia__marco video.activo { opacity: 1; transform: none; }
@media (max-width: 860px) {
  .dia__grid { grid-template-columns: 1fr; }
  .dia__escena { display: none; }
  .dia__paso { min-height: 0; opacity: 1; padding-block: 0; }
  .dia__paso + .dia__paso { margin-top: 64px; }
  .dia__paso .dia__video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin-top: 22px;
    border-radius: var(--radius-sm); box-shadow: var(--shadow-md); background: var(--card); }
}

/* ---------- entradas al hacer scroll (solo con JS y sin «reducir movimiento») ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-anim] { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
  .js [data-anim].visto { opacity: 1; transform: none; }
  .js .rubros[data-anim] > *, .js .pasos[data-anim] > *, .js .datos[data-anim] > *, .js .estado[data-anim] > * {
    opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
  .js [data-anim].visto > * { opacity: 1; transform: none; }
  .js [data-anim].visto > :nth-child(2) { transition-delay: .09s; }
  .js [data-anim].visto > :nth-child(3) { transition-delay: .18s; }
  .js [data-anim].visto > :nth-child(4) { transition-delay: .27s; }
  .hero__body { will-change: transform, opacity; }
}

/* ---------- intro: logo al centro → se corre y aparece el nombre → claim → vuela al encabezado ---------- */
/* --k: el bloque es el logo del encabezado multiplicado por k, así el vuelo termina calzando exacto */
.intro { --k: 3; position: fixed; inset: 0; z-index: 300; display: none; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px; background-color: var(--bg); transition: background-color .8s ease; }
.con-intro .intro { display: flex; }
.con-intro, .con-intro body { overflow: hidden; }
.con-intro header.top .logo { opacity: 0; }
.intro__marca { display: flex; align-items: center; font-family: var(--serif); font-weight: 600; font-size: calc(1.3rem * var(--k));
  line-height: 1.6; color: var(--ink); transition: transform .85s cubic-bezier(.65, 0, .2, 1); }
.intro__marca svg { flex: none; width: calc(28px * var(--k)); height: calc(28px * var(--k)); }
/* el logo se dibuja: primero el hexágono, después cada pieza de la libélula traza su contorno y se rellena.
   Al terminar queda idéntico al logo del encabezado (relleno blanco con el corte terracota). */
.dib { fill: rgba(255, 255, 255, 0); stroke: #fff; stroke-width: .3; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: dibujar .9s cubic-bezier(.45, 0, .25, 1) var(--d) forwards, rellenar .5s ease calc(var(--d) + .75s) forwards; }
.dib--hexa { stroke-width: .65; animation: dibujar 1.3s cubic-bezier(.45, 0, .25, 1) var(--d) forwards; }
@keyframes dibujar { to { stroke-dashoffset: 0; } }
@keyframes rellenar { to { fill: #fff; stroke: #a25f35; stroke-width: .45; } }
.intro__nombre { display: inline-block; overflow: hidden; white-space: nowrap; width: 0; transition: width .9s cubic-bezier(.65, 0, .2, 1); }
.intro__nombre span { display: inline-block; padding-left: calc(10px * var(--k)); opacity: 0; transform: translateX(-24%);
  transition: transform 1s cubic-bezier(.2, .7, .2, 1), opacity .6s ease .15s; }
.intro.nombre .intro__nombre span { opacity: 1; transform: none; }
.intro__claim { margin: 0; font-size: clamp(1rem, 2.4vw, 1.25rem); color: var(--ink-2); letter-spacing: .02em; text-align: center; padding-inline: 20px;
  opacity: 0; transform: translateY(10px); transition: opacity .7s ease, transform .7s ease; }
.intro.claim .intro__claim { opacity: 1; transform: none; }
.intro.vuela { background-color: transparent; }
.intro.vuela .intro__claim { opacity: 0; transform: translateY(-6px); transition-duration: .3s; }
@media (max-width: 520px) { .intro { --k: 2; } }

/* ---------- más movimiento al bajar ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* portada: entra cuando termina la intro */
  .js .hero__body > * { opacity: 0; transform: translateY(22px); transition: opacity .9s ease, transform 1s cubic-bezier(.2, .7, .2, 1); }
  .js.listo .hero__body > * { opacity: 1; transform: none; }
  .js.listo .hero__body > :nth-child(2) { transition-delay: .12s; }
  .js.listo .hero__body > :nth-child(3) { transition-delay: .26s; }
  .js.listo .hero__body > :nth-child(4) { transition-delay: .4s; }
  .js.listo .hero__body > :nth-child(5) { transition-delay: .55s; }
  .hero__fotos { transform: scale(1.08); transition: transform 2.6s cubic-bezier(.2, .7, .2, 1); }
  .listo .hero__fotos { transform: none; }

  /* encabezados de sección: el título se descubre de abajo hacia arriba */
  .js .head[data-anim] { opacity: 1; transform: none; }
  .js .head[data-anim] > * { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
  .js .head[data-anim] > .h2 { opacity: 1; clip-path: inset(-20% -5% 100% -5%); transform: translateY(28px);
    transition: clip-path 1.1s cubic-bezier(.65, 0, .2, 1) .08s, transform 1.1s cubic-bezier(.2, .7, .2, 1) .08s; }
  .js .head[data-anim].visto > * { opacity: 1; transform: none; }
  .js .head[data-anim].visto > .h2 { clip-path: inset(-20% -5% -20% -5%); }
  .js .head[data-anim].visto > .lead { transition-delay: .35s; }

  /* íconos de «Para quién es»: se dibujan */
  .js .rubros[data-anim] svg * { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s ease .3s; }
  .js .rubros[data-anim].visto svg * { stroke-dashoffset: 0; }

  /* imágenes y videos: se abren desde el centro */
  .js [data-anim="imagen"] { opacity: 1; transform: none; clip-path: inset(12% 9% 12% 9% round 28px);
    transition: clip-path 1.3s cubic-bezier(.65, 0, .2, 1); }
  .js [data-anim="imagen"].visto { clip-path: inset(0 0 0 0 round 0); }

  /* «Sus datos»: la línea superior se extiende */
  .datos { border-top: 0; position: relative; }
  .datos::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: var(--pine-rule); transform-origin: left; }
  .js .datos[data-anim]::before { transform: scaleX(0); transition: transform 1.6s cubic-bezier(.65, 0, .2, 1); }
  .js .datos[data-anim].visto::before { transform: none; }

  /* preguntas: entran de a una */
  .js .faq[data-anim] > details { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
  .js .faq[data-anim].visto > details { opacity: 1; transform: none; }
  .js .faq[data-anim].visto > :nth-child(5) { transition-delay: .36s; }
  .js .faq[data-anim].visto > :nth-child(6) { transition-delay: .45s; }
}
