:root {
  --bg: #07080a;
  --fg: #ecedee;
  --dim: #8b9097;
  --line: rgba(255, 255, 255, 0.09);
  --acc: #7cc4ff;
  --acc2: #9b8cff;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--sans);
  line-height: 1.6; min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* backdrop: soft glow + faint grid, fading out */
.glow {
  position: fixed; inset: -20% -10% auto -10%; height: 70vh; pointer-events: none; z-index: -2;
  background:
    radial-gradient(40% 55% at 30% 30%, rgba(124, 196, 255, 0.16), transparent 70%),
    radial-gradient(35% 50% at 72% 20%, rgba(155, 140, 255, 0.14), transparent 70%);
  filter: blur(20px); animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(3%, 4%, 0) scale(1.06); } }

.top, main, footer { width: 100%; max-width: 46rem; margin: 0 auto; padding-left: 1.25rem; padding-right: 1.25rem; }
.top { display: flex; justify-content: space-between; align-items: center; padding-top: 1.4rem; padding-bottom: 1.4rem; }
.logo { font-family: var(--mono); font-size: 0.9rem; text-decoration: none; letter-spacing: 0.02em; }
.beta { color: var(--dim); }

main { padding-bottom: 3rem; }
section { padding-top: 4.5rem; }

.hero { padding-top: clamp(3.5rem, 12vh, 7rem); }
.status { font-family: var(--mono); font-size: 0.74rem; color: var(--dim); letter-spacing: 0.06em; display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.3rem 0.8rem 0.3rem 0.65rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.03); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 10px #4ade80; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

