/* ========================= */
/* Header                    */
/* ========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-open .site-header {
  visibility: hidden;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: var(--pad-header-x);
  padding-right: var(--pad-header-x);
  height: var(--header-height);
}

.header__logo {
  display: block;
  flex-shrink: 0;
}

.header__logo img {
  display: block;
}

.header__nav {
  display: none;
  align-items: center;
  gap: 28px;
  height: 100%;
  position: relative;
}

.header__nav-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  height: 100%;
  color: var(--color-primary);
  white-space: nowrap;
  font-size: var(--fs-xs);
  line-height: var(--lh-sm);
  font-weight: var(--fw-regular);
  border-bottom: 4px solid transparent;
}

/* Reserve semibold width on every link — prevents layout shift
   when is-active switches font-weight 400 → 600 */
.header__nav-link::after {
  content: attr(data-text);
  font-weight: var(--fw-semibold);
  height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.header__nav-link.is-active {
  font-weight: var(--fw-semibold);
}

/* Single sliding indicator bar */
.header__nav-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background-color: var(--color-primary);
  transition: transform 0.3s ease, width 0.3s ease;
  pointer-events: none;
  will-change: transform, width;
}

.header__border {
  height: 1px;
  background-color: var(--color-primary);
}

/* Mobile menu toggle */
.header__menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
}

.header__menu-icon {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-primary);
  position: relative;
}

.header__menu-icon::before,
.header__menu-icon::after {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-primary);
  position: absolute;
  left: 0;
  transition: transform var(--transition-base);
}

.header__menu-icon::before { top: -7px; }
.header__menu-icon::after  { top: 7px; }

/* Mobile menu open state */
.header__nav.is-open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  background-color: var(--color-bg-white);
  padding: var(--space-xl) 0 var(--space-2xl);
  gap: 0;
  height: auto;
  border-top: 1px solid var(--color-bg-light);
  border-bottom: 1px solid var(--color-bg-light);
  z-index: 49;
}

.header__nav.is-open .header__nav-indicator {
  display: none;
}

.header__nav.is-open .header__nav-link {
  height: auto;
  padding: var(--space-lg) var(--pad-page-x-mobile);
  min-height: 48px;
  display: flex;
  align-items: center;
  font-size: var(--fs-md);
  line-height: var(--lh-lg);
  font-weight: var(--fw-regular);
  border-bottom: 1px solid var(--color-bg-light);
}

.header__nav.is-open .header__nav-link:last-of-type {
  border-bottom: none;
}

.header__nav.is-open .header__nav-link.is-active {
  font-weight: var(--fw-semibold);
  border-bottom-color: var(--color-primary);
  border-bottom-width: 2px;
}

/* Download button inside mobile menu */
.header__download-mobile {
  margin: var(--space-xl) var(--pad-page-x-mobile) 0;
}

/* Hamburger → X animation */
.header__menu-toggle[aria-expanded="true"] .header__menu-icon {
  background-color: transparent;
}

.header__menu-toggle[aria-expanded="true"] .header__menu-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.header__menu-toggle[aria-expanded="true"] .header__menu-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

@media (max-width: 767px) {
  .header__inner {
    padding-left: var(--pad-page-x-mobile);
    padding-right: var(--pad-page-x-mobile);
  }
}

@media (min-width: 1300px) {
  .header__nav {
    display: flex;
  }
  .header__nav.is-open {
    position: static;
    flex-direction: row;
    padding: 0;
    box-shadow: none;
    gap: 28px;
    height: 100%;
  }
  .header__nav.is-open .header__nav-link {
    height: 100%;
    padding: 0;
    font-size: var(--fs-xs);
    line-height: var(--lh-sm);
    font-weight: var(--fw-regular);
    border-bottom: 4px solid transparent;
  }
  .header__menu-toggle {
    display: none;
  }
  /* Hide download button from inside mobile menu at desktop */
  .header__nav .header__download-mobile {
    display: none;
  }
}

/* ========================= */
/* Pill Button               */
/* ========================= */

.pill-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  height: 56px;
  padding: 10px var(--space-2xl) 10px var(--space-3xl);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-primary);
  background: transparent;
  flex-shrink: 0;
  transition: background-color var(--transition-base);
  text-decoration: none;
  cursor: pointer;
}

/* Hide download button on mobile */
.header__download {
  display: none;
}

@media (min-width: 1300px) {
  .header__download {
    display: flex;
    width: 209px; /* fixed — prevents FOUT reflow (measured: 208.66px with Artegra Sans SemiBold loaded) */
  }
}

a.pill-btn {
  color: inherit;
}

a.pill-btn:hover {
  opacity: 1;
}

.pill-btn:hover {
  background-color: var(--color-primary);
}

