/* ---------- Tokens ---------- */
:root {
  --color-sand: #F3EBDD;
  --color-sand-light: #FAF6EF;
  --color-white: #FFFFFF;
  --color-terracotta: #C0613B;      /* íconos y detalles decorativos */
  --color-terracotta-dark: #A9532F; /* botones y texto (contraste AA) */
  --color-terracotta-deep: #8E4526; /* hover */
  --color-green: #1F4D3A;
  --color-green-deep: #173B2C;
  --color-text: #2B2A26;
  --color-text-muted: #55534B;
  --color-border: #E6DCC9;

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(31, 77, 58, 0.06), 0 2px 8px rgba(31, 77, 58, 0.05);
  --shadow-md: 0 8px 24px rgba(31, 77, 58, 0.10);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 200ms;
  --dur-reveal: 700ms;

  --header-h: 68px;
  --gutter: 16px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  margin: 0;
  color: var(--color-green);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: var(--color-terracotta-dark);
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--color-terracotta);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon-sprite {
  display: none;
}

.icon,
.card-icon,
.step-icon {
  fill: currentColor;
  flex-shrink: 0;
}

.icon {
  width: 20px;
  height: 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 100;
  padding: 10px 16px;
  background: var(--color-green);
  color: var(--color-white);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 8px;
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-terracotta-deep);
  margin-bottom: 12px;
}

.lead {
  font-size: 1.125rem;
  color: var(--color-text-muted);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-terracotta-dark);
  color: var(--color-white);
  box-shadow: 0 6px 18px rgba(169, 83, 47, 0.28);
}

.btn-primary:hover {
  background: var(--color-terracotta-deep);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--color-white);
  color: var(--color-green);
  border: 2px solid var(--color-green);
}

.btn-secondary:hover {
  background: var(--color-green);
  color: var(--color-white);
}

.btn-ghost {
  color: var(--color-white);
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.btn-ghost:hover {
  background: var(--color-white);
  color: var(--color-green);
}

.cta-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- Aviso de idioma ---------- */
.lang-suggest {
  background: var(--color-green);
  color: var(--color-white);
  font-size: 0.9375rem;
}

.lang-suggest[hidden] {
  display: none;
}

.lang-suggest-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
}

.lang-suggest p {
  padding-block: 8px;
}

.lang-suggest a {
  color: var(--color-white);
  font-weight: 700;
  text-underline-offset: 3px;
}

.lang-suggest-close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-white);
  cursor: pointer;
}

.lang-suggest-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.lang-suggest :focus-visible {
  outline-color: var(--color-white);
}

/* ---------- Encabezado ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: box-shadow var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.15;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-green);
}

.brand-tag {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-terracotta-dark);
}

.main-nav {
  display: none;
}

.main-nav a {
  position: relative;
  padding: 8px 2px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
  text-decoration: none;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  background: var(--color-terracotta);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-fast) var(--ease-out);
}

.main-nav a:hover::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-white);
  color: var(--color-green);
  cursor: pointer;
}

.menu-toggle[aria-expanded="true"] {
  background: var(--color-green);
  color: var(--color-white);
}

.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: grid;
  padding: 8px var(--gutter) 16px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  animation: menu-in var(--dur-fast) var(--ease-out);
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu a {
  display: flex;
  align-items: center;
  min-height: 52px;
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--color-green);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
}

.mobile-menu a:last-child {
  border-bottom: 0;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-sand-light);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.lang-toggle span {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--color-text-muted);
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.lang-toggle span.is-active {
  background: var(--color-green);
  color: var(--color-white);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-sand);
  overflow: hidden;
}

/* En celular la imagen va arriba, recortada al tema y fundida con el fondo. */
.hero-image {
  -webkit-mask-image: linear-gradient(to bottom, #000 65%, transparent);
  mask-image: linear-gradient(to bottom, #000 65%, transparent);
}

.hero-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 88% 45%;
}

.hero-inner {
  margin-top: -24px;
  padding-block: 0 36px;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 16px;
}

.hero .lead {
  margin-bottom: 28px;
  max-width: 34rem;
}

/* ---------- Estadísticas ---------- */
.stats {
  background: var(--color-green);
  color: var(--color-white);
  padding-block: 28px;
}

.stats-grid {
  display: grid;
  gap: 16px;
}

.stat {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  align-items: center;
  gap: 12px;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-sand);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- Secciones ---------- */
.section {
  padding-block: 48px;
}

.section-sand {
  background: var(--color-sand);
}

.section-header {
  max-width: 44rem;
  margin-bottom: 28px;
}

.section-header h2,
.about-text h2,
.contact h2 {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 12px;
}

.section-intro {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
}

/* ---------- Servicios ---------- */
.service-group + .service-group {
  margin-top: 32px;
}

.group-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-left: 14px;
  border-left: 4px solid var(--color-terracotta);
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.card {
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 14px;
  align-items: start;
  padding: 16px;
  background: var(--color-sand-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) ease,
    border-color var(--dur-fast) ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-terracotta);
}

.card-icon {
  grid-row: span 2;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 12px;
  background: var(--color-white);
  color: var(--color-terracotta);
  box-shadow: var(--shadow-sm);
}

.card h4 {
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}

