:root {
  --bg: #020405;
  --panel: rgba(8, 15, 19, 0.82);
  --panel-solid: #081014;
  --tile: #050a0d;
  --line: rgba(126, 190, 218, 0.14);
  --line-strong: rgba(126, 190, 218, 0.3);
  --text: #e9f2f5;
  --muted: #8ea6b0;
  --dim: #5d7580;
  --accent: #6fb6d6;
  --accent-ink: #021015;
  --rec: #ff2a3d;
  --speak: #59e0a0;
  --mono: 'Space Mono', ui-monospace, Menlo, monospace;
  --sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --radius: 22px;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: 110px;
}
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

#field {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: -1;
  opacity: 0.8;
}
/* calm the dots behind the hero copy and footer so text stays readable */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(70% 55% at 22% 24%, rgba(2,4,5,0.88), transparent 70%),
    radial-gradient(60% 50% at 75% 30%, rgba(2,4,5,0.92), transparent 75%);
}

/* ── glass pill, shared by chips/tags ─────────────────────── */
.chip, .tag, .name-tag, .code {
  font-family: var(--mono);
  letter-spacing: 0.01em;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  font-size: 13px;
  color: var(--muted);
}
.chip svg, .ctl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ── top bar ──────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px var(--gutter);
  background: linear-gradient(to bottom, rgba(2,4,5,0.92), rgba(2,4,5,0.6) 70%, transparent);
  backdrop-filter: blur(6px);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-family: var(--mono); font-weight: 700; font-size: 18px;
  letter-spacing: -0.01em;
}
.bars { display: inline-flex; align-items: center; gap: 3px; height: 20px; }
.bars i { display: block; width: 3px; border-radius: 2px; background: var(--accent); animation: eq 1.4s ease-in-out infinite; }
.bars i:nth-child(1) { height: 40%; animation-delay: -0.2s; }
.bars i:nth-child(2) { height: 90%; animation-delay: -0.6s; }
.bars i:nth-child(3) { height: 60%; animation-delay: -0.9s; }
.bars i:nth-child(4) { height: 30%; animation-delay: -0.4s; }
@keyframes eq { 50% { transform: scaleY(0.45); } }

