/* =========================================================
   HÁBITAT CARPINTERÍA — Design tokens
   Paleta tomada del isologo: verde salvia, rosa empolvado,
   vino profundo, sobre base crema-menta.
   ========================================================= */
:root {
  --hb-cream:      #f6f8f1;   /* fondo principal, tono menta muy claro del logo */
  --hb-linen:      #efe9df;   /* fondo alterno cálido */
  --hb-dark:       #262622;   /* sección oscura (proceso) */
  --hb-wine:       #6a2436;   /* acento principal — texto del logo */
  --hb-wine-dark:  #521c2a;
  --hb-sage:       #7c8f6e;   /* verde salvia — estructura, íconos */
  --hb-sage-dark:  #56634c;
  --hb-rose:       #d3a6a2;   /* rosa empolvado — detalles, líneas */
  --hb-ink:        #2c2822;   /* texto principal */
  --hb-ink-soft:   #6a6459;   /* texto secundario */
  --hb-border:     rgba(44,40,34,0.12);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--hb-ink);
  background-color: var(--hb-cream);
  overflow-x: hidden;
  font-weight: 400;
}

a { text-decoration: none; }
::selection { background: var(--hb-rose); color: var(--hb-wine-dark); }

img { max-width: 100%; }

/* Focus visibility */
a:focus-visible, button:focus-visible, .nav-link:focus-visible {
  outline: 2px solid var(--hb-sage);
  outline-offset: 3px;
}

/* =========================================================
   NAVBAR
   ========================================================= */
.navbar-hb {
  background-color: rgba(246, 248, 241, 0.92);
  backdrop-filter: blur(8px);
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--hb-border);
  transition: box-shadow .3s ease;
}

.brand-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.brand-logo-offcanvas {
  height: 60px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.navbar-hb .nav-link {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--hb-ink);
  padding: 0.4rem 0.9rem;
  position: relative;
}

.navbar-hb .nav-link::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.15rem;
  height: 1px;
  background: var(--hb-wine);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.navbar-hb .nav-link:hover::after { transform: scaleX(1); }

.offcanvas-hb {
  background-color: var(--hb-cream);
  max-width: 320px;
}

.offcanvas-hb .nav-link { font-size: 1.05rem; color: var(--hb-ink); }

/* =========================================================
   BOTONES
   ========================================================= */
.btn-hb-primary {
  background-color: var(--hb-wine);
  border: 1px solid var(--hb-wine);
  color: #fdf9f5;
  font-family: var(--font-body);
  font-weight: 500;
  padding: 0.7rem 1.6rem;
  border-radius: 2px;
  transition: background-color .25s ease, transform .25s ease;
}

.btn-hb-primary:hover {
  background-color: var(--hb-wine-dark);
  border-color: var(--hb-wine-dark);
  color: #fdf9f5;
  transform: translateY(-2px);
}

/* =========================================================
   HERO / CARRUSEL
   ========================================================= */
.hero-section {
  position: relative;
  width: 100%;
}

.hero-carousel, .hero-carousel .carousel-inner, .hero-carousel .carousel-item {
  height: 92vh;
  min-height: 480px;
}

.hero-img {
  height: 92vh;
  min-height: 480px;
  width: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-carousel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(38,38,34,0.15) 0%, rgba(38,38,34,0.55) 100%);
  pointer-events: none;
}

.hero-overlay-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3.5rem;
  z-index: 3;
  color: #fdf9f5;
}

.hero-overlay-content .container {
  position: relative;
  z-index: 1;
}

