/* tickrate.app's landing page only (the policy pages use style.css alone): the hero's light,
   the app window that settles on scroll, the marquee and the mockups coming alive. Every
   "starts hidden" state is inside prefers-reduced-motion: no-preference and behind .js, so
   without motion or without the script everything is simply there. */

@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  grid-template-columns: none;
  min-height: 100vh;
  min-height: 100svh;
  margin-top: calc(-1 * var(--top-h));
  padding: calc(var(--top-h) + 40px) var(--gutter) 120px;
  overflow: hidden;
  text-align: center;
}
.hero-fallback {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 50% 45% at 30% 30%, rgba(124, 58, 237, .45), transparent 70%),
    radial-gradient(ellipse 45% 40% at 72% 70%, rgba(196, 165, 255, .22), transparent 70%),
    var(--bg);
}
canvas.silk {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.4s ease;
}
canvas.silk.lit { opacity: 1; }
.hero-text { position: relative; max-width: 1000px; margin: 0 auto; }
.hero h1 {
  max-width: 13.5ch;
  margin: 0 auto;
  font-size: clamp(44px, 6.4vw, 100px);
  line-height: 1.02;
  letter-spacing: -.03em;
  text-wrap: balance;
  text-shadow: 0 2px 40px rgba(11, 11, 12, .5);
}
.hero h1 .grad {
  background-image: linear-gradient(100deg, #fff 0%, var(--violet-light) 30%, var(--violet) 55%, var(--violet-light) 80%, #fff 100%);
  background-size: 220% 100%;
  animation: shine 7s ease-in-out infinite alternate;
  text-shadow: none;
}
@keyframes shine { from { background-position: 0% 0; } to { background-position: 100% 0; } }
.hero .lede { max-width: 38ch; margin: 28px auto 38px; text-wrap: balance; }
.hero .ctas { justify-content: center; margin-left: auto; margin-right: auto; }
.hero .fine { margin-left: auto; margin-right: auto; }
.hero-hint {
  position: absolute;
  left: 50%;
  bottom: 28px;
  margin: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--faint);
  white-space: nowrap;
}
.hero-hint::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--violet-light);
  box-shadow: 0 0 0 0 rgba(196, 165, 255, .6);
  animation: ping 2.2s ease-out infinite;
}
@keyframes ping { 70%, 100% { box-shadow: 0 0 0 12px rgba(196, 165, 255, 0); } }
.hint-touch { display: none; }
@media (hover: none) { .hint-mouse { display: none; } .hint-touch { display: inline; } }
.no-gl .hero-hint { display: none; }

/* The hero comes in on load: a soft rise out of a blur, one piece after another. */
@media (prefers-reduced-motion: no-preference) {
  .hero-text > * { animation: rise 1.1s cubic-bezier(.2, .8, .2, 1) both; }
  .hero-text > :nth-child(1) { animation-delay: .1s; }
  .hero-text > :nth-child(2) { animation-delay: .22s; }
  .hero-text > :nth-child(3) { animation-delay: .4s; }
  .hero-text > :nth-child(4) { animation-delay: .52s; }
  .hero-text > :nth-child(5) { animation-delay: .64s; }
  .hero h1 .grad { animation: shine 7s ease-in-out 1.2s infinite alternate; }
  .hero-hint { animation: fade 1s ease 1.6s both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(28px); filter: blur(12px); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- The app, settling as it is scrolled to ---------- */
.tour { position: relative; padding: 40px var(--gutter) 150px; }
.tour-head { max-width: 760px; margin: 0 auto 56px; text-align: center; }
.tour-head p { margin: 0; font-size: clamp(16px, 1.25vw, 19px); color: var(--muted); }
.tour-stage { max-width: 1120px; margin: 0 auto; perspective: 1600px; }
.tour .stage { perspective: none; }
/* --p runs 0 → 1 (home.js); without it the window is simply upright. */
.tour .monitor {
  animation: none;
  transform-origin: 50% 0;
  transform:
    translateY(calc((1 - var(--p, 1)) * 70px))
    rotateX(calc((1 - var(--p, 1)) * 36deg))
    scale(calc(.8 + .2 * var(--p, 1)));
  box-shadow:
    0 60px 140px rgba(0, 0, 0, .6),
    0 0 calc(40px + 80px * var(--p, 1)) rgba(124, 58, 237, calc(.12 + .25 * var(--p, 1))),
    inset 0 1px 0 rgba(255, 255, 255, .06);
}
/* A light that runs round the window's edge. */
.tour .monitor::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 1;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--spin), transparent 0 62%, rgba(196, 165, 255, .9) 76%, #fff 80%, rgba(155, 92, 246, .9) 86%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
  animation: spin 6s linear infinite;
}
@keyframes spin { to { --spin: 360deg; } }
.tour .float {
  --in: clamp(0, (var(--p, 1) - .72) * 3.6, 1);
  opacity: var(--in);
  translate: 0 calc((1 - var(--in)) * 26px);
}
.tour.off .monitor::before, .tour.off .float { animation-play-state: paused; }

