/* ==========================================================================
   Reset, layout base, navegacion y footer
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 1rem);
}

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background-color var(--dur-mid) var(--ease-out),
    color var(--dur-mid) var(--ease-out);
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--brand-strong);
  color: #ffffff;
}

/* Material Symbols ------------------------------------------------------- */
.icon {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 1.25em;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  flex-shrink: 0;
}

/* Tamanos puntuales del icono, para no recurrir a estilos en linea */
.icon--xs { font-size: 0.85em; }
.icon--sm { font-size: 1rem; }

/* Layout ----------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3.5rem);
}

.section {
  padding-block: clamp(4rem, 9vw, 8.5rem);
  position: relative;
}

.section--tight {
  padding-block: clamp(3rem, 6vw, 5rem);
}

.section--alt {
  background: var(--bg-alt);
}

.section--band {
  background: var(--band-bg);
  color: var(--band-text);
}

.section-head {
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
  max-width: 60ch;
}

.section-head__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-accent);
  margin-bottom: var(--space-sm);
}

.section-head__eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.section-head__title {
  font-size: var(--step-4);
  color: var(--brand);
}

.section--band .section-head__title {
  color: var(--band-text);
}

.section--band .section-head__lead {
  color: var(--band-text-muted);
}

.section--band .section-head__eyebrow {
  color: var(--band-text-muted);
}

.section-head__lead {
  margin-top: var(--space-sm);
  color: var(--text-muted);
  font-size: var(--step-1);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

.cluster--center {
  justify-content: center;
}

.grid {
  display: grid;
  gap: clamp(1rem, 2.5vw, 2rem);
}

/* Utilidades de espaciado y color (evitan estilos en linea en las plantillas) */
.u-mt-xs { margin-top: var(--space-xs); }
.u-mt-sm { margin-top: var(--space-sm); }
.u-mt-md { margin-top: var(--space-md); }
.u-mt-lg { margin-top: var(--space-lg); }
.u-mt-xl { margin-top: var(--space-xl); }
.u-mb-md { margin-bottom: var(--space-md); }
.u-muted { color: var(--text-muted); }
.u-subtle { color: var(--text-subtle); }
.u-band-muted { color: var(--band-text-muted); }
.u-full { width: 100%; }

.link-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.link-list a {
  color: var(--band-text-muted);
  transition: color var(--dur-fast) var(--ease-out);
}

.link-list a:hover {
  color: var(--band-text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 200;
  background: var(--brand);
  color: var(--on-brand);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  transition: top var(--dur-fast) var(--ease-out);
}

.skip-link:focus {
  top: 1rem;
}

/* Barra de progreso de scroll -------------------------------------------- */
.scroll-progress {
  position: fixed;
  inset-inline: 0;
  top: 0;
  height: 3px;
  z-index: 120;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--brand-strong), var(--navy-300));
  will-change: transform;
}

/* Navegacion -------------------------------------------------------------- */
.nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 110;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: transform var(--dur-mid) var(--ease-out),
    background-color var(--dur-mid) var(--ease-out),
    border-color var(--dur-mid) var(--ease-out),
    backdrop-filter var(--dur-mid) var(--ease-out);
}

.nav.is-stuck {
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  backdrop-filter: blur(16px) saturate(1.6);
  border-bottom-color: var(--border-soft);
  box-shadow: var(--shadow-sm);
}

.nav.is-hidden {
  transform: translateY(-105%);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  width: 100%;
}

.nav__brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.06rem;
  letter-spacing: -0.03em;
  color: var(--brand);
}

.nav__brand span {
  color: var(--brand-accent);
}

.nav__links {
  display: none;
  align-items: center;
  gap: 0.25rem;
  position: relative;
}

.nav__link {
  position: relative;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-out);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--brand);
}

/* Pastilla deslizante que sigue al enlace activo */
.nav__indicator {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--brand-soft);
  opacity: 0;
  transition: transform var(--dur-mid) var(--ease-spring),
    width var(--dur-mid) var(--ease-spring), opacity var(--dur-fast) linear;
  z-index: -1;
  pointer-events: none;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--brand);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-spring),
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.icon-btn:hover {
  transform: translateY(-2px);
  border-color: var(--brand-accent);
  background: var(--surface-alt);
}

.icon-btn:active {
  transform: scale(0.94);
}

.nav__toggle {
  display: inline-grid;
}

/* Menu movil */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 115;
  background: var(--bg);
  padding: calc(var(--nav-height) + 2rem) clamp(1.25rem, 6vw, 3rem) 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform var(--dur-slow) var(--ease-out), visibility var(--dur-slow);
}

.nav-drawer.is-open {
  transform: translateY(0);
  visibility: visible;
}

.nav-drawer__link {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 700;
  color: var(--brand);
  padding-block: 0.6rem;
  border-bottom: 1px solid var(--border-soft);
  opacity: 0;
  transform: translateY(18px);
}

.nav-drawer.is-open .nav-drawer__link {
  animation: drawer-in var(--dur-mid) var(--ease-out) forwards;
}

.nav-drawer.is-open .nav-drawer__link:nth-child(1) { animation-delay: 60ms; }
.nav-drawer.is-open .nav-drawer__link:nth-child(2) { animation-delay: 110ms; }
.nav-drawer.is-open .nav-drawer__link:nth-child(3) { animation-delay: 160ms; }
.nav-drawer.is-open .nav-drawer__link:nth-child(4) { animation-delay: 210ms; }
.nav-drawer.is-open .nav-drawer__link:nth-child(5) { animation-delay: 260ms; }
.nav-drawer.is-open .nav-drawer__link:nth-child(6) { animation-delay: 310ms; }
.nav-drawer.is-open .nav-drawer__link:nth-child(7) { animation-delay: 360ms; }

@media (min-width: 900px) {
  .nav__links {
    display: flex;
  }
  .nav__toggle {
    display: none;
  }
}

/* Footer ------------------------------------------------------------------ */
.footer {
  background: var(--band-bg);
  color: var(--band-text);
  padding-block: clamp(3rem, 6vw, 5rem) 2rem;
  position: relative;
  overflow: hidden;
}

.footer__grid {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: 1fr;
}

.footer__brand {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.footer__tagline {
  color: var(--band-text-muted);
  max-width: 34ch;
  margin-top: var(--space-xs);
  font-size: 0.92rem;
}

.footer__heading {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--band-text-muted);
  margin-bottom: var(--space-md);
}

.footer__socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.social-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--band-border);
  background: var(--band-surface);
  color: var(--band-text);
  font-size: 0.85rem;
  font-weight: 500;
  transition: transform var(--dur-fast) var(--ease-spring),
    border-color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}

.social-chip:hover {
  transform: translateY(-3px);
  border-color: var(--social-accent, var(--band-text-muted));
  background: color-mix(in srgb, var(--social-accent, #ffffff) 16%, transparent);
}

.social-chip .icon {
  color: var(--social-accent, var(--band-text-muted));
}

.footer__bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--band-border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--band-text-muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer__portal {
  width: 32px;
  height: 32px;
  border-color: var(--band-border);
  background: transparent;
  color: var(--band-text-muted);
  opacity: 0.6;
}

.footer__portal:hover {
  opacity: 1;
  border-color: var(--band-text-muted);
  background: var(--band-surface);
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: pulse-ring 2.4s var(--ease-out) infinite;
}

@media (min-width: 780px) {
  .footer__grid {
    grid-template-columns: 1.2fr 1fr;
  }
}
