/* ===== Tokens ===== */
:root {
  --ink: #0A0A0C;
  --panel: #131316;
  --panel-2: #1A1A1E;
  --line: #262629;
  --paper: #EDEBE6;
  --mist: #8C8C92;
  --red: #C22128;
  --red-bright: #E8434A;
  --red-deep: #4A0C0F;
  --live: #4E8F6B;

  --display: "Space Grotesk", "Arial Narrow", sans-serif;
  --body: "Inter", -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 7px;
  --radius-lg: 11px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

.hidden { display: none !important; }

button { font-family: var(--body); cursor: pointer; }

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 1px solid var(--red-bright);
  outline-offset: 2px;
}

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

input[type="text"] {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 13px 16px;
  font-size: 15px;
  font-family: var(--body);
  width: 100%;
}
input[type="text"]:focus { border-color: var(--red-deep); }
input[type="text"]::placeholder { color: var(--mist); }

.btn {
  border: none;
  border-radius: var(--radius);
  padding: 14px 22px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-family: var(--body);
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--red); color: #100404; }
.btn-primary:hover { background: var(--red-bright); }
.btn-ghost { background: transparent; color: var(--paper); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--red); color: var(--red-bright); }
.btn-danger { background: transparent; color: var(--red-bright); border: 1px solid var(--red-deep); }
.btn-danger:hover { background: rgba(227,36,43,0.1); }
.btn-sm { padding: 8px 14px; font-size: 12.5px; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
}

/* ===== Shell / layout ===== */
.screen { min-height: 100dvh; width: 100%; display: flex; flex-direction: column; }
.wrap { max-width: 600px; margin: 0 auto; width: 100%; padding: 0 24px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--paper);
}
.wordmark b { color: var(--red); font-weight: 700; }

.topbar-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--mist);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 12px;
}

/* ===== Landing / hero ===== */
.hero-shell { position: relative; overflow: hidden; }
#hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,12,0.4) 0%, rgba(10,10,12,0.85) 75%, var(--ink) 100%);
  pointer-events: none;
}
.hero { position: relative; z-index: 1; padding: 68px 0 72px; }

.section-title {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 8px 0 26px;
  color: var(--paper);
}

.link-cta {
  display: block;
  margin: 16px auto 0 0;
  background: none;
  border: none;
  color: var(--mist);
  font-family: var(--body);
  font-size: 13.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px 0;
}
.link-cta:hover { color: var(--red-bright); }

.glimpse { padding: 58px 0 8px; }

.stamp {
  position: absolute;
  top: 0;
  right: 24px;
  border: 1.5px solid var(--red);
  color: var(--red);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 3px;
  opacity: 0.85;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(30px, 6.4vw, 43px);
  font-weight: 700;
  line-height: 1.14;
  margin: 20px 0 16px;
  letter-spacing: -0.01em;
}
.hero h1 em { font-style: normal; color: var(--red); }
.hero p.sub {
  color: var(--mist);
  font-size: 16px;
  max-width: 44ch;
  margin: 0 0 32px;
}

/* Signature element: an identity gets redacted, then settles into an alias */
.roster-mock {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin: 0 0 8px;
}
.roster-mock .roster-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mist);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.roster-mock .live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
  display: inline-block;
  margin-right: 6px;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.mock-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.mock-row:last-child { border-bottom: none; }
.mock-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.redact-bar {
  height: 10px;
  border-radius: 3px;
  background: #1F1F22;
  border: 1px solid var(--line);
  width: var(--w, 70%);
}
.alias-reveal {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--red-bright);
  opacity: 0;
  animation: revealIn 0.5s ease forwards;
}
.mock-row:nth-child(1) .alias-reveal { animation-delay: 0.5s; }
.mock-row:nth-child(2) .alias-reveal { animation-delay: 1.1s; }
.mock-row:nth-child(3) .alias-reveal { animation-delay: 1.7s; }
@keyframes revealIn { to { opacity: 1; } }

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