/* The streams inside the mockups drift slowly, like a picture that is playing. */
.shot use, .mpic > svg use, .thumb-live svg use {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: playing 16s ease-in-out infinite alternate;
}
.thumb-live svg use, .mpic > svg use { animation-duration: 12s; }
@keyframes playing { from { transform: scale(1); } to { transform: scale(1.12) translate(-3%, 1%); } }
.off .shot use, .off .mpic > svg use, .off .thumb-live svg use { animation-play-state: paused; }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  padding: 22px 0;
  border-block: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(124, 58, 237, .06), transparent 30%, transparent 70%, rgba(124, 58, 237, .06));
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 46s linear infinite; }
.marquee span { display: inline-flex; align-items: center; font-size: clamp(16px, 1.6vw, 22px); font-weight: 700; color: var(--muted); white-space: nowrap; }
.marquee span::after { content: ""; width: 6px; height: 6px; margin: 0 32px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 12px var(--violet); }
.marquee:hover .marquee-track, .marquee.off .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections come in out of a blur ---------- */
.js .reveal { transition: opacity .9s ease, transform .9s cubic-bezier(.2, .8, .2, 1), filter .9s ease; }
@media (prefers-reduced-motion: no-preference) {
  .js .reveal:not(.in) { filter: blur(10px); }
}

/* ---------- Cards: every card moves the same smooth way ----------
   A slow lift on a long ease-out, a soft violet shadow, a light inside that follows the
   pointer and a border that lights up where the pointer is (home.js sets --x/--y). The lift is
   `translate`, so the scroll-in reveal's `transform` stays its own. */
.feature, .mosaic, .voice, .chatcard {
  position: relative;
  isolation: isolate;
  border-color: rgba(255, 255, 255, .07);
  transition:
    opacity .9s ease, transform .9s cubic-bezier(.2, .8, .2, 1), filter .9s ease,
    translate .7s cubic-bezier(.22, 1, .36, 1),
    box-shadow .7s cubic-bezier(.22, 1, .36, 1),
    border-color .6s ease;
}
.feature { display: flex; flex-direction: column; overflow: hidden; border-radius: 24px; padding: 30px 28px 26px; background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .008)); }
.feature::after, .mosaic::after, .voice::after, .chatcard::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--x, 50%) var(--y, 0%), rgba(155, 92, 246, .14), transparent 60%);
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
}
.feature::before, .mosaic::before, .voice::before, .chatcard::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--x, 50%) var(--y, 0%), rgba(196, 165, 255, .7), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
}
@media (hover: hover) {
  .feature:hover, .mosaic:hover, .voice:hover, .chatcard:hover {
    translate: 0 -6px;
    border-color: rgba(196, 165, 255, .14);
    box-shadow: 0 40px 100px rgba(0, 0, 0, .5), 0 30px 70px -30px rgba(124, 58, 237, .5);
  }
  .feature:hover::after, .mosaic:hover::after, .voice:hover::after, .chatcard:hover::after,
  .feature:hover::before, .mosaic:hover::before, .voice:hover::before, .chatcard:hover::before { opacity: 1; }
}
/* The scroll-in reveal sets its own transition list; on a card it must keep the lift's too. */
.js .feature.reveal {
  transition:
    opacity .9s ease, transform .9s cubic-bezier(.2, .8, .2, 1), filter .9s ease,
    translate .7s cubic-bezier(.22, 1, .36, 1),
    box-shadow .7s cubic-bezier(.22, 1, .36, 1),
    border-color .6s ease;
}
/* The three come in one after another. */
.js .cards .feature:nth-child(2).reveal { transition-delay: .12s, .12s, .12s, 0s, 0s, 0s; }
.js .cards .feature:nth-child(3).reveal { transition-delay: .24s, .24s, .24s, 0s, 0s, 0s; }

