/* Segunda versión: movimiento editorial, sin dependencias. */
:root {
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  width: 100%;
  height: 3px;
  background: #9dab74;
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

.hero {
  position: relative;
  isolation: isolate;
}

.hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 17%;
  left: 2%;
  width: 370px;
  max-width: 75%;
  aspect-ratio: 1;
  background: radial-gradient(circle, #dfe5be65, transparent 69%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(54px, 5.15vw, 75px);
  line-height: 1.07;
  margin-bottom: 33px;
}

.hero h1 em {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 1.11em;
  letter-spacing: -.045em;
}

.focus-word {
  display: inline-block;
  position: relative;
}

.focus-word::after {
  content: '';
  position: absolute;
  left: 2%;
  right: -2%;
  bottom: -.06em;
  height: 7px;
  border: 2px solid #adbc8e;
  border-color: #adbc8e transparent transparent;
  border-radius: 50%;
  transform-origin: left;
  pointer-events: none;
}

.motion-ready:not(.motion-paused) .focus-word::after {
  animation: focus-underline 1s var(--motion-ease) .8s both;
}

.image-frame {
  transform: perspective(1100px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform .5s var(--motion-ease), box-shadow .5s ease;
  box-shadow: 0 20px 60px #2533290d;
}

.image-frame img {
  transform: scale(1.06) translateY(var(--photo-shift, 0px));
  transition: transform .4s var(--motion-ease);
}

.motion-ready:not(.motion-paused) .focus-seal {
  animation: floating-seal 7s ease-in-out infinite;
}

.kinetic-band {
  border-top: 1px solid #d2d9c0;
  border-bottom: 1px solid #d2d9c0;
  background: #e8edda;
  overflow: hidden;
  padding: 22px 0 30px;
}

.band-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.band-caption p {
  font-size: 10px;
  color: var(--green);
}

.band-caption strong {
  font-weight: 650;
}

.motion-toggle {
  display: none;
  align-items: center;
  gap: 7px;
  color: var(--green);
  background: transparent;
  padding: 6px 8px;
  border: 1px solid #6b805638;
  border-radius: 20px;
  font-size: 8px;
}

.motion-ready .motion-toggle {
  display: inline-flex;
}

.motion-toggle svg {
  width: 12px;
  height: 12px;
}

.motion-toggle:hover {
  background: #dce5c5;
}

.motion-toggle:disabled {
  cursor: default;
  opacity: .65;
}

.kinetic-marquee {
  overflow: hidden;
  width: 100%;
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
}

.marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
}

.marquee-group {
  display: flex;
  align-items: center;
  gap: 42px;
  padding-right: 42px;
  flex-shrink: 0;
}

.marquee-group > span {
  font-family: var(--display);
  font-size: clamp(35px, 4.3vw, 61px);
  line-height: 1.3;
  letter-spacing: -.05em;
  font-weight: 500;
  color: var(--forest);
  white-space: nowrap;
}

.marquee-group > .marquee-serif {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: clamp(40px, 4.9vw, 70px);
  font-weight: 400;
}

.marquee-group > .marquee-outline {
  color: transparent;
  -webkit-text-stroke: 1px #556e45;
}

.marquee-group > svg {
  color: #899d6d;
  width: 28px;
  height: 28px;
  stroke-width: 1;
}

.motion-ready .marquee-track {
  animation: marquee-journey 35s linear infinite;
}

.motion-paused .marquee-track,
.kinetic-band:hover .marquee-track,
.kinetic-band:focus-within .marquee-track {
  animation-play-state: paused;
}

/* Mantener los márgenes interiores cuando una sección es el propio container. */
.section.container {
  padding-left: 52px;
  padding-right: 52px;
}

.service-card {
  position: relative;
  isolation: isolate;
  transition: background .3s ease, box-shadow .35s ease;
}

.service-card > * {
  position: relative;
  z-index: 1;
}

.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(180px circle at var(--pointer-x, 50%) var(--pointer-y, 50%), #d9e3bd90, transparent 80%);
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
}

.service-icon,
.service-icon svg {
  transition: transform .45s var(--motion-ease), background .3s ease;
}

.service-card:hover .service-icon,
.service-card:focus-visible .service-icon {
  transform: translateY(-3px);
  background: #dce5c5;
}

.service-card:hover .service-icon svg {
  transform: rotate(-8deg);
}

.button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: background .3s, transform .35s var(--motion-ease), box-shadow .35s;
}

