/* ==========================================================
   Inmobiliaria Familiar del Bajío
   Tokens
   ========================================================== */
:root{
  --ink: #2B2A28;
  --ink-soft: #55524C;
  --paper: #FAF6F0;
  --paper-alt: #F1E8D9;
  --white: #FFFDF9;
  --terracotta: #B9603F;
  --terracotta-deep: #8C4530;
  --sage: #6B7658;
  --line: #E1D5C2;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --wrap: 1180px;
  --nav-h: 84px;

  --ease: cubic-bezier(.22,.61,.36,1);
}

*, *::before, *::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

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

img{ max-width: 100%; display: block; }

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

a{ color: inherit; }

.skip-link{
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  z-index: 999;
}
.skip-link:focus{ left: 16px; top: 16px; }

:focus-visible{
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
}

h1, h2, h3{
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0;
  color: var(--ink);
}

p{ margin: 0; color: var(--ink-soft); }

.eyebrow{
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terracotta-deep);
  margin: 0 0 14px;
}

/* ==========================================================
   Buttons
   ========================================================== */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  padding: 15px 26px;
  border: 1.5px solid transparent;
  border-radius: 3px;
  transition: transform .35s var(--ease), background-color .25s ease, border-color .25s ease, color .25s ease, box-shadow .25s ease;
  white-space: nowrap;
}
.btn:hover{ transform: translateY(-2px); }
.btn:active{ transform: translateY(0); }

.btn-primary{
  background: var(--terracotta);
  color: var(--white);
  box-shadow: 0 8px 20px -8px rgba(140,69,48,.55);
}
.btn-primary:hover{ background: var(--terracotta-deep); }

.btn-ghost{
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,.55);
}
.btn-ghost:hover{ border-color: #fff; background: rgba(255,255,255,.1); }

.btn-outline{
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-outline:hover{ background: var(--ink); color: var(--paper); }

.btn-small{ padding: 10px 18px; font-size: 13.5px; }
.btn-large{ padding: 18px 32px; font-size: 16px; }

/* ==========================================================
   Header / Nav
   ========================================================== */
.site-header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background-color .4s ease, box-shadow .4s ease, height .3s ease;
}
.site-header.is-scrolled{
  background: rgba(250, 246, 240, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
  height: 68px;
}

.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand{ display: flex; align-items: center; text-decoration: none; }
.brand-logo{ height: 46px; width: auto; transition: height .3s ease; }
.site-header.is-scrolled .brand-logo{ height: 38px; }

.main-nav{
  display: flex;
  align-items: center;
  gap: 34px;
}
.main-nav a{
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding: 4px 0;
}
.main-nav a:not(.btn)::after{
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%;
  height: 1.5px;
  background: var(--terracotta);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.main-nav a:not(.btn):hover::after{ transform: scaleX(1); }

.hero .main-nav a:not(.btn){ color: var(--white); }
.site-header.is-scrolled .main-nav a:not(.btn){ color: var(--ink); }

.nav-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 110;
}
.nav-toggle span{
  display: block;
  height: 1.5px;
  background: var(--ink);
  transition: transform .3s ease, opacity .3s ease, background-color .3s ease;
}
.site-header:not(.is-scrolled) .nav-toggle span{ background: var(--white); }
.site-header .nav-toggle[aria-expanded="true"] span{ background: var(--ink); }
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-6.5px) rotate(-45deg); }

/* ==========================================================
   Hero
   ========================================================== */
.hero{
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--white);
}
.hero-media{
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-photo{
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 60%;
}
.hero-scrim{
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(30,26,20,.55) 0%, rgba(30,26,20,.45) 45%, rgba(30,26,20,.78) 100%);
}

.hero-inner{
  position: relative;
  z-index: 1;
  padding-top: var(--nav-h);
  max-width: 720px;
}

.hero-logo{
  width: 200px;
  height: auto;
  margin-bottom: 18px;
  filter: brightness(0) invert(1);
  opacity: 0;
  transform: translateY(14px) scale(.97);
  animation: heroLogoIn .9s var(--ease) .25s forwards;
}
@keyframes heroLogoIn{ to{ opacity: .95; transform: translateY(0) scale(1); } }

