/* ==========================================================================
   HABIT-KALLI · Sistema de diseño
   Inspiración: refinamiento editorial, paleta terrosa, tipografía serif.
   ========================================================================== */

:root {
  /* Paleta homologada y cálida */
  --bone:       #F4EFE7;   /* fondo principal */
  --cream:      #EAE2D4;   /* superficies */
  --sand:       #D9CDB8;   /* acento suave */
  --clay:       #A87A5B;   /* acento cálido */
  --terracotta: #8B4E2F;   /* acento principal */
  --ink:        #1E1A16;   /* texto principal */
  --ink-soft:   #5A524A;   /* texto secundario */
  --line:       rgba(30,26,22,.12);

  --ff-display: "Cormorant Garamond", "Times New Roman", serif;
  --ff-body:    "Jost", system-ui, sans-serif;

  --container: 1280px;
  --radius: 2px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* ---------- Reset ---------- */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--ff-body);
  font-weight: 300;
  color: var(--ink);
  background: var(--bone);
  line-height: 1.55;
  overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* ---------- Utilidades tipográficas ---------- */
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px); }

.eyebrow {
  font-family: var(--ff-body);
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 400;
}
.display {
  font-family: var(--ff-display);
  font-weight: 300;
  font-size: clamp(48px, 8.5vw, 128px);
  line-height: .96;
  letter-spacing: -0.02em;
}
.display em { font-style: italic; color: var(--terracotta); }
.display-sm {
  font-family: var(--ff-display);
  font-weight: 300;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin-top: 14px;
}
.display-sm em { font-style: italic; color: var(--terracotta); }

.section-head { margin-bottom: clamp(40px, 6vw, 80px); max-width: 900px; }
.section-sub { color: var(--ink-soft); margin-top: 18px; max-width: 520px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 16px 34px;
  font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  border-radius: 999px;
  transition: all .45s var(--ease);
  border: 1px solid transparent;
  font-weight: 400;
}
.btn--primary {
  background: var(--ink);
  color: var(--bone);
}
.btn--primary:hover { background: var(--terracotta); transform: translateY(-2px); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn--ghost:hover { background: var(--ink); color: var(--bone); }

/* =========================================================================
   NAVEGACIÓN
   ========================================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background .4s var(--ease), padding .4s var(--ease), box-shadow .4s var(--ease);
  backdrop-filter: blur(12px);
  background: rgba(244,239,231,0);
}
.nav.is-scrolled {
  background: rgba(244,239,231,.92);
  padding: 12px 0;
  box-shadow: 0 1px 0 var(--line);
}
.nav__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}

/* ---------- LOGO INTERACTIVO ---------- */
.logo { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.logo__mark {
  width: 42px; height: 42px;
  color: var(--terracotta);
  transition: transform .6s var(--ease);
  animation: logo-breathe 5s ease-in-out infinite;
}
.logo:hover .logo__mark { transform: rotate(-8deg) scale(1.08); }
.logo:hover .logo__roof { animation: roof-lift .7s var(--ease); }
.logo:hover .logo__sun { animation: sun-pulse 1s ease-in-out infinite; }
.logo:hover .logo__door { animation: door-open .7s var(--ease) forwards; transform-origin: 26px 50px; }

@keyframes logo-breathe {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.04); }
}
@keyframes roof-lift {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}
@keyframes sun-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: .4; transform: scale(1.8); }
}
@keyframes door-open {
  0%   { transform: skewX(0deg); }
  100% { transform: skewX(-18deg); }
}

.logo__word {
  font-family: var(--ff-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: .02em;
  display: flex; gap: 2px;
}
.logo__dash { color: var(--terracotta); margin: 0 2px; transition: transform .5s var(--ease); }
.logo:hover .logo__dash { transform: rotate(90deg); }
.logo__h { transition: color .4s; }
.logo__k { transition: color .4s; color: var(--ink); }
.logo:hover .logo__k { color: var(--terracotta); }

/* ---------- Links ---------- */
.nav__links { display: flex; gap: clamp(18px, 2.5vw, 36px); }
.nav__links a {
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); font-weight: 400;
  position: relative; padding: 6px 0;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  height: 1px; width: 0; background: var(--terracotta);
  transition: width .45s var(--ease);
}
.nav__links a:hover::after,
.nav__links a.is-active::after { width: 100%; }
.nav__links a.is-active { color: var(--terracotta); }

.nav__cta {
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  padding: 11px 22px; border: 1px solid var(--ink);
  border-radius: 999px; transition: all .4s var(--ease);
}
.nav__cta:hover { background: var(--ink); color: var(--bone); }

