:root {
  --bg-1: #06110d;
  --bg-2: #0b1f18;
  --bg-3: #102820;
  --text: #f5fff9;
  --text-soft: rgba(245, 255, 249, 0.78);
  --accent: #00ff7f;
  --border: rgba(255, 255, 255, 0.14);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(
      circle at 12% 14%,
      rgba(0, 255, 127, 0.16),
      transparent 24%
    ),
    radial-gradient(
      circle at 88% 78%,
      rgba(0, 200, 255, 0.12),
      transparent 24%
    ),
    radial-gradient(
      circle at 50% 50%,
      rgba(255, 255, 255, 0.03),
      transparent 45%
    ),
    linear-gradient(
      135deg,
      var(--bg-1) 0%,
      var(--bg-2) 38%,
      var(--bg-3) 72%,
      #07110d 100%
    );
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.05), transparent 40%);
  mix-blend-mode: screen;
  opacity: 0.55;
}

body::after {
  content: "";
  position: fixed;
  inset: -25vmax;
  pointer-events: none;
  z-index: 1;
  opacity: 0.22;
  will-change: transform, background-position, opacity;
  background-image:
    repeating-linear-gradient(
      to right,
      rgba(255, 255, 255, 0.09) 0px,
      rgba(255, 255, 255, 0.09) 1px,
      transparent 1px,
      transparent 34px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.075) 0px,
      rgba(255, 255, 255, 0.075) 1px,
      transparent 1px,
      transparent 34px
    );
  background-position:
    0 0,
    0 0;
  transform: rotate(169deg) translate3d(0, 0, 0) scale(1.02);
  transform-origin: center;
  animation: backgroundGridMotion 36s ease-in-out infinite alternate;
}

@keyframes backgroundGridMotion {
  0% {
    transform: rotate(169deg) translate3d(-18px, -10px, 0) scale(1.02);
    background-position:
      0 0,
      0 0;
    opacity: 0.1;
  }

  50% {
    transform: rotate(169deg) translate3d(8px, 6px, 0) scale(1.06);
    background-position:
      16px 4px,
      4px 16px;
    opacity: 0.15;
  }

  100% {
    transform: rotate(169deg) translate3d(18px, 10px, 0) scale(1.09);
    background-position:
      28px 8px,
      8px 28px;
    opacity: 0.12;
  }
}

.selection-shell {
  position: relative;
  z-index: 2;
  width: min(1160px, 100%);
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 42px;
  opacity: 0;
  transform: translateY(16px);
  animation: heroReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 0.18s both;
}

.hero h1 {
  font-size: clamp(2.2rem, 4vw, 4.1rem);
  line-height: 1.03;
  letter-spacing: -0.04em;
  margin-bottom: 14px;
}

.hero-text {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text-soft);
}

.buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.nav-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 400px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  background: #08120f;
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  appearance: none;
  text-align: left;
  isolation: isolate;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 50px rgba(0, 0, 0, 0.28);
  transition:
    transform 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease,
    filter 0.28s ease,
    opacity 0.28s ease;
  opacity: 0;
  transform: translateY(22px) scale(0.992);
  animation: cardReveal 1.05s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.nav-card:nth-child(1) {
  animation-delay: 0.28s;
}

.nav-card:nth-child(2) {
  animation-delay: 0.4s;
}

.nav-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0) 38%
    ),
    radial-gradient(
      circle at top right,
      rgba(0, 255, 127, 0.16),
      transparent 32%
    );
}

.nav-card:hover {
  transform: translateY(-8px);
  border-color: rgba(0, 255, 127, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    var(--shadow-lg);
}

.nav-card:active {
  transform: translateY(-3px);
}

.nav-card:focus-visible {
  outline: 2px solid rgba(0, 255, 127, 0.85);
  outline-offset: 4px;
}

.nav-card__preview {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.nav-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1);
  filter: brightness(0.64) saturate(1.02);
  transition:
    transform 0.45s ease,
    filter 0.35s ease;
}

.nav-card--immersive .nav-card__image {
  object-position: center top;
}

.nav-card--clean .nav-card__image {
  object-position: center center;
}

.nav-card__preview::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      to top,
      rgba(4, 10, 8, 0.94) 0%,
      rgba(4, 10, 8, 0.84) 24%,
      rgba(4, 10, 8, 0.48) 52%,
      rgba(4, 10, 8, 0.14) 76%,
      rgba(4, 10, 8, 0.02) 100%
    ),
    linear-gradient(
      135deg,
      rgba(0, 255, 127, 0.12) 0%,
      rgba(0, 255, 127, 0) 42%
    );
}

.nav-card:hover .nav-card__image {
  transform: scale(1.05);
  filter: brightness(0.8) saturate(1.08);
}

.nav-card__content,
.nav-card__meta {
  position: relative;
  z-index: 2;
}

.nav-card__content {
  margin-bottom: 14px;
}

.nav-card__title {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-size: clamp(1.7rem, 2.4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #ffffff;
  text-shadow:
    0 2px 12px rgba(0, 0, 0, 0.46),
    0 0 24px rgba(0, 255, 127, 0.12);
}

.nav-card__version {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #63ffad;
}

.nav-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-card__meta span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(8, 18, 14, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  color: #f3fff8;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

/* Loading */

body.is-loading .nav-card {
  pointer-events: none;
}

body.is-loading .nav-card:not(.is-loading) {
  opacity: 0.56;
  filter: grayscale(0.18);
}

.nav-card:disabled {
  cursor: progress;
}

.nav-card.is-loading::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 18px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--accent);
  animation: nav-card-spin 0.8s linear infinite;
  z-index: 3;
}

.nav-card.is-loading .nav-card__title::after {
  content: " · ouverture...";
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(245, 255, 249, 0.76);
}

.page-footer {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  opacity: 0;
  transform: translateY(12px);
  animation: footerReveal 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.62s both;
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 18, 14, 0.58);
  backdrop-filter: blur(10px);
  color: #f5fff9;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}

.github-link:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 255, 127, 0.36);
  background: rgba(10, 22, 17, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 16px 30px rgba(0, 0, 0, 0.24);
}

.github-link:focus-visible {
  outline: 2px solid rgba(0, 255, 127, 0.85);
  outline-offset: 4px;
}

.github-link__icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: #ffffff;
}

@keyframes heroReveal {
  from {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.992);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes footerReveal {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes nav-card-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::after {
    animation: none;
    transform: rotate(169deg) scale(1.04);
    opacity: 0.12;
  }

  .hero,
  .nav-card,
  .page-footer {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@media (max-width: 900px) {
  .selection-shell {
    min-height: auto;
    justify-content: flex-start;
  }

  .buttons {
    grid-template-columns: 1fr;
  }

  .hero {
    margin-bottom: 24px;
  }

  .nav-card {
    min-height: 340px;
  }
}

@media (max-width: 560px) {
  body {
    padding: 16px;
  }

  .hero h1 {
    font-size: 2.1rem;
  }

  .hero-text {
    font-size: 0.98rem;
  }

  .nav-card {
    min-height: 280px;
    padding: 18px;
    border-radius: 24px;
  }

  .nav-card__title {
    font-size: 1.45rem;
  }

  .nav-card__meta span {
    font-size: 0.76rem;
    padding: 7px 10px;
  }

  .page-footer {
    margin-top: 18px;
  }

  .github-link {
    min-height: 48px;
    padding: 0 16px;
    font-size: 0.9rem;
  }

  .github-link__icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }
}
