:root {
  --night: #050609;
  --card: #0b0d13;
  --ink: #eef1f7;
  --mute: #8b93a4;
  --faint: #5b6273;
  --line: rgba(255, 255, 255, 0.08);
  --edge: rgba(255, 255, 255, 0.16);
  --ice: #8fd0ff;
  --lilac: #a99bff;
  --peach: #ffb98a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--night);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 50% 46%, rgba(120, 140, 220, 0.07), transparent 70%),
    var(--night);
}

/* ---------------------------------------------------------------- the card */
.card {
  position: relative;
  width: min(430px, 92vw);
  height: min(480px, 94vh);
  display: flex;
  flex-direction: column;
  border-radius: clamp(20px, 5vh, 30px);
  background: var(--card);
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 0 0 1px var(--line),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 18px 40px -12px rgba(0, 0, 0, 0.75),
    0 50px 90px -30px rgba(40, 60, 140, 0.35);
}

.card__gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* without WebGL: three soft bands of light, drawn in CSS */
.card__fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: none;
}
.card.no-gl .card__gl { display: none; }
.card.no-gl .card__fallback { display: block; }
.card__fallback span {
  position: absolute;
  left: -10%;
  right: -10%;
  top: 50%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--ice) 30%, var(--lilac) 70%, transparent);
  filter: blur(0.6px);
  box-shadow: 0 0 18px 2px rgba(143, 208, 255, 0.35);
  animation: band 5s ease-in-out infinite;
}
.card__fallback span:nth-child(2) { animation-delay: -1.6s; opacity: 0.6; }
.card__fallback span:nth-child(3) { animation-delay: -3.1s; opacity: 0.4; }
@keyframes band {
  0%, 100% { transform: translateY(-50%) translateY(-6px) scaleX(0.96); }
  50% { transform: translateY(-50%) translateY(6px) scaleX(1); }
}

.card__sheen {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.35));
}

/* ---------------------------------------------------------------- top bar */
.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(14px, 4vh, 22px) clamp(16px, 4.6vw, 24px) 0;
}

.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand__mark { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; }
.brand__faint { opacity: 0.4; }
.brand__name { font-size: 14px; font-weight: 640; font-stretch: 106%; letter-spacing: 0.01em; }

.state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 11px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-size: 12px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.state__words { position: relative; display: inline-block; overflow: hidden; height: 16px; }
.state__word { display: block; line-height: 16px; font-weight: 600; font-stretch: 104%; color: var(--ink); white-space: nowrap; }
.state__time {
  color: var(--mute);
  font-variant-numeric: tabular-nums;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

/* ---------------------------------------------------------------- the big button */
.core {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  min-height: 0;
}

.talk {
  --d: min(176px, 32vh, 46vw);
  position: relative;
  width: var(--d);
  height: var(--d);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink);
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.015) 55%, rgba(0, 0, 0, 0.12)),
    rgba(255, 255, 255, 0.015);
  box-shadow:
    inset 0 0 0 1px var(--edge),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.22),
    inset 0 -14px 28px rgba(0, 0, 0, 0.35),
    0 10px 30px -10px rgba(0, 0, 0, 0.8);
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.talk:focus-visible { box-shadow: inset 0 0 0 1px var(--edge), 0 0 0 3px rgba(143, 208, 255, 0.45); }

.talk__rim {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(from var(--rim, 210deg), transparent 0deg, rgba(255, 255, 255, 0.55) 26deg, transparent 70deg, transparent 360deg);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 1.6px), #000 calc(100% - 0.6px));
  mask: radial-gradient(closest-side, transparent calc(100% - 1.6px), #000 calc(100% - 0.6px));
  opacity: 0.7;
}
.talk__glint {
  position: absolute;
  left: 18%;
  top: 9%;
  width: 46%;
  height: 22%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.22), transparent);
  filter: blur(2px);
}
.talk__mic {
  position: relative;
  width: 28%;
  height: 28%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

/* ---------------------------------------------------------------- caption */
.caption {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 clamp(18px, 6vw, 34px);
  min-height: clamp(54px, 15vh, 74px);
}
.caption__who {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--mute);
  margin-bottom: clamp(4px, 1.4vh, 8px);
}
.caption__line {
  font-size: clamp(14px, 4.2vh, 17px);
  line-height: 1.38;
  font-weight: 480;
  font-stretch: 102%;
  color: var(--ink);
  text-wrap: balance;
}
.caption__line .w { display: inline-block; opacity: 0.12; filter: blur(3px); }

/* ---------------------------------------------------------------- tools */
.tools {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 clamp(14px, 4.4vw, 22px) clamp(14px, 3.6vh, 20px);
}
.tools__hint {
  font-size: 10.5px;
  color: var(--faint);
  text-align: center;
  line-height: 1.3;
}
.tool {
  flex: 0 0 auto;
  width: clamp(36px, 10vh, 42px);
  height: clamp(36px, 10vh, 42px);
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: background 0.25s ease;
}
.tool svg { width: 46%; height: 46%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tool--end { background: rgba(255, 110, 120, 0.12); color: #ffb3b8; }
@media (hover: hover) {
  .tool:hover { background: rgba(255, 255, 255, 0.1); }
  .tool--end:hover { background: rgba(255, 110, 120, 0.2); }
}
.tool.is-on { background: rgba(255, 255, 255, 0.14); }

/* ---------------------------------------------------------------- drawn pointer */
.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  z-index: 5;
  pointer-events: none;
  fill: #fff;
  stroke: #0b0d13;
  stroke-width: 1.3;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
  opacity: 0;
}

@media (max-height: 430px) {
  .tools__hint { display: none; }
}
