@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --night: #050a13;
  --ink: #07101f;
  --panel: rgba(11, 24, 43, 0.78);
  --line: rgba(163, 198, 233, 0.14);
  --muted: #8294aa;
  --paper: #f4f8fc;
  --signal: #3bb8ff;
  --signal-light: #8cd8ff;
  --error: #ff8f9b;
  --shadow: rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--night);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--paper);
  background:
    radial-gradient(circle at 15% 10%, rgba(49, 104, 161, 0.22), transparent 32rem),
    radial-gradient(circle at 88% 86%, rgba(26, 95, 148, 0.16), transparent 29rem),
    linear-gradient(145deg, var(--ink), var(--night) 66%);
  font-family: "Manrope", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  content: "";
  opacity: 0.075;
  pointer-events: none;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-shell {
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.brand-row,
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--paper);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-mark {
  position: relative;
  width: 32px;
  height: 26px;
  border-radius: 10px 10px 10px 3px;
  background: var(--signal);
  box-shadow: 0 0 32px rgba(59, 184, 255, 0.22);
}

.brand-mark::after {
  position: absolute;
  right: 7px;
  bottom: -5px;
  width: 9px;
  height: 9px;
  background: var(--signal);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  content: "";
}

.presence {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #a8b8c9;
  font-size: 0.82rem;
  font-weight: 600;
}

.presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #58e6aa;
  box-shadow: 0 0 0 5px rgba(88, 230, 170, 0.1), 0 0 18px rgba(88, 230, 170, 0.38);
}

main {
  display: grid;
  place-items: center;
  padding: 44px 0;
}

.chat-window {
  position: relative;
  width: min(100%, 720px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: 0 32px 90px var(--shadow), inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.window-bar {
  height: 58px;
  padding: 0 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 10, 19, 0.28);
}

.window-dots {
  display: flex;
  gap: 7px;
}

.window-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #314156;
}

.room-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9dafc3;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.lock-icon {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.screen {
  min-height: 450px;
}

.join-screen {
  padding: clamp(48px, 9vw, 84px) clamp(24px, 8vw, 92px) 46px;
}

.join-screen[hidden],
.reveal-screen[hidden] {
  display: none;
}

.intro {
  max-width: 520px;
  margin: 0 0 43px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 510px;
  margin-bottom: 18px;
  font-size: clamp(2.35rem, 7vw, 4.25rem);
  line-height: 0.99;
  letter-spacing: -0.067em;
}

.intro p {
  max-width: 450px;
  margin-bottom: 0;
  color: #9aabbd;
  font-size: clamp(0.98rem, 2vw, 1.08rem);
  line-height: 1.7;
}

.join-form {
  width: 100%;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  color: #c9d4e0;
  font-size: 0.82rem;
  font-weight: 700;
}

.field-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.input-shell {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 58px;
  padding: 0 18px;
  border: 1px solid rgba(161, 193, 224, 0.18);
  border-radius: 15px;
  background: rgba(4, 11, 21, 0.64);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.input-shell:focus-within {
  border-color: rgba(59, 184, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(59, 184, 255, 0.1);
}

.at-sign {
  flex: 0 0 auto;
  margin-right: 8px;
  color: var(--signal);
  font-weight: 800;
}

input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--paper);
  background: transparent;
  font-size: 1rem;
  font-weight: 600;
}

input::placeholder {
  color: #51637a;
  font-weight: 500;
}

.continue-button {
  height: 58px;
  padding: 0 24px;
  border: 0;
  border-radius: 15px;
  color: #02111c;
  background: var(--signal);
  box-shadow: 0 12px 32px rgba(16, 134, 202, 0.21);
  cursor: pointer;
  font-weight: 800;
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.continue-button:hover {
  background: var(--signal-light);
  box-shadow: 0 15px 36px rgba(16, 134, 202, 0.28);
  transform: translateY(-1px);
}

.continue-button:active {
  transform: translateY(1px);
}

.continue-button:focus-visible,
.profile-link:focus-visible,
.retry-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

.continue-button:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.form-meta {
  min-height: 22px;
  margin: 12px 2px 0;
  color: #64778e;
  font-size: 0.75rem;
  line-height: 1.45;
}

.form-meta.is-error {
  color: var(--error);
}

.reveal-screen {
  position: relative;
  min-height: 450px;
  padding: clamp(46px, 7vw, 62px) clamp(24px, 7vw, 72px) 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 84% 20%, rgba(59, 184, 255, 0.13), transparent 20rem),
    linear-gradient(135deg, rgba(10, 31, 54, 0.3), transparent 65%);
}

.reveal-screen::before {
  position: absolute;
  top: 44px;
  right: 50px;
  width: 68px;
  height: 68px;
  border: 1px solid rgba(59, 184, 255, 0.2);
  border-radius: 50%;
  box-shadow: 0 0 0 12px rgba(59, 184, 255, 0.035), 0 0 0 24px rgba(59, 184, 255, 0.02);
  content: ":)";
  display: grid;
  place-items: center;
  color: var(--signal);
  font-size: 1rem;
  font-weight: 800;
  transform: rotate(8deg);
}

.reveal-kicker {
  margin-bottom: 17px;
  color: var(--signal-light);
  font-size: 0.85rem;
  font-weight: 700;
}

h2 {
  max-width: 570px;
  margin-bottom: 28px;
  font-size: clamp(2rem, 4.1vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.057em;
}

.reveal-copy {
  max-width: 560px;
  margin-bottom: 14px;
  color: #9db0c4;
  font-size: clamp(0.94rem, 2vw, 1.05rem);
  line-height: 1.65;
}

.profile-link {
  position: relative;
  width: fit-content;
  margin-top: 4px;
  color: var(--paper);
  font-size: clamp(1.12rem, 3vw, 1.45rem);
  font-weight: 800;
  text-decoration: none;
}

.profile-link span {
  color: var(--signal);
}

.profile-link::after {
  position: absolute;
  right: 0;
  bottom: -5px;
  left: 0;
  height: 2px;
  background: var(--signal);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.profile-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.retry-button {
  width: fit-content;
  margin-top: 30px;
  padding: 0;
  border: 0;
  color: #667c92;
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
}

.retry-button:hover {
  color: #b5c3d2;
}

.reveal-screen.is-entering > * {
  animation: reveal-in 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.reveal-screen.is-entering > :nth-child(2) { animation-delay: 55ms; }
.reveal-screen.is-entering > :nth-child(3) { animation-delay: 110ms; }
.reveal-screen.is-entering > :nth-child(4) { animation-delay: 155ms; }
.reveal-screen.is-entering > :nth-child(5) { animation-delay: 200ms; }

@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.footer-row {
  color: #52657a;
  font-size: 0.72rem;
  font-weight: 600;
}

.footer-row p {
  margin: 0;
}

@media (max-width: 620px) {
  .site-shell {
    width: min(100% - 24px, 720px);
    padding: 18px 0;
  }

  main {
    padding: 28px 0;
  }

  .chat-window,
  .input-shell,
  .continue-button {
    border-radius: 13px;
  }

  .chat-window {
    border-radius: 22px;
  }

  .join-screen {
    min-height: 480px;
    padding-top: 58px;
  }

  .field-wrap {
    grid-template-columns: 1fr;
  }

  .continue-button {
    width: 100%;
  }

  .reveal-screen::before {
    top: 34px;
    right: 29px;
    width: 52px;
    height: 52px;
  }

  .footer-row p:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