.card p {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

/* ---------- Cómo funciona ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  counter-reset: none;
}

.step {
  position: relative;
  padding: 20px;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.step-number {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-terracotta);
}

.step-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 14px;
  color: var(--color-terracotta);
}

.step h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.step p {
  color: var(--color-text-muted);
}

/* ---------- Sobre mí ---------- */
.about {
  display: grid;
  gap: 24px;
  align-items: center;
}

.about-photo {
  max-width: 200px;
  margin-inline: auto;
}

.about-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid var(--color-sand);
  box-shadow: var(--shadow-md);
}

.about-text > p {
  margin-bottom: 16px;
  font-size: 1.0625rem;
  max-width: 38rem;
}

.about-facts {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.about-facts li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--color-sand-light);
  border-radius: var(--radius-sm);
}

.about-facts .icon {
  margin-top: 3px;
  color: var(--color-terracotta);
}

/* ---------- Contacto ---------- */
.contact {
  background: var(--color-green);
  color: var(--color-white);
  text-align: center;
}

.contact h2 {
  color: var(--color-white);
}

.contact .lead {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 28px;
}

.contact-inner {
  max-width: 44rem;
}

.cta-center {
  align-items: stretch;
}

.btn-on-dark {
  box-shadow: none;
}

.btn-contact {
  justify-content: flex-start;
  padding-block: 12px;
  border-radius: var(--radius);
  text-align: left;
}

.btn-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.btn-detail {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.9;
}

/* ---------- Pie ---------- */
.site-footer {
  background: var(--color-green-deep);
  color: rgba(255, 255, 255, 0.8);
  padding-block: 32px calc(100px + env(safe-area-inset-bottom, 0px));
  font-size: 0.875rem;
}

.footer-inner {
  display: grid;
  gap: 6px;
  text-align: center;
}

.footer-brand {
  font-weight: 700;
  color: var(--color-white);
}

/* ---------- Barra fija de WhatsApp (celular) ---------- */
.cta-bar {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--color-terracotta-dark);
  color: var(--color-white);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  transform: translateY(calc(100% + 24px));
  visibility: hidden;
  transition: transform 300ms var(--ease-out), visibility 0s linear 300ms;
}

.cta-bar.is-visible {
  transform: none;
  visibility: visible;
  transition: transform 300ms var(--ease-out), visibility 0s;
}

.cta-bar:active {
  background: var(--color-terracotta-deep);
}

/* ---------- Botón flotante de WhatsApp (escritorio) ---------- */
.whatsapp-float {
  display: none;
  position: fixed;
  right: var(--gutter);
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-terracotta-dark);
  color: var(--color-white);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) ease;
}

.whatsapp-float .icon {
  width: 26px;
  height: 26px;
}

.whatsapp-float:hover {
  background: var(--color-terracotta-deep);
  transform: scale(1.06);
}

/* ---------- Animaciones al hacer scroll ---------- */
.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms);
}

.reveal-ready [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* La tarjeta ya visible usa su propia transición rápida para el hover. */
.reveal-ready .card[data-reveal].is-visible {
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) ease,
    border-color var(--dur-fast) ease, opacity var(--dur-reveal) var(--ease-out);
  transition-delay: 0ms;
}

.reveal-ready .hero-image {
  animation: hero-zoom 1.6s var(--ease-out) both;
}

@keyframes hero-zoom {
  from {
    transform: scale(1.06);
    opacity: 0.4;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal-ready [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

@media print {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .site-header,
  .whatsapp-float {
    position: static;
  }
}

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  .cta-row {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .cta-center {
    justify-content: center;
  }

  .stats {
    padding-block: 36px;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }

  .stat {
    display: block;
    text-align: center;
  }

  .stat-number {
    font-size: 2.5rem;
  }

  .section {
    padding-block: 64px;
  }

  .section-header {
    margin-bottom: 40px;
  }

  .card {
    display: block;
    padding: 24px;
  }

  .card h4 {
    font-size: 1.1875rem;
    margin-bottom: 8px;
  }

  .card p {
    font-size: 1rem;
  }

  .card-icon {
    margin-bottom: 16px;
  }

  .about-photo {
    max-width: 320px;
  }

  .hero-image {
    aspect-ratio: 16 / 9;
    object-position: 75% 50%;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Escritorio ---------- */
@media (min-width: 960px) {
  :root {
    --gutter: 32px;
  }

  .main-nav {
    display: flex;
    gap: 28px;
  }

  .menu-toggle,
  .mobile-menu,
  .cta-bar {
    display: none !important;
  }

  .whatsapp-float {
    display: grid;
  }

  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .section {
    padding-block: 96px;
  }

  .about {
    grid-template-columns: 2fr 3fr;
    gap: 64px;
  }

  .about-photo {
    max-width: 380px;
  }

  .site-footer {
    padding-block: 40px;
  }
}

/* ---------- Hero a pantalla ancha: texto sobre la zona libre de la imagen ---------- */
@media (min-width: 1100px) {
  .hero {
    min-height: min(calc(100svh - var(--header-h)), 760px);
    display: flex;
    align-items: center;
  }

  .hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, var(--color-sand) 0%, rgba(243, 235, 221, 0.85) 38%, rgba(243, 235, 221, 0) 58%);
  }

  .hero-image {
    position: absolute;
    inset: 0;
    height: 100%;
    aspect-ratio: auto;
    -webkit-mask-image: none;
    mask-image: none;
    object-position: 85% 50%;
  }

  .hero-inner {
    position: relative;
    z-index: 2;
    margin-top: 0;
    padding-block: 80px;
  }

  .hero-content {
    max-width: 32rem;
  }
}