.pill-btn__label {
  color: var(--color-primary);
  white-space: nowrap;
  font-size: var(--fs-xs);
  line-height: var(--lh-sm);
  font-weight: var(--fw-semibold);
  transition: color var(--transition-base);
}

.pill-btn:hover .pill-btn__label {
  color: #fff;
}

.pill-btn__icon {
  width: 24px;
  height: 24px;
  transition: filter var(--transition-base);
}

.pill-btn:hover .pill-btn__icon {
  filter: brightness(0) invert(1);
}

/* ========================= */
/* Video Button              */
/* ========================= */

/* ─── Video area + custom cursor ─── */
.video-area {
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .video-area {
    cursor: none;
  }
}

.video-cursor {
  position: fixed;
  z-index: 9999;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: rgba(0, 87, 135, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6);
  transition: opacity 0.2s, transform 0.2s;
}

.video-cursor.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.video-cursor__label {
  color: var(--color-text-white);
  white-space: nowrap;
  font-size: var(--fs-xs);
  line-height: var(--lh-sm);
  font-weight: var(--fw-bold);
}

/* ─── Video modal ─── */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s, visibility 0.3s;
}

.video-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 87, 135, 0.85);
}

.video-modal__content {
  position: relative;
  width: 90vw;
  max-width: 960px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.video-modal__close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.video-modal__player {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
}

.video-modal__player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ─── SVG modal ─── */
.svg-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s, visibility 0.3s;
}

.svg-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.svg-modal__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 87, 135, 0.85);
}

.svg-modal__content {
  position: relative;
  width: 90vw;
  max-width: 780px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.svg-modal__close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  z-index: 1;
}

.svg-modal__body {
  overflow-y: auto;
  border-radius: var(--radius-md);
  background-color: #fff;
}

.svg-modal__body img {
  display: block;
  width: 100%;
  height: auto;
}

/* ========================= */
/* CTA Link (download arrow) */
/* ========================= */

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0;
  transition: opacity var(--transition-base);
}

.cta-link:hover {
  opacity: 0.7;
}

.cta-link__text {
  white-space: nowrap;
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  font-weight: var(--fw-bold);
}

.cta-link--teal .cta-link__text {
  color: var(--color-accent-teal);
}

/* ========================= */
/* Hero Intro Animation      */
/* ========================= */

@keyframes heroLetterIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes heroBarIn {
  from { opacity: 0; transform: scaleX(0); }
  to   { opacity: 1; transform: scaleX(1); }
}

@keyframes heroFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.hero-letter {
  display: inline-block;
  opacity: 0;
  animation: heroLetterIn 0.06s ease-out forwards;
}

.hero-intro-hidden {
  opacity: 0;
}

.hero-bar-animate {
  transform-origin: left;
  animation: heroBarIn 0.3s ease-out forwards;
}

.hero-body-animate {
  animation: heroFadeIn 1.1s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

/* ========================= */
/* Hero Illustration Video   */
/* ========================= */

/* Static illustration images hidden — only the video animation is shown */
img[class*="hero__illustration"] {
  display: none;
}

.hero-illustration-video {
  opacity: 0;
  transition: opacity 0.8s ease;
  object-fit: contain;
  pointer-events: none;
}

.hero-illustration-video.is-playing {
  opacity: 1;
}

/* Mobile: video flows below content instead of overlaying */
@media (max-width: 767px) {
  .hero-illustration-video {
    position: static;
    width: calc(100% - var(--pad-page-x-mobile) * 2);
    max-width: 400px;
    height: auto;
    margin: var(--space-xl) auto 0;
  }
}

/* ========================= */
/* Section Cards             */
/* ========================= */

.section-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.section-card__link {
  display: block;
  opacity: 1;
}

.section-card__link:hover {
  opacity: 1;
}

.section-card__visual {
  position: relative;
  aspect-ratio: 400 / 312;
  border-radius: var(--radius-md);
}

.section-card__accent {
  position: absolute;
  top: 3.85%;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius-md);
}

.section-card__accent[data-accent="primary"] { background-color: var(--color-primary); }
.section-card__accent[data-accent="yellow"]  { background-color: var(--color-secondary); }
.section-card__accent[data-accent="cream"]   { background-color: var(--color-accent-cream); }
.section-card__accent[data-accent="red"]     { background-color: var(--color-accent-red); }
.section-card__accent[data-accent="teal"]    { background-color: var(--color-accent-teal); }
.section-card__accent[data-accent="green"]   { background-color: var(--color-accent-green); }

