/* ────────────────────────────────────────────────────────────────
   Casa Nívola — sistema visual
   No hay ni un color ni una fuente escritos aquí a mano: todo entra
   como variable CSS desde datos/cliente.json (lo hace app.js).
   ──────────────────────────────────────────────────────────────── */

/* Hasta que no hay consentimiento no se piden las fuentes a Google, así que
   la pila del sistema tiene que aguantar el diseño ella sola. Estas dos
   listas son las que se ven con "Solo las necesarias". */
:root {
  --fallback-display: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --fallback-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans), var(--fallback-sans);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Evita el parpadeo mientras el JSON no ha pintado la página */
body[data-listo="no"] { opacity: 0; }
body[data-listo="si"] { opacity: 1; transition: opacity .4s ease; }

::selection { background: var(--accent); color: var(--paper); }

/* ── Tipografía ───────────────────────────────────────────────── */
.font-display { font-family: var(--font-display), var(--fallback-display); font-variation-settings: 'opsz' 144, 'SOFT' 50; }
.display-tight { letter-spacing: -0.035em; line-height: 0.92; }
.display-italic { font-variation-settings: 'opsz' 144, 'SOFT' 100; font-style: italic; }

/* Georgia y Palatino ya vienen anchas: al mismo tracking apretado que
   Fraunces las letras se tocan. Un pelo más de aire mientras no haya webfont. */
html[data-fuentes="sistema"] .display-tight { letter-spacing: -0.018em; line-height: 0.98; }
html[data-fuentes="sistema"] .hero-title { font-size: clamp(40px, 6.4vw, 88px); }

.eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.22em;
  color: var(--ink-soft); font-weight: 500;
}

.hero-title { font-size: clamp(44px, 7.2vw, 104px); }
.section-title { font-size: clamp(36px, 5.2vw, 76px); }

/* El cirílico ocupa más: al mismo cuerpo, los titulares rusos se parten en
   tres líneas y dejan palabras huérfanas. Un punto menos y vuelven a cuadrar. */
html[lang="ru"] .hero-title { font-size: clamp(36px, 5.8vw, 82px); }
html[lang="ru"] .section-title { font-size: clamp(30px, 4.4vw, 62px); }

.editorial-num {
  font-family: var(--font-display), var(--fallback-display);
  font-variation-settings: 'opsz' 144, 'wght' 300;
  font-style: italic; letter-spacing: -0.02em;
}
.editorial-num.on-image { text-shadow: 0 2px 24px rgba(0,0,0,0.35); }

/* Cursiva serif como acento dentro de un párrafo */
.fi {
  font-family: var(--font-display), var(--fallback-display); font-style: italic;
  font-variation-settings: 'opsz' 144, 'wght' 500;
  font-size: 1.08em; letter-spacing: -0.005em;
}

/* ── Texturas y capas ─────────────────────────────────────────── */
.noise::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0 0.06 0 0 0 0.35 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.6'/></svg>");
  opacity: .22; mix-blend-mode: multiply;
}

/* Velo sobre las fotos. Arriba también tiene carga: si no, el texto
   del relleno de placehold.co se pelea con el titular. */
.hero-overlay::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10,12,11,0.52) 0%, rgba(10,12,11,0.46) 42%, rgba(10,12,11,0.78) 100%),
    radial-gradient(900px 520px at 78% 8%, rgba(var(--accent-rgb) / 0.20), transparent 62%);
}

.warm-overlay::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(10,12,11,0.06) 30%, rgba(var(--brand-deep-rgb) / 0.62) 100%);
}

.hair { border-color: rgb(var(--ink-rgb) / 0.14); }
.hair-light { border-color: rgb(var(--paper-rgb) / 0.16); }

/* ── Profundidad: base → elevado → flotante ───────────────────── */
.nivel-elevado {
  box-shadow:
    0 1px 2px rgb(var(--brand-deep-rgb) / 0.06),
    0 8px 20px -8px rgb(var(--brand-deep-rgb) / 0.14);
}
.nivel-flotante {
  box-shadow:
    0 1px 2px rgb(var(--brand-deep-rgb) / 0.08),
    0 12px 28px -10px rgb(var(--brand-deep-rgb) / 0.22),
    0 32px 64px -24px rgb(var(--brand-deep-rgb) / 0.30);
}

/* ── Enlaces y botones ────────────────────────────────────────── */
.link-u { position: relative; display: inline-block; }
.link-u::after {
  content: ''; position: absolute; left: 0; bottom: -2px; height: 1px; width: 100%;
  background: currentColor; transform-origin: right; transform: scaleX(0);
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.link-u:hover::after { transform-origin: left; transform: scaleX(1); }
.link-u:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

.btn-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px;
  font-size: 14px; letter-spacing: 0.02em; font-weight: 500;
  cursor: pointer; border: 0;
}
.btn-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn-pill .arrow {
  width: 28px; height: 28px; border-radius: 999px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper); color: var(--brand);
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
}