.nav__toggle { display: none; width: 36px; height: 36px; flex-direction: column; justify-content: center; gap: 5px; }
.nav__toggle span { display: block; height: 1px; background: var(--ink); transition: transform .4s, opacity .4s; }

/* =========================================================================
   HERO
   ========================================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: flex-end;
  padding: 0 0 clamp(60px, 8vw, 120px);
  color: var(--bone);
  overflow: hidden;
}
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__video {
  width: 100%; height: 100%; object-fit: cover;
  filter: brightness(.72) saturate(.9);
}
.hero__overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(30,26,22,.25) 0%, rgba(30,26,22,.15) 40%, rgba(30,26,22,.75) 100%);
}
.hero__content {
  position: relative; z-index: 2;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  width: 100%;
}
.hero .eyebrow { color: rgba(244,239,231,.75); }
.hero .display { color: var(--bone); }
.hero .display em { color: var(--sand); }
.hero__sub {
  font-size: clamp(16px, 1.2vw, 19px);
  max-width: 520px;
  color: rgba(244,239,231,.85);
  margin-top: 28px; font-weight: 300;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }
.hero__actions .btn--primary { background: var(--bone); color: var(--ink); }
.hero__actions .btn--primary:hover { background: var(--terracotta); color: var(--bone); }
.hero__actions .btn--ghost { color: var(--bone); border-color: rgba(244,239,231,.6); }
.hero__actions .btn--ghost:hover { background: var(--bone); color: var(--ink); }

.hero__scroll {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 2; width: 22px; height: 38px;
  border: 1px solid rgba(244,239,231,.6);
  border-radius: 999px;
  display: flex; justify-content: center; padding-top: 8px;
}
.hero__scroll span {
  width: 2px; height: 8px; background: var(--bone); border-radius: 2px;
  animation: scrollDot 1.8s ease-in-out infinite;
}
@keyframes scrollDot {
  0%   { transform: translateY(0); opacity: 1; }
  60%  { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* Reveal on load */
.reveal { opacity: 0; transform: translateY(24px); animation: reveal .9s var(--ease) forwards; }
.reveal:nth-child(1){ animation-delay: .1s; }
.reveal:nth-child(2){ animation-delay: .25s; }
.reveal:nth-child(3){ animation-delay: .4s; }
.reveal:nth-child(4){ animation-delay: .55s; }
@keyframes reveal { to { opacity: 1; transform: none; } }

/* =========================================================================
   MANIFIESTO
   ========================================================================= */
.manifest { padding: clamp(80px, 12vw, 160px) 0; background: var(--bone); }
.manifest__title {
  font-family: var(--ff-display);
  font-weight: 300;
  font-size: clamp(28px, 3.6vw, 52px);
  line-height: 1.22;
  max-width: 1100px;
  margin-top: 28px;
  letter-spacing: -0.005em;
}
.manifest__title em { font-style: italic; color: var(--terracotta); }

/* =========================================================================
   SERVICIOS
   ========================================================================= */
.services { padding: clamp(80px, 10vw, 140px) 0; background: var(--cream); }
.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}
.service {
  padding: 40px 32px 44px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--cream);
  transition: background .4s var(--ease);
  position: relative;
}
.service:hover { background: var(--sand); }
.service__num {
  font-family: var(--ff-display);
  font-size: 22px; font-style: italic;
  color: var(--terracotta);
  display: block; margin-bottom: 40px;
}
.service h3 {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.1;
  margin-bottom: 14px;
}
.service p { color: var(--ink-soft); font-size: 15px; }

/* =========================================================================
   PROCESO
   ========================================================================= */
.process { padding: clamp(80px, 10vw, 140px) 0; background: var(--bone); }
.process__list { list-style: none; max-width: 900px; margin: 0 auto; }
.process__item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 40px;
  padding: 38px 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
  transition: padding .4s var(--ease);
}
.process__item:last-child { border-bottom: 1px solid var(--line); }
.process__item:hover { padding-left: 18px; }
.process__num {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 40px;
  color: var(--terracotta);
  font-weight: 300;
}
.process__item h3 {
  font-family: var(--ff-display);
  font-size: 32px; font-weight: 400;
  margin-bottom: 10px;
}
.process__item p { color: var(--ink-soft); max-width: 540px; }

/* =========================================================================
   ANTES & DESPUÉS (RIEL)
   ========================================================================= */
.beforeafter { padding: clamp(80px, 10vw, 140px) 0; background: var(--cream); }

.ba__track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 32px;
}