.meeting-meta { display: flex; gap: 18px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.meeting-title { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.meeting-title svg { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; }
.meeting-title .private, .meeting-title .sched { font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.meeting-title .private { border-color: rgba(255,42,61,.45); color: #ff8a95; }
.rec { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.rec-dot, .live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rec); box-shadow: 0 0 0 0 rgba(255,42,61,0.6); animation: pulse 1.8s infinite; display: inline-block; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(255,42,61,0); } 100% { box-shadow: 0 0 0 0 rgba(255,42,61,0); } }

/* ── hero / stage ─────────────────────────────────────────── */
.stage {
  min-height: min(calc(100vh - 70px), 1000px);
  padding: clamp(24px, 6vh, 72px) var(--gutter) 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-content: center;
  max-width: 1440px; margin: 0 auto;
}
.kicker { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px; font-family: var(--mono); font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
h1 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(40px, 7.2vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.035em;
}
.lede { text-shadow: 0 1px 12px #020405, 0 0 2px #020405; max-width: 560px; color: var(--muted); font-size: clamp(16px, 1.6vw, 19px); margin: 18px 0 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  border-radius: 999px;
  font: 600 15px/1 var(--sans);
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--text); color: var(--bg); }
.btn.primary:hover { background: #fff; }
.btn.ghost { background: var(--panel); border-color: var(--line-strong); color: var(--text); backdrop-filter: blur(8px); }
.btn.ghost:hover { border-color: var(--accent); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2vw, 24px); }
.tile {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 40%, #0c1a20 0%, var(--tile) 70%);
  border: 1px solid var(--line);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.tile canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.55; }
.tile.speaking { border-color: var(--speak); box-shadow: 0 0 0 1px var(--speak), 0 0 40px -10px rgba(89,224,160,0.45); }
.avatar {
  position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%);
  width: clamp(64px, 11vw, 132px); aspect-ratio: 1;
  border-radius: 50%;
  display: grid; place-items: center;
  font: 700 clamp(22px, 3.4vw, 42px)/1 var(--mono);
  color: var(--text);
  background: #0e1d24;
  border: 1px solid var(--line-strong);
}
.avatar::after {
  content: ''; position: absolute; inset: -10px; border-radius: 50%;
  border: 2px solid var(--speak); opacity: 0; transform: scale(0.9);
  transition: opacity .2s, transform .2s;
}
.tile.speaking .avatar::after { opacity: 0.7; transform: scale(1); animation: ring 1.2s ease-in-out infinite; }
@keyframes ring { 50% { transform: scale(1.08); opacity: 0.35; } }
.name-tag {
  position: absolute; left: 14px; bottom: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(2,4,5,0.72); backdrop-filter: blur(8px);
  font-size: clamp(11px, 1.1vw, 14px);
}
.name-tag .mic { width: 14px; height: 14px; display: inline-flex; gap: 2px; align-items: flex-end; }
.name-tag .mic i { width: 3px; height: 30%; background: var(--dim); border-radius: 2px; }
.tile.speaking .name-tag .mic i { background: var(--speak); animation: eq .8s ease-in-out infinite; }
.tile.speaking .name-tag .mic i:nth-child(2) { height: 100%; animation-delay: -.3s; }
.tile.speaking .name-tag .mic i:nth-child(3) { height: 60%; animation-delay: -.5s; }
.tile .role { position: absolute; right: 14px; top: 14px; font-family: var(--mono); font-size: 11px; color: var(--dim); }

.captions {
  justify-self: center;
  display: flex; align-items: flex-start; gap: 12px;
  max-width: 820px; width: 100%;
  padding: 12px 18px;
  background: rgba(0,0,0,0.72);
  border-radius: 12px;
  min-height: 52px;
}
.cc { flex: none; font: 700 11px/1 var(--mono); border: 1px solid var(--muted); color: var(--muted); border-radius: 4px; padding: 4px 5px; margin-top: 3px; }
#caption { margin: 0; font-size: clamp(14px, 1.5vw, 17px); }
#caption b { font-family: var(--mono); font-weight: 700; color: var(--accent); margin-right: 8px; font-size: 0.85em; text-transform: uppercase; }
#caption span::after { content: '▍'; color: var(--muted); margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

@media (min-width: 1100px) {
  .stage-copy { display: grid; grid-template-columns: 1.3fr 1fr; column-gap: 56px; align-items: end; }
  .stage-copy .kicker { grid-column: 1; grid-row: 1; }
  .stage-copy h1 { grid-column: 1; grid-row: 2 / span 2; }
  .stage-copy .lede { grid-column: 2; grid-row: 2; margin: 0; }
  .stage-copy .cta-row { grid-column: 2; grid-row: 3; }
  .tile { aspect-ratio: 16 / 9; }
}

/* ── panels ───────────────────────────────────────────────── */
.panel {
  max-width: 1200px;
  margin: 0 auto 28px;
  padding: clamp(22px, 4vw, 44px) clamp(18px, 4vw, 44px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  backdrop-filter: blur(14px);
  width: calc(100% - 2 * var(--gutter));
}
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 26px; }
.panel-head h2 { margin: 0; font-size: clamp(26px, 3.2vw, 38px); letter-spacing: -0.02em; font-weight: 600; display: flex; align-items: center; gap: 12px; }
.panel-head p { margin: 0; color: var(--muted); max-width: 520px; font-size: 15px; }
.count { font: 400 14px/1 var(--mono); color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 10px; }

.next-call {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  padding: 14px 18px; margin-bottom: 18px;
  border: 1px dashed var(--line-strong); border-radius: 16px;
  font-family: var(--mono); font-size: 13px; color: var(--muted);
}
.next-call strong { color: var(--text); font-weight: 700; }

.episodes { display: grid; gap: 16px; }
.ep {
  display: grid; grid-template-columns: 1fr; gap: 18px;
  padding: clamp(16px, 2.4vw, 26px);
  border-radius: 20px;
  background: rgba(2,4,5,0.55);
  border: 1px solid var(--line);
  transition: border-color .2s;
}
.ep:hover { border-color: var(--line-strong); }
@media (min-width: 820px) { .ep { grid-template-columns: 300px 1fr; gap: 28px; } }
.thumb {
  position: relative; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden;
  background: #000; border: 1px solid var(--line); cursor: pointer; padding: 0;
  display: block; width: 100%; color: inherit;
}
.thumb canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.thumb .mini { position: absolute; inset: 22% 8% 22%; display: grid; grid-template-columns: 1fr 1fr; gap: 6%; }
.thumb .mini span { background: #0d1a20; border: 1px solid var(--line-strong); border-radius: 6px; display: grid; place-items: center; font: 700 12px/1 var(--mono); color: var(--muted); }
.thumb .play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 54px; height: 54px; border-radius: 50%; background: var(--text); color: var(--bg);
  display: grid; place-items: center; transition: transform .15s;
  box-shadow: 0 8px 30px rgba(0,0,0,.6);
}
.thumb:hover .play { transform: translate(-50%,-50%) scale(1.08); }
.thumb .play svg { width: 20px; height: 20px; fill: currentColor; margin-left: 3px; }
.thumb .tl { position: absolute; left: 10px; bottom: 10px; font: 700 11px/1 var(--mono); background: rgba(0,0,0,.7); padding: 5px 8px; border-radius: 999px; }
.thumb .tr { position: absolute; right: 10px; bottom: 10px; font: 400 11px/1 var(--mono); background: rgba(0,0,0,.7); padding: 5px 8px; border-radius: 999px; color: var(--muted); }

.ep-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.ep h3 { margin: 6px 0 4px; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -0.02em; line-height: 1.1; font-weight: 600; }
.ep .sub { margin: 0 0 12px; color: var(--accent); font-family: var(--mono); font-size: 13px; }
.ep p.sum { margin: 0 0 14px; color: #c3d3d9; font-size: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.tag { font-size: 12px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.ep blockquote { margin: 0 0 16px; padding: 10px 14px; border-left: 2px solid var(--accent); background: rgba(111,182,214,0.06); border-radius: 0 10px 10px 0; font-size: 15px; }
.ep blockquote cite { display: block; font: 400 12px/1.4 var(--mono); color: var(--muted); font-style: normal; margin-top: 4px; }
.ep-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ep-actions .btn { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

/* participants */
.people { display: grid; gap: 16px; }
@media (min-width: 820px) { .people { grid-template-columns: 1fr 1fr; } }
.person { padding: 24px; border-radius: 20px; background: rgba(2,4,5,0.55); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.person-top { display: flex; align-items: center; gap: 14px; }
.person .av { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font: 700 18px/1 var(--mono); background: #0e1d24; border: 1px solid var(--line-strong); flex: none; }
.person h3 { margin: 0; font-size: 22px; letter-spacing: -0.01em; font-weight: 600; }
.person .role { margin: 2px 0 0; font: 400 12px/1.4 var(--mono); color: var(--accent); }
.person p.bio { margin: 0; color: #c3d3d9; font-size: 16px; }
.person .links { display: flex; gap: 8px; margin-top: auto; }
.person.you { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; padding: 16px 24px; border-style: dashed; }
.person.you .av { width: 40px; height: 40px; font-size: 14px; color: var(--muted); }
.person.you p { margin: 0; color: var(--muted); font-size: 15px; }
.person.you svg { width: 18px; height: 18px; stroke: var(--rec); fill: none; stroke-width: 1.8; stroke-linecap: round; margin-left: auto; flex: none; }

/* chat / form */
.chat { display: grid; gap: 18px; }
@media (min-width: 900px) { .chat { grid-template-columns: 0.8fr 1.2fr; gap: 28px; align-items: start; } }
.chat-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 92%; padding: 12px 16px; border-radius: 16px 16px 16px 4px; background: #0d1a20; border: 1px solid var(--line); }
.msg .who { display: block; font: 700 12px/1 var(--mono); color: var(--accent); margin-bottom: 6px; }
.msg p { margin: 0; font-size: 15px; }
.msg.me { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: rgba(111,182,214,0.12); border-color: var(--line-strong); }
.chat-form { display: grid; gap: 14px; }
.chat-form .row { display: grid; gap: 14px; }
@media (min-width: 560px) { .chat-form .row { grid-template-columns: 1fr 1fr; } }
.chat-form label { display: grid; gap: 6px; font: 400 12px/1.2 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.chat-form .opt { text-transform: none; letter-spacing: 0; color: var(--dim); }
.chat-form input, .chat-form select, .chat-form textarea {
  font: 400 16px/1.4 var(--sans); color: var(--text);
  background: rgba(2,4,5,0.7);
  border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 12px 14px; width: 100%;
  text-transform: none; letter-spacing: 0;
}
.chat-form textarea { resize: vertical; min-height: 110px; }
.chat-form input:focus, .chat-form select:focus, .chat-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(111,182,214,0.18); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.send-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.form-status { margin: 0; font: 400 13px/1.4 var(--mono); color: var(--muted); flex: 1 1 200px; }
.form-status.ok { color: var(--speak); }
.form-status.err { color: #ff8a95; }

/* footer */
.footer { padding: 40px var(--gutter) 30px; background: linear-gradient(to bottom, transparent, rgba(2,4,5,0.92) 35%); }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: flex-start; }
.fine { color: var(--muted); font-size: 13px; max-width: 460px; margin: 12px 0 0; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; }
.social { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel); text-decoration: none; font: 400 13px/1 var(--mono); }
.social:hover { border-color: var(--accent); }
.social svg { width: 16px; height: 16px; fill: currentColor; }
.social.soon { opacity: 0.45; pointer-events: none; }
.social.soon::after { content: 'soon'; font-size: 10px; color: var(--muted); }

/* ── bottom control bar ───────────────────────────────────── */
.controls {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 6px;
  padding: 8px;
  background: rgba(10, 18, 22, 0.88);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0,0,0,0.6);
  max-width: calc(100vw - 24px);
}
.ctl {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; min-width: 46px; padding: 0 14px;
  border-radius: 999px; border: 0;
  background: #142229; color: var(--text);
  font: 500 14px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background .15s;
}
.ctl:hover { background: #1d2f37; }
.ctl.off { background: #3a1015; color: #ff8a95; padding: 0; width: 46px; cursor: not-allowed; }
.ctl.leave { background: var(--rec); color: #fff; padding: 0 18px; }
.ctl.leave svg { fill: currentColor; stroke: none; width: 22px; height: 22px; }
.ctl[data-tip]:hover::before {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; padding: 7px 10px; border-radius: 8px;
  background: var(--text); color: var(--bg); font: 400 12px/1 var(--mono);
  pointer-events: none;
}
.sep { width: 1px; height: 26px; background: var(--line-strong); margin: 0 4px; }

/* ── player dialog ────────────────────────────────────────── */
.player {
  width: min(1100px, calc(100vw - 24px));
  padding: 0; border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: var(--panel-solid); color: var(--text);
}
.player::backdrop { background: rgba(0,0,0,0.78); backdrop-filter: blur(4px); }
.player-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; font-size: 15px; }
.code { font-size: 12px; color: var(--accent); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 9px; margin-right: 6px; }
.x { background: #142229; color: var(--text); border: 0; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 14px; }
.screen { aspect-ratio: 16/9; background: #000; display: grid; place-items: center; }
.screen video { width: 100%; height: 100%; display: block; background: #000; }
.screen .missing { text-align: center; padding: 24px; font-family: var(--mono); color: var(--muted); font-size: 14px; max-width: 520px; }
.screen .missing strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 8px; }
.mirrors { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px 18px; align-items: center; }
.mirrors .lbl { font: 400 12px/1 var(--mono); color: var(--muted); margin-right: 4px; }
.mirrors .btn { min-height: 36px; padding: 0 14px; font-size: 13px; }

/* ── small screens ────────────────────────────────────────── */
@media (max-width: 1100px) { .meeting-title .sched { display: none; } }
@media (max-width: 720px) {
  body { font-size: 16px; padding-bottom: 96px; }
  .meeting-meta .meeting-title { display: none; }
  .listener span { display: none; }
  .listener { padding: 8px; }
  .ctl span { display: none; }
  .ctl { padding: 0; width: 44px; min-width: 44px; height: 44px; }
  .ctl.leave { width: 52px; padding: 0; }
  .ctl[data-tip]:hover::before { display: none; }
  .tile .role { display: none; }
  .tile { aspect-ratio: 1 / 1; border-radius: 16px; }
  .avatar { top: 42%; width: 64px; }
  .name-tag { left: 8px; right: 8px; bottom: 8px; justify-content: center; padding: 6px 8px; }
  .stage { min-height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