.btn-brand {
  background: var(--brand); color: var(--paper);
  transition: background .3s cubic-bezier(.2,.7,.2,1), transform .3s cubic-bezier(.2,.7,.2,1);
}
.btn-brand:hover { background: var(--brand-deep); transform: translateY(-1px); }
.btn-brand:hover .arrow { transform: translateX(3px) rotate(-8deg); }
.btn-brand:active { transform: translateY(0); }

.btn-accent {
  background: var(--accent); color: var(--paper);
  transition: background .3s cubic-bezier(.2,.7,.2,1), transform .3s cubic-bezier(.2,.7,.2,1);
}
.btn-accent:hover { background: var(--brand-deep); transform: translateY(-1px); }
.btn-accent:hover .arrow { transform: translateX(3px) rotate(-8deg); }
.btn-accent:active { transform: translateY(0); }
.btn-accent .arrow { background: var(--paper); color: var(--accent); }

.btn-claro { background: var(--paper); color: var(--brand-deep); transition: transform .3s cubic-bezier(.2,.7,.2,1), background .3s ease; }
.btn-claro:hover { transform: translateY(-1px); background: var(--paper-2); }
.btn-claro .arrow { background: var(--brand); color: var(--paper); }

.btn-ghost {
  border: 1px solid rgb(var(--ink-rgb) / 0.22);
  transition: background .3s ease, border-color .3s ease, transform .3s cubic-bezier(.2,.7,.2,1);
}
.btn-ghost:hover { background: rgb(var(--ink-rgb) / 0.04); border-color: rgb(var(--ink-rgb) / 0.5); transform: translateY(-1px); }

.btn-ghost-claro {
  border: 1px solid rgb(var(--paper-rgb) / 0.32); color: var(--paper);
  transition: background .3s ease, border-color .3s ease, transform .3s cubic-bezier(.2,.7,.2,1);
}
.btn-ghost-claro:hover { background: rgb(var(--paper-rgb) / 0.1); border-color: rgb(var(--paper-rgb) / 0.6); transform: translateY(-1px); }

/* ── Chips y detalles ─────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: rgb(var(--paper-rgb) / 0.92); color: var(--ink);
  font-size: 11.5px; letter-spacing: 0.06em; backdrop-filter: blur(8px);
}
.chip-oscuro { background: rgb(10 12 11 / 0.55); color: var(--paper); }

.loc-dot {
  width: 8px; height: 8px; border-radius: 999px; background: var(--accent);
  box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / 0.22);
}

.dot-live {
  width: 6px; height: 6px; border-radius: 999px; background: var(--accent);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgb(var(--accent-rgb) / 0.5); }
  70%  { box-shadow: 0 0 0 8px rgb(var(--accent-rgb) / 0); }
  100% { box-shadow: 0 0 0 0 rgb(var(--accent-rgb) / 0); }
}

/* ── Selector de idioma ───────────────────────────────────────── */
.selector-idioma { position: relative; }

.selector-boton {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 12px; border-radius: 999px;
  font-family: inherit; font-size: 11.5px; letter-spacing: 0.06em;
  color: var(--ink); background: transparent; border: 1px solid rgb(var(--ink-rgb) / 0.18);
  cursor: pointer; white-space: nowrap;
  transition: background .25s ease, border-color .25s ease;
}
.selector-boton:hover { background: rgb(var(--ink-rgb) / 0.05); border-color: rgb(var(--ink-rgb) / 0.4); }
.selector-boton:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.selector-chevron { display: inline-flex; transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.selector-boton[aria-expanded="true"] .selector-chevron { transform: rotate(180deg); }

.selector-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 168px; padding: 6px;
  background: var(--paper); border: 1px solid rgb(var(--ink-rgb) / 0.12);
  border-radius: 14px; list-style: none;
  box-shadow:
    0 1px 2px rgb(var(--brand-deep-rgb) / 0.08),
    0 14px 32px -10px rgb(var(--brand-deep-rgb) / 0.28);
}
.selector-menu[hidden] { display: none; }
.selector-menu a {
  display: block; padding: 9px 12px; border-radius: 9px;
  font-size: 13.5px; letter-spacing: 0; color: var(--ink);
  transition: background .2s ease;
}
.selector-menu a:hover { background: rgb(var(--ink-rgb) / 0.05); }
.selector-menu a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.selector-menu a.es-actual { color: var(--brand); font-weight: 600; }
.selector-menu a.es-actual::after { content: ' ·'; color: var(--accent); }