.ficon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: linear-gradient(145deg, #b088ff, var(--violet-deep));
  box-shadow: 0 8px 22px -6px rgba(124, 58, 237, .6), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: translate .7s cubic-bezier(.22, 1, .36, 1), rotate .7s cubic-bezier(.22, 1, .36, 1), box-shadow .7s ease;
}
.ficon svg { width: 24px; height: 24px; }
@media (hover: hover) {
  .feature:hover .ficon { translate: 0 -2px; rotate: -6deg; box-shadow: 0 14px 30px -6px rgba(124, 58, 237, .75), inset 0 1px 0 rgba(255, 255, 255, .3); }
}
.feature h3 { letter-spacing: -.01em; }
.feature p { line-height: 1.65; }

/* Every card ends on the same line: a footer pushed to the bottom. */
.feat-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 22px; }
.feat-foot.col { display: block; }
.tag {
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
  transition: color .5s ease, box-shadow .5s ease, background-color .5s ease;
}
@media (hover: hover) {
  .feature:hover .tag { color: var(--violet-light); background: rgba(155, 92, 246, .08); box-shadow: inset 0 0 0 1px rgba(155, 92, 246, .3); }
}
.num { font-variant-numeric: tabular-nums; }
.feature .num { color: #fff; }
.spark { display: block; width: 100%; height: 40px; overflow: visible; }
.spark path { fill: none; stroke: var(--violet-light); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px rgba(155, 92, 246, .8)); }
.feature .note { margin-top: 10px; }
@media (prefers-reduced-motion: no-preference) {
  .js .spark path { stroke-dasharray: 400; stroke-dashoffset: 400; transition: stroke-dashoffset 2s cubic-bezier(.2, .8, .2, 1) .5s; }
  .js .feature.in .spark path { stroke-dashoffset: 0; }
}

