/* ==========================================================================
   Portillo Legal Studio — hoja de estilos principal
   Paleta y tipografías heredadas de la identidad del estudio.
   ========================================================================== */

:root {
  /* Paleta de marca */
  --ivory: #f7f5f1;
  --warm: #e8dfd2;
  --sand: #d5c8b7;
  --clay: #b18d70;
  --brown: #604b39;
  --ink: #302722;
  --faded: #74665b;
  --line: #604b3925;

  /* Tipografía */
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;

  /* Ritmo */
  --gap: 24px;
  --section: clamp(72px, 10vw, 132px);
  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* Accesibilidad: respeta a quien pide menos movimiento. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.wrap {
  width: min(1210px, calc(100% - 54px));
  margin-inline: auto;
}

.wrap--narrow {
  width: min(820px, calc(100% - 54px));
}

.section {
  padding-block: var(--section);
}

.section--warm {
  background: var(--warm);
}
.section--sand {
  background: var(--sand);
}
.section--ink {
  background: var(--ink);
  color: var(--ivory);
}
.section--brown {
  background: var(--brown);
  color: var(--ivory);
}

.grid {
  display: grid;
  gap: var(--gap);
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 900px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Tipografía
   -------------------------------------------------------------------------- */

.eyebrow {
  /* A 10px apenas se leían. A 13 siguen siendo un rótulo discreto pero
     ya cumplen su función de orientar antes del titular. */
  font: 13px var(--mono), monospace;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--brown);
  display: block;
  margin-bottom: 20px;
}

.section--ink .eyebrow,
.section--brown .eyebrow {
  color: var(--sand);
}

.display {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
  font-size: clamp(40px, 7vw, 82px);
}

.title {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
  font-size: clamp(30px, 4.2vw, 52px);
}

.subtitle {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(21px, 2.4vw, 28px);
  line-height: 1.25;
  margin: 0 0 14px;
}

.lead {
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.6;
  color: var(--faded);
  max-width: 62ch;
  margin: 0 0 28px;
}

.section--ink .lead,
.section--brown .lead {
  color: #f7f5f1cc;
}

.italic {
  font-style: italic;
  color: var(--clay);
}

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

/* --------------------------------------------------------------------------
   Botones
   -------------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--brown);
  padding: 15px 22px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: transparent;
  color: var(--brown);
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px #604b3922;
  background: var(--brown);
  color: var(--ivory);
}

.button--solid {
  background: var(--brown);
  color: var(--ivory);
}
.button--solid:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.button--light {
  border-color: var(--ivory);
  color: var(--ivory);
}
.button--light:hover {
  background: var(--ivory);
  color: var(--ink);
}

.button__arrow {
  transition: transform 0.25s var(--ease);
}
.button:hover .button__arrow {
  transform: translateX(4px);
}

/* Enlace con subrayado animado */
.link-underline {
  position: relative;
  font-weight: 500;
  color: var(--brown);
}
.link-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.link-underline:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding-block: 22px;
  transition: all 0.35s var(--ease);
}

.header.is-scrolled {
  padding-block: 12px;
  background: #f7f5f1f2;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand__name {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.brand__tag {
  font: 8px var(--mono), monospace;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--clay);
  margin-top: 4px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav__link {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding-block: 4px;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--brown);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.nav__link:hover::after,
.nav__link.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav__toggle span {
  width: 24px;
  height: 1.5px;
  background: var(--ink);
  transition: all 0.3s var(--ease);
}
.nav__toggle.is-open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav__toggle.is-open span:nth-child(2) {
  opacity: 0;
}
.nav__toggle.is-open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

@media (max-width: 900px) {
  .nav__toggle {
    display: flex;
  }
  .nav {
    position: fixed;
    inset: 0;
    background: var(--ivory);
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    transform: translateX(100%);
    transition: transform 0.45s var(--ease);
  }
  .nav.is-open {
    transform: translateX(0);
  }
  .nav__link {
    font-family: var(--serif);
    font-size: 28px;
  }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding-top: 120px;
  padding-bottom: 60px;
  position: relative;
  overflow: hidden;
}

