:root {
  color-scheme: dark;
  --graphite: #101415;
  --paper: #f0f5f4;
  --muted: #a5b4b4;
  --aqua: #85ebdc;
  --mic-size: clamp(140px, 40vw, 196px);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(ellipse at 50% 42%, #1a2223 0, var(--graphite) 65%);
  color: var(--paper);
}

button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid var(--aqua); outline-offset: 6px; }

.timelink {
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: clamp(32px, 5svh, 52px);
  min-height: 100vh;
  min-height: 100svh;
  padding: max(48px, min(10svh, 96px), env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right)) max(26px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
  overflow: clip;
  text-align: center;
}

.product h1 {
  margin: 0;
  font-size: clamp(52px, 11.5vw, 80px);
  font-weight: 660;
  letter-spacing: -.035em;
  font-kerning: none;
  line-height: .98;
}

.product p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 3.9vw, 18px);
  letter-spacing: .015em;
  line-height: 1.4;
}

.voice-console {
  display: grid;
  justify-items: center;
  align-self: center;
  width: min(100%, 420px);
  min-width: 0;
}

.instance {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
  font-size: 18px;
  font-weight: 620;
  line-height: 24px;
}

.instance > span:last-child { color: var(--muted); font-weight: 450; }
.instance-separator { width: 4px; height: 4px; border-radius: 50%; background: #6d9994; }

.mic-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  margin: 43px 0 40px;
}

.mic-stage::before {
  position: absolute;
  inset: -70%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, #5ae2ce30 0, #49baab15 43%, transparent 72%);
  content: "";
  opacity: .35;
  pointer-events: none;
  transition: opacity .4s ease;
}

.mic-stage:has(.mic-button.active)::before { opacity: 1; }

.mic-button {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--mic-size);
  height: var(--mic-size);
  padding: 0;
  border: 1px solid #536464;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 0%, #303e3d 0, transparent 76%), #1c2425;
  box-shadow: inset 0 1px #ffffff12, inset 0 -8px 28px #080d1066, 0 14px 36px #0005;
  color: #a4b7b6;
  transition: background .3s, color .3s, border-color .3s, box-shadow .3s, transform .25s;
  touch-action: manipulation;
}

.mic-button::before, .mic-button::after {
  position: absolute;
  border: 1px solid #96b9b529;
  border-radius: 50%;
  content: "";
  pointer-events: none;
  transition: border-color .35s;
}

.mic-button::before { inset: -12px; }
.mic-button::after { inset: -25px; border-color: #96b9b512; }

.mic-button.active {
  border-color: #8be7d9a1;
  background: radial-gradient(ellipse at 50% 0%, #3a5f59 0, #25413e 46%, #182c2d 100%);
  box-shadow: inset 0 1px #cdfff85c, inset 0 -12px 32px #07161955, 0 0 32px #6ce8d42a, 0 16px 36px #0005;
  color: #bdfbef;
}

.mic-button.active::before { border-color: #88dcd34a; }
.mic-button.active::after { border-color: #88dcd32b; }
.mic-button:active { transform: scale(.975); }

.timelink:has(+ div #stopButton:not(.hidden)) .mic-button.active::before { animation: pulse 2.6s ease-in-out infinite; }
.timelink:has(+ div #stopButton:not(.hidden)) .mic-button.active::after { animation: pulse 2.6s .45s ease-in-out infinite; }

@keyframes pulse {
  50% { transform: scale(1.075); opacity: .43; }
}

.mic-glyph {
  position: relative;
  display: block;
  width: 46px;
  height: 54px;
  filter: drop-shadow(0 0 9px #80eadb3b);
}

.mic-glyph::before {
  position: absolute;
  top: 1px;
  left: 13px;
  width: 20px;
  height: 32px;
  border: 2px solid currentColor;
  border-radius: 12px;
  content: "";
}

.mic-glyph::after {
  position: absolute;
  top: 19px;
  left: 6px;
  width: 34px;
  height: 23px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 20px 20px;
  content: "";
}

.mic-glyph > span {
  position: absolute;
  top: 41px;
  left: 22px;
  width: 2px;
  height: 10px;
  background: currentColor;
}

.mic-glyph > span::before, .mic-glyph > span::after {
  position: absolute;
  border-radius: 2px;
  background: currentColor;
  content: "";
}

.mic-glyph > span::before { bottom: -1px; left: -7px; width: 16px; height: 2px; }
.mic-glyph > span::after { top: -15px; left: -25px; width: 51px; height: 2px; transform: rotate(-45deg); }
.mic-button.active .mic-glyph > span::after { visibility: hidden; }

.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 0 9px #85ebdc8c;
}

.voice-console:has(.mic-button:not(.active)) .dot:not(.pending, .error) { background: #81908f; box-shadow: none; }
.dot.pending { background: #d0b47c; box-shadow: none; }
.dot.error { background: #ef9c90; box-shadow: none; }
.status:not(:has(.pending, .error)) #healthText, .status:has(.pending, .error) #micStatus { display: none; }

.voice-test {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  margin-top: 19px;
  padding: 0 17px;
  border: 1px solid #819a993d;
  border-radius: 24px;
  background: #161d1e;
  color: #dbe7e6;
  font-size: 13px;
  font-weight: 560;
  transition: background .2s, border-color .2s;
  touch-action: manipulation;
}

.voice-glyph { display: flex; align-items: center; gap: 2px; height: 14px; color: #a5e1d6; }
.voice-glyph i { width: 2px; height: 6px; border-radius: 2px; background: currentColor; }
.voice-glyph i:nth-child(2) { height: 12px; }
.voice-glyph i:nth-child(3) { height: 9px; }

.attribution { color: #98a7a7; font-size: 12px; line-height: 1.4; }
.attribution strong { color: #d4dfde; font-weight: 580; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (hover: hover) {
  .mic-button:hover { border-color: #a9f1e7; }
  .voice-test:hover { background: #202b2b; border-color: #8dd7cc75; }
}

@media (max-height: 680px) {
  :root { --mic-size: clamp(124px, 34vw, 158px); }
  .timelink { gap: 26px; padding-top: max(28px, env(safe-area-inset-top)); }
  .mic-stage { margin: 33px 0 31px; }
}

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