

body.is-locked {
  overflow: hidden;
}

.modal {
  width: min(100% - var(--gutter) * 2, 540px);
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;

  opacity: 0;
  scale: 0.97;
  translate: 0 10px;
  transition:
    opacity 220ms var(--ease),
    scale 220ms var(--ease),
    translate 220ms var(--ease),
    overlay 220ms allow-discrete,
    display 220ms allow-discrete;
}

.modal[open] {
  opacity: 1;
  scale: 1;
  translate: 0 0;
}

@starting-style {
  .modal[open] {
    opacity: 0;
    scale: 0.97;
    translate: 0 10px;
  }
}

.modal::backdrop {
  background: #1111140a;
  transition:
    background 220ms var(--ease),
    backdrop-filter 220ms var(--ease),
    overlay 220ms allow-discrete,
    display 220ms allow-discrete;
}

.modal[open]::backdrop {
  background: #11111466;
  backdrop-filter: blur(6px);
}

@starting-style {
  .modal[open]::backdrop {
    background: #1111140a;
    backdrop-filter: blur(0);
  }
}

.modal__panel {
  position: relative;
  max-height: calc(100dvh - 48px);
  padding: 28px;
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: 0 24px 60px #1111142e;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: var(--surface-sunken);
  color: var(--ink-soft);
}

.modal__close .icon {
  font-size: 17px;
}

.modal__close:hover .icon,
.modal__close:focus-visible .icon {
  rotate: 90deg;
}

.modal__head {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding-right: 48px;
}

.modal__heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  gap: 2px;
  min-width: 0;
}

.modal__verified {
  order: -1;
  margin-bottom: 12px;
}

.modal__title {
  font-size: clamp(24px, 4.4vw, 30px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.modal__publisher {
  color: var(--ink-soft);
  font-size: 13px;
}

.modal__description {
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
}

.modal__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
}

.modal__fact {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 0 14px;
  border-radius: var(--r-xs);
  background: var(--surface-sunken);
}

.modal__fact-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: var(--r-tile-sm);
  background: var(--surface);
  color: var(--ink-soft);
}

.modal__field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.modal__field dt {
  color: var(--ink-soft);
  font-size: 11px;
}

.modal__field dd {
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.modal__password {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--r-xs);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-sunken));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent);
}

.modal__password[hidden] {
  display: none;
}

.modal__password-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-tile-sm);
  background: var(--surface);
  color: var(--accent);
}

.modal__password-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.modal__password-label {
  color: var(--ink-soft);
  font-size: 11px;
}

.modal__password code {
  color: var(--ink);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.modal__password-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
  transition: color 220ms var(--ease), transform 180ms var(--ease-wave);
}

.modal__password-button:hover {
  color: var(--accent);
}

.modal__password-button:active {
  transform: scale(0.97);
}

.modal__password-button .icon {
  font-size: 14px;
}

.modal__cta {
  width: 100%;
  min-height: 54px;
  margin-top: 22px;
  font-weight: 500;
  --wave: var(--accent-hover);
  --wave-ink: var(--on-dark);
}

.modal__foot {
  margin-top: 14px;
  color: var(--ink-faint);
  font-size: 12px;
  text-align: center;
}

.modal__source-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-soft);
  font-weight: 500;
  transition: color 220ms var(--ease);
}

.modal__source-link:hover {
  color: var(--accent);
}

.modal__foot-icon {
  font-size: 13px;
  transition: translate 260ms var(--ease-wave);
}

.modal__source-link:hover .modal__foot-icon {
  translate: 2px -2px;
}

@media (max-width: 480px) {
  .modal__panel {
    padding: 22px;
  }

  .modal__head {
    gap: 14px;
  }

  .modal__head .tile--xl {
    width: 76px;
    height: 76px;
    font-size: 28px;
  }

  .modal__facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .modal__password {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .modal__password-button {
    grid-column: 1 / -1;
  }
}