.hero__display .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.hero__display .word > span {
  display: inline-block;
  transform: translateY(105%);
  animation: word-rise 0.9s var(--ease) forwards;
}

@keyframes word-rise {
  to {
    transform: translateY(0);
  }
}

/* Palabra que rota en el hero */
.rotator {
  display: inline-grid;
  vertical-align: bottom;
}
.rotator__item {
  grid-area: 1 / 1;
  font-style: italic;
  color: var(--clay);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.rotator__item.is-active {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Trama de fondo
   --------------------------------------------------------------------------
   Mosaico de marcas tipográficas jurídicas y palabras de marca.
   Se aplica con mask-image (no background-image) para poder recolorearlo
   desde CSS: la misma trama sirve para fondos claros y oscuros.
   -------------------------------------------------------------------------- */

/* Dónde aparece la trama. Se decide aquí y no vista por vista, para poder
   activarla o quitarla de todo el sitio en un único punto.
   `.patron` queda disponible como opt-in para cualquier otra sección. */
.patron,
.hero,
.section--brown,
.section--ink,
.footer {
  position: relative;
  isolation: isolate;
  /* Imprescindible: el pseudo-elemento es mayor que la sección para poder
     desplazarse sin dejar esquinas vacías. Sin esto aparecerían scrollbars. */
  overflow: hidden;
}

.patron::before,
.hero::before,
.section--brown::before,
.section--ink::before,
.footer::before {
  content: "";
  position: absolute;
  /* Un mosaico completo de margen a la izquierda: es lo que consume la
     deriva horizontal sin dejar el borde derecho vacío. */
  top: 0;
  left: -660px;
  width: calc(100% + 660px);
  height: 100%;
  z-index: -1;
  pointer-events: none;

  background-color: var(--brown);
  opacity: 0.055;

  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22660%22 height=%22340%22 viewBox=%220 0 660 340%22%3E%3Cg fill=%22%23000%22 font-family=%22Georgia, %27Times New Roman%27, serif%22 font-size=%2230%22 letter-spacing=%227%22%3E%3Ctext x=%220%22 y=%2270%22 textLength=%22660%22 lengthAdjust=%22spacing%22%3ELEGAL DESIGN %C2%B7 LEGAL DESIGN %C2%B7%3C/text%3E%3Ctext x=%220%22 y=%22240%22 textLength=%22660%22 lengthAdjust=%22spacing%22%3ELEGAL DESIGN %C2%B7 LEGAL DESIGN %C2%B7%3C/text%3E%3Ctext x=%22-330%22 y=%22155%22 textLength=%22660%22 lengthAdjust=%22spacing%22%3ELEGAL DESIGN %C2%B7 LEGAL DESIGN %C2%B7%3C/text%3E%3Ctext x=%22330%22 y=%22155%22 textLength=%22660%22 lengthAdjust=%22spacing%22%3ELEGAL DESIGN %C2%B7 LEGAL DESIGN %C2%B7%3C/text%3E%3Ctext x=%22-330%22 y=%22325%22 textLength=%22660%22 lengthAdjust=%22spacing%22%3ELEGAL DESIGN %C2%B7 LEGAL DESIGN %C2%B7%3C/text%3E%3Ctext x=%22330%22 y=%22325%22 textLength=%22660%22 lengthAdjust=%22spacing%22%3ELEGAL DESIGN %C2%B7 LEGAL DESIGN %C2%B7%3C/text%3E%3C/g%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22660%22 height=%22340%22 viewBox=%220 0 660 340%22%3E%3Cg fill=%22%23000%22 font-family=%22Georgia, %27Times New Roman%27, serif%22 font-size=%2230%22 letter-spacing=%227%22%3E%3Ctext x=%220%22 y=%2270%22 textLength=%22660%22 lengthAdjust=%22spacing%22%3ELEGAL DESIGN %C2%B7 LEGAL DESIGN %C2%B7%3C/text%3E%3Ctext x=%220%22 y=%22240%22 textLength=%22660%22 lengthAdjust=%22spacing%22%3ELEGAL DESIGN %C2%B7 LEGAL DESIGN %C2%B7%3C/text%3E%3Ctext x=%22-330%22 y=%22155%22 textLength=%22660%22 lengthAdjust=%22spacing%22%3ELEGAL DESIGN %C2%B7 LEGAL DESIGN %C2%B7%3C/text%3E%3Ctext x=%22330%22 y=%22155%22 textLength=%22660%22 lengthAdjust=%22spacing%22%3ELEGAL DESIGN %C2%B7 LEGAL DESIGN %C2%B7%3C/text%3E%3Ctext x=%22-330%22 y=%22325%22 textLength=%22660%22 lengthAdjust=%22spacing%22%3ELEGAL DESIGN %C2%B7 LEGAL DESIGN %C2%B7%3C/text%3E%3Ctext x=%22330%22 y=%22325%22 textLength=%22660%22 lengthAdjust=%22spacing%22%3ELEGAL DESIGN %C2%B7 LEGAL DESIGN %C2%B7%3C/text%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-size: 660px 340px;
  mask-size: 660px 340px;
  -webkit-mask-repeat: repeat;
  mask-repeat: repeat;

  /* Deriva muy lenta y solo horizontal: en un fondo de lettering, el
     desplazamiento lateral se lee como una banda que avanza; en diagonal
     parecería que el texto se descuelga. */
  animation: deriva 180s linear infinite;
}

@keyframes deriva {
  to {
    /* Exactamente un mosaico: al reiniciar, el salto es imperceptible. */
    transform: translate3d(660px, 0, 0);
  }
}

/* Sobre fondos oscuros la trama va en arena y algo más presente. */
.section--ink::before,
.section--brown::before,
.footer::before {
  background-color: var(--sand);
  opacity: 0.1;
}

/* En el hero se deja aún más tenue: ahí manda el titular. */
.hero::before {
  opacity: 0.045;
}

@media (prefers-reduced-motion: reduce) {
  .patron::before,
  .hero::before,
  .section--brown::before,
  .section--ink::before,
  .footer::before {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Fotografía
   -------------------------------------------------------------------------- */

/* Marco base de cualquier foto del sitio. */
.figure {
  position: relative;
  overflow: hidden;
  background: var(--warm);
  margin: 0;
}

.figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.1s var(--ease);
}

.figure:hover img {
  transform: scale(1.035);
}

/* Proporciones */
.figure--portrait {
  aspect-ratio: 2 / 3;
}
.figure--tall {
  aspect-ratio: 9 / 16;
}
.figure--square {
  aspect-ratio: 1 / 1;
}
.figure--wide {
  aspect-ratio: 4 / 3;
}
.figure--pano {
  aspect-ratio: 16 / 10;
}

/* Velo cálido para integrar la foto en la paleta del estudio. */
.figure--veiled::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #604b3900, #604b3926);
  pointer-events: none;
}

/* Bloque de color desplazado detrás de la foto (recurso editorial). */
.figure--offset {
  isolation: isolate;
}
.figure--offset::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
}

.media-frame {
  position: relative;
}
.media-frame::before {
  content: "";
  position: absolute;
  inset: 22px -22px -22px 22px;
  border: 1px solid var(--clay);
  z-index: 0;
  pointer-events: none;
}
.media-frame .figure {
  position: relative;
  z-index: 1;
}

@media (max-width: 640px) {
  .media-frame::before {
    inset: 14px -14px -14px 14px;
  }
}

/* Pareja de fotos desplazadas verticalmente. */
.media-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.media-duo > :nth-child(2) {
  margin-top: 46px;
}
@media (max-width: 640px) {
  .media-duo > :nth-child(2) {
    margin-top: 0;
  }
}

/* Pie de foto discreto. */
.media-caption {
  font: 11.5px var(--mono), monospace;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faded);
  margin-top: 14px;
}

