/* Mallimaci Inmobiliaria · concepto "Empavesado" (Leomak.Soft, demo) */

@font-face { font-family: "Anton"; src: url("fonts/anton-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Work Sans"; src: url("fonts/work-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Work Sans"; src: url("fonts/work-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --naval: #1c232b;        /* gris naval: fondos oscuros y texto */
  --lona: #f2efe7;         /* fondo */
  --lona-sombra: #e6e1d5;  /* secciones alternas */
  --azul: #1e3f8f;         /* azul señal: acento, texto y botones (8,4:1 sobre lona) */
  --celeste: #9cc3f0;      /* sobre gris naval (8,6:1) */
  --suave: #4b5560;        /* texto secundario (6,7:1 sobre lona) */
  --rojo: #c8322b;         /* solo decorativo: banderas y cursor */
  --amarillo: #e8b73a;     /* solo decorativo: banderas */
  --acero: #8b949c;        /* metálico del rubro: solo decorativo */
  --display: "Anton", "Arial Narrow", sans-serif;
  --texto: "Work Sans", system-ui, sans-serif;
  --ease-izado: cubic-bezier(.2, .9, .25, 1);
  --franja: 2.5rem;
  --radio: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--franja) + 4.5rem); }
body { margin: 0; background: var(--lona); color: var(--naval); font: 400 1rem/1.6 var(--texto); padding-top: var(--franja); overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.02; }
h2 { font-family: var(--display); font-size: clamp(2.25rem, 6vw, 4.5rem); text-transform: uppercase; letter-spacing: .01em; }
h3 { font-family: var(--texto); font-weight: 600; font-size: 1.15rem; line-height: 1.3; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 3px; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.saltar { position: absolute; left: 1rem; top: -4rem; z-index: 200; background: var(--azul); color: #fff; padding: .75rem 1rem; }
.saltar:focus { top: calc(var(--franja) + .5rem); }

.franja { position: fixed; inset: 0 0 auto; z-index: 100; min-height: var(--franja); display: flex; align-items: center; justify-content: center; padding: .4rem 1rem; background: var(--azul); color: #fff; font-size: .78rem; line-height: 1.3; text-align: center; }

/* Cabecera */
.cabecera { position: sticky; top: var(--franja); z-index: 90; display: flex; align-items: center; gap: 1rem; padding: .75rem clamp(1rem, 4vw, 3rem); background: color-mix(in srgb, var(--naval) 94%, transparent); color: var(--lona); backdrop-filter: blur(8px); }
.marca { font-family: var(--display); font-size: 1.6rem; text-transform: uppercase; text-decoration: none; letter-spacing: .02em; display: flex; align-items: baseline; gap: .5rem; min-height: 44px; align-items: center; }
.marca span { font-family: var(--texto); font-size: .7rem; letter-spacing: .18em; color: var(--celeste); }
.cabecera nav { margin-left: auto; display: none; }
.cabecera ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
.cabecera nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .9rem; text-decoration: none; font-size: .95rem; }
.cabecera nav a:hover { color: var(--celeste); }
.cabecera-tel { margin-left: auto; display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border: 1px solid var(--celeste); border-radius: 999px; color: var(--celeste); text-decoration: none; font-weight: 600; font-size: .9rem; }
.cabecera-tel:hover { background: var(--celeste); color: var(--naval); }
@media (min-width: 900px) { .cabecera nav { display: block; } .cabecera-tel { margin-left: 0; } }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .8rem 1.5rem; border-radius: 999px; border: 2px solid transparent; font: 600 1rem/1.2 var(--texto); text-decoration: none; cursor: pointer; transition: background-color .25s, color .25s, border-color .25s; }
.btn-primario { background: var(--azul); color: #fff; }
.btn-primario:hover { background: #17326f; }
.hero .btn-primario { background: var(--celeste); color: var(--naval); }
.hero .btn-primario:hover { background: var(--lona); }
.btn-linea { border-color: currentColor; color: var(--lona); }
.btn-linea:hover { background: var(--lona); color: var(--naval); }

/* Hero */
.hero { position: relative; min-height: calc(100svh - var(--franja) - 4.25rem); display: grid; grid-template-rows: auto 1fr; background: var(--naval); color: var(--lona); overflow: hidden; padding: 0 clamp(1rem, 4vw, 3rem) clamp(3rem, 8vh, 6rem); }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 1px; background: linear-gradient(90deg, transparent, var(--acero), transparent); opacity: .5; }
.empavesado { position: relative; height: clamp(170px, 30vw, 330px); perspective: 900px; margin: 0 calc(clamp(1rem, 4vw, 3rem) * -1); }
.empavesado-scroll, .empavesado-escena { position: absolute; inset: 0; transform-style: preserve-3d; }
.cuerda { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cuerda path { fill: none; stroke: var(--acero); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.banderas { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; transform-style: preserve-3d; }
.bandera { position: absolute; left: var(--x); top: var(--y); width: clamp(26px, 5.2vw, 64px); translate: -50% 0; transform: translateZ(var(--z, 0)); transform-style: preserve-3d; }
.bandera-in { transform-origin: 50% 0; transform-style: preserve-3d; }
.bandera svg { width: 100%; height: auto; transform-origin: 50% 0; filter: drop-shadow(0 10px 12px rgb(0 0 0 / .35)); }
.bandera b { display: block; margin-top: .4rem; text-align: center; font: 600 clamp(.6rem, 1.2vw, .8rem)/1 var(--texto); letter-spacing: .1em; color: var(--acero); }
.bandera:nth-child(1) { --x: 10%; --y: 24.4%; --z: 30px;  --d: 3.1s; }
.bandera:nth-child(2) { --x: 20%; --y: 35.6%; --z: -20px; --d: 2.7s; }
.bandera:nth-child(3) { --x: 30%; --y: 43.6%; --z: 50px;  --d: 3.4s; }
.bandera:nth-child(4) { --x: 40%; --y: 48.4%; --z: 0px;   --d: 2.9s; }
.bandera:nth-child(5) { --x: 50%; --y: 50%;   --z: 70px;  --d: 3.2s; }
.bandera:nth-child(6) { --x: 60%; --y: 48.4%; --z: -10px; --d: 2.8s; }
.bandera:nth-child(7) { --x: 70%; --y: 43.6%; --z: 45px;  --d: 3.5s; }
.bandera:nth-child(8) { --x: 80%; --y: 35.6%; --z: -25px; --d: 3s; }
.bandera:nth-child(9) { --x: 90%; --y: 24.4%; --z: 35px;  --d: 2.6s; }
.empavesado.flamea .bandera svg { animation: flamear var(--d) ease-in-out infinite alternate; }
@keyframes flamear {
  0%   { transform: rotateX(0) skewX(0); }
  40%  { transform: rotateX(14deg) skewX(-3deg); }
  100% { transform: rotateX(-6deg) skewX(2deg); }
}

.hero-texto { align-self: end; max-width: 72rem; position: relative; z-index: 1; }
.hero-lugar { font-size: .8rem; letter-spacing: .22em; text-transform: uppercase; color: var(--celeste); margin-bottom: .75rem; }
.hero-titulo { font-family: var(--display); font-size: clamp(3.6rem, 17vw, 13rem); text-transform: uppercase; letter-spacing: .005em; line-height: .88; perspective: 600px; }
.hero-titulo .char { display: inline-block; transform-origin: 50% 100%; }
.hero-lema { font-family: var(--display); text-transform: uppercase; font-size: clamp(1.25rem, 3.4vw, 2.4rem); color: var(--celeste); margin-top: .5rem; letter-spacing: .03em; }
.hero-bajada { max-width: 36rem; margin-top: 1.25rem; font-size: clamp(1rem, 1.6vw, 1.15rem); color: #d9dde1; }
.hero-acciones { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.hero-acciones .btn { flex: 1 1 14rem; }
@media (min-width: 640px) { .hero-acciones .btn { flex: 0 0 auto; } }

/* Secciones */
.seccion { padding: clamp(4.5rem, 11vw, 9rem) clamp(1rem, 4vw, 3rem); }
.contenedor { max-width: 76rem; margin: 0 auto; }
.seccion-cabeza { margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.rotulo { font-size: .8rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--azul); margin-bottom: .75rem; display: flex; align-items: center; gap: .6rem; }
.rotulo::before { content: ""; width: 10px; height: 14px; background: linear-gradient(var(--rojo) 0 50%, var(--amarillo) 50%); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); }
.rotulo-claro { color: var(--celeste); }

/* Buscador */
.buscador { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1rem; padding: 1.25rem; margin-bottom: 2rem; background: var(--naval); color: var(--lona); border-radius: var(--radio); }
.campo { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.campo label { font-size: .85rem; font-weight: 600; }
.buscador label { color: var(--celeste); }
select, input, textarea { width: 100%; min-height: 48px; padding: .6rem .8rem; border: 1.5px solid var(--acero); border-radius: var(--radio); background: #fff; color: var(--naval); font: 400 1rem/1.4 var(--texto); }
select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--celeste); outline-offset: 1px; border-color: var(--azul); }
.buscador-total { grid-column: 1 / -1; font-family: var(--display); font-size: 1.6rem; text-transform: uppercase; color: var(--celeste); }
@media (min-width: 900px) { .buscador { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* Fichas */
.fichas { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.ficha { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--lona-sombra); border-radius: var(--radio); transform-style: preserve-3d; transition: transform .4s var(--ease-izado), box-shadow .4s; }
.ficha:hover { box-shadow: 0 24px 40px -24px rgb(28 35 43 / .45); }
.ficha[hidden] { display: none; }
.ficha-dibujo { color: var(--azul); background: var(--lona-sombra); padding: 1.25rem 2rem .5rem; transform: translateZ(40px); }
.ficha-dibujo svg { width: 100%; max-height: 120px; }
.ficha-cuerpo { padding: 1.25rem 1.25rem 1.4rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.ficha-meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.etiqueta { font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; padding: .2rem .55rem; background: var(--azul); color: #fff; border-radius: 2px; }
.etiqueta-alq { background: var(--naval); }
.codigo { font-size: .8rem; color: var(--suave); letter-spacing: .05em; }
.ficha-dir { color: var(--suave); font-size: .95rem; }
.ficha-datos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.ficha-datos li { font-size: .85rem; padding: .2rem .6rem; border: 1px solid var(--lona-sombra); border-radius: 999px; }
.ficha-precio { font-family: var(--display); font-size: 1.9rem; color: var(--azul); margin-top: auto; padding-top: .5rem; transform: translateZ(30px); }
.ficha-acciones { display: flex; gap: .5rem; }
.btn-ficha { flex: 1; background: var(--azul); color: #fff; padding: .7rem 1rem; font-size: .95rem; }
.btn-ficha:hover { background: var(--naval); }
.btn-tel { border-color: var(--azul); color: var(--azul); padding: .7rem 1rem; font-size: .95rem; }
.btn-tel:hover { background: var(--azul); color: #fff; }
.fichas-vacio { padding: 2rem; text-align: center; background: var(--lona-sombra); border-radius: var(--radio); }

/* Nosotros */
.nosotros { background: var(--lona-sombra); }
.nosotros-grilla { display: grid; gap: 2rem; }
.nosotros-texto { font-size: clamp(1.15rem, 2.2vw, 1.5rem); line-height: 1.55; max-width: 40rem; }
@media (min-width: 900px) { .nosotros-grilla { grid-template-columns: 1fr 1fr; align-items: end; } }

/* Servicios */
.servicios-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.servicio { padding: 1.75rem 1.5rem; background: var(--naval); color: var(--lona); border-radius: var(--radio); transform-style: preserve-3d; transition: transform .4s var(--ease-izado); }
.servicio:nth-child(even) { background: var(--azul); }
.servicio-num { display: block; font-family: var(--display); font-size: 3.5rem; line-height: 1; color: var(--celeste); transform: translateZ(50px); margin-bottom: 1.5rem; }
.servicio:nth-child(even) .servicio-num { color: #fff; }
.servicio p { margin-top: .5rem; color: #e3e6ea; }

/* Diferenciales */
.diferenciales { background: var(--lona-sombra); }
.dif-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.dif-icono { width: 56px; height: 56px; margin-bottom: 1rem; fill: none; stroke: var(--azul); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.dif-lista p { margin-top: .4rem; color: var(--suave); }

/* Trazo que se dibuja: se oculta solo desde JS */
.js .dibuja svg, .js svg.dibuja { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s var(--ease-izado); }
.js .dibuja.visto svg, .js svg.dibuja.visto { stroke-dashoffset: 0; }

/* Tasación */
.tasacion { background: var(--naval); color: var(--lona); }
.tasacion-grilla { display: grid; gap: 2.5rem; }
.tasacion-grilla > div p:last-child { margin-top: 1rem; color: #d9dde1; max-width: 30rem; }
.form { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); padding: clamp(1.25rem, 3vw, 2rem); background: var(--lona); color: var(--naval); border-radius: var(--radio); }
.form-aviso { justify-self: start; font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; padding: .25rem .6rem; border: 1.5px dashed var(--azul); color: var(--azul); }
.form-estado { min-height: 1.5em; font-weight: 600; color: var(--azul); }
@media (min-width: 640px) { .form { grid-template-columns: 1fr 1fr; } .campo-ancho, .form-aviso { grid-column: 1 / -1; } }
@media (min-width: 900px) { .tasacion-grilla { grid-template-columns: 5fr 7fr; align-items: start; } }

/* Contacto */
.contacto-grilla { display: grid; gap: 2rem; }
.contacto-datos { margin: 0; display: grid; gap: 1.25rem; }
.contacto-datos dt { font-size: .8rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--azul); }
.contacto-datos dd { margin: .25rem 0 0; font-size: clamp(1.1rem, 2vw, 1.35rem); overflow-wrap: anywhere; }
.contacto-datos a { display: inline-flex; min-height: 44px; align-items: center; }
@media (min-width: 900px) { .contacto-grilla { grid-template-columns: 1fr 1fr; } }

/* Pie */
.pie { background: var(--naval); color: #d9dde1; padding: 3rem clamp(1rem, 4vw, 3rem); font-size: .95rem; }
.pie-grilla { display: grid; gap: 1rem; }
.pie a { display: inline-block; padding: .5rem 0; }
.pie-marca { font-family: var(--display); font-size: 2rem; text-transform: uppercase; color: var(--lona); }
.pie-marca span { display: block; font-size: 1rem; color: var(--celeste); }
.pie-firma { color: var(--celeste); }

/* Cursor gallardete: solo con mouse y cuando el JS arrancó */
.cursor { display: none; }
html.cursor-activo, html.cursor-activo a, html.cursor-activo button, html.cursor-activo select { cursor: none; }
html.cursor-activo input, html.cursor-activo textarea { cursor: auto; }
html.cursor-activo .cursor { display: block; position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; will-change: translate; }
.cursor-gallardete { width: 22px; height: 16px; margin: -8px 0 0 -4px; background: var(--rojo); transform-origin: 4px 50%; clip-path: polygon(0 0, 50% 25%, 100% 50%, 50% 75%, 0 100%, 0 75%, 0 50%, 0 25%); transition: clip-path .3s var(--ease-izado), scale .3s var(--ease-izado), opacity .3s; }
.cursor.hover .cursor-gallardete { clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); scale: 1.6; opacity: .75; }

/* Scroll reveal y escena con scroll (CSS scroll-driven); sin soporte, todo visible */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .revela { animation: subir linear both; animation-timeline: view(); animation-range: entry 0% entry 30%; }
    .empavesado-scroll { animation: alejar linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }
  }
}
@keyframes subir { from { opacity: 0; translate: 0 56px; } to { opacity: 1; translate: 0 0; } }
@keyframes alejar { to { transform: translateY(-6vh) rotateX(32deg) scale(.8); opacity: .3; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .dibuja svg, .js svg.dibuja { stroke-dashoffset: 0; }
  .bandera { transform: none; }
}