.button::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, #ffffff17 50%, transparent 80%);
  transform: translateX(-110%);
  transition: transform .7s var(--motion-ease);
  pointer-events: none;
}

.button svg {
  transition: transform .4s var(--motion-ease);
}

.button:hover::before,
.button:focus-visible::before {
  transform: translateX(110%);
}

.button:hover svg,
.button:focus-visible svg {
  transform: translate(2px, -2px);
}

.button:hover {
  box-shadow: 0 9px 20px #273b2c16;
}

.work-art {
  transition: transform .65s var(--motion-ease), box-shadow .5s ease;
}

.work-caption > svg {
  transition: transform .4s var(--motion-ease);
}

.work-card:hover .work-art,
.work-card:focus-visible .work-art {
  transform: translateY(-6px);
  box-shadow: 0 18px 36px #25332910;
}

.work-card:hover .work-caption > svg {
  transform: translate(3px, -3px);
}

.alma-orbit,
.campaign-spark {
  transition: transform 1.2s var(--motion-ease);
}

.work-card:hover .alma-orbit {
  transform: rotate(48deg);
}

.work-card:hover .campaign-spark {
  transform: rotate(40deg);
}

.agency-image img {
  transition: transform 1.2s var(--motion-ease);
}

.agency-image:hover img {
  transform: scale(1.04);
}

.desktop-nav a[aria-current="location"]::after {
  width: 100%;
}

.motion-ready:not(.motion-paused) .info-dialog[open] {
  animation: dialog-arrival .3s var(--motion-ease) both;
}

.motion-ready:not(.motion-paused) .mobile-nav:not([hidden]) {
  animation: menu-arrival .3s var(--motion-ease) both;
}

.contact-form {
  transition: box-shadow .4s ease;
}

.contact-form:focus-within {
  box-shadow: 0 20px 70px #53683f12;
}

@keyframes focus-underline {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes floating-seal {
  0%, 100% { transform: translateY(0) rotate(10deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}

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

@keyframes dialog-arrival {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@media (hover: hover) and (pointer: fine) {
  .service-card:hover::before {
    opacity: 1;
  }
}

@media (max-width: 1100px) {
  .section.container {
    padding-left: 35px;
    padding-right: 35px;
  }
}

@media (max-width: 680px) {
  .hero h1 {
    font-size: clamp(45px, 11.2vw, 69px);
    margin-bottom: 29px;
  }

  .hero h1 em {
    font-size: 1.1em;
  }

  .focus-word::after {
    height: 5px;
    border-width: 1.5px;
  }

  .section.container {
    padding-left: 24px;
    padding-right: 24px;
  }

  .kinetic-band {
    padding: 18px 0 23px;
  }

  .band-caption {
    margin-bottom: 12px;
  }

  .band-caption p {
    font-size: 9px;
  }

  .motion-toggle {
    min-height: 34px;
    font-size: 8px;
    padding: 7px 9px;
  }

  .marquee-group {
    gap: 24px;
    padding-right: 24px;
  }

  .marquee-group > svg {
    width: 20px;
    height: 20px;
  }

  .image-frame {
    transform: none;
  }

  .image-frame img {
    transform: none;
  }
}

/* El contenido sigue visible y utilizable al desactivar el movimiento. */
.motion-paused *,
.motion-paused *::before,
.motion-paused *::after {
  transition: none !important;
}

.motion-paused .focus-seal,
.motion-paused .focus-word::after,
.motion-paused .info-dialog,
.motion-paused .mobile-nav {
  animation: none !important;
}

.motion-paused .image-frame,
.motion-paused .image-frame img {
  transform: none;
}

html:has(.motion-paused) {
  scroll-behavior: auto;
}

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

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

  .image-frame,
  .image-frame img {
    transform: none !important;
  }

  .focus-word::after {
    transform: none;
  }
}
