.hero-languages {
  position: absolute;
  z-index: 5;
  right: 4.5%;
  bottom: 32px;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid #96c7ee61;
  border-radius: 999px;
  background: #061124d9;
}

.hero-languages a {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  color: #c9d9ed;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .05em;
}

.hero-languages a:hover { background: #1c3856; }
.hero-languages a[aria-current] { background: #b6e3fb; color: #071428; }

@media (max-width: 700px) {
  #top.hero .hero-content h1 { font-size: min(12.8vw, 5.5rem); }

  #top.hero .scroll-prompt {
    left: 0;
    transform: translateY(-50%);
  }

  #top.hero .hero-languages {
    right: max(10px, calc(env(safe-area-inset-right, 0px) + 4px));
    bottom: 28px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  #top.hero .hero-languages::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 5px 2px;
    border: 1px solid #96c7ee61;
    border-radius: 999px;
    background: #061124d9;
    pointer-events: none;
  }

  #top.hero .hero-languages a {
    padding: 7px 3px;
    background-clip: content-box;
    font-size: .6875rem;
  }
}

.language-dialog {
  margin: auto;
  width: min(25rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: clamp(1.25rem, 5vw, 2rem);
  color: var(--text, #edf5ff);
  background: #081528;
  border: 1px solid #7eb7df80;
  border-radius: 16px;
  box-shadow: 0 24px 70px #010611b3;
}

.language-dialog::backdrop { background: #0308169c; backdrop-filter: blur(5px); }
.language-dialog[open] { animation: language-arrive 240ms ease-out both; }
.language-dialog[open][data-closing="true"] { animation: language-leave 240ms ease-in both; }
.language-dialog[data-closing="true"]::backdrop { animation: language-dim-out 240ms ease-in both; }
.language-dialog h2 { font-size: clamp(1.2rem, 4.7vw, 1.5rem); margin-bottom: 1.15rem; }
.language-dialog fieldset { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; border: 0; padding: 0; margin: 0 0 1rem; }
.language-dialog label { position: relative; min-width: 0; }
.language-dialog input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.language-dialog label span {
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: .45rem;
  border: 1px solid #56768f;
  border-radius: 8px;
  color: #d7e7f4;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 650;
}

.language-dialog input:checked + span { background: #183b5b; color: #ecfaff; border-color: #a2dcfc; box-shadow: inset 0 0 0 1px #a2dcfc; }
.language-dialog input:focus-visible + span, .hero-languages a:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.language-dialog .button { width: 100%; justify-content: center; min-height: 48px; font-size: .95rem; }
html:lang(en) .gesture-hint span::after { content: 'Drag to rotate · Pinch to zoom'; }

@keyframes language-arrive { from { opacity: 0; transform: translateY(16px); } }
@keyframes language-leave { to { opacity: 0; transform: translateY(24px); } }
@keyframes language-dim-out { to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .language-dialog[open], .language-dialog[open][data-closing="true"], .language-dialog[data-closing="true"]::backdrop { animation: none; }
}
