/* =========================================================================
   layout.css — header sticky, navegación, footer, global-page-header, CTA
   ========================================================================= */

/* -------- Skip link (a11y) -------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--ink-900);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  text-decoration: none;
  font-weight: 500;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
  color: #fff;
  outline: 3px solid var(--brand);
}

/* -------- Focus visible global -------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* -------- Header sticky -------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, padding 0.2s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  padding-block: 0.75rem;
}

.site-header__brand img {
  width: 10rem;
  max-width: 100%;
}

/* -------- Nav -------- */
.site-nav__toggle {
  background: none;
  border: 0;
  padding: 0.5rem;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.site-nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink-700);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-nav__list {
  display: none;
  flex-direction: column;
  gap: 0;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1rem 1rem;
  box-shadow: var(--shadow-md);
}

.site-nav.is-open .site-nav__list {
  display: flex;
}

.site-nav__list a {
  display: block;
  padding: 0.75rem 0.5rem;
  color: var(--ink-700);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.site-nav__list li:last-child a {
  border-bottom: 0;
}

.site-nav__list a:hover,
.site-nav__list a[aria-current="page"] {
  color: var(--brand);
}

@media (min-width: 992px) {
  .site-nav__toggle {
    display: none;
  }

  .site-nav__list {
    display: flex;
    flex-direction: row;
    position: static;
    padding: 0;
    border: 0;
    box-shadow: none;
    gap: 0.25rem;
  }

  .site-nav__list a {
    padding: 0.5rem 0.9rem;
    border-bottom: 0;
  }
}

/* -------- Global page header (subpáginas) -------- */
.global-page-header {
  background: var(--brand);
  color: #fff;
  text-align: center;
  padding: 4rem 0 1.5rem;
}

.global-page-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .global-page-header {
    padding: 5rem 0 2rem;
  }
  .global-page-header h1 {
    font-size: 2.625rem;
  }
}

.breadcrumb {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  font-size: 1rem;
  padding: 0.5rem 0;
  margin: 0;
  flex-wrap: wrap;
  list-style: none;
}

.breadcrumb li {
  list-style: none;
}

.breadcrumb a,
.breadcrumb li {
  color: #fff;
}

.breadcrumb a:hover {
  opacity: 0.85;
}

.breadcrumb__sep {
  opacity: 0.7;
}

/* -------- Call to action -------- */
.cta {
  background: var(--brand);
  color: #fff;
  text-align: center;
  padding: 5rem 0;
}

.cta h2 {
  color: #fff;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  font-weight: 300;
  font-size: 1.875rem;
}

.cta p {
  color: #fff;
  font-weight: 300;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.95rem 2.1rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 0;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn--cta {
  background: #fff;
  color: var(--brand);
  border-color: #fff;
}

.btn--cta:hover {
  background: var(--brand);
  color: #fff;
}

.btn--primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.btn--primary:hover {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: #fff;
}

.btn--dark {
  background: var(--dark-cta);
  color: #fff;
  border-color: var(--dark-cta);
}

/* -------- Footer -------- */
.site-footer {
  background: var(--bg);
  padding: 1.5rem 0;
  color: var(--ink-500);
  border-top: 1px solid var(--border);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

.site-footer__copy {
  font-size: 0.8rem;
  margin: 0;
}

.site-footer__copy a {
  color: var(--brand);
}

.site-footer__social {
  display: flex;
  gap: 1rem;
}

.site-footer__social a {
  color: var(--brand);
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
}

@media (min-width: 768px) {
  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* -------- Reveal on scroll (sustituto de WOW.js) -------- */
.reveal,
.reveal--left,
.reveal--right,
.reveal--down {
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal {
  transform: translateY(24px);
}

.reveal--left {
  transform: translateX(-30px);
}

.reveal--right {
  transform: translateX(30px);
}

.reveal--down {
  transform: translateY(-24px);
}

.reveal.is-visible,
.reveal--left.is-visible,
.reveal--right.is-visible,
.reveal--down.is-visible {
  opacity: 1;
  transform: none;
}

/* Stagger escalonado para grids de tarjetas (feature + service) */
.feature-grid > .reveal:nth-child(1),
.service-grid > .reveal:nth-child(1) {
  --reveal-delay: 0ms;
}
.feature-grid > .reveal:nth-child(2),
.service-grid > .reveal:nth-child(2) {
  --reveal-delay: 120ms;
}
.feature-grid > .reveal:nth-child(3),
.service-grid > .reveal:nth-child(3) {
  --reveal-delay: 240ms;
}
.feature-grid > .reveal:nth-child(4),
.service-grid > .reveal:nth-child(4) {
  --reveal-delay: 360ms;
}
.feature-grid > .reveal:nth-child(5),
.service-grid > .reveal:nth-child(5) {
  --reveal-delay: 480ms;
}
.feature-grid > .reveal:nth-child(6),
.service-grid > .reveal:nth-child(6) {
  --reveal-delay: 600ms;
}

.about-feature > .reveal:nth-child(1) {
  --reveal-delay: 0ms;
}
.about-feature > .reveal:nth-child(2) {
  --reveal-delay: 150ms;
}
.about-feature > .reveal:nth-child(3) {
  --reveal-delay: 300ms;
}

.contact-details__grid > .reveal:nth-child(1) {
  --reveal-delay: 0ms;
}
.contact-details__grid > .reveal:nth-child(2) {
  --reveal-delay: 150ms;
}
.contact-details__grid > .reveal:nth-child(3) {
  --reveal-delay: 300ms;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal--left,
  .reveal--right,
  .reveal--down {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
