:root {
  --site-header-bg: rgba(11, 13, 18, .82);
  --site-header-panel: rgba(18, 24, 33, .92);
  --site-header-line: rgba(148, 163, 184, .16);
  --site-header-line-strong: rgba(148, 163, 184, .28);
  --site-header-text: #f4f7fb;
  --site-header-muted: #aeb8c6;
  --site-header-soft: rgba(255, 255, 255, .06);
  --site-header-accent: #19c37d;
  --site-header-accent-2: #5eead4;
}

.site-header,
.site-header *,
.utility-strip,
.utility-strip *,
.lang-drawer,
.lang-drawer * {
  box-sizing: border-box;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1050;
  background: var(--site-header-bg);
  border-bottom: 1px solid var(--site-header-line);
  backdrop-filter: saturate(1.35) blur(16px);
  -webkit-backdrop-filter: saturate(1.35) blur(16px);
}

.nav-wrap {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 84px;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  min-width: 0;
}

.site-header a,
.utility-strip a {
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  color: var(--site-header-text);
  font-family: "Plus Jakarta Sans", "Poppins", "Segoe UI", sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.brand:hover,
.brand:focus {
  color: #fff;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: #04120e;
  background: linear-gradient(135deg, var(--site-header-accent), var(--site-header-accent-2));
  box-shadow: 0 0 0 1px rgba(94, 234, 212, .16), 0 12px 34px rgba(25, 195, 125, .24);
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
  /* Override inline-migrated.css `.nav-links { margin-left: auto }`, which
     combined with justify-content:center + min-width:0 causes items to
     overflow to the LEFT and overlap the brand on tight viewports. */
  margin-left: 0;
  margin-right: 0;
  padding-left: 12px;
  padding-right: 12px;
}

.nav-links a {
  color: var(--site-header-muted);
  border-radius: 999px;
  padding: 10px 12px;
  font-family: "Plus Jakarta Sans", "Poppins", "Segoe UI", sans-serif;
  font-size: .96rem;
  font-weight: 700;
  line-height: 1;
  transition: color .18s ease, background .18s ease;
}

.nav-links a:hover,
.nav-links a:focus,
.nav-links a.active {
  color: var(--site-header-text);
  background: var(--site-header-soft);
}

.nav-link-mobile-only {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.nav-login,
.site-header .btn-secondary,
.site-header .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 18px;
  padding: 0 18px;
  font-family: "Plus Jakarta Sans", "Poppins", "Segoe UI", sans-serif;
  font-size: .95rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}

.nav-login,
.site-header .btn-secondary {
  color: var(--site-header-text);
  border: 1px solid var(--site-header-line-strong);
  background: rgba(255, 255, 255, .035);
}

.site-header .btn {
  gap: 10px;
  color: #04120e;
  border: 0;
  background: linear-gradient(135deg, #34d6ff 0%, #63e6be 100%);
  box-shadow: 0 18px 45px rgba(52, 214, 255, .18);
}

.site-header .btn::after {
  content: "->";
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(4, 18, 14, .12);
}

.nav-login:hover,
.site-header .btn-secondary:hover,
.site-header .btn:hover {
  color: var(--site-header-text);
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, .38);
}

.site-header .btn:hover {
  color: #04120e;
  box-shadow: 0 20px 54px rgba(94, 234, 212, .22);
}

/* La animación del borde luminoso de los botones del nav vive en
   css/subpage-coherence.css para que aplique también al index. */

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--site-header-line-strong);
  border-radius: 12px;
  color: var(--site-header-text);
  background: rgba(255, 255, 255, .04);
}

.utility-strip {
  position: sticky;
  top: 85px;
  z-index: 1040;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 0 24px;
  max-height: none;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  background: rgba(12, 16, 23, .78);
  border-bottom: 1px solid var(--site-header-line);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.utility-links {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: rgba(174, 184, 198, .62);
  font-family: "Plus Jakarta Sans", "Poppins", "Segoe UI", sans-serif;
  font-size: .83rem;
  font-weight: 700;
}

.utility-links a {
  color: rgba(174, 184, 198, .82);
}

.utility-links a:hover,
.utility-links a:focus {
  color: var(--site-header-text);
}

.lang-drawer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--site-header-line);
  border-radius: 999px;
  color: var(--site-header-text);
  background: rgba(255, 255, 255, .045);
  font-family: "Plus Jakarta Sans", "Poppins", "Segoe UI", sans-serif;
  font-size: .82rem;
  font-weight: 800;
}

.lang-drawer-toggle__copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lang-drawer-toggle__kicker {
  display: none;
}

.lang-drawer-toggle__icon {
  color: var(--site-header-accent);
}

.mobile-utility-toggle,
.mobile-lang-toggle {
  display: none;
}

.lang-drawer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
  visibility: hidden;
}

.lang-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.lang-drawer__overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: rgba(5, 7, 12, .58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity .24s ease;
}

.lang-drawer.is-open .lang-drawer__overlay {
  opacity: 1;
}

