/* ==========================================================================
   Mining AI — Componentes compartidos
   Header · Menú móvil · Botones · Héroes de página · Rail · Chips · CTA · Footer
   ========================================================================== */

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  color: #fff;
  transition:
    background-color 0.5s var(--ease-out),
    box-shadow 0.5s var(--ease-out),
    height 0.5s var(--ease-out),
    color 0.5s var(--ease-out),
    transform 0.5s var(--ease-out);
}
.site-header::after {
  /* velo superior para legibilidad sobre imágenes */
  content: "";
  position: absolute; inset: 0 0 -40px 0;
  background: linear-gradient(to bottom, rgba(5, 10, 20, 0.55), transparent);
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.5s var(--ease-out);
}
.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  background: transparent;
  padding: 0;
  transition: transform 0.4s var(--ease-out), opacity 0.3s;
}
.brand img {
  height: 74px;
  width: auto;
  aspect-ratio: 1024 / 335;
  object-fit: contain;
  transition: height 0.5s var(--ease-out);
}
.brand:hover { transform: translateY(-1px); opacity: 0.92; }

.main-nav { margin-left: auto; }
.main-nav__list { display: flex; align-items: center; gap: clamp(1rem, 0.2rem + 1.6vw, 2.4rem); }
.main-nav__link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding-block: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0.86;
  transition: opacity 0.3s, color 0.3s;
}
.main-nav__link span {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--brand-cyan);
  opacity: 0.75;
}
.main-nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-cyan), var(--brand-blue));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}
.main-nav__link:hover,
.main-nav__link[aria-current="page"] { opacity: 1; }
.main-nav__link:hover::after,
.main-nav__link[aria-current="page"]::after { transform: scaleX(1); }

.header-cta { flex: none; }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 48px; height: 48px;
  border-radius: 50%;
  position: relative;
  z-index: 120;
}
.nav-toggle__bar {
  position: absolute;
  left: 13px; right: 13px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.45s var(--ease-out), opacity 0.3s, top 0.45s var(--ease-out);
}
.nav-toggle__bar:nth-child(1) { top: 18px; }
.nav-toggle__bar:nth-child(2) { top: 28px; }
.nav-open .nav-toggle__bar:nth-child(1) { top: 23px; transform: rotate(45deg); }
.nav-open .nav-toggle__bar:nth-child(2) { top: 23px; transform: rotate(-45deg); }

/* Estado con scroll */
.site-header.is-scrolled { height: 76px; }
.site-header.is-scrolled::after { opacity: 0; }
.site-header.is-scrolled .brand img { height: 56px; }

