:root {
  --bg: #EDF1EA;        /* pale laurel */
  --surface: #FFFFFF;
  --ink: #17261C;       /* deep laurel, not neutral black */
  --muted: #4A5A4F;
  --laurel: #2F5D3F;
  --laurel-deep: #234A31;
  --brick: #A2452A;     /* Medellín brick */
  --stone: #CBC4B5;

  --f: "Bricolage Grotesque", system-ui, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: clamp(2.25rem, 5vw, 3.25rem);
  --step-4: clamp(3rem, 9vw, 6.5rem);

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  color-scheme: light;
}

/* language switching: content lives in both languages in the HTML */
:root[data-lang="es"] body [lang="en"],
:root[data-lang="en"] body [lang="es"] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f);
  font-size: var(--step-0);
  line-height: 1.55;
  font-optical-sizing: auto;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--laurel); text-underline-offset: 0.18em; }
h1, h2, h3 { line-height: 1.1; margin: 0; font-weight: 700; }
h2 { font-size: var(--step-3); font-stretch: 85%; letter-spacing: -0.015em; margin-bottom: 1.25rem; }
h3 { font-size: var(--step-1); font-weight: 650; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--brick); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 46px; padding: .6em 1.25em;
  border-radius: 999px; border: 2px solid var(--laurel);
  font: 600 var(--step-0)/1.1 var(--f);
  text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.btn-solid { background: var(--laurel); color: #fff; }
.btn-solid:hover { background: var(--laurel-deep); border-color: var(--laurel-deep); }
.btn-line { background: transparent; color: var(--laurel); }
.btn-line:hover { background: var(--surface); }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1.25rem;
  padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid color-mix(in srgb, var(--stone) 60%, transparent);
}
.brand { font-weight: 750; font-size: var(--step-1); font-stretch: 80%; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; margin-right: auto; }
.top-nav { display: flex; gap: 1.25rem; }
.top-nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.top-nav a:hover { text-decoration: underline; }
.lang { display: flex; border: 1.5px solid var(--stone); border-radius: 999px; padding: 2px; }
.lang button {
  font: 600 var(--step--1)/1 var(--f); border: 0; background: none; color: var(--muted);
  padding: 7px 10px; border-radius: 999px; cursor: pointer; min-width: 40px;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.top-cta { min-height: 40px; font-size: var(--step--1); }

/* ---------- hero ---------- */
.listing > section { padding-inline: var(--gutter); }
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px); align-items: end;
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
  padding-block: clamp(32px, 6vw, 72px) clamp(40px, 6vw, 80px);
}
.hero-plain { grid-template-columns: 1fr; }
.plan {
  position: absolute; left: calc(-1 * var(--gutter)); bottom: -40px;
  width: min(760px, 70vw); height: auto; z-index: 0; pointer-events: none;
  fill: none; stroke: var(--brick); stroke-width: 1.25; opacity: .32;
}
.plan .spokes { stroke-dasharray: 3 6; }
.plan .rings circle { stroke-dasharray: 3300; stroke-dashoffset: 3300; animation: draw 2.2s cubic-bezier(.2,.7,.2,1) forwards; }
.plan .rings circle:nth-child(2) { animation-delay: .12s; }
.plan .rings circle:nth-child(3) { animation-delay: .24s; }
.plan .rings circle:nth-child(4) { animation-delay: .36s; }
.plan .rings circle:nth-child(5) { animation-delay: .48s; }
.plan .rings circle:nth-child(6) { animation-delay: .60s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .plan .rings circle { animation: none; stroke-dashoffset: 0; } }

.hero-text { position: relative; z-index: 1; max-width: 36rem; }
.status { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1.5rem; }
.tag { font-size: var(--step--1); font-weight: 600; padding: 5px 12px; border-radius: 999px; }
.tag-on { background: var(--laurel); color: #fff; }
.tag-open { border: 1.5px solid var(--brick); color: var(--brick); background: var(--surface); }
h1 { margin-bottom: 1.25rem; }
.h1-main {
  display: block; font-size: var(--step-4); font-weight: 800;
  font-stretch: 75%; letter-spacing: -0.035em; line-height: .9;
}
.h1-sub { display: block; margin-top: .6rem; font-size: var(--step-1); font-weight: 500; color: var(--muted); }
.lede { font-size: var(--step-1); line-height: 1.45; max-width: 32ch; }
.price { font-size: var(--step-1); margin: 1.5rem 0; }
.price strong { font-size: var(--step-2); font-weight: 750; letter-spacing: -0.01em; }
.price small { color: var(--muted); font-size: var(--step--1); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-photo { position: relative; z-index: 1; margin: 0; }
.hero-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px 4px 160px 4px; }
.hero-photo figcaption { font-size: var(--step--1); color: var(--muted); margin-top: 8px; }

/* ---------- specs ---------- */
.ficha, .gallery, .terms, .barrio, .contact {
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
  padding-block: clamp(40px, 6vw, 80px);
}
.ficha { padding-inline: var(--gutter); }
.specs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 45%), 1fr));
  margin: 0; border-top: 2px solid var(--ink);
}
.specs > div { padding: 14px 16px 16px 0; border-bottom: 1px solid var(--stone); }
.specs dt { font-size: var(--step--1); color: var(--muted); }
.specs dd { margin: 2px 0 0; font-size: var(--step-1); font-weight: 600; }
.specs small { display: block; font-size: var(--step--1); font-weight: 400; color: var(--muted); }