/* Zona desenfocada detrás del texto, con bordes difuminados */
.hero-blur {
  position: absolute;
  left: 1.5rem;
  bottom: -0.5rem;
  width: min(560px, 88vw);
  height: min(300px, 60vh);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(38,38,34,0.14);
  mask-image: radial-gradient(ellipse 55% 55% at 30% 55%, rgba(0,0,0,1) 0%, rgba(0,0,0,0.55) 55%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: radial-gradient(ellipse 55% 55% at 30% 55%, rgba(0,0,0,1) 0%, rgba(0,0,0,0.55) 55%, rgba(0,0,0,0) 100%);
  border-radius: 8px;
  pointer-events: none;
  z-index: 0;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
  opacity: 0.95;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.05;
  margin: 0;
  text-shadow: 0 2px 12px rgba(0,0,0,0.65);
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 1.05rem;
  max-width: 34ch;
  color: rgba(253,249,245,0.92);
  margin: 1.1rem 0 0;
  line-height: 1.6;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.hero-scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.3rem;
  transform: translateX(-50%);
  z-index: 3;
  width: 26px;
  height: 42px;
  border: 1px solid rgba(253,249,245,0.55);
  border-radius: 20px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.hero-scroll-cue span {
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background-color: #fdf9f5;
  animation: hb-scroll-cue 1.8s ease infinite;
}
@keyframes hb-scroll-cue {
  0%   { opacity: 1; transform: translateY(0); }
  60%  { opacity: 0.2; transform: translateY(10px); }
  100% { opacity: 0; transform: translateY(10px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-scroll-cue span { animation: none; }
}
@media (max-width: 575.98px) {
  .hero-scroll-cue { display: none; }
}

/* Franja de datos superpuesta entre el hero y "Nosotros" */
.hero-strip-wrap {
  position: relative;
  z-index: 5;
  margin-bottom: -3.4rem;
}
.hero-strip {
  background: var(--hb-cream);
  border: 1px solid var(--hb-border);
  box-shadow: 0 18px 40px rgba(38,38,34,0.12);
  border-radius: 4px;
  display: flex;
  flex-wrap: wrap;
  transform: translateY(-3.4rem);
}
.hero-strip-item {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.3rem 1.6rem;
  min-width: 12rem;
  border-right: 1px solid var(--hb-border);
}
.hero-strip-item:last-child { border-right: none; }
.hero-strip-item i {
  font-size: 1.25rem;
  color: var(--hb-wine);
}
.hero-strip-item span {
  font-size: 0.92rem;
  color: var(--hb-ink);
  font-weight: 500;
}
@media (max-width: 767.98px) {
  .hero-strip { transform: translateY(-1.8rem); }
  .hero-strip-wrap { margin-bottom: -1.8rem; }
  .hero-strip-item {
    flex: 1 1 50%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--hb-border);
  }
  .hero-strip-item:nth-child(odd) { border-right: 1px solid var(--hb-border); }
  .hero-strip-item:nth-last-child(-n+2) { border-bottom: none; }
}

.hero-arrow {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(253,249,245,0.6);
  border-radius: 50%;
  font-size: 1.1rem;
  color: #fdf9f5;
  background: rgba(38,38,34,0.25);
}

.carousel-control-prev, .carousel-control-next { width: 8%; z-index: 4; }

.carousel-indicators { z-index: 4; margin-bottom: 1.5rem; }
.carousel-indicators [data-bs-target] {
  width: 8px; height: 8px; border-radius: 50%;
  background-color: #fdf9f5; opacity: 0.55; border: none;
}
.carousel-indicators .active { opacity: 1; }

/* =========================================================
   SECCIONES GENERALES
   ========================================================= */
.section-hb { padding: 6.5rem 0; }
@media (max-width: 767.98px) { .section-hb { padding: 4rem 0; } }

.bg-hb-cream { background-color: var(--hb-cream); }
.bg-hb-linen { background-color: var(--hb-linen); }
.bg-hb-dark  { background-color: var(--hb-dark); color: #eee9df; }

.section-kicker {
  font-family: var(--font-body);
  color: var(--hb-sage-dark);
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
  position: relative;
  padding-left: 1.6rem;
}
.section-kicker::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 1.1rem; height: 1px;
  background: var(--hb-sage-dark);
}
.section-kicker-light { color: var(--hb-rose); }
.section-kicker-light::before { background: var(--hb-rose); }

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  line-height: 1.15;
  color: var(--hb-ink);
  margin-bottom: 1.3rem;
  max-width: 20ch;
}
.section-title-light { color: #f4efe6; }

.lead-hb {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--hb-wine);
  max-width: 46ch;
}

.body-hb {
  font-size: 1.03rem;
  line-height: 1.75;
  color: var(--hb-ink-soft);
  max-width: 52ch;
}

/* =========================================================
   NOSOTROS
   ========================================================= */
.stat-row { max-width: 30rem; }
.stat-number {
  font-family: var(--font-display);
  font-size: 3.2rem;
  color: var(--hb-wine);
  line-height: 1;
  margin-bottom: 0.35rem;
}
.stat-label {
  font-size: 0.9rem;
  color: var(--hb-ink-soft);
  max-width: 16ch;
}

.about-image-frame {
  position: relative;
  padding: 1.5rem 2.5rem 2.5rem 0;
}
.about-image-main {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  display: block;
  border-radius: 4px 60px 4px 4px;
}
.about-image-accent {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 45%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border: 6px solid var(--hb-cream);
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(38,38,34,0.18);
}

/* =========================================================
   SERVICIOS
   ========================================================= */
.service-card {
  background: var(--hb-cream);
  border: 1px solid var(--hb-border);
  padding: 2.2rem 1.9rem;
  height: 100%;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  contain: content; /* aísla layout/paint de cada tarjeta: menos trabajo de repintado */
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 32px rgba(38,38,34,0.09);
  border-color: var(--hb-sage);
}
.service-icon {
  font-size: 1.8rem;
  color: var(--hb-sage-dark);
  margin-bottom: 1.1rem;
  display: block;
}
.service-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 0.6rem;
  color: var(--hb-ink);
}
.service-text {
  color: var(--hb-ink-soft);
  font-size: 0.96rem;
  line-height: 1.6;
  margin-bottom: 0;
}

/* =========================================================
   TRABAJOS / GALERÍA
   ========================================================= */
.work-tile, .gallery-item {
  overflow: hidden;
  border-radius: 4px;
  display: block;
  width: 100%;
  border: none;
  padding: 0;
  background: var(--hb-linen);
  contain: content; /* evita que la carga diferida de imágenes recalcule layout fuera de la celda */
}
.work-tile img, .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}
.work-tile:hover img, .gallery-item:hover img { transform: scale(1.04); }