.hero-title{
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--white);
  margin-bottom: 22px;
}

.hero-sub{
  font-size: 17.5px;
  color: rgba(255,255,255,.88);
  max-width: 520px;
  margin-bottom: 36px;
}

.hero-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* scroll reveal */
.reveal{
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-visible{ opacity: 1; transform: translateY(0); }
.reveal[data-delay="1"]{ transition-delay: .05s; }
.reveal[data-delay="2"]{ transition-delay: .15s; }
.reveal[data-delay="3"]{ transition-delay: .25s; }
.reveal[data-delay="4"]{ transition-delay: .35s; }

/* hero copy reveals immediately (not scroll-triggered) */
.hero .reveal{ opacity: 0; transform: translateY(16px); animation: heroIn .8s var(--ease) forwards; }
.hero .reveal[data-delay="1"]{ animation-delay: .5s; }
.hero .reveal[data-delay="2"]{ animation-delay: .65s; }
.hero .reveal[data-delay="3"]{ animation-delay: .8s; }
.hero .reveal[data-delay="4"]{ animation-delay: .95s; }
@keyframes heroIn{ to{ opacity: 1; transform: translateY(0); } }

/* ==========================================================
   Section dividers (skyline)
   ========================================================== */
.divider{
  background: var(--paper);
  line-height: 0;
  padding: 0 0;
}
.skyline{
  width: 100%;
  height: 56px;
  color: var(--line);
  display: block;
}
.skyline .draw-path{
  stroke-dasharray: 1900;
  stroke-dashoffset: 1900;
  transition: stroke-dashoffset 1.6s var(--ease);
}
.skyline.is-visible .draw-path{ stroke-dashoffset: 0; }

/* ==========================================================
   Sections
   ========================================================== */
.section{
  padding: 108px 0;
  scroll-margin-top: 84px;
}
.section-alt{ background: var(--paper-alt); }

.section-head{
  max-width: 620px;
  margin: 0 0 56px;
}
.section-title{
  font-size: clamp(1.9rem, 3.2vw, 2.5rem);
  line-height: 1.2;
}

.section-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}
.section-grid-reverse .section-media{ order: 2; }
.section-grid-reverse .section-copy{ order: 1; }

.section-media img{
  width: 100%;
  aspect-ratio: 4 / 3.1;
  object-fit: cover;
  border-radius: 3px;
}

.section-copy .section-title{ margin-bottom: 20px; }
.section-copy p{ margin-bottom: 0; }

.values{
  list-style: none;
  margin: 34px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.values li{
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.values-mark{
  flex: none;
  width: 9px; height: 9px;
  margin-top: 7px;
  border: 1.5px solid var(--terracotta);
  transform: rotate(45deg);
}
.values strong{
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  margin-bottom: 3px;
}
.values p{ font-size: 14.5px; margin: 0; }

/* ==========================================================
   Services
   ========================================================== */
.services-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.service-card{
  background: var(--paper-alt);
  padding: 40px 34px;
  transition: background-color .35s ease;
}
.service-card:hover{ background: var(--white); }

.service-icon{
  width: 40px; height: 40px;
  color: var(--terracotta);
  margin-bottom: 22px;
}

.service-card h3{
  font-size: 18.5px;
  margin-bottom: 10px;
}
.service-card p{ font-size: 14.5px; }

/* ==========================================================
   Proceso
   ========================================================== */
.process-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}

.process-media{
  aspect-ratio: 4 / 3.1;
  overflow: hidden;
  border-radius: 3px;
  margin-bottom: 22px;
}
.process-media img{
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(30%);
  transform: scale(1.01);
  transition: filter .5s ease, transform .6s ease;
}
.process-card:hover .process-media img{
  filter: grayscale(0%);
  transform: scale(1.05);
}

.process-num{
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--terracotta);
  margin-bottom: 10px;
}