.section-card__body {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.section-card__link:hover .section-card__body {
  transform: translateY(-10px);
  box-shadow: var(--shadow-card);
}

.section-card__illustration {
  display: none;
}

.section-card__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section-card__card-img {
  position: absolute;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  pointer-events: none;
}

.section-card__card-img--modelo {
  left: 8.75%;
  right: 10.25%;
  top: 0;
  width: auto;
  aspect-ratio: 1028 / 952;
}

.section-card__card-img--plan {
  left: 6.25%;
  right: 6.25%;
  top: 0;
  width: auto;
  aspect-ratio: 1730 / 1026;
}

.section-card__card-img--cliente {
  left: 3%;
  right: 2.75%;
  top: 15px;
  width: auto;
  aspect-ratio: 1664 / 1192;
}

.section-card__card-img--grupo {
  left: 0.5%;
  right: 0.75%;
  top: 33px;
  width: auto;
  aspect-ratio: 1588 / 1360;
}

.section-card__title {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  line-height: var(--lh-card);
  color: var(--color-text);
}

.section-card__desc {
  margin-top: var(--space-xs);
  max-width: 400px;
}

/* ========================= */
/* Footer                    */
/* ========================= */

.site-footer {
  background-color: var(--color-primary);
  width: 100%;
}

/* Unified footer — mobile-first (flex column → grid at 768px) */
.footer__content {
  display: flex;
  flex-direction: column;
  padding: var(--space-3xl) var(--pad-page-x-mobile) var(--space-lg);
}

.footer__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-2xl);
}

.footer__nav-link {
  color: var(--color-text-white);
  font-size: var(--fs-xs);
  line-height: var(--lh-sm);
  font-weight: var(--fw-regular);
  transition: color var(--transition-base);
}

.footer__nav-link:hover {
  color: var(--color-accent-teal);
  opacity: 1;
}

.footer__docs {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-2xl);
}

.footer__doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__doc-row + .footer__doc-row {
  margin-top: var(--space-md);
}

.footer__doc-name {
  display: block;
  color: var(--color-text-white);
  font-size: var(--fs-xs);
  line-height: var(--lh-sm);
  font-weight: var(--fw-regular);
}

.footer__pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0;
  transition: opacity var(--transition-base);
}

.footer__pdf-btn img,
.footer__comprometidos-link img {
  width: 16px;
  height: 16px;
}

.footer__pdf-btn:hover {
  opacity: 0.7;
}

.footer__pdf-label {
  color: var(--color-accent-teal);
  white-space: nowrap;
  font-size: var(--fs-xs);
  line-height: var(--lh-sm);
  font-weight: var(--fw-semibold);
  text-align: center;
}

.footer__download-block {
  margin-bottom: var(--space-xl);
}

.footer__download-block + .footer__download-block {
  margin-bottom: var(--space-2xl);
}

.footer__download-title {
  margin-bottom: 6px;
  color: var(--color-text-white);
}

.footer__download-title--bold {
  font-size: var(--fs-md);
  line-height: var(--lh-card);
  font-weight: var(--fw-bold);
}

.footer__download-title--medium {
  font-size: 22px;
  line-height: var(--lh-xl);
  font-weight: var(--fw-medium);
}

.footer__download-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer__comprometidos-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  transition: opacity var(--transition-base);
}

.footer__comprometidos-link:hover {
  opacity: 0.7;
}

.footer__copyright {
  color: var(--color-text-white);
  text-align: center;
  white-space: nowrap;
  font-size: var(--fs-2xs);
  line-height: 24px;
  font-weight: var(--fw-regular);
}

/* ========================= */
/* Scroll-Reveal Animation   */
/* ========================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
}

.is-visible > [data-reveal],
.is-visible [data-reveal] {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
  transition-delay: calc(var(--reveal-i, 0) * 120ms);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ========================= */
/* Carousel — reduced-motion */
/* ========================= */
@media (prefers-reduced-motion: reduce) {
  .comp-voluntariado__card,
  .comp-reconocimientos__card {
    transition: none !important;
  }
}

@media (min-width: 768px) {
  .footer__content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: var(--space-2xl);
    row-gap: var(--space-xl);
    padding: 60px var(--pad-page-x) var(--space-xl);
  }
  .footer__nav {
    gap: 11px;
    margin-bottom: 0;
  }
  .footer__docs {
    margin-bottom: 0;
  }
  .footer__doc-row {
    justify-content: flex-start;
  }
  .footer__doc-row + .footer__doc-row {
    margin-top: 25px;
  }
  .footer__doc-name {
    width: 273px;
  }
  .footer__download-block {
    margin-bottom: 0;
  }
  .footer__download-block + .footer__download-block {
    margin-top: 48px;
    margin-bottom: 0;
  }
  .footer__download-title {
    margin-bottom: var(--space-2xs);
  }
  .footer__download-title--bold {
    font-size: var(--fs-xl);
  }
  .footer__download-title--medium {
    font-size: var(--fs-lg);
    line-height: var(--lh-2xl);
  }
  .footer__download-actions {
    gap: 14px;
  }
  .footer__copyright {
    grid-column: 1 / -1;
  }
}
