:root {
  --bg: #0b0b0b;
  --panel: #111111;
  --line: #3a3a3a;
  --border: #2a2a2a;
  --text: #e8e8e8;
  --muted: #8a8a8a;
  --faint: #4a4a4a;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Nunito Sans", system-ui, -apple-system, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12vh 0 6vh;
  animation: rise 1.4s var(--ease) both;
}

h1 { margin: 0; }

.logo {
  display: block;
  width: clamp(200px, 22vw, 280px);
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* Access key */
.access {
  margin-top: clamp(56px, 9vh, 88px);
  width: min(280px, 100%);
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  transition: border-color .4s var(--ease);
}
.access:focus-within { border-color: var(--muted); }
.access.shake { animation: shake .45s var(--ease); }

.access label {
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.access input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  padding: 0;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  letter-spacing: .25em;
  caret-color: var(--muted);
}

/* iOS Safari zooms in on focused inputs smaller than 16px */
@media (hover: none) and (pointer: coarse) {
  .access input { font-size: 16px; }
}

.status {
  height: 16px;
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  transition: opacity .6s var(--ease);
}
.status.show { opacity: 1; }

.invite {
  margin-top: 14px;
  background: none;
  border: 0;
  padding: 8px 4px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .4s var(--ease);
}
.invite:hover, .invite:focus-visible { color: var(--text); }
.invite:focus-visible { outline: 1px solid var(--faint); outline-offset: 4px; }

footer {
  padding: 24px 0 calc(24px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  animation: fade 2s .4s var(--ease) both;
}
footer .sep { margin: 0 .9em; }

/* Contact dialog */
dialog {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  opacity: 0;
  transform: translateY(8px) scale(.98);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
dialog::backdrop {
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .45s var(--ease);
}
dialog.visible { opacity: 1; transform: none; }
dialog.visible::backdrop { opacity: 1; }

.dialog-body {
  position: relative;
  padding: 48px 36px 44px;
  text-align: center;
}

.dialog-body h2 {
  margin: 0 0 18px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
}

.dialog-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  letter-spacing: .04em;
}

.dialog-body a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color .4s var(--ease);
}
.dialog-body a:hover, .dialog-body a:focus-visible { border-color: var(--text); outline: none; }

.close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  font: inherit;
  font-size: 20px;
  font-weight: 200;
  line-height: 1;
  transition: color .3s var(--ease);
}
.close:hover, .close:focus-visible { color: var(--text); outline: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
