/* Houspi · houspi.css · v1 · 2026-07-03
   Blanco / negro. Inter Tight + Inter. Líneas finas. Sin colorines. */

:root {
  --ink: #111111;
  --graphite: #343434;
  --muted: #6b6b68;
  --canvas: #ffffff;
  --surface: #f6f6f3;
  --border: #ddddd8;
  --focus: #2457d6;
  --error: #b42318;
  --success: #287a4b;
  --font-display: "Inter Tight", sans-serif;
  --font-body: "Inter", Arial, sans-serif;
  --container: 1160px;
  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.intro-lock { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

#main-content:focus,
#main-content:focus-visible {
  outline: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: min(var(--container), calc(100% - 48px));
  margin: 0 auto;
}

/* ───────────────────────── INTRO ───────────────────────── */

.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.intro[hidden] { display: none; }

.intro-stage {
  text-align: center;
  padding: 0 24px;
}

.intro-word {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: clamp(3.4rem, 13vw, 9.5rem);
  letter-spacing: 0.34em;
  margin-right: -0.34em; /* compensa el tracking del último carácter */
  color: var(--ink);
  display: block;
  white-space: nowrap;
}

.intro-word span {
  display: inline-block;
  opacity: 0;
  transform: translateY(58vh);
}

.intro.play .intro-word span {
  animation: intro-rise 1.7s var(--ease) forwards;
  animation-delay: calc(0.2s + var(--i) * 0.09s);
}

@keyframes intro-rise {
  0%   { opacity: 0; transform: translateY(58vh); }
  55%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0); }
}

.intro-line {
  width: 0;
  height: 1px;
  background: var(--ink);
  margin: 26px auto 22px;
  opacity: 0.85;
}

.intro.play .intro-line {
  animation: intro-line 1s var(--ease) forwards;
  animation-delay: 2.1s;
}

@keyframes intro-line {
  from { width: 0; }
  to   { width: min(320px, 60vw); }
}

.intro-tag {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(0.95rem, 2.4vw, 1.25rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--graphite);
  opacity: 0;
  transform: translateY(14px);
}

.intro.play .intro-tag {
  animation: intro-tag 1.2s var(--ease) forwards;
  animation-delay: 4.1s;
}

@keyframes intro-tag {
  to { opacity: 1; transform: translateY(0); }
}

/* salida: todo sube y desaparece por arriba */
.intro.leave .intro-stage {
  animation: intro-leave 1.9s var(--ease) forwards;
}

@keyframes intro-leave {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-62vh); }
}

.intro.leave {
  animation: intro-fade 0.6s linear forwards;
  animation-delay: 1.7s;
}

@keyframes intro-fade {
  to { opacity: 0; visibility: hidden; }
}

.intro-skip {
  position: absolute;
  bottom: max(28px, env(safe-area-inset-bottom, 0px) + 20px);
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 26px;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.6s, color 0.2s, border-color 0.2s;
}

.intro.play .intro-skip { opacity: 1; transition-delay: 1.6s; }
.intro-skip:hover { color: var(--ink); border-color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .intro { display: none !important; }
}

/* ───────────────────────── CABECERA ───────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 74px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.5rem;
  letter-spacing: 0.4em;
  margin-right: -0.4em;
  text-decoration: none;
}

.header-back {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--graphite);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.header-back:hover { border-color: var(--ink); color: var(--ink); }
body[data-route="comprar"] .header-back,
body[data-route="vender"] .header-back,
body[data-route="mas"] .header-back { display: inline-flex; }

/* ───────────────────────── VISTAS ───────────────────────── */

.view { display: none; }
.view.is-active { display: block; animation: view-in 0.55s var(--ease); }

@keyframes view-in {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ───────────────────────── HOME: 3 MÓDULOS ───────────────────────── */

.home-lead {
  text-align: center;
  padding: clamp(40px, 7vh, 76px) 24px 8px;
}

.home-lead h1 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 300;
}

.home-lead p {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: clamp(28px, 5vh, 56px);
  min-height: clamp(380px, 58vh, 560px);
}