/* Flotación muy leve, para que la página respire. */
@media (prefers-reduced-motion: no-preference) {
  .float {
    animation: float 7s ease-in-out infinite;
  }
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-11px);
  }
}

/* Revelado de la foto con cortina, al entrar en pantalla. */
.figure-reveal .figure img {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.15s var(--ease);
}
.figure-reveal.is-visible .figure img {
  clip-path: inset(0 0 0 0);
}

/* Hero partido: texto a la izquierda, retrato a la derecha.
   Se usan áreas con nombre porque en móvil el orden cambia: allí la foto
   se cuela entre el titular y el párrafo. */
.hero--split .hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  grid-template-areas:
    "intro media"
    "pitch media";
  column-gap: clamp(40px, 6vw, 88px);
  align-content: center;
}

.hero__intro {
  grid-area: intro;
  align-self: end;
}
.hero__pitch {
  grid-area: pitch;
  align-self: start;
}
.hero__media {
  grid-area: media;
  align-self: center;
}

.hero__media {
  position: relative;
}

/* Sello circular giratorio sobre el retrato. */
.seal {
  position: absolute;
  left: -34px;
  bottom: -30px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: var(--brown);
  color: var(--ivory);
  display: grid;
  place-items: center;
  z-index: 2;
  box-shadow: 0 14px 34px #604b3933;
}
.seal__text {
  position: absolute;
  inset: 0;
  animation: spin 22s linear infinite;
}
.seal__center {
  font-size: 21px;
  line-height: 1;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .seal__text {
    animation: none;
  }
}