/* ── Marquee ──────────────────────────────────────────────────── */
.marquee {
  display: flex; overflow: hidden; gap: 3rem;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; gap: 3rem; animation: marq 42s linear infinite; flex-shrink: 0; }
@keyframes marq { to { transform: translateX(-50%); } }

/* ── Entrada suave ────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); animation: rv .9s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes rv { to { opacity: 1; transform: translateY(0); } }

/* ── Buscador del hero ────────────────────────────────────────── */
.campo {
  width: 100%; background: transparent; border: 0; padding: 0;
  font-family: inherit; font-size: 15px; color: var(--ink);
  letter-spacing: -0.01em;
}
.campo:focus { outline: none; }
.campo::-webkit-calendar-picker-indicator { opacity: .45; cursor: pointer; }

.campo-caja {
  padding: 14px 18px;
  transition: background .3s ease;
}
.campo-caja:focus-within { background: rgb(var(--accent-rgb) / 0.07); }
.campo-caja:hover { background: rgb(var(--ink-rgb) / 0.03); }

/* ── Tarjeta de casa ──────────────────────────────────────────── */
.tarjeta-casa img { transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.tarjeta-casa:hover img { transform: scale(1.045); }
.tarjeta-casa .flecha-casa { transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.tarjeta-casa:hover .flecha-casa { transform: translateX(5px); }

/* ── Estrellas ────────────────────────────────────────────────── */
.estrellas { display: inline-flex; gap: 2px; color: var(--accent); }
.estrellas svg { width: 13px; height: 13px; }

/* ── Marcadores PENDIENTE_ ────────────────────────────────────────
   Un dato que el cliente aún no ha dado no puede pasar por bueno.
   Se pinta en monoespaciada, en el color de acento y con un subrayado
   punteado: imposible confundirlo con un teléfono o un registro real. */
.pendiente {
  font-family: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Consolas, monospace;
  font-size: 0.88em; letter-spacing: 0.02em; font-style: normal;
  color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.09);
  border-bottom: 1px dotted rgb(var(--accent-rgb) / 0.6);
  padding: 0.1em 0.36em; border-radius: 3px;
  overflow-wrap: anywhere;
}
/* Sobre fondo oscuro (pie) el acento se apaga: se usa el acento suave */
.bg-ink .pendiente, footer .pendiente {
  color: var(--accent-soft);
  background: rgb(var(--accent-soft-rgb) / 0.14);
  border-bottom-color: rgb(var(--accent-soft-rgb) / 0.55);
}

/* ── Aviso de web de demostración (pie) ───────────────────────── */
.aviso-demo {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 28px; padding-top: 20px;
  border-top: 1px solid rgb(var(--paper-rgb) / 0.08);
  max-width: 760px;
  font-size: 11.5px; line-height: 1.75;
  color: rgb(var(--paper-rgb) / 0.42);
}
.aviso-demo-punto {
  width: 5px; height: 5px; border-radius: 999px; flex-shrink: 0;
  margin-top: 7px; background: var(--accent-soft); opacity: .8;
}

/* Un botón que parece un enlace (el de configurar cookies del pie) */
.boton-texto {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit;
}

/* ── Banner de cookies ────────────────────────────────────────── */
.banner-cookies {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  padding: 14px; pointer-events: none;
}
.banner-cookies[hidden] { display: none; }

.banner-cookies-caja {
  pointer-events: auto;
  max-width: 1120px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 20px;
  padding: 22px 24px;
  background: var(--paper);
  border: 1px solid rgb(var(--ink-rgb) / 0.12);
  border-radius: 18px;
  animation: sube-banner .5s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes sube-banner {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.banner-cookies-titulo {
  font-size: 17px; letter-spacing: -0.02em; line-height: 1.15;
  color: var(--ink); margin-bottom: 8px;
}
.banner-cookies-texto p {
  font-size: 13px; line-height: 1.65; color: var(--ink-soft);
  max-width: 68ch;
}
.banner-cookies-enlace {
  display: inline-block; margin-top: 10px;
  font-size: 12.5px; color: var(--brand);
}
.banner-cookies-botones { display: flex; flex-wrap: wrap; gap: 10px; }
.banner-cookies-botones .btn-pill { padding: 12px 20px; font-size: 13.5px; }

/* En móvil el aviso se come media pantalla si no se aprieta un poco.
   Se recorta el aire, no el texto: es un consentimiento, tiene que leerse. */
@media (max-width: 520px) {
  .banner-cookies { padding: 10px; }
  .banner-cookies-caja { padding: 18px 18px 20px; gap: 16px; border-radius: 14px; }
  .banner-cookies-titulo { font-size: 16px; margin-bottom: 7px; }
  .banner-cookies-texto p { font-size: 12.5px; line-height: 1.6; }
  .banner-cookies-botones .btn-pill { flex: 1 1 auto; padding: 11px 16px; font-size: 13px; }
}

@media (min-width: 860px) {
  .banner-cookies { padding: 20px; }
  .banner-cookies-caja {
    flex-direction: row; align-items: center; justify-content: space-between;
    gap: 36px; padding: 24px 28px;
  }
  .banner-cookies-botones { flex-shrink: 0; }
}

/* ── Páginas legales ──────────────────────────────────────────── */
.titulo-legal { font-size: clamp(34px, 4.6vw, 62px); }
html[lang="ru"] .titulo-legal { font-size: clamp(28px, 3.8vw, 50px); }

.aviso-pendiente {
  border-left: 2px solid var(--accent);
  background: rgb(var(--accent-rgb) / 0.06);
  padding: 16px 20px; border-radius: 0 4px 4px 0;
  font-size: 13.5px; line-height: 1.75; color: var(--ink-soft);
  max-width: 68ch; margin-bottom: 44px;
}

.seccion-legal { padding-bottom: 44px; margin-bottom: 44px; border-bottom: 1px solid rgb(var(--ink-rgb) / 0.1); }
.seccion-legal:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.seccion-legal { scroll-margin-top: 110px; }

.parrafo-legal { font-size: 15px; line-height: 1.8; color: var(--ink-soft); max-width: 68ch; }
.parrafo-legal + .parrafo-legal { margin-top: 16px; }

.lista-legal { margin-top: 18px; max-width: 68ch; }
.lista-legal li {
  position: relative; padding-left: 22px;
  font-size: 14.5px; line-height: 1.75; color: var(--ink-soft);
}
.lista-legal li + li { margin-top: 12px; }
.lista-legal li::before {
  content: ''; position: absolute; left: 2px; top: 10px;
  width: 5px; height: 5px; border-radius: 999px; background: var(--accent);
}

.datos-legales { margin-top: 20px; max-width: 640px; }
.datos-legales-fila {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px;
  padding: 11px 0; border-bottom: 1px solid rgb(var(--ink-rgb) / 0.1);
}
.datos-legales-fila dt {
  flex: 0 0 210px; font-size: 12.5px; color: var(--ink-soft);
}
.datos-legales-fila dd { flex: 1 1 200px; font-size: 14.5px; color: var(--ink); }

@media (max-width: 560px) {
  .datos-legales-fila dt { flex-basis: 100%; }
}

.tabla-legal-caja { margin-top: 22px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabla-legal { width: 100%; min-width: 640px; border-collapse: collapse; text-align: left; }
.tabla-legal th, .tabla-legal td {
  padding: 13px 16px 13px 0; vertical-align: top;
  border-bottom: 1px solid rgb(var(--ink-rgb) / 0.1);
}
.tabla-legal thead th {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.16em;
  font-weight: 500; color: var(--ink-soft);
  border-bottom-color: rgb(var(--ink-rgb) / 0.22);
}
.tabla-legal tbody th, .tabla-legal tbody td {
  font-size: 13.5px; line-height: 1.65; color: var(--ink-soft); font-weight: 400;
}
.tabla-legal tbody code {
  font-family: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Consolas, monospace;
  font-size: 12.5px; color: var(--brand);
}

.indice-legal-lista { list-style: none; counter-reset: none; }
.indice-legal-lista li + li { margin-top: 11px; }
.indice-legal-lista a {
  display: flex; gap: 11px; align-items: baseline;
  font-size: 13px; line-height: 1.5; color: var(--ink-soft);
}
.indice-legal-lista a:hover { color: var(--ink); }
.indice-legal-num {
  font-family: var(--font-display), var(--fallback-display);
  font-style: italic; font-size: 12.5px; color: var(--accent);
  flex-shrink: 0; min-width: 18px;
}
/* El índice lateral repite lo que ya dice el texto: el subrayado animado
   de .link-u sobra ahí y ensucia una lista de trece líneas. */
.indice-legal-lista a::after { display: none; }

/* ── Rejilla de 12 columnas en móvil ──────────────────────────────
   Un grid-cols-12 con gap-10 mide 440 px solo de huecos (11 × 40),
   por mucho que las columnas puedan valer 0. A 375 px eso empuja el
   documento a 464 px y aparece scroll horizontal en toda la web.
   Debajo de md se limita el hueco horizontal a 24 px: 11 × 24 = 264,
   que sí cabe, y los pares col-span-6 conservan su calle. El hueco
   vertical no se toca. (.grid.grid-cols-12 gana a la utilidad de
   Tailwind por especificidad, sin necesidad de !important.) */
@media (max-width: 767px) {
  .grid.grid-cols-12 { column-gap: 1.5rem; }
}

@media (max-width: 900px) { .hide-md { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .marquee-track { animation: none; }
  .reveal { opacity: 1; transform: none; }
}
