/* ============================================================
   Humedal Chile — Sitio web
   Paleta de marca + tipografía editorial
   ============================================================ */

:root {
  --teal:        #29727b;
  --teal-deep:   #1f5560;
  --teal-dark:   #163e47;
  --teal-soft:   #5a9aa1;
  --teal-mist:   #e3ecec;
  --paper:       #f5f2ec;
  --paper-2:     #ece7dd;
  --ink:         #1c2622;
  --ink-soft:    #44514c;
  --line:        rgba(28, 38, 34, 0.14);
  --line-soft:   rgba(28, 38, 34, 0.08);
  --white:       #ffffff;

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans:  'Instrument Sans', system-ui, -apple-system, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, monospace;

  --wrap: 1280px;
  --gut: clamp(20px, 5vw, 72px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gut);
}

/* ---------- Tipografía utilitaria ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0;
}
.eyebrow.light { color: var(--teal-soft); }

.display {
  font-family: var(--serif);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.display em { font-style: italic; color: var(--teal); }

.section-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.section-title em { font-style: italic; color: var(--teal); }

.lead {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.32;
  color: var(--ink-soft);
}

.body { color: var(--ink-soft); text-wrap: pretty; }

.label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  padding: 15px 28px;
  border-radius: 100px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .25s ease, background .25s ease, color .25s ease, border-color .25s ease;
}
.btn .arrow { transition: transform .25s ease; }
.btn:hover .arrow { transform: translateX(4px); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-deep); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn-on-dark { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.4); backdrop-filter: blur(4px); }
.btn-on-dark:hover { background: #fff; color: var(--teal-deep); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gut);
  transition: background .35s ease, box-shadow .35s ease, padding .35s ease;
}
.nav.scrolled {
  background: rgba(245, 242, 236, 0.86);
  backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: 0 1px 0 var(--line-soft);
  padding-top: 12px;
  padding-bottom: 12px;
}
.nav .logo { height: 46px; transition: opacity .35s ease, height .35s ease; }
.nav .logo.teal { display: none; }
.nav.scrolled .logo.white { display: none; }
.nav.scrolled .logo.teal { display: block; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 38px;
}
.nav-links a {
  font-weight: 500;
  font-size: 15px;
  color: #fff;
  letter-spacing: 0.01em;
  position: relative;
  padding: 4px 0;
  transition: color .25s ease;
}
.nav.scrolled .nav-links a { color: var(--ink); }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1.5px;
  background: var(--teal);
  transition: width .28s ease;
}
.nav-links a:hover::after { width: 100%; }
.nav-links a.cta {
  padding: 11px 22px;
  border-radius: 100px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.45);
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.nav-links a.cta::after { display: none; }
.nav.scrolled .nav-links a.cta {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.nav-toggle { display: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-media {
  position: absolute;
  inset: 0;
  background-image: url('img/junco-flores.jpg');
  background-size: cover;
  background-position: center 40%;
  transform: scale(1.06);
}
.hero-media::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(22,62,71,0.55) 0%, rgba(22,62,71,0.18) 35%, rgba(22,62,71,0.78) 100%),
    linear-gradient(90deg, rgba(31,85,96,0.55) 0%, rgba(31,85,96,0) 55%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-bottom: clamp(56px, 9vh, 120px);
  padding-top: 140px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 300;
  color: #fff;
  font-size: clamp(52px, 9vw, 132px);
  line-height: 0.92;
  letter-spacing: -0.03em;
  max-width: 16ch;
}
.hero h1 em { font-style: italic; color: #bfe0e0; }
.hero .sub {
  margin-top: 28px;
  max-width: 50ch;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.5;
  color: rgba(255,255,255,0.92);
}
.hero .actions {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.hero .scroll-hint {
  position: absolute;
  right: var(--gut);
  bottom: clamp(56px, 9vh, 120px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.75);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}
.hero .scroll-hint .bar {
  width: 1px; height: 56px;
  background: linear-gradient(rgba(255,255,255,0.7), rgba(255,255,255,0));
  animation: drip 2.2s ease-in-out infinite;
}
@keyframes drip {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ============================================================
   IMPACTO (banda de cifras)
   ============================================================ */