.lang-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 340px;
  max-width: 90vw;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #111820;
  border-left: 1px solid var(--site-header-line-strong);
  box-shadow: -24px 0 70px rgba(0, 0, 0, .42);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.2, .8, .28, 1);
}

.lang-drawer.is-open .lang-drawer__panel {
  transform: translateX(0);
}

.lang-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--site-header-line);
  color: var(--site-header-text);
  font-family: "Plus Jakarta Sans", "Poppins", "Segoe UI", sans-serif;
}

.lang-drawer__close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--site-header-line);
  border-radius: 8px;
  color: var(--site-header-muted);
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
}

.lang-drawer__close:hover {
  color: var(--site-header-text);
}

.lang-drawer #lang-toggle-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 24px;
  display: block !important;
  position: static !important;
  transform: none !important;
}

.lang-drawer #lang-toggle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.lang-drawer #lang-toggle-indicator {
  display: none;
}

.lang-drawer .lang-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--site-header-muted);
  background: transparent;
  font-family: "Plus Jakarta Sans", "Poppins", "Segoe UI", sans-serif;
  font-size: .95rem;
  font-weight: 800;
  text-align: left;
}

.lang-drawer .lang-btn span {
  color: rgba(174, 184, 198, .74);
  font-size: .82rem;
  font-weight: 600;
}

.lang-drawer .lang-btn:hover {
  color: var(--site-header-text);
  background: rgba(255, 255, 255, .045);
  border-color: var(--site-header-line);
}

.lang-drawer .lang-btn.active,
.lang-drawer .lang-btn[aria-pressed="true"] {
  color: var(--site-header-accent-2);
  background: rgba(25, 195, 125, .12);
  border-color: rgba(25, 195, 125, .32);
}

.lang-drawer .lang-btn.active span,
.lang-drawer .lang-btn[aria-pressed="true"] span {
  color: var(--site-header-accent-2);
}

/* Override inline-migrated.css `#lang-toggle-wrapper[data-static-lang="true"] ...`
   rules so the drawer on every page renders flat (matching the index) instead
   of inheriting the oval-pill blue-glow shell. */
.lang-drawer #lang-toggle-wrapper[data-static-lang="true"],
.lang-drawer #lang-toggle-wrapper {
  flex: 1;
  width: auto;
  max-width: none;
  padding: 14px 18px 24px;
  position: static;
}

.lang-drawer #lang-toggle-wrapper[data-static-lang="true"] #lang-toggle,
.lang-drawer #lang-toggle {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: visible !important;
  isolation: auto !important;
}

.lang-drawer #lang-toggle::before,
.lang-drawer #lang-toggle::after {
  content: none;
  display: none;
}

.lang-drawer #lang-toggle-wrapper[data-static-lang="true"] .lang-btn,
.lang-drawer .lang-btn {
  width: 100% !important;
  height: auto !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  padding: 14px 16px !important;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--site-header-muted) !important;
  font-size: .95rem !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
  text-align: left !important;
  white-space: normal !important;
  transform: none !important;
}

.lang-drawer #lang-toggle-wrapper[data-static-lang="true"] .lang-btn span,
.lang-drawer .lang-btn span {
  color: rgba(174, 184, 198, .74);
  font-size: .82rem;
  font-weight: 600;
}

.lang-drawer #lang-toggle-wrapper[data-static-lang="true"] .lang-btn:hover,
.lang-drawer .lang-btn:hover {
  color: var(--site-header-text);
  background: rgba(255, 255, 255, .045);
  border-color: var(--site-header-line);
  transform: none;
}

.lang-drawer #lang-toggle-wrapper[data-static-lang="true"] .lang-btn.active,
.lang-drawer #lang-toggle-wrapper[data-static-lang="true"] .lang-btn[aria-pressed="true"],
.lang-drawer .lang-btn.active,
.lang-drawer .lang-btn[aria-pressed="true"] {
  color: var(--site-header-accent-2) !important;
  background: rgba(25, 195, 125, .12) !important;
  border-color: rgba(25, 195, 125, .32) !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

.lang-drawer #lang-toggle-wrapper[data-static-lang="true"] .lang-btn.active span,
.lang-drawer #lang-toggle-wrapper[data-static-lang="true"] .lang-btn[aria-pressed="true"] span,
.lang-drawer .lang-btn.active span,
.lang-drawer .lang-btn[aria-pressed="true"] span {
  color: var(--site-header-accent-2);
}

.lang-drawer #lang-toggle-indicator {
  display: none !important;
}

/* Intermediate zone: viewport wide enough to keep desktop nav, but tight
   enough that the Spanish nav copy needs compaction to avoid the brand/
   actions overlap. */
@media (max-width: 1400px) {
  .nav-wrap {
    gap: 14px;
  }

  .nav-links {
    gap: 2px;
  }

  .nav-links a {
    padding: 9px 9px;
    font-size: .9rem;
  }

  .nav-actions {
    gap: 6px;
  }

  .nav-login,
  .site-header .btn-secondary,
  .site-header .btn {
    padding-inline: 14px;
    font-size: .9rem;
  }
}