.work-tile { aspect-ratio: 4/3; }
.work-tile-tall { aspect-ratio: 3/4; height: 100%; }
.gallery-item { aspect-ratio: 1/1; cursor: pointer; }

.modal-hb {
  background: var(--hb-dark);
  border: none;
  border-radius: 6px;
  position: relative;
}
.modal-hb .btn-close {
  position: absolute;
  top: 0.9rem; right: 0.9rem;
  z-index: 2;
  background-color: rgba(253,249,245,0.15);
  border-radius: 50%;
  padding: 0.6rem;
}
.modal-hb img { border-radius: 6px; }

/* =========================================================
   PROCESO / DIFERENCIALES (fondo oscuro)
   ========================================================= */
.process-step { height: 100%; padding-right: 0.5rem; contain: content; }
.process-num {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--hb-rose);
  display: block;
  margin-bottom: 0.9rem;
}
.process-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  color: #f4efe6;
  margin-bottom: 0.55rem;
}
.process-text {
  color: rgba(244,239,230,0.72);
  font-size: 0.95rem;
  line-height: 1.65;
}

.diff-row { border-top: 1px solid rgba(244,239,230,0.15); }
.diff-item { display: flex; gap: 0.9rem; align-items: flex-start; height: 100%; }
.diff-item i { color: var(--hb-rose); font-size: 1.3rem; margin-top: 0.15rem; }
.diff-item p { color: rgba(244,239,230,0.78); font-size: 0.94rem; line-height: 1.6; margin: 0; }

/* =========================================================
   CTA
   ========================================================= */
.cta-section {
  background: var(--hb-wine);
  padding: 5.5rem 0;
  color: #fdf9f5;
}
.cta-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.9rem);
  margin-bottom: 0.9rem;
}
.cta-text {
  font-size: 1.05rem;
  color: rgba(253,249,245,0.85);
  max-width: 40ch;
  margin: 0 auto 2rem;
}
.cta-section .btn-hb-primary {
  background-color: #fdf9f5;
  border-color: #fdf9f5;
  color: var(--hb-wine);
}
.cta-section .btn-hb-primary:hover {
  background-color: var(--hb-rose);
  border-color: var(--hb-rose);
  color: var(--hb-wine-dark);
}