.how { padding: 54px 0 68px; border-top: 1px solid var(--line); margin-top: 44px; }
.how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.how-card {
  background: var(--panel);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.how-card .num { font-family: var(--mono); color: var(--red); font-size: 11.5px; letter-spacing: 0.06em; }
.how-card strong { color: var(--paper); font-size: 15px; font-weight: 600; }
.how-card span:not(.num) { color: var(--mist); font-size: 13.5px; line-height: 1.5; }

@media (max-width: 560px) {
  .how-grid { grid-template-columns: 1fr; }
}

/* ===== Panels (setup / waiting rooms) ===== */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
}
.panel + .panel { margin-top: 14px; }
.panel h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  margin: 0 0 6px;
}
.panel .desc { color: var(--mist); font-size: 14px; margin: 0 0 18px; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 11px;
  color: var(--mist);
  margin-bottom: 7px;
  font-family: var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.link-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.link-box input {
  background: none; border: none; padding: 0; color: var(--red-bright);
  font-family: var(--mono); font-size: 13px;
}
.link-box input:focus-visible { outline: none; }

.request-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.request-item:last-child { border-bottom: none; }
.request-name { font-weight: 600; font-size: 15px; }
.request-meta { font-family: var(--mono); font-size: 11px; color: var(--mist); }
.alias-input { width: 130px; padding: 8px 10px; font-size: 12px; }
.request-actions { display: flex; gap: 8px; margin-left: auto; }

.empty-note { color: var(--mist); font-size: 13.5px; padding: 6px 0; }

.approved-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--live);
  border: 1px solid rgba(78,143,107,0.4);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
}

.center-col { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 40px 0 60px; }

.status-line {
  display: flex; align-items: center; gap: 8px;
  color: var(--mist);
  font-size: 13.5px;
  margin: 22px 0;
}
.spinner {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--red);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Call screen ===== */
.call-screen { background: var(--ink); }
.call-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.call-room-tag {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--mist);
  display: flex; align-items: center; gap: 8px;
}
.role-badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--red);
  color: var(--red-bright);
  border-radius: 20px;
  padding: 3px 10px;
}
.role-badge.guest { border-color: var(--line); color: var(--mist); }

.tiles {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 16px;
  align-content: start;
}

.tile {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  aspect-ratio: 4/3;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.tile video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.tile .no-video-fallback {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-size: 18px;
  color: var(--red-bright);
}
.tile-label {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(10,10,12,0.82);
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 6px;
}
.tile-label .real-name { color: var(--mist); font-size: 10px; }
.tile-muted-dot {
  position: absolute; top: 10px; right: 10px;
  background: var(--red);
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
}

.call-controls { display: flex; justify-content: center; gap: 10px; padding: 16px; border-top: 1px solid var(--line); }
.icon-btn {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.icon-btn.active-off { background: var(--red); border-color: var(--red); }
.icon-btn.leave { background: var(--red); border-color: var(--red); }
.icon-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.host-dock { border-top: 1px solid var(--line); padding: 14px 18px; max-height: 34dvh; overflow-y: auto; }
.host-dock h3 {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
  margin: 0 0 10px;
}
.host-dock-bar { display: flex; justify-content: flex-end; padding-bottom: 8px; }
.host-row .request-name { font-size: 14px; }
.host-controls { display: flex; gap: 6px; margin-left: auto; }
.ctrl-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--paper);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.ctrl-btn.ctrl-active { background: var(--red); border-color: var(--red); }
.ctrl-btn.ctrl-danger { color: var(--red-bright); }
.ctrl-btn.ctrl-danger:hover { background: rgba(227,36,43,0.14); border-color: var(--red-deep); }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--paper);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  max-width: 90vw;
  z-index: 50;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

footer.foot {
  padding: 26px 0 34px;
  color: var(--mist);
  font-size: 12.5px;
  border-top: 1px solid var(--line);
}
footer.foot .signature {
  margin-top: 8px;
  font-size: 11px;
  opacity: 0.6;
}

@media (max-width: 480px) {
  .wrap { padding: 0 18px; }
  .panel { padding: 20px; }
  .stamp { right: 18px; }
}