/* ---------- Lives: the menu pops up, the volume slides ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .mosaic .menu { transition: opacity .4s ease .7s, transform .6s cubic-bezier(.34, 1.56, .64, 1) .7s; }
  .js .split-art:not(.in) .mosaic .menu { opacity: 0; transform: translateY(10px) scale(.92); }
  .js .split-art.in .mosaic .slider span { animation: fill 1.2s cubic-bezier(.2, .8, .2, 1) 1.1s both; }
  .js .split-art.in .mtile.hot .mpic { animation: picked .8s ease .5s both; }
}
@keyframes fill { from { width: 15%; } }
@keyframes picked { from { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Voice: the switches turn on, the levels rise ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .voice .switch { transition: background .3s ease; }
  .js .voice .switch::after { transition: transform .4s cubic-bezier(.34, 1.56, .64, 1); }
  .js .split-art:not(.in) .voice .switch { background: #3f3f46; }
  .js .split-art:not(.in) .voice .switch::after { transform: translateX(-18px); background: #a1a1aa; }
  .js .split-art.in .switch-row:nth-of-type(1) .switch, .js .split-art.in .switch-row:nth-of-type(1) .switch::after { transition-delay: .5s; }
  .js .split-art.in .switch-row:nth-of-type(2) .switch, .js .split-art.in .switch-row:nth-of-type(2) .switch::after { transition-delay: .8s; }
  .js .split-art.in .switch-row:nth-of-type(3) .switch, .js .split-art.in .switch-row:nth-of-type(3) .switch::after { transition-delay: 1.1s; }
  .js .split-art.in .voice .range span { animation: fill 1.1s cubic-bezier(.2, .8, .2, 1) .3s both; }
}

/* ---------- Chat: a message, someone typing, then the link's card ---------- */
.chatcard { position: relative; }
.typing { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .js .typing {
    position: absolute;
    left: 22px;
    bottom: 26px;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
  }
  .js .typing small { color: var(--muted); font-size: 13px; }
  .js .typing .dots { display: inline-flex; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--raised); }
  .js .typing .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: dot 1s ease-in-out infinite; }
  .js .typing .dots i:nth-child(2) { animation-delay: .15s; }
  .js .typing .dots i:nth-child(3) { animation-delay: .3s; }
  .js .chatcard .msg { opacity: 0; }
  .js .split-art.in .chatcard .msg:first-child { animation: pop .6s cubic-bezier(.34, 1.4, .64, 1) .3s both; }
  .js .split-art.in .typing { animation: typing 1.7s ease 1s both; }
  .js .split-art.in .chatcard .msg:last-child { animation: pop .6s cubic-bezier(.34, 1.4, .64, 1) 2.6s both; }
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes typing { 0% { opacity: 0; transform: translateY(8px); } 15%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes dot { 50% { transform: translateY(-4px); opacity: .5; } }

/* ---------- Finale: the light again ---------- */
.finale { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 86vh; }
.finale h2 { font-size: clamp(48px, 8vw, 120px); letter-spacing: -.045em; }

@media (max-width: 1080px) {
  .tour-stage { max-width: 760px; }
}
@media (max-width: 640px) {
  .hero { padding-bottom: 96px; }
  .tour { padding-bottom: 110px; }
  .tour-head { margin-bottom: 36px; }
  .marquee { padding: 16px 0; }
  .marquee span::after { margin: 0 20px; }
  .finale { min-height: 70vh; }
}

/* ---------- The app window as a clickable demo (demo.js), drawn like the real app ---------- */
@font-face { font-family: "JetBrains Mono"; src: url(/fonts/JetBrainsMono-Variable.ttf) format("truetype"); font-weight: 400 700; font-display: swap; }

.demo-chip { display: none; }
.js .demo-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px !important;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px !important;
  font-weight: 600;
  color: var(--violet-light) !important;
  background: rgba(155, 92, 246, .1);
  box-shadow: inset 0 0 0 1px rgba(155, 92, 246, .3);
}
.demo-chip span { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--violet-light); animation: ping 2.2s ease-out infinite; }
/* The demo shows by itself who talks and what's live: the floating chips would cover it. */
.js .tour .float { display: none; }

.app.demo {
  --d-bg: #0a0a0a; --d-panel: #141414; --d-raised: #202023; --d-line: #262628;
  --d-text: #ededed; --d-muted: #a1a1aa; --d-faint: #888890; --d-red: #ef4444; --d-ok: #22c55e;
  position: relative;
  display: grid;
  grid-template-columns: 3.3em 14.5em minmax(0, 1fr) 16em;
  gap: .5em;
  height: 100%;
  padding: .5em;
  background: var(--d-bg);
  color: var(--d-text);
  font-family: Inter, -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 1.12cqi;
  line-height: 1.35;
  text-align: left;
}
.app.demo .mono { font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; }
.app.demo .i { flex: none; width: 1.15em; height: 1.15em; }
.app.demo button, .app.demo input { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; }
.app.demo button { cursor: pointer; transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease, scale .2s cubic-bezier(.22, 1, .36, 1); }
.app.demo button:active { scale: .95; }
.app.demo :focus-visible { outline: 2px solid var(--violet-light); outline-offset: 2px; }
.app.demo .sp { flex: 1; }
.app.demo .grow { flex: 1; min-height: .5em; }