/* =========================================================
   CONTACTO
   ========================================================= */
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { border-bottom: 1px solid var(--hb-border); }
.contact-list li:first-child { border-top: 1px solid var(--hb-border); }
.contact-list a, .contact-static {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 0.2rem;
  color: var(--hb-ink);
  font-size: 1.02rem;
  transition: color .2s ease, padding-left .2s ease;
}
.contact-list a:hover { color: var(--hb-wine); padding-left: 0.4rem; }
.contact-list i {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--hb-linen);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hb-sage-dark);
  font-size: 1rem;
  flex-shrink: 0;
}

.contact-image-frame {
  aspect-ratio: 16/11;
  overflow: hidden;
  border-radius: 4px 60px 4px 4px;
}
.contact-image-frame img { width: 100%; height: 100%; object-fit: cover; }

/* Formulario de contacto */
.contact-form {
  background: var(--hb-linen);
  border: 1px solid var(--hb-border);
  padding: 2.4rem;
  border-radius: 4px 40px 4px 4px;
}
.contact-form-kicker {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--hb-wine);
  margin-bottom: 1.6rem;
}
.form-label-hb {
  font-size: 0.88rem;
  color: var(--hb-ink-soft);
  margin-bottom: 0.35rem;
}
.form-control-hb {
  background-color: var(--hb-cream);
  border: 1px solid var(--hb-border);
  border-radius: 2px;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-body);
  color: var(--hb-ink);
}
.form-control-hb:focus {
  background-color: var(--hb-cream);
  border-color: var(--hb-sage);
  box-shadow: 0 0 0 3px rgba(124,143,110,0.18);
  color: var(--hb-ink);
}
.contact-form-note {
  font-size: 0.85rem;
  color: var(--hb-ink-soft);
  margin: 0.9rem 0 0;
}

/* Botón "Ver más" */
.btn-hb-outline {
  background: transparent;
  border: 1px solid var(--hb-wine);
  color: var(--hb-wine);
  font-family: var(--font-body);
  font-weight: 500;
  padding: 0.65rem 1.8rem;
  border-radius: 2px;
  transition: background-color .25s ease, color .25s ease;
}
.btn-hb-outline:hover {
  background-color: var(--hb-wine);
  color: #fdf9f5;
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer-hb {
  background: var(--hb-dark);
  color: rgba(244,239,230,0.75);
  padding: 5rem 0 2rem;
}
.footer-logo {
  height: 56px;
  filter: brightness(0) invert(1) opacity(0.92);
}
.footer-text {
  font-size: 0.94rem;
  line-height: 1.7;
  max-width: 34ch;
  color: rgba(244,239,230,0.65);
}
.footer-heading {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #f4efe6;
  margin-bottom: 1.2rem;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.7rem; }
.footer-links a, .footer-links span {
  color: rgba(244,239,230,0.65);
  font-size: 0.93rem;
}
.footer-links a:hover { color: var(--hb-rose); }

.footer-social {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.5rem;
}
.footer-social a {
  width: 38px; height: 38px;
  border: 1px solid rgba(244,239,230,0.25);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(244,239,230,0.8);
  transition: background-color .2s ease, color .2s ease;
}
.footer-social a:hover { background-color: var(--hb-rose); color: var(--hb-wine-dark); }

.footer-divider { border-color: rgba(244,239,230,0.15); margin: 2.5rem 0 1.5rem; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: rgba(244,239,230,0.55);
}
.footer-bottom a { color: rgba(244,239,230,0.75); }
.footer-bottom a:hover { color: var(--hb-rose); }

/* =========================================================
   REVEAL ON SCROLL (una sola animación orquestada por sección)
   ========================================================= */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================= */
@media (max-width: 991.98px) {
  .about-image-frame { padding: 1rem 1.5rem 1.5rem 0; }
  .hero-overlay-content { bottom: 2.2rem; }
}

@media (max-width: 575.98px) {
  .hero-carousel, .hero-carousel .carousel-inner, .hero-carousel .carousel-item, .hero-img {
    height: 80vh;
    min-height: 420px;
  }
  .about-image-accent { width: 52%; }
}