.ba {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  border-radius: var(--radius);
  user-select: none;
  cursor: ew-resize;
  background: var(--sand);
}
.ba__before, .ba__after {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.ba__after {
  clip-path: inset(0 0 0 50%);
  transition: clip-path .05s linear;
}

.ba__tag {
  position: absolute;
  top: 18px; left: 18px;
  font-family: var(--ff-body);
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  padding: 8px 14px;
  background: rgba(30,26,22,.75);
  color: var(--bone);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.ba__tag--after { left: auto; right: 18px; background: rgba(139,78,47,.9); }

/* EL RIEL HOMOLOGADO */
.ba__slider {
  position: absolute; top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--bone);
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(30,26,22,.1);
}
.ba__handle {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bone);
  color: var(--terracotta);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(30,26,22,.25);
  pointer-events: none;
  transition: transform .3s var(--ease);
}
.ba:hover .ba__handle { transform: translate(-50%,-50%) scale(1.1); }

.ba__caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 22px 20px;
  background: linear-gradient(180deg, transparent, rgba(30,26,22,.8));
  color: var(--bone);
}
.ba__caption h4 {
  font-family: var(--ff-display);
  font-size: 22px; font-weight: 400;
}
.ba__caption p { font-size: 13px; opacity: .8; letter-spacing: .06em; }

/* =========================================================================
   NUMBERS
   ========================================================================= */
.numbers { padding: clamp(60px, 8vw, 100px) 0; background: var(--terracotta); color: var(--bone); }
.numbers__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  text-align: center;
}
.stat { display: flex; flex-direction: column; gap: 8px; }
.stat__n {
  font-family: var(--ff-display);
  font-size: clamp(48px, 6vw, 88px);
  font-weight: 300;
  line-height: 1;
}
.stat span:last-child {
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
  opacity: .85;
}

/* =========================================================================
   CONTACTO
   ========================================================================= */
.contact { padding: clamp(80px, 10vw, 140px) 0; background: var(--bone); }
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 90px);
  align-items: start;
}
.contact__copy { margin-top: 24px; color: var(--ink-soft); max-width: 420px; }
.contact__info { list-style: none; margin-top: 36px; }
.contact__info li {
  display: grid;
  grid-template-columns: 120px 1fr;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.contact__info li:last-child { border-bottom: 1px solid var(--line); }
.contact__info span {
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 3px;
}
.contact__info a:hover { color: var(--terracotta); }

.contact__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.contact__form label { display: flex; flex-direction: column; gap: 8px; }
.contact__form label.full { grid-column: 1 / -1; }
.contact__form span {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-soft);
}
.contact__form input,
.contact__form select,
.contact__form textarea {
  font: inherit;
  padding: 14px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  transition: border-color .3s;
}
.contact__form input:focus,
.contact__form select:focus,
.contact__form textarea:focus {
  outline: none;
  border-color: var(--terracotta);
}
.contact__form textarea { resize: vertical; }
.contact__form .btn { margin-top: 14px; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.foot { background: var(--ink); color: var(--bone); padding: 80px 0 30px; }
.foot__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 60px;
  border-bottom: 1px solid rgba(244,239,231,.15);
}
.foot__logo {
  font-family: var(--ff-display);
  font-size: 28px;
  color: var(--sand);
  display: block; margin-bottom: 12px;
}
.foot h5 {
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--sand); font-weight: 500;
  margin-bottom: 18px;
}
.foot a { display: block; padding: 6px 0; font-size: 14px; opacity: .85; transition: opacity .3s, color .3s; }
.foot a:hover { opacity: 1; color: var(--sand); }
.foot__bottom {
  max-width: var(--container); margin: 0 auto;
  padding: 26px clamp(20px, 4vw, 48px) 0;
  font-size: 12px; opacity: .6; letter-spacing: .08em;
}

/* =========================================================================
   SCROLL REVEAL (intersection)
   ========================================================================= */
.sr { opacity: 0; transform: translateY(30px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.sr.is-visible { opacity: 1; transform: none; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 960px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: flex; }
  .nav.is-open .nav__links {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bone);
    padding: 30px 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
    gap: 20px;
  }
  .contact__grid { grid-template-columns: 1fr; }
  .foot__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .process__item { grid-template-columns: 70px 1fr; gap: 20px; }
}
@media (max-width: 540px) {
  .contact__form { grid-template-columns: 1fr; }
  .foot__grid { grid-template-columns: 1fr; }
  .hero__actions { flex-direction: column; align-items: flex-start; }
  .hero__actions .btn { width: 100%; max-width: 320px; }
}