.impacto {
  background: var(--teal-deep);
  color: #fff;
  padding: clamp(56px, 8vw, 96px) 0;
}
.impacto .head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.impacto .head p { color: rgba(255,255,255,0.8); max-width: 46ch; }
.impacto-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid rgba(255,255,255,0.22);
}
.impacto .cell {
  padding: 32px 24px 8px 0;
  border-right: 1px solid rgba(255,255,255,0.16);
}
.impacto .cell:last-child { border-right: none; padding-right: 0; }
.impacto .num {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(46px, 5vw, 76px);
  line-height: 1;
  letter-spacing: -0.03em;
}
.impacto .num sup { font-size: 0.42em; vertical-align: middle; color: #bfe0e0; margin-right: 2px; }
.impacto .num .u { font-size: 0.4em; color: #bfe0e0; letter-spacing: 0; }
.impacto .desc {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(255,255,255,0.8);
}

/* ============================================================
   Bloque genérico de sección
   ============================================================ */
.section { padding: clamp(72px, 11vw, 160px) 0; }
.section-head { max-width: 64ch; margin-bottom: clamp(40px, 5vw, 72px); }
.section-head .eyebrow { margin-bottom: 22px; }
.section-head .lead { margin-top: 28px; }

/* ============================================================
   PROYECTOS
   ============================================================ */
.proyectos { background: var(--paper); }
.proj-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(18px, 2vw, 28px);
}
.proj {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: var(--paper-2);
  cursor: pointer;
}
.proj .ph {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform .9s cubic-bezier(.2,.7,.2,1);
}
.proj::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(22,62,71,0) 35%, rgba(22,62,71,0.82) 100%);
  transition: opacity .4s ease;
}
.proj:hover .ph { transform: scale(1.06); }
.proj .meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 28px;
  color: #fff;
  transform: translateY(8px);
  transition: transform .4s ease;
}
.proj:hover .meta { transform: translateY(0); }
.proj .cat {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #bfe0e0;
}
.proj .pt {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.05;
  margin-top: 8px;
}
.proj .loc {
  margin-top: 10px;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  display: flex;
  gap: 8px;
  align-items: center;
}
.proj .loc .dot { width: 4px; height: 4px; border-radius: 50%; background: #bfe0e0; }

/* tamaños del mosaico */
.proj.tall { grid-column: span 5; aspect-ratio: 4/5; }
.proj.wide { grid-column: span 7; aspect-ratio: 16/11; }
.proj.third { grid-column: span 4; aspect-ratio: 1/1; }

.proj-note {
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  color: var(--ink-soft);
}
.proj-note .ln { flex: 1; height: 1px; background: var(--line); }

/* ============================================================
   SOMOS
   ============================================================ */
.somos { background: var(--paper-2); }
.somos-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
.somos-media {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: 4px;
  overflow: hidden;
}
.somos-media .ph {
  position: absolute; inset: 0;
  background-image: url('img/jardin-cabana.jpg');
  background-size: cover; background-position: center;
}
.somos-media .badge {
  position: absolute;
  left: 24px; bottom: 24px;
  background: rgba(245,242,236,0.92);
  backdrop-filter: blur(6px);
  border-radius: 4px;
  padding: 18px 22px;
}
.somos-media .badge .n {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 300;
  line-height: 1;
  color: var(--teal-deep);
}
.somos-media .badge .l { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }

.mv {
  display: grid;
  gap: 0;
  margin-top: 40px;
}
.mv .row {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.mv .row:last-child { border-bottom: 1px solid var(--line); }
.mv .row .k {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}
.mv .row .v { font-size: 18px; line-height: 1.5; color: var(--ink-soft); }

/* Respaldo */
.respaldo {
  margin-top: 56px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}
.respaldo .k {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 20px;
}
.respaldo .names { display: flex; gap: 40px; flex-wrap: wrap; }
.respaldo .names .nm {
  font-family: var(--serif); font-size: 30px; color: var(--teal-deep);
}

/* Cómo funciona (mini-pasos) */
.como {
  margin-top: clamp(56px, 8vw, 100px);
}
.como-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 40px);
  margin-top: 40px;
}
.como .step { border-top: 2px solid var(--teal); padding-top: 22px; }
.como .step .s {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em;
  color: var(--teal); margin-bottom: 16px;
}
.como .step h3 {
  font-family: var(--serif); font-weight: 400; font-size: 28px;
  line-height: 1.1; color: var(--ink); margin-bottom: 12px;
}
.como .step p { font-size: 16px; line-height: 1.55; color: var(--ink-soft); }

/* ============================================================
   CONTACTO
   ============================================================ */