.site-header.is-scrolled:not(.site-header--dark) {
  background: rgba(11, 31, 59, 0.94);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  box-shadow: 0 1px 0 rgba(0, 210, 230, 0.12);
  color: #fff;
}
.site-header--dark.is-scrolled {
  background: rgba(8, 22, 43, 0.94);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  box-shadow: 0 1px 0 rgba(0, 210, 230, 0.12);
}
.site-header--light { color: #fff; }
.site-header--light::after { display: block; }
.site-header.is-hidden { transform: translateY(-100%); }

/* ---------- Menú móvil ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: var(--navy-900);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: calc(var(--header-h) + 2rem) var(--gutter) 2rem;
  opacity: 0;
  visibility: hidden;
  clip-path: inset(0 0 100% 0);
  transition:
    clip-path 0.7s var(--ease-out),
    opacity 0.4s,
    visibility 0s 0.7s;
  overflow-y: auto;
}
.mobile-menu::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 40% at 90% 10%, rgba(0, 102, 255, 0.22), transparent 70%),
    radial-gradient(50% 40% at 0% 100%, rgba(0, 210, 230, 0.18), transparent 70%);
  pointer-events: none;
}
.nav-open .mobile-menu {
  opacity: 1;
  visibility: visible;
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.7s var(--ease-out), opacity 0.3s, visibility 0s;
}
.nav-open .site-header { color: #fff; background: transparent !important; box-shadow: none !important; backdrop-filter: none !important; }
.mobile-menu__list { position: relative; display: grid; gap: 0.25rem; }
.mobile-menu__link {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.1rem + 3vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.6s var(--ease-out), opacity 0.6s var(--ease-out), color 0.3s;
}
.mobile-menu__link span { font-family: var(--font-mono); font-size: 0.8rem; color: var(--brand-cyan); font-weight: 500; }
.mobile-menu__link[aria-current="page"] { color: var(--brand-cyan); }
.nav-open .mobile-menu__link { transform: none; opacity: 1; }
.nav-open .mobile-menu__list li:nth-child(1) .mobile-menu__link { transition-delay: 0.15s; }
.nav-open .mobile-menu__list li:nth-child(2) .mobile-menu__link { transition-delay: 0.2s; }
.nav-open .mobile-menu__list li:nth-child(3) .mobile-menu__link { transition-delay: 0.25s; }
.nav-open .mobile-menu__list li:nth-child(4) .mobile-menu__link { transition-delay: 0.3s; }
.nav-open .mobile-menu__list li:nth-child(5) .mobile-menu__link { transition-delay: 0.35s; }
.mobile-menu__footer {
  position: relative;
  margin-top: auto;
  padding-top: 2.5rem;
  display: grid;
  gap: 0.4rem;
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.66);
}
.mobile-menu__footer a:hover { color: #fff; }
.mobile-menu__footer .btn { margin-top: 1.25rem; justify-self: start; }
.nav-open { overflow: hidden; }

@media (max-width: 1080px) {
  .main-nav, .header-cta { display: none; }
  .nav-toggle { display: block; }
}
@media (max-width: 640px) {
  :root { --header-h: 72px; }
  .brand img { height: 34px; }
  .site-header.is-scrolled { height: 64px; }
  .site-header.is-scrolled .brand img { height: 30px; }
}

/* ---------- Botones ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: currentColor;
  --btn-bd: currentColor;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  min-height: 52px;
  padding: 0 1.6rem;
  border: 1px solid var(--btn-bd);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.45s var(--ease-out), border-color 0.45s var(--ease-out), background-color 0.45s var(--ease-out), box-shadow 0.45s;
}
.btn::before {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background: var(--btn-hover, var(--brand-blue));
  transform: translateY(101%);
  transition: transform 0.55s var(--ease-out);
}
.btn:hover::before { transform: none; }
.btn:hover { color: #fff; border-color: var(--btn-hover, var(--brand-blue)); }
.btn__icon {
  width: 18px; height: 18px;
  flex: none;
  transition: transform 0.45s var(--ease-out);
}
.btn:hover .btn__icon { transform: translateX(4px); }

.btn--primary {
  --btn-bg: linear-gradient(135deg, #0066ff 0%, #004ecc 100%);
  --btn-fg: #fff;
  --btn-bd: #0066ff;
  --btn-hover: #00d2e6;
  box-shadow: 0 4px 18px rgba(0, 102, 255, 0.35);
}
.btn--primary:hover {
  border-color: #00d2e6;
  box-shadow: 0 6px 24px rgba(0, 210, 230, 0.45);
  color: #08162b;
}
.btn--light { --btn-fg: #fff; --btn-bd: rgba(255, 255, 255, 0.5); }
.btn--dark { --btn-fg: var(--ink); --btn-bd: rgba(13, 21, 36, 0.3); }
.btn--sm { min-height: 42px; padding: 0 1.15rem; font-size: 0.75rem; gap: 0.6rem; }
.btn--sm .btn__icon { width: 15px; height: 15px; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.link-arrow__circle {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid currentColor;
  transition: background-color 0.4s var(--ease-out), border-color 0.4s, color 0.4s;
}
.link-arrow__circle svg { width: 16px; height: 16px; transition: transform 0.4s var(--ease-out); }
.link-arrow:hover .link-arrow__circle,
a:hover > .link-arrow .link-arrow__circle {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
  box-shadow: 0 0 16px rgba(0, 102, 255, 0.4);
}
.link-arrow:hover .link-arrow__circle svg,
a:hover > .link-arrow .link-arrow__circle svg { transform: translateX(3px); }

/* ---------- Héroe de página interior ---------- */
.page-hero {
  position: relative;
  min-height: min(92svh, 920px);
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: var(--navy-900);
  overflow: hidden;
  isolation: isolate;
}
.page-hero__media {
  position: absolute; inset: -6% 0 0 0;
  z-index: -2;
}
.page-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.page-hero::before {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5, 10, 20, 0.85) 0%, rgba(5, 10, 20, 0.45) 55%, rgba(5, 10, 20, 0.1) 100%),
    linear-gradient(0deg, rgba(5, 10, 20, 0.85) 0%, transparent 50%);
}
.page-hero__content {
  padding-top: calc(var(--header-h) + 4rem);
  padding-bottom: clamp(3.5rem, 2rem + 6vw, 7.5rem);
}
.page-hero__title { margin-top: 1.5rem; max-width: 16ch; }
.page-hero__text {
  margin-top: 2rem;
  max-width: 52ch;
  font-size: var(--fs-lg);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
}
.page-hero__meta {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.56);
}

/* Indicador de scroll */
.scroll-cue {
  position: absolute;
  right: var(--gutter);
  bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
  writing-mode: vertical-rl;
}
.scroll-cue__line {
  width: 1px; height: 64px;
  background: rgba(255, 255, 255, 0.25);
  position: relative;
  overflow: hidden;
}
.scroll-cue__line::after {
  content: "";
  position: absolute; left: 0; top: -40%;
  width: 1px; height: 40%;
  background: #fff;
  animation: scrollCue 2.2s var(--ease-in-out) infinite;
}
@keyframes scrollCue { to { top: 100%; } }
@media (max-width: 760px) { .scroll-cue { display: none; } }

