/* =============================================================
   USAM UPDATE · LANDING DE CUENTA REGRESIVA · VERSIÓN 6
   -------------------------------------------------------------
   Diseño reconstruido a partir de las referencias Desktop/Mobile.
   Mantiene: accesibilidad, responsive, splash y contador en vivo.
   ============================================================= */

:root {
  --navy: #01133f;
  --navy-lower: #071a3f;
  --white: #ffffff;
  --cyan: #65c9cf;
  --cyan-bright: #70d5da;
  --focus: #7cf8ff;
  --counter-bg: #292929;
  --max-width: 1120px;
  --radius: 0.5rem;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--navy);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--white);
  background: linear-gradient(
    180deg,
    #01133f 0%,
    #01133f 58%,
    #071a3f 75%,
    #01133f 100%
  );
  font-family: "Montserrat", "Avenir Next", "Segoe UI", Arial, sans-serif;
  line-height: 1.35;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

.container {
  width: min(calc(100% - 2rem), var(--max-width));
  margin-inline: auto;
}

/* Accesibilidad ================================================= */
.skip-link {
  position: fixed;
  z-index: 11000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--navy);
  background: var(--white);
  border-radius: var(--radius);
  font-weight: 700;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Presentación superior ======================================== */
.intro-section {
  padding-top: clamp(1.75rem, 3vw, 2.35rem);
  text-align: center;
}

.intro-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.anniversary-logo {
  width: clamp(112px, 8.2vw, 142px);
}

.intro-copy {
  max-width: 760px;
  margin: clamp(0.85rem, 1.4vw, 1.2rem) auto 0;
  color: var(--white);
  font-size: clamp(1.02rem, 1.22vw, 1.32rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.005em;
}

.legacy-site-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  margin-top: clamp(1rem, 1.5vw, 1.35rem);
  padding: 0.48rem 1.2rem;
  border: 0;
  border-radius: 999px;
  color: var(--navy);
  background: var(--cyan);
  text-decoration: none;
  font-size: clamp(0.88rem, 0.9vw, 1rem);
  font-weight: 600;
  line-height: 1;
  transition: transform 150ms ease, background-color 150ms ease;
}

.legacy-site-link:hover {
  background: var(--cyan-bright);
  transform: translateY(-1px);
}

.legacy-site-link:active {
  transform: translateY(0);
}

/* Arte principal =============================================== */
.launch-section {
  margin-top: clamp(0.55rem, 1vw, 0.85rem);
  overflow: hidden;
}

.launch-inner {
  display: flex;
  justify-content: center;
}

/*
   La imagen original incorpora cinco barras inferiores. En el nuevo
   diseño se muestra únicamente la composición principal y las curvas;
   el recorte reproduce la referencia suministrada sin alterar el archivo.
*/
.launch-art {
  display: block;
  width: min(100%, 590px);
  height: clamp(454px, 41.5vw, 463px);
  overflow: hidden;
}

.launch-art img {
  width: 100%;
  height: auto;
}

/* Cuenta regresiva ============================================== */
.countdown-section {
  position: relative;
  z-index: 3;
  margin-top: clamp(-4.8rem, -4vw, -3.2rem);
}

.countdown-inner {
  text-align: center;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.5rem, 0.8vw, 0.82rem);
  width: min(100%, 720px);
  margin-inline: auto;
}

.countdown-unit {
  min-width: 0;
}

.flip-pair {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.18rem, 0.38vw, 0.34rem);
}

.flip-pair::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: 50%;
  left: -3px;
  right: -3px;
  height: 2px;
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-50%);
  pointer-events: none;
}

