/* ===== Tokens ===== */
:root {
  --paper: #f4f1ea;
  --paper-2: #ece7dc;
  --ink: #1b1a17;
  --muted: #6b665b;
  --line: #d8d2c4;
  --blue: #21409a;       /* azul plano/blueprint */
  --blue-deep: #0e2a5e;  /* panel blueprint */
  --terra: #c2613a;      /* acento cálido */
  --maxw: 1180px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.kicker {
  display: inline-block; font-size: 0.74rem; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--blue);
  margin-bottom: 16px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; font-weight: 600; font-size: 0.92rem;
  border-radius: 2px; border: 1.5px solid var(--ink); cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, color 0.2s;
}
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--blue); border-color: var(--blue); transform: translateY(-2px); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }

/* ===== Header ===== */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  background: rgba(244, 241, 234, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.35rem; letter-spacing: -0.01em; }
.brand-x { color: var(--muted); font-size: 1.05rem; font-weight: 400; }
.brand-logo { height: 24px; width: auto; }
.nav ul { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 8px 14px; font-size: 0.9rem; font-weight: 500; color: var(--muted); transition: color 0.2s; }
.nav a:hover { color: var(--ink); }
.nav-cta { color: var(--paper) !important; background: var(--ink); border-radius: 2px; }
.nav-cta:hover { background: var(--blue); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); transition: 0.3s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero { position: relative; padding: 140px 0 90px; overflow: hidden; }
.cad-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  -webkit-mask-image: radial-gradient(90% 80% at 65% 25%, #000, transparent 80%);
  mask-image: radial-gradient(90% 80% at 65% 25%, #000, transparent 80%);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero-copy h1 { font-size: clamp(2.4rem, 5.4vw, 4.1rem); font-weight: 600; }
.hero-copy h1 em { color: var(--blue); font-style: italic; }
.hero-lead { color: var(--muted); font-size: 1.12rem; margin: 22px 0 30px; max-width: 460px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-stats { display: flex; gap: 40px; margin-top: 48px; }
.hero-stats dt { font-family: "Fraunces", serif; font-size: 2.1rem; font-weight: 600; color: var(--ink); }
.hero-stats dd { color: var(--muted); font-size: 0.85rem; }

/* Blueprint visual */
.blueprint {
  position: relative; background: var(--blue-deep);
  border-radius: 4px; padding: 20px; overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(14, 42, 94, 0.6);
}
.blueprint svg { width: 100%; height: auto; }
.bp-draw .dline { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 3s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.scanline {
  position: absolute; left: 0; right: 0; top: 0; height: 60px;
  background: linear-gradient(180deg, rgba(127,209,255,0.25), transparent);
  animation: scan 4s linear infinite;
}
@keyframes scan { 0% { transform: translateY(-60px); } 100% { transform: translateY(360px); } }

/* ===== Sections ===== */
.section { padding: 96px 0; position: relative; }
.sec-head { max-width: 620px; margin-bottom: 50px; }
.sec-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
.sec-head p { color: var(--muted); margin-top: 12px; font-size: 1.05rem; }
.sec-head.light .kicker { color: #7fb0ff; }
.sec-head.light h2, .sec-head.light p { color: var(--paper); }

/* Servicios */
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line); }
.svc { padding: 32px 26px 32px 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.svc:last-child { border-right: 0; }
.svc-num { font-family: "Fraunces", serif; font-size: 0.95rem; color: var(--blue); }
.svc h3 { font-size: 1.25rem; margin: 14px 0 8px; }
.svc p { color: var(--muted); font-size: 0.92rem; }

/* ===== Plano interactivo ===== */
.plan-section { background: var(--blue-deep); color: var(--paper); }
.plan-wrap { display: grid; grid-template-columns: 1fr 280px; gap: 28px; align-items: start; }
.plan-canvas { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.15); border-radius: 4px; padding: 10px; }
.floorplan { width: 100%; height: auto; }
.floorplan .room rect {
  fill: rgba(127, 176, 255, 0.04);
  stroke: #9cc2ff; stroke-width: 2;
  transition: fill 0.25s var(--ease);
  cursor: pointer;
}
.floorplan .room:hover rect, .floorplan .room.active rect { fill: rgba(127, 209, 255, 0.28); }
.floorplan .r-name { fill: #dce9ff; font-family: "Inter", sans-serif; font-size: 15px; font-weight: 600; text-anchor: middle; pointer-events: none; }
.floorplan .r-area { fill: #7fb0ff; font-family: "Inter", sans-serif; font-size: 13px; text-anchor: middle; pointer-events: none; }

.plan-info {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px; padding: 26px; position: sticky; top: 90px;
}
.pi-label { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: #7fb0ff; }
.pi-name { font-family: "Fraunces", serif; font-size: 1.5rem; margin: 4px 0 2px; }
.pi-area { color: #cdddff; font-size: 1.05rem; }
.plan-info hr { border: 0; border-top: 1px solid rgba(255,255,255,0.15); margin: 20px 0; }
.pi-total { font-family: "Fraunces", serif; font-size: 2.4rem; color: #fff; }
.pi-total span { color: #7fd1ff; }
.pi-hint { color: rgba(255,255,255,0.5); font-size: 0.82rem; margin-top: 16px; }

/* ===== Proyectos ===== */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.filter {
  padding: 8px 18px; border: 1px solid var(--line); background: transparent;
  font: inherit; font-size: 0.88rem; font-weight: 500; color: var(--muted);
  border-radius: 999px; cursor: pointer; transition: 0.2s;
}
.filter:hover { color: var(--ink); border-color: var(--ink); }
.filter.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.work { position: relative; overflow: hidden; border-radius: 3px; aspect-ratio: 4 / 3; }
.work img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.work:hover img { transform: scale(1.06); }
.work figcaption {
  position: absolute; inset: auto 0 0 0; padding: 18px;
  background: linear-gradient(180deg, transparent, rgba(27,26,23,0.85));
  color: #fff; display: flex; justify-content: space-between; align-items: flex-end;
}
.work figcaption span { font-family: "Fraunces", serif; font-size: 1.1rem; }
.work figcaption em { font-style: normal; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.8; }
.work.hide { display: none; }

/* ===== Proceso ===== */
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: t; }
.timeline li { padding-top: 22px; border-top: 2px solid var(--ink); }
.timeline span { font-family: "Fraunces", serif; color: var(--blue); font-size: 1rem; }
.timeline h3 { font-size: 1.2rem; margin: 8px 0 6px; }
.timeline p { color: var(--muted); font-size: 0.92rem; }

/* ===== Contacto ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.contact-copy h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
.contact-copy p { color: var(--muted); margin: 12px 0 22px; }
.contact-data { display: grid; gap: 8px; font-size: 1.05rem; }
.contact-data a:hover { color: var(--blue); }
.contact-form { display: grid; gap: 14px; }
.contact-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form label { display: grid; gap: 6px; font-size: 0.82rem; font-weight: 500; color: var(--muted); }
.contact-form input, .contact-form select, .contact-form textarea {
  background: #fff; border: 1px solid var(--line); border-radius: 3px;
  padding: 11px 13px; font: inherit; color: var(--ink); transition: border-color 0.2s, box-shadow 0.2s;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(33,64,154,0.12);
}
.contact-form textarea { resize: vertical; }
.contact-form .btn { justify-self: start; }
.form-note { font-size: 0.88rem; min-height: 1.2em; }
.form-note.ok { color: #1f7a4d; }
.form-note.err { color: #b3402f; }

/* ===== Footer ===== */
.site-footer { background: var(--ink); color: var(--paper); padding: 56px 0 28px; }
.foot-grid { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.foot-brand { font-size: 1.6rem; }
.foot-grid p { color: rgba(244,241,234,0.6); font-size: 0.92rem; margin-top: 6px; }
.foot-by { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.foot-by span { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(244,241,234,0.5); }
.foot-by img { height: 30px; }
.foot-bottom { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,0.12); flex-wrap: wrap; gap: 8px; }
.foot-bottom p { color: rgba(244,241,234,0.5); font-size: 0.82rem; }

/* To top */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--ink); color: var(--paper); border-radius: 50%;
  font-size: 1.2rem; opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: 0.3s var(--ease);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top[hidden] { display: grid; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-grid, .plan-wrap, .contact-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .services, .timeline { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .plan-info { position: static; }
  .svc { border-right: 0; }

  .nav-toggle { display: flex; }
  .nav {
    position: fixed; inset: 70px 0 auto 0; background: var(--paper);
    border-bottom: 1px solid var(--line); max-height: 0; overflow: hidden;
    transition: max-height 0.35s var(--ease);
  }
  .nav.open { max-height: 360px; }
  .nav ul { flex-direction: column; align-items: stretch; padding: 14px 28px; gap: 2px; }
  .nav a { padding: 12px 0; }
}
@media (max-width: 560px) {
  .services, .timeline, .gallery, .contact-form .row { grid-template-columns: 1fr; }
  .hero-stats { gap: 26px; }
  .section { padding: 64px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .bp-draw .dline { stroke-dashoffset: 0; }
}
