:root {
  color-scheme: dark;
  --ink: #0a0a0a;
  --surface: #17171b;
  --surface-raised: #202026;
  --surface-control: #292930;
  --text: #f5f5f7;
  --muted: #b2b2bc;
  --line: #5e5e69;
  --pink: #ff1a4a;
  --cyan: #00e5ff;
  --danger: #d4143a;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ink); }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 0%, #202027 0, var(--ink) 58%);
  color: var(--text);
  font: 400 1rem/1.55 var(--font);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; }
button {
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 650;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 140ms ease, filter 140ms ease, border-color 140ms ease;
}
button:hover { filter: brightness(1.08); }
button:active { transform: scale(.985); }
button:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}
input {
  width: 100%;
  min-height: 50px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--ink);
  color: var(--text);
  line-height: 1.4;
}
label { font-weight: 650; line-height: 1.35; }
h1, h2, h3, p { margin-top: 0; }

.home {
  width: min(calc(100% - 40px), 576px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(36px, 8vh, 76px) 0 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.brand { display: grid; justify-items: center; margin-bottom: var(--space-6); }
.logo { display: block; border-radius: 18px; box-shadow: 0 12px 44px #0008; }
.wordmark {
  margin: 14px 0 0;
  color: var(--cyan);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .19em;
  line-height: 1.3;
}
.home h1 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(2.35rem, 7vw, 3.35rem);
  font-weight: 750;
  line-height: 1.04;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.home h1 span { color: var(--muted); font-weight: 550; }
.lede {
  max-width: 40ch;
  margin: 18px 0 28px;
  color: var(--muted);
  font-size: clamp(.98rem, 2.3vw, 1.06rem);
  line-height: 1.6;
  text-wrap: pretty;
}

.install-card, .start-card, .invite-form {
  width: 100%;
  margin: 0 0 14px;
  padding: 20px;
  border: 1px solid #ffffff1c;
  border-radius: 18px;
  background: linear-gradient(145deg, #1b1b20, var(--surface) 70%);
  text-align: left;
}
.install-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-color: #00e5ff3a;
}
.install-card h2, .start-card h2 {
  margin: 0 0 5px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.015em;
}
.install-card p, .card-copy {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
}
.install-card .secondary { flex: 0 0 auto; }
.start-card { display: grid; gap: 12px; }
.invite-form { display: grid; gap: 12px; }
.primary {
  width: 100%;
  background: linear-gradient(100deg, var(--pink), #ff6eb4, var(--cyan));
  color: var(--ink);
  font-size: 1rem;
  font-weight: 750;
}
.secondary {
  background: var(--surface-control);
  border-color: #ffffff24;
  color: var(--text);
}
.fine { color: var(--muted); font-size: .82rem; line-height: 1.5; }
.error { margin: 0; color: #ff9aab; font-size: .9rem; }
.account-link {
  margin-top: 8px;
  color: var(--muted);
  font-size: .86rem;
  text-underline-offset: 4px;
}
.account-link:hover { color: var(--cyan); }
.privacy { max-width: 48ch; margin: 20px 0 0; }

.host-call {
  width: min(100%, 1040px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 16px) max(20px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 24px) max(20px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.call-head { min-height: 40px; display: flex; align-items: center; gap: 16px; }
.call-head p { margin: 0 auto 0 0; color: var(--muted); font-size: .92rem; }
.call-head time { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.back-home { color: var(--text); font-size: .94rem; font-weight: 700; text-decoration: none; }
.video-stage {
  position: relative;
  height: min(62vh, 650px);
  min-height: 40vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid #ffffff14;
  border-radius: 20px;
  background: #000;
}
.video-stage > video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.remote-wait { position: absolute; inset: auto 16px 18px; margin: 0; color: #d0d0d8; font-size: .92rem; text-align: center; pointer-events: none; }
.host-self {
  position: absolute;
  top: 16px;
  right: 16px;
  width: clamp(112px, 23vw, 208px);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid #ffffff60;
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: 0 8px 28px #0006;
}
.host-self video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.host-self span { position: absolute; bottom: 7px; left: 7px; padding: 2px 7px; border-radius: 6px; background: #000b; font-size: .76rem; line-height: 1.35; }
.invite-share, .host-notes, .final-notes {
  padding: 18px 20px;
  border: 1px solid #ffffff1c;
  border-radius: 16px;
  background: var(--surface);
}
.share-row { display: flex; align-items: center; gap: 8px; }
.share-row input { flex: 1; min-width: 0; }
.invite-share label { display: block; margin-bottom: 8px; }
.invite-share p { margin: 8px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.call-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.call-controls button { min-width: 112px; }
.hangup { background: var(--danger); color: #fff; }
.notes-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.notes-head strong { font-size: .98rem; }
.text-button { min-height: 40px; padding: 6px 10px; background: transparent; color: var(--cyan); }
.notes-disclosure { margin: 12px 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.host-notes .fine { margin: 8px 0 0; }
.host-notes ol, .final-notes ol { max-height: 190px; overflow: auto; margin: 12px 0 0; padding-left: 24px; }
.host-notes li, .final-notes li { padding: 3px 0; line-height: 1.5; }
.final-notes h2 { margin: 0 0 8px; font-size: 1.35rem; letter-spacing: -.02em; }
.final-notes h3 { margin: 16px 0 6px; font-size: 1rem; }
.final-notes p { line-height: 1.6; }
.final-notes details { margin: 14px 0; }
.final-notes summary { min-height: 44px; padding: 10px 0; cursor: pointer; font-weight: 650; }
.final-notes .share-row { margin-top: 14px; }

@media (max-width: 560px) {
  .home { width: min(calc(100% - 32px), 440px); padding-top: 32px; }
  .brand { margin-bottom: 20px; }
  .home h1 { font-size: clamp(2.25rem, 10vw, 2.8rem); }
  .lede { margin: 14px 0 22px; }
  .install-card, .start-card, .invite-form { padding: 18px; border-radius: 16px; }
  .install-card { align-items: stretch; flex-direction: column; gap: 12px; }
  .install-card button { width: 100%; }
  .host-call { gap: 12px; padding-right: max(16px, env(safe-area-inset-right)); padding-left: max(16px, env(safe-area-inset-left)); }
  .video-stage { height: 52vh; min-height: 290px; border-radius: 16px; }
  .host-self { top: 12px; right: 12px; }
  .call-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .call-controls button { width: 100%; min-width: 0; }
  .call-controls .hangup { grid-column: span 2; }
  .share-row { flex-wrap: wrap; }
  .share-row input { flex-basis: 100%; }
  .invite-share .share-row button { flex: 1; }
  .invite-share, .host-notes, .final-notes { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