.process-card h3{
  font-size: 18.5px;
  margin-bottom: 8px;
}
.process-card p{ font-size: 14.5px; }

/* ==========================================================
   Mid banner
   ========================================================== */
.mid-banner{
  position: relative;
  min-height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  color: var(--white);
}
.mid-banner-photo{
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
.mid-banner-scrim{
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30,26,20,.4) 0%, rgba(30,26,20,.62) 100%);
}
.mid-banner-inner{
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 640px;
}
.mid-banner-inner .eyebrow{ margin-bottom: 0; }
.mid-banner-inner h2{
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--white);
  line-height: 1.2;
}

/* ==========================================================
   Contact
   ========================================================== */
.contact-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
}

.contact-email{
  display: inline-block;
  margin-top: 22px;
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color .25s ease, border-color .25s ease;
}
.contact-email:hover{ color: var(--terracotta-deep); border-color: var(--terracotta); }

/* ==========================================================
   Footer
   ========================================================== */
.site-footer{
  background: var(--ink);
  color: rgba(250,246,240,.75);
  padding: 52px 0;
}
.footer-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
.footer-logo{
  height: 34px;
  width: auto;
  filter: invert(1) brightness(1.6);
  opacity: .92;
}
.footer-contact{
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
}
.footer-contact a{
  text-decoration: none;
  font-weight: 500;
  font-size: 14.5px;
  color: var(--paper);
  border-bottom: 1px solid rgba(250,246,240,.3);
  padding-bottom: 2px;
  transition: border-color .25s ease, color .25s ease;
}
.footer-contact a:hover{ border-color: var(--terracotta); color: var(--terracotta); }

.footer-note{
  width: 100%;
  font-size: 12.5px;
  color: rgba(250,246,240,.5);
  margin-top: 4px;
}

/* ==========================================================
   WhatsApp floating button
   ========================================================== */
.whatsapp-fab{
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 10px 24px -8px rgba(0,0,0,.4);
  z-index: 90;
  transition: transform .3s var(--ease);
}
.whatsapp-fab:hover{ transform: scale(1.07); }

.whatsapp-fab-ring{
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid #25D366;
  animation: pulseRing 2.6s ease-out infinite;
}
@keyframes pulseRing{
  0%{ transform: scale(.9); opacity: .8; }
  100%{ transform: scale(1.35); opacity: 0; }
}

/* ==========================================================
   Mobile
   ========================================================== */
@media (max-width: 880px){
  .wrap{ padding: 0 22px; }

  .nav-toggle{ display: flex; }

  .main-nav{
    position: fixed;
    inset: 0;
    z-index: 105;
    background: var(--paper);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 28px;
    padding: 32px;
    transform: translateX(100%);
    transition: transform .4s var(--ease);
  }
  .main-nav.is-open{ transform: translateX(0); }
  .main-nav a{ font-size: 22px; color: var(--ink) !important; }
  .main-nav a.btn{ margin-top: 12px; }

  .section-grid{
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .section-grid-reverse .section-media,
  .section-grid-reverse .section-copy{ order: initial; }

  .services-grid{ grid-template-columns: 1fr 1fr; }
  .process-grid{ grid-template-columns: 1fr; gap: 40px; }
  .mid-banner{ min-height: 46vh; padding: 0 8px; }

  .section{ padding: 76px 0; }
}

@media (max-width: 560px){
  .services-grid{ grid-template-columns: 1fr; }
  .hero-actions, .contact-actions{ flex-direction: column; align-items: stretch; }
  .btn{ justify-content: center; }
  .hero-logo{ width: 160px; }
  .footer-inner{ flex-direction: column; align-items: flex-start; }
}

/* ==========================================================
   Reduced motion
   ========================================================== */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  .reveal, .hero .reveal, .hero-logo{
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-logo{ opacity: .95 !important; }
  .draw-path{ stroke-dashoffset: 0 !important; animation: none !important; transition: none !important; }
  .whatsapp-fab-ring{ animation: none; display: none; }
  .btn:hover{ transform: none; }
}
