:root {
  color-scheme: dark;
  --ink: #08111f;
  --panel: #0d192b;
  --panel-raised: #122138;
  --line: #263750;
  --text: #f3f7fc;
  --muted: #91a2b9;
  --blue: #63a8ff;
  --blue-bright: #9bc8ff;
  --mint: #6ee7c2;
  --danger: #ff8c91;
  --font-body: "DM Sans", sans-serif;
  --font-display: "Manrope", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--ink); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  background:
    linear-gradient(rgba(99, 168, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 168, 255, 0.035) 1px, transparent 1px),
    var(--ink);
  background-size: 48px 48px;
}

button, input { font: inherit; }
button { color: inherit; }

.shell {
  width: min(1180px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar, footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font: 700 17px/1 var(--font-display);
  text-decoration: none;
}

.brand svg { width: 25px; fill: none; stroke: var(--blue); stroke-width: 1.8; }

.privacy {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
}

.privacy span, .state-dot, .live-label span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(110, 231, 194, 0.12);
}

main { display: grid; align-items: center; padding: 72px 0; }

.intro { max-width: 850px; }

.kicker {
  margin: 0 0 22px;
  color: var(--blue-bright);
  font-size: 16px;
  font-weight: 600;
}

h1 {
  margin: 0;
  max-width: 820px;
  font: 700 clamp(50px, 8vw, 102px)/0.97 var(--font-display);
  letter-spacing: -0.06em;
}

.lede {
  max-width: 610px;
  margin: 30px 0 0;
  color: #bdc9d9;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
}

.actions { display: flex; gap: 12px; margin-top: 38px; }

.button {
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.button.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--blue);
  color: #06101d;
}

.button.primary:hover { background: var(--blue-bright); }
.button.primary svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.button.quiet, .button.secondary {
  border-color: var(--line);
  background: var(--panel);
}

.button.quiet:hover, .button.secondary:hover { background: var(--panel-raised); border-color: #3a506e; }

.button:focus-visible, input:focus-visible, .text-button:focus-visible, .room-code:focus-visible {
  outline: 3px solid rgba(99, 168, 255, 0.45);
  outline-offset: 3px;
}

.promise-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 45px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  list-style: none;
}

.promise-list li::before { content: "✓"; margin-right: 8px; color: var(--mint); }

.join-panel {
  max-width: 600px;
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  background: var(--panel);
}

.join-panel label { display: block; margin-bottom: 12px; color: #bdc9d9; }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }

input {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0 16px;
  border: 1px solid #344963;
  border-radius: 7px;
  background: #081321;
  color: var(--text);
  font: 600 20px/1 var(--font-display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

input::placeholder { color: #52647c; }

.session { width: 100%; }

.session-bar, .handoff {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}

.state-wrap { display: flex; align-items: center; gap: 14px; }
.state-wrap .state-dot { background: var(--blue); box-shadow: 0 0 0 4px rgba(99, 168, 255, 0.12); }
.state { margin: 0 0 3px; font-weight: 600; }
.state-detail { margin: 0; color: var(--muted); font-size: 14px; }

.text-button, .room-code {
  padding: 5px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.text-button { color: var(--danger); }

.stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid #2f4460;
  border-radius: 11px;
  background: #03070d;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.28);
}

video { width: 100%; height: 100%; object-fit: contain; background: #03070d; }

.empty-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--muted);
}

.pulse {
  width: 28px;
  height: 28px;
  border: 2px solid var(--blue);
  border-radius: 50%;
  animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
  from { box-shadow: 0 0 0 0 rgba(99, 168, 255, 0.55); }
  to { box-shadow: 0 0 0 22px rgba(99, 168, 255, 0); }
}

.live-label {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(4, 10, 18, 0.84);
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 600;
}

.live-label span { width: 7px; height: 7px; background: #ff6872; box-shadow: none; }

.handoff { gap: 40px; border-bottom: 1px solid var(--line); }
.handoff-label { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.room-code { padding-left: 0; font: 700 28px/1 var(--font-display); letter-spacing: 0.13em; }
.invite-block { display: flex; align-items: center; gap: 18px; }
.invite-block p { color: var(--muted); }

footer {
  min-height: 66px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.prototype { color: #61758f; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: 360px;
  padding: 14px 18px;
  border: 1px solid #3c5575;
  border-radius: 8px;
  background: #172941;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
}

[hidden] { display: none !important; }

@media (max-width: 700px) {
  .shell { width: min(100% - 28px, 1180px); }
  .topbar { min-height: 66px; }
  .privacy { font-size: 12px; }
  main { padding: 50px 0; }
  h1 { font-size: clamp(43px, 14vw, 66px); }
  .actions, .promise-list, .session-bar, .handoff, .invite-block { align-items: stretch; flex-direction: column; }
  .button { width: 100%; }
  .join-row { grid-template-columns: 1fr; }
  .session-bar { gap: 18px; }
  .text-button { align-self: flex-start; padding-left: 0; }
  .handoff { align-items: flex-start; gap: 24px; }
  .invite-block { width: 100%; gap: 8px; }
  footer .prototype { display: none; }
}

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