@media (max-width: 900px) {
  /* En vertical la foto sube: va justo detrás del titular, antes del
     párrafo y los botones, para que el retrato tome protagonismo sin
     obligar a bajar hasta el final del bloque. */
  .hero--split .hero__grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "media"
      "pitch";
    row-gap: 34px;
  }
  .hero__intro,
  .hero__pitch {
    align-self: auto;
  }
  .hero__media {
    max-width: 420px;
    margin-inline: auto;
  }
  .seal {
    width: 92px;
    height: 92px;
    left: -18px;
    bottom: -18px;
  }
  .seal__center {
    font-size: 17px;
  }
}

/* Banda de fotos a sangre completa. */
.strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
@media (max-width: 700px) {
  .strip {
    grid-template-columns: 1fr 1fr;
  }
  .strip > :nth-child(3) {
    display: none;
  }
}

/* Foto con texto superpuesto. */
.overlay-card {
  position: relative;
  overflow: hidden;
}
.overlay-card .figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #302722d9, #30272233 55%, #30272200);
}
.overlay-card__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 30px 28px;
  color: var(--ivory);
  z-index: 2;
}

/* --------------------------------------------------------------------------
   Reveal al hacer scroll
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Escalonado de hijos */
.reveal-group > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal-group.is-visible > * {
  opacity: 1;
  transform: none;
}
.reveal-group.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-group.is-visible > *:nth-child(2) { transition-delay: 0.13s; }
.reveal-group.is-visible > *:nth-child(3) { transition-delay: 0.21s; }
.reveal-group.is-visible > *:nth-child(4) { transition-delay: 0.29s; }
.reveal-group.is-visible > *:nth-child(5) { transition-delay: 0.37s; }
.reveal-group.is-visible > *:nth-child(6) { transition-delay: 0.45s; }

/* Línea que se dibuja sola */
.rule {
  height: 1px;
  background: var(--line);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1s var(--ease);
}
.rule.is-visible {
  transform: scaleX(1);
}

/* --------------------------------------------------------------------------
   Tarjetas
   -------------------------------------------------------------------------- */

.card {
  background: var(--ivory);
  border: 1px solid var(--line);
  padding: 34px 30px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px #604b3914;
}

.card__num {
  font: 12.5px var(--mono), monospace;
  color: var(--clay);
  letter-spacing: 0.12em;
  margin-bottom: 20px;
}

.card__title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 12px;
}

.card__text {
  color: var(--faded);
  font-size: 15px;
  margin: 0 0 20px;
  flex-grow: 1;
}

.card__list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.card__list li {
  font-size: 14px;
  color: var(--faded);
  padding-left: 18px;
  position: relative;
  margin-bottom: 7px;
}
.card__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 1px;
  background: var(--clay);
}

/* Tarjeta destacada: rompe la monotonía de una lista de cajas iguales y
   dirige la mirada al dolor más caro para el cliente. */