h1 {
  margin-top: 1.4rem; font-size: clamp(2.4rem, 8vw, 4.2rem); line-height: 1.04;
  font-weight: 600; letter-spacing: -0.03em;
}
h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--acc), var(--acc2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub { margin-top: 1.5rem; max-width: 34rem; font-size: 1.1rem; color: #b6bac0; }
.actions { margin-top: 2rem; display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.hint { font-family: var(--mono); font-size: 0.75rem; color: var(--dim); }

.btn {
  display: inline-block; text-decoration: none; font-weight: 600; font-size: 0.98rem;
  color: #05070a; background: var(--fg); padding: 0.8rem 1.4rem; border-radius: 0.5rem; border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08); }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }

h2 { font-family: var(--mono); font-size: 0.85rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); display: flex; gap: 0.9rem; align-items: baseline; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.num { color: var(--acc); }

.steps { list-style: none; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 2.4rem 1fr; gap: 0.5rem; padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.idx { font-family: var(--mono); color: var(--dim); font-size: 0.85rem; padding-top: 0.2rem; }
.steps p { color: #b6bac0; } .steps strong { color: var(--fg); font-weight: 600; }

.list { list-style: none; }
.list li, .spec div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: 0.95rem 0; border-bottom: 1px solid var(--line); }
.k, dt { font-family: var(--mono); font-size: 0.82rem; color: var(--dim); padding-top: 0.15rem; }
.v, dd { color: var(--fg); }
.note { margin-top: 1.4rem; font-size: 0.85rem; color: var(--dim); max-width: 34rem; }

.access { text-align: left; padding-bottom: 1rem; }
.access .sub { margin-bottom: 1.6rem; margin-top: 1.4rem; }

footer { display: flex; justify-content: space-between; padding-top: 2rem; padding-bottom: 2.5rem; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 0.75rem; color: var(--dim); }
footer { max-width: 46rem; }
footer a { text-decoration: none; } footer a:hover { color: var(--fg); }

@media (max-width: 560px) {
  .list li, .spec div { grid-template-columns: 1fr; gap: 0.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .glow, .dot { animation: none; }
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

.pitch .big { margin-top: 1.6rem; font-size: clamp(1.5rem, 4.5vw, 2.1rem); line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
.pitch .big em { font-style: normal; color: var(--acc); }
.pitch .body { margin-top: 1.1rem; max-width: 36rem; color: #b6bac0; }
.points { list-style: none; margin-top: 2rem; }
.points li { padding: 1.1rem 0; border-top: 1px solid var(--line); color: #b6bac0; max-width: 40rem; }
.points li:last-child { border-bottom: 1px solid var(--line); }
.points strong { color: var(--fg); font-weight: 600; }
.pitch .big .win { display: block; margin-top: 0.4rem; background: linear-gradient(100deg, var(--acc), var(--acc2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.attack-sec .body { margin-top: 1.4rem; max-width: 36rem; color: #b6bac0; }
.attack-sec .list { margin-top: 1.6rem; }
.attack li { grid-template-columns: 11rem 1fr; }
.attack .v { color: #b6bac0; }
.attack li:nth-child(4) .v { color: var(--fg); }
.verdict { margin-top: 1.8rem; padding: 1.1rem 1.3rem; border: 1px solid rgba(124, 196, 255, 0.28); border-radius: 0.7rem; background: linear-gradient(100deg, rgba(124, 196, 255, 0.07), rgba(155, 140, 255, 0.05)); max-width: 40rem; color: #b6bac0; }
.verdict strong { color: var(--fg); font-size: 1.15rem; display: block; margin-bottom: 0.2rem; }
@media (max-width: 560px) { .attack li { grid-template-columns: 1fr; } }

.compare { margin-top: 2rem; width: 100%; max-width: 46rem; border: 1px solid var(--line); border-radius: 0.7rem; overflow: hidden; }
.compare > div { display: grid; grid-template-columns: 9.5rem repeat(3, 1fr); gap: 1rem; padding: 0.85rem 1.1rem; border-top: 1px solid var(--line); font-size: 0.92rem; color: var(--dim); }
.compare > div:first-child { border-top: 0; background: rgba(255, 255, 255, 0.03); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.compare .k { font-family: var(--mono); font-size: 0.8rem; color: var(--dim); }
.compare .us { color: var(--fg); }
.compare > div:not(:first-child) .us { color: var(--acc); }
.compare > div:first-child .us { color: var(--acc); }
@media (max-width: 700px) {
  .compare > div { grid-template-columns: 1fr; gap: 0.35rem; }
  .compare > div:first-child { display: none; }
  .compare > div > span[data-label]::before { content: attr(data-label) ": "; font-family: var(--mono); font-size: 0.72rem; color: var(--dim); }
  .compare > div > span.us[data-label]::before { color: var(--acc); }
}

/* ---- the app (start, waiting, call) ---- */
#home, #wait, #call { display: flex; flex-direction: column; gap: 1.1rem; align-items: flex-start; }
#home[hidden], #wait[hidden], #call[hidden], #marketing[hidden] { display: none; }
.lead { max-width: 34rem; font-size: 1.1rem; color: #b6bac0; }
.fine { font-family: var(--mono); font-size: .75rem; color: var(--dim); line-height: 1.5; max-width: 34rem; }
code { background: rgba(255,255,255,.08); padding: 0 .3rem; border-radius: .2rem; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: .6rem; padding: .65rem 1.1rem; font-size: .95rem; transition: border-color .15s ease; }
button:hover { border-color: var(--acc); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
button.btn { background: var(--fg); color: #05070a; border-color: transparent; font-weight: 600; padding: .8rem 1.4rem; border-radius: .5rem; font-size: .98rem; transition: background .2s ease, box-shadow .2s ease; }
button.btn:hover { border-color: transparent; background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
button[aria-pressed="true"] { background: rgba(74,222,128,.12); border-color: rgba(74,222,128,.5); }
button.danger:hover { border-color: #f87171; color: #fca5a5; }
button:disabled { opacity: .4; cursor: not-allowed; }
input[type=text] { width: 100%; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: .6rem; padding: .75rem .9rem; font-family: var(--mono); font-size: .85rem; }
input[type=text]:focus { border-color: var(--acc); }

.row { display: flex; gap: .5rem; flex-wrap: wrap; width: 100%; align-items: center; }
#linkbox { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; width: 100%; }
#linkbox[hidden] { display: none; }
#qr { width: 220px; height: 220px; border-radius: .6rem; image-rendering: pixelated; background: #fff; }
#qr[hidden] { display: none; }

#contacts-wrap { width: 100%; margin-top: 1.4rem; display: flex; flex-direction: column; gap: .7rem; }
#contacts-wrap[hidden] { display: none; }
#contacts { list-style: none; border: 1px solid var(--line); border-radius: .7rem; overflow: hidden; }
#contacts li { display: flex; align-items: center; gap: .5rem; padding: .6rem .9rem; border-top: 1px solid var(--line); background: rgba(255,255,255,.03); }
#contacts li:first-child { border-top: 0; }
#contacts .cname { flex: 1; word-break: break-word; }
#contacts .btn { padding: .45rem 1rem; font-size: .9rem; }

.sasbox { display: flex; flex-direction: column; gap: .25rem; padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: .7rem; background: rgba(255,255,255,.03); width: 100%; }
.label { font-family: var(--mono); font-size: .72rem; color: var(--dim); letter-spacing: .1em; text-transform: uppercase; }
#sas { font-family: var(--mono); font-size: 1.6rem; letter-spacing: .16em; background: linear-gradient(100deg, var(--acc), var(--acc2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
#videos { position: relative; width: 100%; aspect-ratio: 4/3; background: #000; border: 1px solid var(--line); border-radius: .8rem; overflow: hidden; }
#remote { width: 100%; height: 100%; object-fit: cover; }
#local { position: absolute; right: .6rem; bottom: .6rem; width: 28%; border-radius: .5rem; border: 1px solid var(--line); background: #111; }
#controls { display: flex; gap: .5rem; flex-wrap: wrap; }
.pairbox { width: 100%; display: flex; flex-direction: column; gap: .6rem; padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: .7rem; background: rgba(255,255,255,.03); }
.pairbox[hidden], #pairrow[hidden] { display: none; }
#pname { flex: 1; min-width: 10rem; width: auto; }
#log { list-style: none; width: 100%; max-height: 14rem; overflow: auto; display: flex; flex-direction: column; gap: .4rem; }
#log li { padding: .5rem .8rem; border-radius: .6rem; background: rgba(255,255,255,.05); border: 1px solid var(--line); max-width: 85%; word-break: break-word; white-space: pre-wrap; }
#log li.me { align-self: flex-end; background: rgba(124,196,255,.12); border-color: rgba(124,196,255,.25); }
#chat { display: flex; gap: .5rem; width: 100%; } #chat input { flex: 1; }
#status { min-height: 1.4em; margin-top: 1rem; font-family: var(--mono); font-size: .8rem; color: #fbbf77; }
#marketing { margin-top: 1rem; }

/* ---- panels sit on top of the dot field so content stays readable ---- */
.panel { width: 100%; margin-top: 2rem; padding: 1.5rem; background: rgba(8, 10, 14, 0.82); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 1rem; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5); gap: 1.25rem; }
@media (max-width: 560px) { .panel { padding: 1.1rem; } }
.title { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }

/* waiting */
.stagehead { display: flex; align-items: center; gap: 1rem; width: 100%; }
.ring { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 2px solid rgba(124, 196, 255, 0.35); border-top-color: var(--acc); animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.3rem; font-family: var(--mono); font-size: 0.74rem; color: var(--dim); }
.progress li { display: flex; align-items: center; gap: 0.5rem; }
.progress li::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; border: 1px solid var(--dim); }
.progress li.done { color: var(--fg); }
.progress li.done::before { background: #4ade80; border-color: #4ade80; }
.progress li.active { color: var(--acc); }
.progress li.active::before { background: var(--acc); border-color: var(--acc); animation: pulse 1.4s ease-in-out infinite; }
#elapsed[hidden] { display: none; }

/* in a call */
.callbar { display: flex; justify-content: space-between; align-items: center; width: 100%; font-family: var(--mono); font-size: 0.78rem; color: var(--dim); }
.live { display: inline-flex; align-items: center; gap: 0.55rem; color: #86efac; }
.calltimer { font-variant-numeric: tabular-nums; color: var(--fg); }
#local[hidden] { display: none; }
.placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 0.9rem; align-items: center; justify-content: center; text-align: center; padding: 1rem; background: radial-gradient(60% 60% at 50% 40%, rgba(124, 196, 255, 0.08), #05070a); color: var(--dim); font-size: 0.95rem; }
.placeholder[hidden] { display: none; }
#controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; width: 100%; }
#controls button { padding: 0.9rem 0.5rem; font-size: 0.95rem; }
#controls #leave { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.4); color: #fecaca; }
#controls #leave:hover { background: rgba(248, 113, 113, 0.22); border-color: #f87171; }
#mediahint[hidden] { display: none; }
.chatbox { width: 100%; display: flex; flex-direction: column; gap: 0.7rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
@media (max-width: 560px) { #controls { gap: 0.4rem; } #controls button { padding: 0.7rem 0.3rem; font-size: 0.82rem; line-height: 1.25; } }
@media (prefers-reduced-motion: reduce) { .ring { animation: none; } .progress li.active::before { animation: none; } }

/* ---- animated diagrams (pure CSS, inline SVG) ---- */
.hw-fig { width: 100%; margin: 1.6rem 0 0.4rem; padding: 1rem; border: 1px solid var(--line); border-radius: 0.9rem; background: rgba(255, 255, 255, 0.02); }
.hw { width: 100%; height: auto; display: block; overflow: visible; }
.hw text { font-family: var(--mono); }
.hw-small { font-size: 10px; fill: var(--dim); }
.hw-name { font-size: 12px; fill: var(--dim); }
.hw-code { font-size: 15px; font-weight: 600; fill: var(--acc); }
.hw-codes { font-size: 10.5px; }
.hw-dev { fill: rgba(255, 255, 255, 0.04); stroke: rgba(255, 255, 255, 0.3); stroke-width: 1.2; }
.hw-linkline { stroke: rgba(255, 255, 255, 0.2); stroke-width: 1; stroke-dasharray: 3 5; fill: none; }
.hw-direct { stroke: var(--acc); stroke-width: 2; opacity: 1; }
.hw-intro line { stroke: rgba(155, 140, 255, 0.8); stroke-width: 1.5; stroke-dasharray: 5 5; }
.hw-hl line { stroke: rgba(124, 196, 255, 0.55); stroke-width: 1.5; }
.hw-intro, .hw-hl, .hw-srv, .hw-wall, .hw-pk, .hw-keyfly { opacity: 0; }
.hw-srvr { fill: rgba(155, 140, 255, 0.1); stroke: rgba(155, 140, 255, 0.6); stroke-width: 1.2; }
.hw-srvt { font-size: 13px; fill: var(--fg); }
.hw-sB { opacity: 0; }
.hw-wall line { stroke: #f87171; stroke-width: 3; stroke-linecap: round; }
.hw-ok { font-size: 26px; fill: #4ade80; opacity: 1; }
.hw-boxr { fill: #12303a; stroke: var(--acc); stroke-width: 1.2; }
.hw-lockb { fill: var(--acc); }
.hw-lockh { fill: none; stroke: var(--acc); stroke-width: 1.5; }
.hw-keyc, .hw-keyp { fill: none; stroke: #fbbf77; stroke-width: 2; stroke-linecap: round; }
.hw-cap { font-size: 14px; fill: var(--fg); opacity: 0; }
.hw-c3 { opacity: 1; }
.hw-keyL, .hw-keyR { transform-box: fill-box; transform-origin: center; }

.hw-vault { fill: rgba(255, 255, 255, 0.03); stroke: rgba(255, 255, 255, 0.25); stroke-width: 1.2; }
.hw-lt { font-size: 13px; fill: var(--fg); }
.hw-ls { font-size: 11px; fill: #fbbf77; }
.hw-good { fill: #4ade80; }
.hw-lockb2 { fill: rgba(124, 196, 255, 0.25); stroke: var(--acc); stroke-width: 1.5; }
.hw-lockh2 { fill: none; stroke: var(--acc); stroke-width: 2; }
.hw-ghost { fill: none; stroke: rgba(255, 255, 255, 0.3); stroke-width: 1.5; stroke-dasharray: 3 3; }
.hw-sh1 { transform: translateY(-7px); }
.hw-qc { fill: rgba(155, 140, 255, 0.07); stroke: rgba(155, 140, 255, 0.55); stroke-width: 1.2; }
.hw-qring { fill: none; stroke: rgba(155, 140, 255, 0.55); stroke-width: 1.2; transform-box: fill-box; transform-origin: center; }
.hw-beam { stroke: #c4b5fd; stroke-width: 2; stroke-dasharray: 6 4; opacity: 0; }
.hw-result { font-size: 13px; fill: #4ade80; opacity: 1; }

.hw-steps li { transition: background 0.3s ease; }

@media (max-width: 600px) { .hw-cap { display: none; } .hw-fig { padding: 0.6rem; } }

/* motion: one 16 s loop, five phases of 3.2 s. The list below lights up in step. */
.hw-fig * { animation-timing-function: linear; animation-iteration-count: infinite; }
.hw-fig.paused * { animation-play-state: paused; }
@media (prefers-reduced-motion: no-preference) {
  .hw-keyL { animation: hw-keyL 16s infinite; }
  .hw-keyR { animation: hw-keyR 16s infinite; }
  .hw-keyfly { animation: hw-keyfly 16s infinite; }
  .hw-intro { animation: hw-intro 16s infinite; }
  .hw-intro line { animation: hw-dash 1s linear infinite; }
  .hw-hl { animation: hw-hl 16s infinite; }
  .hw-srv { animation: hw-srv 16s infinite; }
  .hw-sA { animation: hw-sA 16s infinite; }
  .hw-sB { animation: hw-sB 16s infinite; }
  .hw-direct { animation: hw-direct 16s infinite; }
  .hw-pk1 { animation: hw-pk1 16s infinite; }
  .hw-pk2 { animation: hw-pk2 16s infinite; }
  .hw-pk3 { animation: hw-pk3 16s infinite; }
  .hw-pk4 { animation: hw-pk4 16s infinite; }
  .hw-wall { animation: hw-wall 16s infinite; }
  .hw-codet { animation: hw-code 16s infinite; }
  .hw-ok { animation: hw-ok 16s infinite; }
  .hw-c1 { animation: hw-c1 16s infinite; }
  .hw-c2 { animation: hw-c2 16s infinite; }
  .hw-c3 { animation: hw-c3 16s infinite; }
  .hw-c4 { animation: hw-c4 16s infinite; }
  .hw-c5 { animation: hw-c5 16s infinite; }
  .hw-steps li { animation: hw-li 16s infinite; }
  .hw-steps li:nth-child(2) { animation-delay: 3.2s; }
  .hw-steps li:nth-child(3) { animation-delay: 6.4s; }
  .hw-steps li:nth-child(4) { animation-delay: 9.6s; }
  .hw-steps li:nth-child(5) { animation-delay: 12.8s; }

  .hw-b1 { animation: hw-b1 12s infinite, hw-dash 0.6s linear infinite; }
  .hw-b2 { animation: hw-b2 12s infinite, hw-dash 0.6s linear infinite; }
  .hw-b3 { animation: hw-b3 12s infinite, hw-dash 0.6s linear infinite; }
  .hw-sh1 { animation: hw-sh1 12s infinite; }
  .hw-l2 { animation: hw-shake 12s infinite; }
  .hw-s1 { animation: hw-s1 12s infinite; }
  .hw-s2 { animation: hw-s2 12s infinite; }
  .hw-s3 { animation: hw-s3 12s infinite; }
  .hw-result { animation: hw-result 12s infinite; }
  .hw-qring { animation: hw-pulse 2.4s ease-in-out infinite; }
  .hw-qr2 { animation-delay: 0.4s; }
  .hw-qr3 { animation-delay: 0.8s; }
}

@keyframes hw-dash { to { stroke-dashoffset: -20; } }
@keyframes hw-pulse { 0%, 100% { opacity: 0.35; transform: scale(0.96); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes hw-keyL { 0% { opacity: 0; transform: scale(0.3); } 5%, 95% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
@keyframes hw-keyR { 0%, 38% { opacity: 0; transform: scale(0.3); } 41%, 95% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
@keyframes hw-keyfly { 0%, 20% { opacity: 0; transform: translate(105px, 36px); } 22% { opacity: 1; transform: translate(105px, 36px); } 38% { opacity: 1; transform: translate(615px, 36px); } 40%, 100% { opacity: 0; transform: translate(615px, 36px); } }
@keyframes hw-intro { 0%, 41% { opacity: 0; } 43%, 51% { opacity: 1; } 54%, 100% { opacity: 0; } }
@keyframes hw-hl { 0%, 62% { opacity: 0; } 64%, 78% { opacity: 1; } 80%, 100% { opacity: 0; } }
@keyframes hw-srv { 0%, 40% { opacity: 0; } 42%, 80% { opacity: 1; } 82%, 100% { opacity: 0; } }
@keyframes hw-sA { 0%, 54% { opacity: 1; } 56%, 100% { opacity: 0; } }
@keyframes hw-sB { 0%, 58% { opacity: 0; } 60%, 80% { opacity: 1; } 82%, 100% { opacity: 0; } }
@keyframes hw-direct { 0%, 44% { opacity: 0; } 48%, 60% { opacity: 1; } 62%, 80% { opacity: 0.1; } 84%, 96% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hw-pk1 { 0%, 48% { opacity: 0; transform: translate(186px, 102px); } 49% { opacity: 1; transform: translate(186px, 102px); } 57% { opacity: 1; transform: translate(574px, 102px); } 58%, 100% { opacity: 0; transform: translate(574px, 102px); } }
@keyframes hw-pk2 { 0%, 51% { opacity: 0; transform: translate(574px, 124px); } 52% { opacity: 1; transform: translate(574px, 124px); } 59% { opacity: 1; transform: translate(186px, 124px); } 60%, 100% { opacity: 0; transform: translate(186px, 124px); } }
@keyframes hw-pk3 { 0%, 64% { opacity: 0; transform: translate(186px, 148px); } 65% { opacity: 1; transform: translate(186px, 148px); } 71% { opacity: 1; transform: translate(380px, 226px); } 77% { opacity: 1; transform: translate(574px, 150px); } 78%, 100% { opacity: 0; transform: translate(574px, 150px); } }
@keyframes hw-pk4 { 0%, 67% { opacity: 0; transform: translate(574px, 158px); } 68% { opacity: 1; transform: translate(574px, 158px); } 73% { opacity: 1; transform: translate(380px, 234px); } 79% { opacity: 1; transform: translate(186px, 156px); } 80%, 100% { opacity: 0; transform: translate(186px, 156px); } }
@keyframes hw-wall { 0%, 60% { opacity: 0; } 62%, 80% { opacity: 1; } 82%, 100% { opacity: 0; } }
@keyframes hw-code { 0%, 81% { opacity: 0; } 85%, 97% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hw-ok { 0%, 86% { opacity: 0; } 90%, 97% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hw-c1 { 0% { opacity: 0; } 2%, 18% { opacity: 1; } 20%, 100% { opacity: 0; } }
@keyframes hw-c2 { 0%, 20% { opacity: 0; } 22%, 38% { opacity: 1; } 40%, 100% { opacity: 0; } }
@keyframes hw-c3 { 0%, 40% { opacity: 0; } 42%, 58% { opacity: 1; } 60%, 100% { opacity: 0; } }
@keyframes hw-c4 { 0%, 60% { opacity: 0; } 62%, 78% { opacity: 1; } 80%, 100% { opacity: 0; } }
@keyframes hw-c5 { 0%, 80% { opacity: 0; } 82%, 98% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hw-li { 0%, 19% { background: rgba(124, 196, 255, 0.09); box-shadow: inset 3px 0 var(--acc); } 20%, 100% { background: transparent; box-shadow: none; } }

@keyframes hw-b1 { 0%, 14% { opacity: 0; } 16%, 34% { opacity: 0.95; } 36%, 100% { opacity: 0; } }
@keyframes hw-b2 { 0%, 38% { opacity: 0; } 40%, 58% { opacity: 0.95; } 60%, 100% { opacity: 0; } }
@keyframes hw-b3 { 0%, 62% { opacity: 0; } 64%, 82% { opacity: 0.6; } 84%, 100% { opacity: 0; } }
@keyframes hw-sh1 { 0%, 20% { transform: translateY(0); } 26%, 95% { transform: translateY(-7px); } 100% { transform: translateY(0); } }
@keyframes hw-shake { 0%, 42% { transform: translateX(0); } 44% { transform: translateX(-3px); } 46% { transform: translateX(3px); } 48% { transform: translateX(-3px); } 50% { transform: translateX(3px); } 52%, 100% { transform: translateX(0); } }
@keyframes hw-s1 { 0%, 26% { opacity: 0; } 30%, 95% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hw-s2 { 0%, 54% { opacity: 0; } 58%, 95% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hw-s3 { 0%, 76% { opacity: 0; } 80%, 95% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hw-result { 0%, 88% { opacity: 0; } 92%, 98% { opacity: 1; } 100% { opacity: 0; } }

/* ---- /join: landing page for an invited person ---- */
#invite, #ended { display: flex; flex-direction: column; gap: 1.1rem; align-items: flex-start; }
#invite[hidden], #ended[hidden] { display: none; }
#invite h1 { font-size: clamp(1.9rem, 5.5vw, 2.8rem); }
body.joinpage main { padding-top: clamp(1rem, 6vh, 3rem); }
#invite .points { width: 100%; }
a.btn { text-decoration: none; }

/* ---- reconnect banner ---- */
.banner { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .7rem .9rem; border: 1px solid rgba(251, 191, 119, 0.45); border-radius: .7rem; background: rgba(251, 191, 119, 0.08); color: #fde7c4; font-size: .92rem; }
.banner[hidden] { display: none; }
.banner .ring { width: 1.3rem; height: 1.3rem; border-width: 2px; border-color: rgba(251, 191, 119, 0.35); border-top-color: #fbbf77; }
.banner span:nth-child(2) { flex: 1; }
.banner button { padding: .35rem .8rem; font-size: .85rem; }

/* ---- call view: controls on top, compact safety code, smaller video, room for the chat ---- */
#controls { position: sticky; top: 0.5rem; z-index: 5; padding: 0.4rem; border-radius: 0.9rem; background: rgba(8, 10, 14, 0.88); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--line); }
.sasbox { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.9rem; padding: 0.6rem 0.9rem; }
.sasbox .fine { flex-basis: 100%; }
#sas { font-size: 1.25rem; }
#videos { aspect-ratio: 16 / 9; max-height: 34vh; }
#local { width: 24%; }
#log { min-height: 6rem; max-height: min(40vh, 18rem); }

/* ---- the call view as a messaging app (Signal-like): header, conversation, input bar ---- */
.sr, .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body.incall .top, body.incall footer { display: none; }
body.incall main { padding-top: 1rem; padding-bottom: 1rem; }
#call.chatapp { padding: 0; gap: 0; align-items: stretch; height: min(calc(100dvh - 2rem), 52rem); margin-top: 0; overflow: hidden; background: rgba(10, 12, 16, 0.92); }
#call.chatapp[hidden] { display: none; }

.chathead { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); }
.avatar { flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: #05070a; background: linear-gradient(135deg, var(--acc), var(--acc2)); }
.who { flex: 1; min-width: 0; }
.peer { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.sub2 { display: flex; align-items: center; gap: 0.4rem; font-family: var(--mono); font-size: 0.7rem; color: #86efac; line-height: 1.3; white-space: nowrap; }
.sub2 .calltimer { color: var(--dim); margin-left: auto; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.6rem; border-radius: 999px; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--acc); background: rgba(124, 196, 255, 0.08); border: 1px solid rgba(124, 196, 255, 0.25); }
.chip:hover { border-color: var(--acc); }
.sasdetail { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.6rem 0.9rem; background: rgba(124, 196, 255, 0.06); border-bottom: 1px solid var(--line); }
.sasdetail[hidden] { display: none; }

#call.chatapp #controls { position: static; display: flex; gap: 0.35rem; width: auto; padding: 0; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; }
#call.chatapp #controls button { width: 2.3rem; height: 2.3rem; padding: 0; border-radius: 50%; display: grid; place-items: center; font-size: 0; }
#call.chatapp #controls #leave { background: rgba(248, 113, 113, 0.16); }
#mediahint { display: none; }

#call.chatapp #videos { border: 0; border-radius: 0; max-height: 30vh; aspect-ratio: 16 / 9; width: 100%; flex: none; }
/* No video yet: keep it rendered (so frames still decode and can be detected) but out of sight. */
#call.chatapp #videos:not(.on) { position: absolute; width: 2px; height: 2px; opacity: 0.01; overflow: hidden; pointer-events: none; aspect-ratio: auto; }

#call.chatapp #log { flex: 1; min-height: 0; max-height: none; overflow-y: auto; padding: 1rem 0.9rem; gap: 0.3rem; }
#call.chatapp #log li { max-width: 78%; padding: 0.45rem 0.8rem 0.3rem; border-radius: 1.1rem; border: 0; background: #262a31; line-height: 1.4; }
#call.chatapp #log li.me { background: #2d6cdf; color: #fff; border-bottom-right-radius: 0.35rem; }
#call.chatapp #log li:not(.me) { border-bottom-left-radius: 0.35rem; }
#log li::after { content: attr(data-t); display: block; text-align: right; font-size: 0.65rem; opacity: 0.6; margin-top: 0.1rem; }

#call.chatapp .pairbox { border-radius: 0; border-left: 0; border-right: 0; padding: 0.6rem 0.9rem; gap: 0.4rem; }
#call.chatapp #chat { flex: none; display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.8rem; border-top: 1px solid var(--line); }
#call.chatapp #chat input { flex: 1; border-radius: 999px; padding: 0.65rem 1rem; font-family: var(--sans); font-size: 0.95rem; }
.send { flex: none; width: 2.6rem; height: 2.6rem; padding: 0; border-radius: 50%; display: grid; place-items: center; background: #2d6cdf; color: #fff; border: 0; }
.send:hover { background: #3a7af0; border: 0; }

@media (max-width: 560px) {
  body.incall main { padding: 0; }
  #call.chatapp { height: 100dvh; border-radius: 0; border-left: 0; border-right: 0; }
  .sub2 .e2e { display: none; }
  .sub2 .calltimer { margin-left: 0; }
  .chathead { gap: 0.5rem; padding: 0.6rem 0.7rem; }
  .avatar { width: 2.2rem; height: 2.2rem; }
  .chip { padding: 0.2rem 0.5rem; letter-spacing: 0.02em; font-size: 0.7rem; }
  .chip svg { display: none; }
  #call.chatapp #controls { gap: 0.3rem; }
  #call.chatapp #controls button { width: 2.1rem; height: 2.1rem; }
}
.chip #sas { font-size: inherit; letter-spacing: inherit; background: none; -webkit-background-clip: border-box; background-clip: border-box; color: inherit; -webkit-text-fill-color: currentColor; }