@media (max-width: 1280px) {
  .site-header {
    position: sticky;
  }

  .nav-wrap {
    min-height: 68px;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 12px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .nav-links,
  .nav-actions {
    display: none;
    width: 100%;
  }

  .nav-links.is-open,
  .nav-actions.is-open {
    display: flex;
  }

  .nav-links {
    order: 3;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px 0 4px;
  }

  .nav-links a {
    width: 100%;
    padding: 13px 14px;
  }

  .nav-link-mobile-only {
    display: block;
  }

  .nav-actions {
    order: 4;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 4px;
  }

  .nav-login,
  .site-header .btn-secondary,
  .site-header .btn {
    width: 100%;
  }

  .mobile-utility-toggle {
    position: sticky;
    top: 69px;
    z-index: 1045;
    width: calc(100% - 32px);
    margin: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--site-header-line);
    border-radius: 12px;
    color: var(--site-header-muted);
    background: rgba(18, 24, 33, .9);
    font-family: "Plus Jakarta Sans", "Poppins", "Segoe UI", sans-serif;
  }

  .mobile-utility-toggle__copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
  }

  .mobile-utility-toggle__label {
    font-size: .72rem;
    color: rgba(174, 184, 198, .72);
  }

  .mobile-utility-toggle__copy strong {
    color: var(--site-header-text);
    font-size: .92rem;
  }

  .mobile-utility-toggle__badge {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 999px;
    color: var(--site-header-accent-2);
    background: rgba(25, 195, 125, .12);
    font-size: .74rem;
    font-weight: 800;
  }

  .utility-strip {
    display: none;
    position: sticky;
    top: 127px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    width: calc(100% - 32px);
    min-height: 0;
    margin: 0 16px 10px;
    padding: 12px;
    border: 1px solid var(--site-header-line);
    border-radius: 12px;
    background: rgba(12, 16, 23, .94);
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .utility-strip.is-open {
    display: flex;
  }

  .utility-links {
    justify-content: center;
    flex-wrap: wrap;
  }

  .lang-drawer-toggle {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .brand {
    font-size: .98rem;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .nav-wrap {
    width: calc(100% - 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header *,
  .utility-strip *,
  .lang-drawer * {
    transition: none !important;
  }
}

/* Compatibility layer: older section styles define generic .nav-wrap, .brand,
   .nav-links and .lang-btn rules. Keep the shared header visually identical
   to the index even when those legacy rules load later on a page. */
.site-header .nav-wrap {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 84px;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  min-width: 0;
}

.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  color: var(--site-header-text);
  font-family: "Plus Jakarta Sans", "Poppins", "Segoe UI", sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.site-header .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--site-header-accent), var(--site-header-accent-2));
  box-shadow: 0 0 0 1px rgba(94, 234, 212, .16), 0 12px 34px rgba(25, 195, 125, .24);
}

.site-header .nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 4px;
  margin: 0;
  padding: 0 12px;
  min-width: 0;
  overflow: hidden;
  max-height: none;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.site-header .nav-links a {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--site-header-muted);
  border-radius: 999px;
  padding: 10px 12px;
  font-family: "Plus Jakarta Sans", "Poppins", "Segoe UI", sans-serif;
  font-size: .96rem;
  font-weight: 700;
  line-height: 1;
  text-transform: none;
  white-space: nowrap;
}

.site-header .nav-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  flex-direction: row;
  gap: 8px;
  width: auto;
  margin: 0;
  max-height: none;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.site-header .nav-login,
.site-header .btn-secondary,
.site-header .btn {
  width: auto;
  min-height: 48px;
  border-radius: 18px;
  padding: 0 18px;
  text-transform: none;
}

@media (max-width: 1400px) {
  .site-header .nav-wrap {
    gap: 10px;
  }

  .site-header .nav-links {
    gap: 0;
    padding-inline: 6px;
  }

  .site-header .nav-links a {
    padding: 8px 7px;
    font-size: .84rem;
  }

  .site-header .nav-actions {
    gap: 6px;
  }

  .site-header .nav-login,
  .site-header .btn-secondary,
  .site-header .btn {
    min-height: 44px;
    padding-inline: 12px;
    border-radius: 15px;
    font-size: .86rem;
  }

  .site-header .btn::after {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 1320px) {
  .site-header .nav-wrap {
    min-height: 68px;
    padding: 12px 0;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .site-header .menu-toggle {
    display: inline-flex;
  }

  .site-header .nav-links,
  .site-header .nav-actions {
    display: none;
    width: 100%;
  }

  .site-header .nav-links.is-open,
  .site-header .nav-actions.is-open {
    display: flex;
  }

  .site-header .nav-links {
    order: 3;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 10px 0 4px;
  }

  .site-header .nav-actions {
    order: 4;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 4px;
  }

  .site-header .nav-links a,
  .site-header .nav-login,
  .site-header .btn-secondary,
  .site-header .btn {
    width: 100%;
    min-height: 46px;
  }
}