.card--destacada {
  background: var(--brown);
  border-color: var(--brown);
  color: var(--ivory);
  position: relative;
}

.card--destacada .card__title {
  color: var(--ivory);
}

.card--destacada .card__text,
.card--destacada .card__list li {
  color: #f7f5f1c9;
}

.card--destacada .card__list li::before {
  background: var(--sand);
}

.card--destacada:hover {
  box-shadow: 0 20px 44px #604b3933;
}

/* Marca de acento en la esquina superior derecha. */
.card--destacada::before {
  content: "";
  position: absolute;
  top: 22px;
  right: 22px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clay);
}

/* Imagen que sangra hasta los bordes de la tarjeta.
   Los márgenes negativos compensan el padding de .card (34px 30px). */
.card__media {
  margin: -34px -30px 26px;
  overflow: hidden;
}

.card__media img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
  transition: transform 0.9s var(--ease);
}

.card:hover .card__media img {
  transform: scale(1.045);
}

/* Tarjeta de servicio destacada, con número grande de fondo */
.card--feature {
  position: relative;
  overflow: hidden;
}
.card--feature::after {
  content: attr(data-num);
  position: absolute;
  right: -10px;
  bottom: -34px;
  font-family: var(--serif);
  font-size: 130px;
  color: var(--line);
  line-height: 1;
  pointer-events: none;
  transition: transform 0.5s var(--ease);
}
.card--feature:hover::after {
  transform: translateY(-8px);
}

/* --------------------------------------------------------------------------
   Comparador antes / después (documento denso vs. documento claro)
   -------------------------------------------------------------------------- */

.compare {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ivory);
  cursor: ew-resize;
  user-select: none;
}

.compare__pane {
  position: absolute;
  inset: 0;
  padding: 30px;
  overflow: hidden;
}

/* El documento claro no va absoluto: es el que marca la altura de la caja.
   Así no sobra ni falta espacio y no hay que acertar una proporción fija
   que además cambiaría en cada tamaño de pantalla. */
.compare__pane--after {
  position: relative;
  inset: auto;
  /* Margen izquierdo extra: al desplazar el tirador del todo a la izquierda
     el texto debe quedar libre y legible, no debajo del tirador. */
  padding-left: 76px;
}

@media (max-width: 760px) {
  .compare__pane--after {
    padding-left: 52px;
  }
}

/* El documento denso es la capa superior y se descubre desde la izquierda:
   así el "antes" queda a la izquierda, que es como se lee de forma natural. */
.compare__pane--before {
  background: #fff;
  clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
  /* La altura la marca el documento claro, así que el denso se corta por
     abajo. El desvanecido hace que ese corte se lea como "el contrato
     sigue y sigue" en vez de como un error de maquetación. */
  -webkit-mask-image: linear-gradient(to bottom, #000 76%, transparent 99%);
  mask-image: linear-gradient(to bottom, #000 76%, transparent 99%);
}

.compare__label {
  position: absolute;
  top: 16px;
  font: 10.5px var(--mono), monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 6px 10px;
  z-index: 3;
}
.compare__label--before {
  left: 16px;
  background: var(--sand);
  color: var(--brown);
}
.compare__label--after {
  right: 16px;
  background: var(--brown);
  color: var(--ivory);
}

.compare__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos, 50%);
  width: 2px;
  background: var(--brown);
  z-index: 4;
  pointer-events: none;
}
.compare__handle::after {
  content: "⇄";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--brown);
  color: var(--ivory);
  display: grid;
  place-items: center;
  font-size: 15px;
}

/* Documento "antes": bloque denso e ilegible */
.doc-dense p {
  font-size: 8.5px;
  line-height: 1.5;
  color: #8a8178;
  text-align: justify;
  margin: 0 0 7px;
}