.flip-digit {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 0.72;
  min-height: 84px;
  color: #efefef;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.065), transparent 48%),
    var(--counter-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.45rem;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-family: "Arial Narrow", "Roboto Condensed", "Segoe UI", Arial, sans-serif;
  font-size: clamp(2.6rem, 4.55vw, 4.35rem);
  font-weight: 300;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.flip-digit::before,
.flip-digit::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 5px;
  height: 11px;
  background: #cfd3d8;
  border-radius: 2px;
  transform: translateY(-50%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.flip-digit::before {
  left: -4px;
}

.flip-digit::after {
  right: -4px;
}

.flip-digit.is-changing {
  animation: digit-flash 260ms ease;
}

.accent-digit {
  color: var(--cyan);
}

.unit-label {
  display: block;
  margin-top: 0.42rem;
  font-size: clamp(0.75rem, 0.98vw, 1.02rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.noscript-message {
  max-width: 620px;
  margin: 1rem auto 0;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

/* Pie de página ================================================ */
.site-footer {
  padding: clamp(2rem, 4vw, 1rem) 0 clamp(2rem, 4vw, 2rem);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.55rem, 2.3vw, 2.4rem);
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.78rem;
}

.social-links a {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 0.25rem;
  transition: transform 150ms ease, opacity 150ms ease;
}

.social-links a:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.social-links img {
  width: 25px;
  height: 25px;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: var(--cyan);
  font-size: clamp(0.8rem, 0.92vw, 0.98rem);
  line-height: 1.35;
}

.footer-contact span:first-child {
  font-size: 1.08em;
}

@keyframes digit-flash {
  0%   { transform: translateY(0);    filter: brightness(1); }
  45%  { transform: translateY(-2px); filter: brightness(1.18); }
  100% { transform: translateY(0);    filter: brightness(1); }
}

/* Tablet ======================================================== */
@media (max-width: 900px) {
  .launch-art {
    width: min(100%, 760px);
    height: clamp(455px, 62vw, 585px);
  }

  .countdown {
    width: min(100%, 680px);
  }
}

/* Móvil ========================================================= */
@media (max-width: 720px) {
  .container {
    width: min(calc(100% - 1.55rem), var(--max-width));
  }

  .desktop-only {
    display: none;
  }

  .intro-section {
    padding-top: 1.55rem;
  }

  .anniversary-logo {
    width: clamp(118px, 34vw, 154px);
  }

  .intro-copy {
    max-width: 22rem;
    margin-top: 1.25rem;
    font-size: clamp(1.0rem, 5.1vw, 1rem);
    line-height: 1.32;
  }

  .legacy-site-link {
    min-height: 44px;
    margin-top: 1.55rem;
    padding-inline: 1.5rem;
    font-size: clamp(0.95rem, 4.25vw, 1.12rem);
  }

  .launch-section {
    margin-top: 2.55rem;
  }

  .launch-art {
    width: min(112%, 560px);
    max-width: none;
    height: clamp(380px, 105vw, 505px);
  }

  .countdown-section {
    margin-top: -9.6rem;
  }

  .countdown {
    gap: 0.42rem;
    width: 100%;
  }

  .flip-pair {
    gap: 0.16rem;
  }

  .flip-digit {
    min-height: 62px;
    border-radius: 0.38rem;
    font-size: clamp(2rem, 11.4vw, 3rem);
  }

  .flip-digit::before,
  .flip-digit::after {
    width: 4px;
    height: 9px;
  }

  .unit-label {
    margin-top: 0.45rem;
    font-size: clamp(0.64rem, 3.2vw, 0.83rem);
  }

  .site-footer {
    padding-top: 3.75rem;
    padding-bottom: 2.5rem;
  }

  .footer-inner {
    gap: clamp(1.15rem, 6vw, 2rem);
  }

  .social-links {
    gap: clamp(0.55rem, 3vw, 0.85rem);
  }

  .social-links a,
  .social-links img {
    width: 27px;
    height: 27px;
  }

  .footer-contact {
    font-size: clamp(0.72rem, 3.45vw, 0.88rem);
  }
}

@media (max-width: 390px) {
  .container {
    width: min(calc(100% - 1rem), var(--max-width));
  }

  .launch-art {
    width: 118%;
    height: 390px;
  }

  .countdown {
    gap: 0.25rem;
  }

  .flip-pair {
    gap: 0.1rem;
  }

  .flip-digit {
    min-height: 56px;
    font-size: clamp(1.75rem, 11vw, 2.55rem);
  }

  .unit-label {
    font-size: 0.6rem;
  }

  .footer-inner {
    gap: 0.85rem;
  }

  .social-links {
    gap: 0.5rem;
  }

  .social-links a,
  .social-links img {
    width: 24px;
    height: 24px;
  }

  .footer-contact {
    font-size: 0.69rem;
  }
}

/* Reduce movimiento ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Splash inteligente · V6 ====================================== */
html.is-splashing,
html.is-splashing body {
  overflow: hidden;
}

.access-splash {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: #01133f;
  opacity: 1;
  visibility: visible;
  transition: opacity 380ms ease, visibility 380ms ease;
}

.access-splash.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.access-splash__content {
  display: grid;
  justify-items: center;
  width: min(78vw, 360px);
}

.access-splash__logo {
  width: 100%;
  height: auto;
  animation: splash-logo-in 620ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.access-splash__line {
  position: relative;
  display: block;
  width: min(70%, 230px);
  height: 3px;
  margin-top: 1.1rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.access-splash__line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #55e7ee, #0d55c8, #ef1760);
  transform-origin: left center;
  animation: splash-progress 1.35s ease-in-out infinite;
}

@keyframes splash-logo-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes splash-progress {
  0% {
    transform: translateX(-105%) scaleX(0.35);
  }
  55% {
    transform: translateX(5%) scaleX(0.72);
  }
  100% {
    transform: translateX(110%) scaleX(0.35);
  }
}