.contacto {
  background: var(--teal-dark);
  color: #fff;
}
.contacto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 96px);
}
.contacto .section-title { color: #fff; }
.contacto .section-title em { color: #bfe0e0; }
.contacto .lead { color: rgba(255,255,255,0.85); }
.contacto .eyebrow { color: #7fb3b9; }

.contact-info { margin-top: 44px; }
.contact-info .row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid rgba(255,255,255,0.16);
  align-items: baseline;
}
.contact-info .row:last-child { border-bottom: 1px solid rgba(255,255,255,0.16); }
.contact-info .k {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: rgba(255,255,255,0.6);
}
.contact-info .v { font-family: var(--serif); font-size: 24px; }
.contact-info .v a { transition: color .2s ease; }
.contact-info .v a:hover { color: #bfe0e0; }

.socials { margin-top: 36px; display: flex; gap: 14px; }
.socials a {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 100px;
  font-size: 14px; font-weight: 500;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.socials a:hover { background: #fff; color: var(--teal-dark); border-color: #fff; }

/* Formulario */
.form-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  padding: clamp(28px, 4vw, 48px);
}
.form-card h3 {
  font-family: var(--serif); font-weight: 300; font-size: 32px;
  margin-bottom: 26px; color: #fff;
}
.field { margin-bottom: 22px; }
.field label {
  display: block;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(255,255,255,0.65);
  margin-bottom: 9px;
}
.field input,
.field textarea {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 6px;
  padding: 14px 16px;
  color: #fff;
  font-family: var(--sans);
  font-size: 16px;
  transition: border-color .25s ease, background .25s ease;
}
.field input::placeholder,
.field textarea::placeholder { color: rgba(255,255,255,0.4); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: #7fb3b9;
  background: rgba(255,255,255,0.1);
}
.field textarea { resize: vertical; min-height: 120px; }
.form-card .btn-primary { width: 100%; justify-content: center; background: #fff; color: var(--teal-dark); }
.form-card .btn-primary:hover { background: #bfe0e0; }
.form-note { margin-top: 16px; font-size: 13px; color: rgba(255,255,255,0.55); text-align: center; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: clamp(48px, 6vw, 80px) 0 36px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer .flogo { height: 64px; }
.footer .ftag {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: 22px; color: rgba(255,255,255,0.85); margin-top: 18px;
  max-width: 24ch;
}
.footer-nav { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-nav .col h4 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: rgba(255,255,255,0.4);
  margin-bottom: 16px;
}
.footer-nav .col a, .footer-nav .col span {
  display: block; font-size: 15px; color: rgba(255,255,255,0.8);
  padding: 5px 0; transition: color .2s ease;
}
.footer-nav .col a:hover { color: #fff; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding-top: 28px;
  font-size: 13px; color: rgba(255,255,255,0.45);
}

/* ============================================================
   Reveal al hacer scroll
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1);
}
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .hero .scroll-hint .bar { animation: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .impacto-grid { grid-template-columns: repeat(2, 1fr); }
  .impacto .cell:nth-child(2) { border-right: none; }
  .impacto .cell { border-bottom: 1px solid rgba(255,255,255,0.16); padding-right: 0; }
  .somos-grid { grid-template-columns: 1fr; }
  .somos-media { aspect-ratio: 16/11; max-height: 420px; }
  .contacto-grid { grid-template-columns: 1fr; }
  .como-grid { grid-template-columns: 1fr; }
  .proj.tall, .proj.wide, .proj.third { grid-column: span 12; aspect-ratio: 16/10; }
}

@media (max-width: 720px) {
  body { font-size: 17px; }
  .nav-links {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(78vw, 320px);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 26px;
    padding: 40px;
    background: var(--teal-dark);
    transform: translateX(100%);
    transition: transform .4s cubic-bezier(.2,.7,.2,1);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a, .nav.scrolled .nav-links a { color: #fff; font-size: 22px; font-family: var(--serif); }
  .nav-links a.cta, .nav.scrolled .nav-links a.cta {
    background: #fff; color: var(--teal-dark); border-color: #fff;
    font-family: var(--sans); font-size: 15px;
  }
  .nav-toggle {
    display: flex; flex-direction: column; gap: 5px;
    width: 40px; height: 40px; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer; z-index: 110;
  }
  .nav-toggle span {
    width: 24px; height: 2px; background: #fff; transition: transform .3s ease, opacity .3s ease;
  }
  .nav.scrolled .nav-toggle span { background: var(--ink); }
  .nav-toggle.open span { background: #fff; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .impacto-grid { grid-template-columns: 1fr; }
  .impacto .cell { border-right: none; }
  .impacto .cell:last-child { border-bottom: none; }
  .respaldo .names { gap: 24px; }
  .contact-info .row { grid-template-columns: 1fr; gap: 6px; }
  .footer-top { flex-direction: column; }
}