/* Panels */
.app.demo .side, .app.demo .main, .app.demo .chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: var(--d-panel);
  border: 1px solid var(--d-line);
  border-radius: .8em;
}

/* Server rail */
.app.demo .rail { display: flex; flex-direction: column; align-items: center; gap: .55em; padding: .2em 0; background: none; border: 0; }
.app.demo .logo { display: grid; place-items: center; width: 2.5em; height: 2.5em; border: 1px solid #3a3a3e; border-radius: .6em; font-family: "JetBrains Mono", monospace; font-size: .62em; font-weight: 700; line-height: 1.05; letter-spacing: .15em; text-align: center; }
.app.demo .srv { display: grid; place-items: center; width: 2.5em; height: 2.5em; border-radius: .65em; background: var(--d-raised); font-size: .85em; font-weight: 800; color: var(--d-muted); }
.app.demo .srv.on { background: var(--d-text); color: var(--d-bg); }
.app.demo .srv.add { background: none; border: 1px dashed #3a3a3e; }
.app.demo .srv.add:hover { color: var(--d-text); border-color: var(--d-muted); }

/* Sidebar */
.app.demo .side { padding: .85em .6em .6em; }
.app.demo .srv-head { padding: 0 .4em .7em; border-bottom: 1px solid var(--d-line); }
.app.demo .srv-head b { display: block; font-size: 1.05em; }
.app.demo .srv-head span { display: block; margin-top: .2em; font-size: .6em; letter-spacing: .06em; color: var(--d-faint); }
.app.demo .lbl { margin: 1.15em .55em .5em; font-size: .6em; letter-spacing: .14em; color: var(--d-faint); }
.app.demo .room { display: flex; align-items: center; gap: .5em; width: 100%; padding: .45em .55em; border-radius: .5em; font-weight: 600; text-align: left; }
.app.demo .room.on { background: var(--d-raised); }
.app.demo .room:not(.on):hover { background: rgba(255, 255, 255, .05); }
.app.demo .room .rec { width: .45em; height: .45em; border-radius: 50%; background: var(--d-red); box-shadow: 0 0 0 .2em rgba(239, 68, 68, .2); }
.app.demo .room .n { font-size: .7em; color: var(--d-faint); }
.app.demo .m-row { display: flex; align-items: center; gap: .5em; min-width: 0; padding: .26em .55em .26em 1.5em; font-size: .92em; color: var(--d-muted); white-space: nowrap; }
.app.demo .m-row .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.app.demo .m-row .live-pill { margin-left: auto; }
.app.demo .m-row.talk { color: var(--d-text); }
.app.demo .chan { display: flex; align-items: center; gap: .5em; padding: .4em .55em; border-radius: .5em; font-weight: 600; color: var(--d-text); }
.app.demo .chan .i { color: var(--d-faint); }
.app.demo .here { display: flex; align-items: center; justify-content: space-between; gap: .5em; margin-bottom: .55em; padding: .55em .65em; border: 1px solid #3a3a3e; border-radius: .65em; }
.app.demo .here b { display: flex; align-items: center; gap: .4em; font-size: .85em; font-weight: 600; color: var(--d-ok); }
.app.demo .here b i { width: .5em; height: .5em; border-radius: 50%; background: var(--d-ok); }
.app.demo .here span { display: block; margin-top: .1em; font-size: .8em; color: var(--d-muted); }
.app.demo .hang { display: grid; place-items: center; flex: none; width: 2.1em; height: 2.1em; border: 1px solid rgba(239, 68, 68, .55); border-radius: .5em; color: var(--d-red); }
.app.demo .hang:hover { background: rgba(239, 68, 68, .12); }
.app.demo .me { display: flex; align-items: center; gap: .45em; margin: 0; padding: .55em .2em 0; border-top: 1px solid var(--d-line); }
.app.demo .me .who { flex: 1; min-width: 0; }
.app.demo .me .who b { display: block; font-size: .85em; }
.app.demo .me .who span { display: block; font-size: .62em; color: var(--d-faint); }

/* Avatars: rounded squares in soft tones, like the app's */
.app.demo .av { display: inline-grid; place-items: center; flex: none; width: 1.75em; height: 1.75em; border: 0; border-radius: .4em; font-size: .78em; font-weight: 700; transition: box-shadow .3s ease; }
.app.demo .av.big { width: 2.6em; height: 2.6em; border-radius: .55em; font-size: 1.05em; }
.app.demo .t-a { background: #ddd6fe; color: #4c1d95; }
.app.demo .t-b { background: #bfdbfe; color: #1e3a8a; }
.app.demo .t-c { background: #fbcfe8; color: #831843; }
.app.demo .t-w { background: var(--d-text); color: var(--d-bg); }
.app.demo .talk .av { box-shadow: 0 0 0 2px var(--d-panel), 0 0 0 3.5px var(--d-ok); }
.app.demo .mute { width: .95em; height: .95em; color: var(--d-red); }

.app.demo .live-pill { display: inline-flex; align-items: center; flex: none; padding: .3em .6em .3em .5em; border-radius: 999px; background: var(--d-red); color: #fff; font-family: "JetBrains Mono", monospace; font-size: .6em; font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.app.demo .live-pill::before { content: ""; width: .55em; height: .55em; margin-right: .5em; border-radius: 50%; background: #fff; }

/* Icon buttons */
.app.demo .ib { position: relative; display: grid; place-items: center; flex: none; width: 2.1em; height: 2.1em; border-radius: .5em; color: var(--d-muted); }
.app.demo .ib:hover { background: var(--d-raised); color: var(--d-text); }
.app.demo .ib.lit { background: var(--d-raised); color: var(--d-text); box-shadow: inset 0 0 0 1px var(--violet); }
.app.demo .ib.off { background: rgba(239, 68, 68, .12); color: var(--d-red); }
.app.demo .ib.off::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1.35em; height: 2px; border-radius: 2px; background: currentColor; transform: translate(-50%, -50%) rotate(-45deg); }

/* Main */
.app.demo .top-bar { display: flex; align-items: center; gap: .55em; padding: .7em 1em; border-bottom: 1px solid var(--d-line); }
.app.demo .top-bar .i { color: var(--d-muted); }
.app.demo .top-bar .dim { padding-left: .7em; border-left: 1px solid var(--d-line); color: var(--d-muted); font-size: .92em; }
.app.demo .stage-area { display: flex; flex: 1; flex-direction: column; gap: .6em; min-height: 0; padding: .75em 1em .7em; }
.app.demo .live-head { display: flex; align-items: center; gap: .6em; min-width: 0; white-space: nowrap; }
.app.demo .live-head b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: .95em; }
.app.demo .chip { display: inline-flex; align-items: center; gap: .4em; flex: none; padding: .25em .55em; border: 1px solid var(--d-line); border-radius: .35em; background: #1a1a1c; font-size: .62em; color: var(--d-muted); }
.app.demo .chip .i { width: 1.3em; height: 1.3em; }
.app.demo .video { flex: 1; min-height: 0; overflow: hidden; border: 1px solid var(--d-line); border-radius: .6em; background: #000; }
.app.demo .scene { display: block; width: 100%; height: 100%; }
.app.demo .scene use { transform-box: fill-box; transform-origin: 50% 50%; animation: playing 16s ease-in-out infinite alternate; }
.off .app.demo .scene use { animation-play-state: paused; }
.app.demo .preview { position: relative; display: grid; place-items: center; height: 100%; background: repeating-linear-gradient(135deg, #121213 0 .9em, #18181a .9em 1.8em); }
.app.demo .tl { position: absolute; left: .7em; top: .7em; }
.app.demo .cap { font-size: .58em; letter-spacing: .1em; color: var(--d-muted); }
.app.demo .preview .cap { position: absolute; left: .9em; bottom: .8em; }
.app.demo .btn-solid { display: inline-flex; align-items: center; gap: .45em; padding: .6em 1em; border-radius: .55em; background: var(--d-text); color: var(--d-bg); font-weight: 600; }
.app.demo .btn-solid:hover { background: #fff; box-shadow: 0 .4em 1.4em rgba(255, 255, 255, .15); }
.app.demo .ctrls { display: flex; align-items: center; gap: .3em; padding: .3em .4em; border: 1px solid var(--d-line); border-radius: .6em; background: #101012; }
.app.demo .vol { -webkit-appearance: none; appearance: none; width: 6em; height: .25em; margin: 0 .3em; border-radius: 1em; cursor: pointer; background: linear-gradient(90deg, var(--d-text) var(--v, 50%), #3a3a3e var(--v, 50%)); }
.app.demo .vol::-webkit-slider-thumb { -webkit-appearance: none; width: 1.05em; height: 1.05em; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(196, 165, 255, .4); transition: box-shadow .3s; }
.app.demo .vol:hover::-webkit-slider-thumb { box-shadow: 0 0 0 .3em rgba(196, 165, 255, .35); }
.app.demo .vol::-moz-range-thumb { width: 1.05em; height: 1.05em; border: 0; border-radius: 50%; background: #fff; }
.app.demo .pct { min-width: 3.4em; font-size: .68em; color: var(--d-muted); }
.app.demo .vsep { flex: none; width: 1px; height: 1.4em; margin: 0 .3em; background: var(--d-line); }
.app.demo .btn-stop { display: inline-flex; align-items: center; gap: .4em; flex: none; padding: .45em .8em; border: 1px solid rgba(239, 68, 68, .55); border-radius: .5em; color: #f87171; font-size: .85em; font-weight: 600; white-space: nowrap; }
.app.demo .btn-stop:hover { background: rgba(239, 68, 68, .1); }
.app.demo .people { display: grid; grid-template-columns: repeat(3, minmax(0, 9.5em)); gap: .55em; }
.app.demo .pcard { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: .45em; height: 5.4em; padding: .65em .7em; overflow: hidden; border: 1px solid var(--d-line); border-radius: .6em; background: #161618; transition: border-color .3s; }
.app.demo .pcard b { display: flex; align-items: center; gap: .3em; font-size: .85em; }
.app.demo .pcard.talk { border-color: rgba(34, 197, 94, .5); }
.app.demo .pcard.mine-live { background: repeating-linear-gradient(135deg, #121213 0 .9em, #18181a .9em 1.8em); }
.app.demo .pcard b.one { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app.demo .empty { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: .6em; padding: 1em; text-align: center; color: var(--d-muted); }
.app.demo .empty b { color: var(--d-text); font-size: 1.15em; }
.app.demo .empty .big { width: 2.4em; height: 2.4em; color: var(--violet-light); }

/* Dock */
.app.demo .dock-bar { position: relative; display: flex; align-items: center; justify-content: center; padding: .5em 1em; border-top: 1px solid var(--d-line); }
.app.demo .where { position: absolute; left: 1em; font-size: .6em; color: var(--d-faint); }
.app.demo .dock { display: flex; align-items: center; gap: .25em; padding: .3em; border: 1px solid var(--d-line); border-top: 1px solid var(--d-line); border-radius: .7em; background: #101012; }
.app.demo .btn-dock { display: inline-flex; align-items: center; gap: .45em; flex: none; padding: .5em .8em; border: 1px solid var(--d-line); border-radius: .5em; background: #18181a; font-size: .85em; font-weight: 600; white-space: nowrap; }
.app.demo .btn-dock:hover { background: var(--d-raised); }
.app.demo .btn-dock.on { border-color: rgba(239, 68, 68, .5); background: rgba(239, 68, 68, .14); color: #fca5a5; }
.app.demo .btn-dock.red { border-color: var(--d-red); background: var(--d-red); color: #fff; }
.app.demo .btn-dock.red:hover { background: #f05252; }
.app.demo .btn-dock.join { border-color: var(--d-text); background: var(--d-text); color: var(--d-bg); }

/* Chat */
.app.demo .chat-head { display: flex; align-items: center; gap: .5em; padding: .7em .9em; border-bottom: 1px solid var(--d-line); }
.app.demo .chat .tabs { display: flex; gap: .3em; padding: .45em .6em; border-bottom: 1px solid var(--d-line); }
.app.demo .chat .tab { padding: .3em .6em; border-radius: .4em; background: var(--d-raised); font-size: .82em; font-weight: 700; color: var(--d-text); }
.app.demo .msgs { display: flex; flex: 1; flex-direction: column; gap: .85em; min-height: 0; margin: 0; padding: .7em .8em; overflow-y: auto; scrollbar-width: none; }
.app.demo .msgs::-webkit-scrollbar { display: none; }
.app.demo .msgs > :first-child { margin-top: auto; }
.app.demo .msg { display: flex; gap: .55em; }
.app.demo .msg .av { width: 2.1em; height: 2.1em; }
.app.demo .msg .body { min-width: 0; }
.app.demo .msg .mh { display: flex; align-items: baseline; gap: .45em; }
.app.demo .msg .mh b { font-size: .85em; }
.app.demo .msg .mh span { font-size: .6em; color: var(--d-faint); }
.app.demo .msg p { margin: .15em 0 0; font-size: .85em; color: #d4d4d8; overflow-wrap: anywhere; }
.app.demo .msg.fresh { animation: pop .45s cubic-bezier(.34, 1.4, .64, 1) both; }
.app.demo .compose { display: flex; align-items: center; gap: .4em; margin: .55em; padding: .3em .35em .3em .6em; border: 1px solid var(--d-line); border-radius: .7em; background: #101012; color: var(--d-faint); transition: border-color .3s, box-shadow .3s; }
.app.demo .compose:focus-within { border-color: var(--violet); box-shadow: 0 0 0 .2em rgba(155, 92, 246, .2); }
.app.demo .compose input { flex: 1; min-width: 0; font-size: .85em; color: var(--d-text); outline: none; cursor: text; }
.app.demo .compose input::placeholder { color: var(--d-faint); }
.app.demo .compose .send { display: grid; place-items: center; flex: none; width: 1.9em; height: 1.9em; border-radius: .45em; background: var(--d-raised); color: var(--d-text); }
.app.demo .compose .send:hover { background: #2c2c30; }

/* A short note about what a click did */
.app.demo .toast {
  position: absolute;
  left: 50%;
  bottom: 4.6em;
  z-index: 5;
  max-width: 70%;
  padding: .65em 1em;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: .7em;
  background: rgba(32, 32, 35, .95);
  box-shadow: 0 1.5em 3em rgba(0, 0, 0, .5);
  font-size: .9em;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  translate: -50% .6em;
  transition: opacity .35s ease, translate .5s cubic-bezier(.22, 1, .36, 1);
}
.app.demo .toast.show { opacity: 1; translate: -50% 0; }

/* Narrower windows: the chat goes first, then the side panel (as the app itself does). */
@media (max-width: 1080px) {
  .app.demo { grid-template-columns: 3.3em 14em minmax(0, 1fr); font-size: 1.5cqi; }
  .app.demo .chat { display: none; }
}
/* A phone: just the room, upright, as the app's own phone layout. */
@media (max-width: 640px) {
  .js .tour .screen { aspect-ratio: 3 / 4; }
  .app.demo { grid-template-columns: minmax(0, 1fr); padding: .6em; font-size: 3.3cqi; }
  .app.demo .rail, .app.demo .side { display: none; }
  .app.demo .where, .app.demo .ctrls .ib:not([data-act="mutelive"]), .app.demo .ctrls .vsep, .app.demo .dock [data-act="soon"], .app.demo .dock .vsep { display: none; }
  .app.demo .vol { width: 5em; }
  .app.demo .people { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .app.demo .pcard { height: 4.8em; }
  .app.demo .chip.eye { display: none; }
}
