:root {
  --paper: #faf9f7;
  --card: #ffffff;
  --ink: #16181d;
  --muted: #6b7280;
  --line: #e3e0db;
  --accent: #3b3f8f;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.6 -apple-system, "Segoe UI", system-ui, sans-serif;
}

body.is-locked {
  overflow: hidden;
}

.stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 48px 24px;
}

.lang {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.lang__btn {
  appearance: none;
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 4px 7px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
  cursor: pointer;
}

.lang__btn[aria-pressed="true"] {
  color: var(--accent);
  font-weight: 600;
}

.lang__sep {
  color: var(--line);
  font-size: 12px;
}

.open {
  appearance: none;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 44px;
  font: inherit;
  font-size: 17px;
  cursor: pointer;
  box-shadow:
    0 1px 2px rgba(22, 24, 29, 0.04),
    0 12px 32px -12px rgba(22, 24, 29, 0.18);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.open:hover {
  transform: translateY(-2px);
  border-color: #d3cfc8;
  box-shadow:
    0 1px 2px rgba(22, 24, 29, 0.05),
    0 20px 40px -16px rgba(22, 24, 29, 0.24);
}

.open:active {
  transform: translateY(0);
}

.open:focus-visible,
.lang__btn:focus-visible,
.modal__close:focus-visible,
.ext:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 24, 29, 0.34);
  backdrop-filter: blur(3px);
  animation: fade 0.2s ease;
}

.modal__card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px 28px;
  box-shadow: 0 24px 60px -24px rgba(22, 24, 29, 0.35);
  animation: rise 0.22s ease;
}

.modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal__close:hover {
  color: var(--ink);
}

.ext {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
}

.ext__icon {
  border-radius: 14px;
  margin-bottom: 6px;
}

.ext__name {
  font-size: 19px;
  font-weight: 600;
}

.ext__text {
  color: var(--muted);
  font-size: 14px;
}

.ext__go {
  margin-top: 6px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}

.ext__go::after {
  content: " \2192";
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .open {
    transition: none;
  }

  .modal__backdrop,
  .modal__card {
    animation: none;
  }
}