/* ---------- gallery ---------- */
.gallery-group { margin-bottom: 36px; }
.gallery-group h3 { margin-bottom: 12px; }
.gallery-group h3 small { font-weight: 400; color: var(--muted); font-size: var(--step--1); margin-left: .4em; }
.thumbs {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(min(30%, 200px), 1fr));
  list-style: none; margin: 0; padding: 0;
}
.thumbs button {
  display: block; width: 100%; padding: 0; border: 0; background: var(--stone);
  cursor: zoom-in; border-radius: 3px; overflow: hidden;
}
.thumbs img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: transform .3s; }
.thumbs button:hover img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .thumbs img { transition: none; } }

/* ---------- terms ---------- */
.terms-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px); }
.term { border-top: 2px solid var(--ink); padding-top: 16px; }
.term h3 { margin-bottom: 10px; }
.term p { max-width: 40ch; }
.term-price strong { font-size: var(--step-2); font-weight: 750; }
.pay { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pay li { background: var(--surface); border: 1px solid var(--stone); padding: 4px 10px; border-radius: 6px; font-weight: 600; font-size: var(--step--1); }

/* ---------- neighborhood ---------- */
.barrio { padding-inline: var(--gutter); }
.barrio-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px; align-items: start; }
blockquote { margin: 0; padding-left: 20px; border-left: 4px solid var(--brick); }
blockquote p { font-size: var(--step-2); line-height: 1.2; font-weight: 600; font-stretch: 90%; margin-bottom: .5rem; max-width: 24ch; }
cite { font-style: normal; font-size: var(--step--1); }
.where { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(24px, 4vw, 56px); margin-top: 48px; align-items: start; }
.where h3 { margin-bottom: 12px; }
.nearby { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--ink); }
.nearby li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--stone); }
.nearby li > span:last-child { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.note { font-size: var(--step--1); color: var(--muted); margin-top: 8px; }
.map { margin: 0; }
.map iframe { display: block; width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: 4px 4px 96px 4px; background: var(--stone); }
.map figcaption { margin-top: 10px; font-weight: 600; }
.barrio-list { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 28px; }
.barrio-list h3 { font-size: var(--step-0); font-weight: 700; margin-bottom: 6px; }
.barrio-list p { color: var(--muted); }

/* ---------- contact ---------- */
.contact {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px);
  padding-inline: var(--gutter);
}
.contact-intro p { max-width: 38ch; }
.direct { display: flex; gap: 12px; flex-wrap: wrap; }
.contact-form { background: var(--surface); padding: clamp(20px, 3vw, 32px); border-radius: 6px; border: 1px solid var(--stone); }
.field { display: grid; gap: 6px; margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.field > span, legend { font-size: var(--step--1); font-weight: 600; color: var(--muted); }
legend { padding: 0; margin-bottom: 6px; }
.field-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.field-row:has([data-currency][hidden]) { grid-template-columns: 1fr; }
input, select, textarea {
  font: inherit; color: var(--ink); width: 100%;
  padding: 10px 12px; min-height: 46px;
  border: 1.5px solid var(--stone); border-radius: 6px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--laurel); outline-offset: 0; border-color: var(--laurel); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.seg label > span { display: inline-block; padding: 8px 14px; border: 1.5px solid var(--stone); border-radius: 999px; cursor: pointer; font-weight: 600; }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--brick); outline-offset: 2px; }
.form-error { color: var(--brick); font-weight: 600; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.foot { padding: 32px var(--gutter) 96px; color: var(--muted); font-size: var(--step--1); text-align: center; border-top: 1px solid var(--stone); }

.wa-float { display: none; }

/* ---------- lightbox ---------- */
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #0d1510f2; color: #fff;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: transparent; }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: 10px; padding: 56px 16px 72px; }
.lightbox img { max-height: calc(100dvh - 150px); width: auto; max-width: 100%; border-radius: 3px; }
.lightbox figcaption { font-size: var(--step--1); color: #d7ddd8; }
.lb-btn {
  position: fixed; font: 600 var(--step--1)/1 var(--f); color: #fff;
  background: #ffffff1f; border: 1px solid #ffffff40; border-radius: 999px;
  padding: 12px 16px; cursor: pointer;
}
.lb-btn:hover { background: #ffffff33; }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; bottom: 16px; }
.lb-next { right: 12px; bottom: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .top-nav { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-photo { order: -1; }
  .hero-photo img { aspect-ratio: 4 / 3; border-radius: 4px 4px 96px 4px; }
  .plan { width: 130vw; bottom: auto; top: 30%; opacity: .2; }
  .terms-grid, .barrio-head, .where, .contact { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .top { gap: 10px; }
  .top-cta { display: none; }
  .wa-float {
    display: inline-flex; position: fixed; z-index: 30;
    left: 16px; right: 16px; bottom: 12px;
    box-shadow: 0 6px 20px rgb(23 38 28 / .25);
  }
  .field-row { grid-template-columns: 1fr; }
}