.module-door {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(32px, 5vw, 64px) clamp(24px, 3.5vw, 52px);
  text-decoration: none;
  border-right: 1px solid var(--border);
  background: var(--canvas);
  transition: background 0.35s var(--ease);
}

.module-door:last-child { border-right: 0; }
.module-door:hover, .module-door:focus-visible { background: var(--surface); }

.module-door .kicker {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.module-door h2 {
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  font-weight: 300;
  margin: 10px 0 14px;
}

.module-door .door-copy {
  color: var(--graphite);
  font-size: 0.98rem;
  max-width: 34ch;
}

.module-door .door-go {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.module-door .door-go::after {
  content: "→";
  transition: transform 0.3s var(--ease);
}

.module-door:hover .door-go::after { transform: translateX(6px); }

@media (max-width: 860px) {
  .module-grid { grid-template-columns: 1fr; min-height: 0; }
  .module-door {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    gap: 20px;
    min-height: 30vh;
  }
  .module-door:last-child { border-bottom: 0; }
}

/* ───────────────────────── MÓDULO INTERIOR ───────────────────────── */

.module-hero {
  padding: clamp(44px, 8vh, 88px) 0 clamp(28px, 4vh, 48px);
  border-bottom: 1px solid var(--border);
}

.module-hero .kicker {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 14px;
}

.module-hero h1 {
  font-size: clamp(1.9rem, 4.6vw, 3.1rem);
  font-weight: 300;
  max-width: 22ch;
}

.module-hero p {
  color: var(--graphite);
  max-width: 62ch;
  margin-bottom: 0;
}

.section {
  padding: clamp(40px, 7vh, 84px) 0;
}

.section + .section { border-top: 1px solid var(--border); }

.section-head {
  margin-bottom: clamp(24px, 4vh, 44px);
}

.section-head h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 400;
}

.section-head p {
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: 0;
}

/* herramientas */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 24px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  background: var(--canvas);
  transition: border-color 0.25s, transform 0.35s var(--ease);
}

.tool-card:hover { border-color: var(--ink); transform: translateY(-3px); }

.tool-card .tool-tag {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.tool-card h3 {
  font-size: 1.22rem;
  font-weight: 500;
  margin: 0;
}

.tool-card p {
  font-size: 0.93rem;
  color: var(--graphite);
  margin: 0;
  flex: 1;
}

.tool-card .tool-open {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-display);
}

.tool-card .tool-open::after { content: " →"; }

/* tarjetas de contenido (acordeón) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
}

.idea-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas);
}

.idea-card summary {
  list-style: none;
  cursor: pointer;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.02rem;
}

.idea-card summary::-webkit-details-marker { display: none; }
.idea-card summary::after {
  content: "+";
  font-weight: 300;
  font-size: 1.3rem;
  color: var(--muted);
  flex: none;
}

.idea-card[open] summary::after { content: "−"; }

.idea-card .idea-body {
  padding: 0 24px 22px;
  font-size: 0.95rem;
  color: var(--graphite);
}

.idea-card .idea-body p:last-child { margin-bottom: 0; }

/* ───────────────────────── INMUEBLES EN VENTA ───────────────────────── */

.props-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.prop-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--canvas);
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s, transform 0.35s var(--ease);
}

.prop-card:hover { border-color: var(--ink); transform: translateY(-3px); }

.prop-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.prop-media-type {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}

.prop-media-type span {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: 4rem;
  color: var(--border);
}

.prop-body {
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.prop-badge {
  align-self: flex-start;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
}

.prop-badge-demo { border-style: dashed; color: var(--muted); border-color: var(--muted); }

.prop-price {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.7rem;
  letter-spacing: -0.01em;
  margin: 2px 0 0;
}

.prop-card h3 { font-size: 1.08rem; font-weight: 500; margin: 0; }
.prop-zone { font-size: 0.85rem; color: var(--muted); margin: 0; }
.prop-specs { font-size: 0.88rem; color: var(--graphite); margin: 0; }
.prop-note { font-size: 0.88rem; color: var(--graphite); margin: 4px 0 10px; flex: 1; }
.prop-cta { align-self: flex-start; padding: 10px 22px; font-size: 0.8rem; }
.prop-cta[disabled] { opacity: 0.45; cursor: not-allowed; }

.props-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 26px;
  color: var(--graphite);
  font-size: 0.95rem;
}