/* Documento "después": jerarquía, aire y destacados */
.doc-clear h4 {
  font-family: var(--serif);
  font-size: 17px;
  margin: 0 0 10px;
  color: var(--ink);
}
.doc-clear p {
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--faded);
  margin: 0 0 12px;
}
.doc-clear .doc-highlight {
  background: var(--warm);
  border-left: 2px solid var(--clay);
  padding: 9px 11px;
  font-size: 11px;
  color: var(--brown);
  margin-bottom: 12px;
}
.doc-clear .doc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: var(--faded);
  margin-bottom: 7px;
}
.doc-clear .doc-icon {
  width: 17px;
  height: 17px;
  border: 1px solid var(--clay);
  border-radius: 50%;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Método: fases numeradas
   -------------------------------------------------------------------------- */

.steps {
  counter-reset: paso;
}

.step {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 28px;
  padding-block: 34px;
  border-top: 1px solid var(--line);
  align-items: start;
}
.step:last-child {
  border-bottom: 1px solid var(--line);
}

.step__num {
  font-family: var(--serif);
  font-size: 42px;
  color: var(--sand);
  line-height: 1;
  transition: color 0.4s var(--ease);
}
.step:hover .step__num {
  color: var(--clay);
}

@media (max-width: 640px) {
  .step {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* --------------------------------------------------------------------------
   Marquesina
   -------------------------------------------------------------------------- */

.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding-block: 20px;
  white-space: nowrap;
}
.marquee__track {
  display: inline-flex;
  gap: 46px;
  animation: marquee 34s linear infinite;
}
.marquee:hover .marquee__track {
  animation-play-state: paused;
}
.marquee__item {
  font-family: var(--serif);
  font-size: clamp(18px, 2.4vw, 30px);
  color: var(--faded);
  display: inline-flex;
  align-items: center;
  gap: 46px;
}
.marquee__item::after {
  content: "◆";
  font-size: 9px;
  color: var(--clay);
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* --------------------------------------------------------------------------
   Acordeón (FAQ)
   -------------------------------------------------------------------------- */

.accordion__item {
  border-bottom: 1px solid var(--line);
}

.accordion__trigger {
  width: 100%;
  background: none;
  border: 0;
  text-align: left;
  padding: 26px 44px 26px 0;
  font-family: var(--serif);
  font-size: clamp(17px, 2vw, 21px);
  color: var(--ink);
  cursor: pointer;
  position: relative;
  transition: color 0.3s var(--ease);
}
.accordion__trigger:hover {
  color: var(--clay);
}
.accordion__trigger::after {
  content: "+";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  color: var(--clay);
  transition: transform 0.35s var(--ease);
  font-family: var(--sans);
}
.accordion__trigger[aria-expanded="true"]::after {
  transform: translateY(-50%) rotate(45deg);
}

.accordion__panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.45s var(--ease);
}
.accordion__panel p {
  color: var(--faded);
  margin: 0 0 26px;
  max-width: 68ch;
}

/* --------------------------------------------------------------------------
   Blog
   -------------------------------------------------------------------------- */

.post-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--line);
  background: var(--ivory);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px #604b3914;
}

.post-card__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--warm);
}
.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.post-card:hover .post-card__media img {
  transform: scale(1.05);
}

.post-card__body {
  padding: 26px 24px 30px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-card__meta {
  font: 11.5px var(--mono), monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 12px;
}

.post-card__title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.28;
  margin: 0 0 10px;
}

.post-card__excerpt {
  font-size: 14.5px;
  color: var(--faded);
  margin: 0 0 18px;
  flex-grow: 1;
}

/* Artículo */
.article-body {
  font-size: 17px;
  line-height: 1.78;
  color: #453a33;
}
.article-body h2 {
  font-family: var(--serif);
  font-size: clamp(25px, 3vw, 33px);
  font-weight: 500;
  margin: 52px 0 16px;
  line-height: 1.2;
}
.article-body h3 {
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 25px);
  font-weight: 500;
  margin: 38px 0 12px;
}
.article-body p {
  margin: 0 0 22px;
}
.article-body ul,
.article-body ol {
  margin: 0 0 22px;
  padding-left: 22px;
}
.article-body li {
  margin-bottom: 9px;
}
.article-body img {
  margin: 32px 0;
  border: 1px solid var(--line);
}
.article-body blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 26px;
  border-left: 2px solid var(--clay);
  font-family: var(--serif);
  font-size: 21px;
  font-style: italic;
  color: var(--brown);
}
.article-body a {
  color: var(--brown);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Barra de progreso de lectura */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--clay);
  width: 0;
  z-index: 200;
  transition: width 0.1s linear;
}

