html.site-splash-active,
html.site-splash-active body {
  overflow: hidden;
}

.site-splash,
.site-splash * {
  box-sizing: border-box;
}

.site-splash[hidden],
.site-splash [hidden],
.home-projects-message[hidden],
.home-projects-message [hidden] {
  display: none !important;
}

.site-splash {
  --splash-bg: #0e1015;
  --splash-blue: #0135a3;
  --splash-size: clamp(7rem, 22vmin, 9.5rem);
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  height: 100dvh;
  padding: max(1.25rem, env(safe-area-inset-top)) 1.25rem max(1.25rem, env(safe-area-inset-bottom));
  overflow: hidden;
  overscroll-behavior: contain;
  isolation: isolate;
  color: #fff;
  background-color: var(--splash-bg);
  background-image: radial-gradient(circle at 50% 50%, rgba(1, 53, 163, 0.14) 0, transparent 38vmax);
  font-family: Inter, Montserrat, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  opacity: 1;
  transition: opacity 450ms cubic-bezier(0.4, 0, 0.2, 1);
}

.site-splash:focus {
  outline: none;
}

.site-splash--leaving {
  opacity: 0;
  pointer-events: none;
}

/* Logo + círculo: un solo bloque que se infla y desinfla al mismo ritmo. */
.site-splash__emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--splash-size);
  height: var(--splash-size);
  animation:
    site-splash-enter 700ms cubic-bezier(0.22, 1, 0.36, 1) both,
    site-splash-breathe 2.6s cubic-bezier(0.45, 0, 0.55, 1) 700ms infinite;
  will-change: transform;
}

.site-splash__circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1a4fc4 0%, var(--splash-blue) 55%, #012a85 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 18px 40px -12px rgba(0, 0, 0, 0.6),
    0 0 32px 2px rgba(1, 53, 163, 0.45);
  animation: site-splash-glow 2.6s cubic-bezier(0.45, 0, 0.55, 1) 700ms infinite;
}

.site-splash__logo {
  position: relative;
  display: block;
  width: auto;
  height: 52%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
  animation: site-splash-logo 2.6s cubic-bezier(0.45, 0, 0.55, 1) 700ms infinite;
}

.site-splash--leaving .site-splash__emblem {
  animation: site-splash-exit 450ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.site-splash__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.site-splash .site-splash__skip {
  position: absolute;
  bottom: max(2rem, env(safe-area-inset-bottom));
  left: 50%;
  margin: 0;
  padding: 0.625rem 1.125rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.04);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
  cursor: pointer;
  transform: translateX(-50%);
  animation: site-splash-fade-up 400ms ease-out both;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.site-splash .site-splash__skip:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.site-splash .site-splash__skip:focus-visible,
.home-projects-message__retry:focus-visible {
  outline: 2px solid #99d535;
  outline-offset: 4px;
}

.home-projects-message {
  width: min(100%, 40rem);
  margin: auto;
  padding: 2rem 1.25rem;
  color: #fff;
  font-family: Montserrat, system-ui, sans-serif;
  text-align: center;
}

#content-corousel {
  background-color: #091b48;
}

#project-carousel[data-project-load-error] {
  background-color: #091b48;
}

#project-carousel[data-project-load-error] [data-project-page-title] {
  font-size: clamp(2rem, 6vw, 4rem);
}

#project-carousel[data-project-load-error] [hidden] {
  display: none !important;
}

#home-projects-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.home-projects-message .home-projects-message__title {
  margin: 0 0 0.75rem;
  padding: 0;
  color: inherit;
  font-family: inherit;
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  font-weight: 700;
  line-height: 1.4;
}

.home-projects-message .home-projects-message__text {
  margin: 0;
  padding: 0;
  color: #d5deee;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.7;
}

.home-projects-message__retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 1.25rem;
  padding: 0.625rem 1.125rem;
  border: 1px solid #99d535;
  border-radius: 0.75rem;
  color: #0b2045;
  background: #99d535;
  font: 600 0.875rem / 1.5 Montserrat, system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.home-projects-message__retry:hover {
  background: #afe55b;
}

.home-projects-message--cards {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 40rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  color: #0f2855;
  background: #fff;
}

.home-projects-message--cards .home-projects-message__text {
  color: #52627a;
}

@keyframes site-splash-enter {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes site-splash-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.09); }
}

@keyframes site-splash-logo {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes site-splash-glow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.06) inset,
      0 18px 40px -12px rgba(0, 0, 0, 0.6),
      0 0 32px 2px rgba(1, 53, 163, 0.45);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.1) inset,
      0 24px 48px -12px rgba(0, 0, 0, 0.6),
      0 0 64px 10px rgba(1, 53, 163, 0.6);
  }
}

@keyframes site-splash-exit {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.25); }
}

@keyframes site-splash-fade-up {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .site-splash,
  .site-splash *,
  .site-splash *::before,
  .site-splash *::after {
    animation: none !important;
    transition: none !important;
  }
}