/* ───────────────────────── FORMULARIO CONVERSACIONAL ───────────────────────── */

.talk {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(26px, 4vw, 44px);
  max-width: 720px;
}

.talk-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 26px;
}

.talk-progress i {
  height: 2px;
  flex: 1;
  background: var(--border);
  transition: background 0.3s;
}

.talk-progress i.done { background: var(--ink); }

.talk-step { display: none; border: 0; padding: 0; margin: 0; min-width: 0; }
.talk-step.is-active { display: block; animation: view-in 0.4s var(--ease); }

.talk-step legend, .talk-step .talk-q {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 500;
  padding: 0;
  margin-bottom: 18px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border: 0;
  padding: 0;
  margin: 0 0 6px;
}

.chip-row legend {
  flex-basis: 100%;
  width: 100%;
}

.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--canvas);
  padding: 11px 20px;
  font-size: 0.93rem;
  transition: border-color 0.2s, background 0.2s;
}

.chip:hover { border-color: var(--ink); }
.chip.is-selected { background: var(--ink); color: #fff; border-color: var(--ink); }

.talk-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 26px;
  gap: 14px;
}

.talk-back {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  color: var(--graphite);
  margin-bottom: 6px;
}

.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas);
  padding: 13px 14px;
  font-size: 1rem;
}

.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--ink);
}

.field .field-error {
  display: none;
  color: var(--error);
  font-size: 0.82rem;
  margin-top: 5px;
}

.field.has-error input, .field.has-error textarea { border-color: var(--error); }
.field.has-error .field-error { display: block; }

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.85rem;
  color: var(--graphite);
  margin: 18px 0 6px;
}

.consent input { margin-top: 4px; flex: none; width: 16px; height: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 13px 30px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn:hover { opacity: 0.82; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.btn-ghost {
  background: none;
  color: var(--ink);
  border-color: var(--border);
}

.btn-ghost:hover { border-color: var(--ink); opacity: 1; }

.talk-status {
  margin-top: 16px;
  font-size: 0.9rem;
  min-height: 1.4em;
}

.talk-status.ok { color: var(--success); }
.talk-status.error { color: var(--error); }

/* ───────────────────────── DIAGNÓSTICO (MÁS) ───────────────────────── */

.diagnosis-result {
  border-left: 2px solid var(--ink);
  padding: 4px 0 4px 20px;
  margin-top: 22px;
  display: none;
}

.diagnosis-result.show { display: block; animation: view-in 0.4s var(--ease); }
.diagnosis-result h3 { font-size: 1.1rem; font-weight: 500; margin-bottom: 6px; }
.diagnosis-result p { color: var(--graphite); font-size: 0.95rem; margin-bottom: 12px; }

/* ───────────────────────── PIE ───────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 44px 0 34px;
  margin-top: clamp(40px, 7vh, 80px);
  font-size: 0.88rem;
  color: var(--muted);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 56px;
  justify-content: space-between;
}

.footer-grid h3 {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--graphite);
  margin-bottom: 10px;
}

.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 7px; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { text-decoration: underline; text-underline-offset: 3px; }

.footer-bottom {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  justify-content: space-between;
  font-size: 0.8rem;
}

/* ───────────────────────── AVISO DE COOKIES ───────────────────────── */

.cookie-note {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  max-width: 460px;
  margin: 0 auto;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(17, 17, 17, 0.10);
  padding: 18px 20px;
  font-size: 0.86rem;
  color: var(--graphite);
  display: none;
}

.cookie-note.show { display: block; animation: view-in 0.45s var(--ease); }
.cookie-note p { margin-bottom: 12px; }

.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-actions .btn { padding: 9px 20px; font-size: 0.78rem; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { width: calc(100% - 40px); }
  .talk { padding: 24px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}