/* Chips de etiquetas */
.chip {
  display: inline-block;
  font: 11.5px var(--mono), monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 7px 13px;
  color: var(--faded);
  transition: all 0.25s var(--ease);
}
.chip:hover,
.chip.is-active {
  background: var(--brown);
  border-color: var(--brown);
  color: var(--ivory);
}

/* --------------------------------------------------------------------------
   Formularios
   -------------------------------------------------------------------------- */

.field {
  margin-bottom: 22px;
}

.field__label {
  display: block;
  font: 11.5px var(--mono), monospace;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--brown);
  margin-bottom: 9px;
}

.field__input,
.field__textarea,
.field__select {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--sand);
  padding: 12px 2px;
  font-family: var(--sans);
  font-size: 15.5px;
  color: var(--ink);
  transition: border-color 0.3s var(--ease);
}
.field__input:focus,
.field__textarea:focus,
.field__select:focus {
  outline: none;
  border-color: var(--brown);
}
.field__textarea {
  resize: vertical;
  min-height: 118px;
}
.field__input.has-error,
.field__textarea.has-error,
.field__select.has-error {
  border-color: #a3402f;
}

.field--check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--faded);
}
.field--check input {
  margin-top: 4px;
  accent-color: var(--brown);
}

.form-note {
  font-size: 12.5px;
  color: var(--faded);
  margin-top: 16px;
}

.alert {
  padding: 15px 18px;
  font-size: 14.5px;
  margin-bottom: 22px;
  border-left: 2px solid;
}
.alert--ok {
  background: #eef2ea;
  border-color: #5d7a4e;
  color: #3d5233;
}
.alert--error {
  background: #f6ece9;
  border-color: #a3402f;
  color: #7d3122;
}

/* Botón en estado "enviando" */
.button[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
  background: var(--ink);
  color: var(--ivory);
  padding-block: 74px 34px;
}

.footer a {
  color: #f7f5f1b3;
  transition: color 0.25s var(--ease);
}
.footer a:hover {
  color: var(--ivory);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 46px;
  padding-bottom: 52px;
}
@media (max-width: 800px) {
  .footer__grid {
    grid-template-columns: 1fr;
    gap: 38px;
  }
}

.footer__heading {
  font: 12px var(--mono), monospace;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sand);
  margin-bottom: 18px;
}

.footer__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer__list li {
  margin-bottom: 11px;
  font-size: 14.5px;
}

/* Redes sociales: iconos en vez de texto. */
.social {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: flex;
  gap: 12px;
}

.social__link {
  width: 40px;
  height: 40px;
  border: 1px solid #f7f5f13d;
  display: grid;
  place-items: center;
  color: #f7f5f1b3;
  transition: all 0.28s var(--ease);
}

.social__link svg {
  width: 17px;
  height: 17px;
  display: block;
}

.social__link:hover {
  background: var(--sand);
  border-color: var(--sand);
  color: var(--ink);
  transform: translateY(-3px);
}

.footer__bottom {
  border-top: 1px solid #f7f5f11f;
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: #f7f5f180;
}

/* --------------------------------------------------------------------------
   WhatsApp flotante
   -------------------------------------------------------------------------- */

.wa-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--brown);
  color: var(--ivory);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 26px #604b3940;
  transition: transform 0.3s var(--ease);
}
.wa-float:hover {
  transform: scale(1.08);
}

/* --------------------------------------------------------------------------
   Utilidades
   -------------------------------------------------------------------------- */

.center {
  text-align: center;
}
.mx-auto {
  margin-inline: auto;
}
.mb-0 {
  margin-bottom: 0;
}
.mt-40 {
  margin-top: 40px;
}
.flow > * + * {
  margin-top: 18px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 86px);
  align-items: center;
}
@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brown);
  color: var(--ivory);
  padding: 12px 18px;
  z-index: 999;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}