/* ---------- Cabecera de sección ---------- */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: end;
  gap: 2rem 4rem;
  margin-bottom: clamp(3rem, 2rem + 4vw, 6rem);
}
.section-head__title { margin-top: 1.25rem; }
.section-head__aside { display: grid; gap: 1.75rem; justify-items: start; }
.section-head__aside--end { justify-items: end; }
@media (max-width: 860px) {
  .section-head { grid-template-columns: 1fr; }
  .section-head__aside--end { justify-items: start; }
}

/* ---------- Chips de capacidades ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--grey-200);
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}
.chip::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand-cyan);
  box-shadow: 0 0 6px rgba(0, 210, 230, 0.4);
}
.chip:hover { border-color: var(--grey-300); transform: translateY(-1px); }
.on-dark .chip, .is-dark .chip {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
}
.on-dark .chip::before, .is-dark .chip::before { background: var(--brand-cyan); box-shadow: 0 0 10px var(--brand-cyan); }

/* ---------- Esquinas HUD (estética tecnológica) ---------- */
.hud { position: absolute; inset: 1.25rem; pointer-events: none; z-index: 1; }
.hud i {
  position: absolute;
  width: 22px; height: 22px;
  border-color: rgba(0, 210, 230, 0.7);
  border-style: solid;
  border-width: 0;
  transition: transform 0.6s var(--ease-out);
}
.hud i:nth-child(1) { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.hud i:nth-child(2) { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.hud i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.hud i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

/* ---------- Rail horizontal ---------- */
.rail {
  --rail-edge: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(280px, 26vw, 380px);
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--rail-edge);
  padding-inline: var(--rail-edge);
  padding-bottom: 1.5rem;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
@media (max-width: 900px) {
  .rail { grid-auto-columns: minmax(250px, 74vw); }
}
.rail-controls { display: flex; align-items: center; gap: 0.75rem; }
.rail-btn {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0.85;
  transition: background-color 0.35s, color 0.35s, border-color 0.35s, opacity 0.35s;
}
.rail-btn svg { width: 18px; height: 18px; }
.rail-btn:hover:not(:disabled) {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
  opacity: 1;
  box-shadow: 0 0 16px rgba(0, 102, 255, 0.4);
}
.rail-btn:disabled { opacity: 0.25; cursor: default; }
.rail-progress {
  width: 140px; height: 2px;
  background: currentColor;
  opacity: 0.9;
  position: relative;
  margin-left: 0.75rem;
  overflow: hidden;
  background: rgba(127, 127, 127, 0.25);
}
.rail-progress span {
  position: absolute; inset: 0 auto 0 0;
  width: var(--progress, 20%);
  background: linear-gradient(90deg, var(--brand-cyan), var(--brand-blue));
  transition: width 0.3s;
}

/* ---------- CTA final (banda con imagen) ---------- */
.cta-band {
  position: relative;
  min-height: min(88svh, 860px);
  display: grid;
  align-items: center;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  background: var(--navy-950);
}
.cta-band__media { position: absolute; inset: -10% 0; z-index: -2; }
.cta-band__media img { width: 100%; height: 100%; object-fit: cover; }
.cta-band::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(5, 13, 26, 0.85) 0%, rgba(5, 13, 26, 0.35) 45%, rgba(5, 13, 26, 0.92) 100%);
}
.cta-band__content { text-align: center; display: grid; justify-items: center; gap: 2.5rem; padding-block: 6rem; }
.cta-band__title { font-size: var(--fs-3xl); line-height: 1; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-950);
  color: rgba(255, 255, 255, 0.72);
  padding-top: clamp(4rem, 3rem + 4vw, 7rem);
  font-size: var(--fs-sm);
  border-top: 1px solid rgba(0, 210, 230, 0.12);
}
.site-footer__top {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.site-footer__brand { display: grid; gap: 1.5rem; justify-items: start; align-content: start; }
.site-footer__logo {
  display: inline-block;
  background: transparent;
  padding: 0;
  transition: opacity 0.3s;
}
.site-footer__logo:hover { opacity: 0.9; }
.site-footer__logo img {
  height: 74px;
  width: auto;
  aspect-ratio: 1024 / 335;
  object-fit: contain;
}
.site-footer__tagline {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
  max-width: 18ch;
}
.site-footer__title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-cyan);
  margin-bottom: 1.25rem;
}
.site-footer__list { display: grid; gap: 0.75rem; }
.site-footer__list a { transition: color 0.3s; display: inline-flex; gap: 0.6rem; }
.site-footer__list a span { font-family: var(--font-mono); font-size: 0.7rem; color: var(--brand-cyan); padding-top: 0.15rem; }
.site-footer__list a:hover { color: #fff; }
.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-block: 2rem;
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: var(--brand-grey);
}
@media (max-width: 860px) {
  .site-footer__top { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .site-footer__top { grid-template-columns: 1fr; }
}
