:root { color-scheme: light; }
[hidden] { display: none !important; }
/* Layout: one full-bleed sunset sky, deep indigo at the top warming to amber at the horizon, with clear soap-bubble letters rising through it. Logotype top left, sound toggle top right, a glass input bar at the bottom where the words leave from. Single look on purpose, so every color is set explicitly. */
:root {
  --sky-0: #2a1f63;
  --sky-1: #5b2a86;
  --sky-2: #b13e91;
  --sky-3: #ee6a73;
  --sky-4: #ff9a5c;
  --sky-5: #ffc977;
  --sun-core: rgba(255, 240, 200, 0.8);
  --sun-halo: rgba(255, 170, 110, 0.42);
  --cloud: #ffffff;
  --cloud-far-lit: #e0a0cf;
  --cloud-far-shade: #5f3a8a;
  --cloud-mid-lit: #ffb9b0;
  --cloud-mid-shade: #93488f;
  --cloud-near-lit: #ffd7b0;
  --cloud-near-shade: #b3578a;
  --logo: #fff4ea;
  --shadow-tint: #3a1850;
  --ink: #1b3150;
  --puff-deep: #746cd2;
  --puff-base: #b8b3f1;
  --puff-light: #e6e3ff;
  --bubble-tint: #1c1630;
  --bubble-dark: #1e1838;
  --bubble-horizon: #ffc9a8;
  --bubble-zenith: #fff6f0;
  --bubble-ground: #b0607a;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-edge: rgba(255, 255, 255, 0.9);
  /* The hero button, and the light card it sits on. Black text on both. */
  --cta: #ed736e;
  --cta-ink: #000;
  --card: #fbf9f8;
  --card-ink: #000;
  --card-edge: rgba(255, 255, 255, 0.35);
  /* Instrument Sans for every word on the page. The bubble letters are drawn in DM Sans by letters.js. */
  --font-display: 'Instrument Sans', system-ui, sans-serif;
  --font-body: 'Instrument Sans', system-ui, sans-serif;
}

html, body { height: 100%; }
body {
  margin: 0;
  position: relative;
  overflow: hidden;
  padding-block: 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background:
    radial-gradient(70% 42% at 50% 94%, var(--sun-core) 0%, var(--sun-halo) 40%, transparent 74%),
    linear-gradient(180deg, var(--sky-0) 0%, var(--sky-1) 22%, var(--sky-2) 44%, var(--sky-3) 64%, var(--sky-4) 82%, var(--sky-5) 100%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
}

#sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: manipulation;
}

.ui {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
}
.top > * { pointer-events: auto; }

h1 { margin: 0; line-height: 0; min-width: 0; }
/* Drawn at half the size it has in Figma. The mark is taller below the letters than above, so the negative margin keeps the letters level with the button. */
.logo { display: block; width: 166px; height: auto; margin-bottom: -4.5px; max-width: 100%; filter: drop-shadow(0 1px 8px rgba(42, 31, 99, 0.45)); }
.logo path { fill: var(--logo) !important; }
#grain { position: absolute; inset: 0; pointer-events: none; }

.sound {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 36px;
  /* On a narrow phone the logo gives way, not the button. */
  flex: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.sound:focus-visible, .go:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.dock { position: relative; width: 100%; max-width: 560px; margin: 0 auto 14px; pointer-events: none; }
.cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.cap span {
  max-width: 100%;
  box-sizing: border-box;
  padding: 8px 14px;
  color: var(--ink);
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: 18px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
}
.bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 6px 6px 6px 8px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.bar:focus-within { box-shadow: 0 0 0 3px var(--puff-base); }

.bar input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 17px;
  color: var(--ink);
}
.bar input::placeholder { color: rgba(27, 49, 80, 0.62); }
.bar input { text-overflow: ellipsis; }
.bar.live input::placeholder { color: var(--ink); opacity: 1; }

.mic {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--glass-edge);
  border-radius: 50%;
  cursor: pointer;
}
.mic.on { color: var(--cloud); background: var(--puff-deep); border-color: var(--puff-deep); }
.mic.on::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--puff-base);
  animation: ring 1.5s ease-out infinite;
}
.mic:disabled { opacity: 0.45; cursor: default; }
.mic:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
@keyframes ring { from { transform: scale(0.9); opacity: 0.9; } to { transform: scale(1.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mic.on::after { animation: none; opacity: 0.7; } }

.micsel {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 44px;
  margin-left: -6px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}
.micsel svg { transition: transform 0.15s ease; }
.micsel[aria-expanded="true"] svg { transform: rotate(180deg); }
.micsel:disabled { opacity: 0.45; cursor: default; }
.micsel:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.dock.picking .cap { display: none; }
.mics {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 2;
  box-sizing: border-box;
  width: min(100%, 360px);
  padding: 12px;
  pointer-events: auto;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--glass-edge);
  border-radius: 18px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.mics-h { margin-bottom: 8px; font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.mics-list { display: grid; gap: 4px; max-height: 40vh; overflow-y: auto; }
.opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 12px;
  text-align: left;
  font: 600 15px/1.25 var(--font-body);
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
}
.opt::before {
  content: '';
  flex: none;
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.opt.ask::before { display: none; }
.opt[aria-checked="true"] { background: var(--puff-light); border-color: var(--puff-base); }
.opt[aria-checked="true"]::before { background: var(--puff-deep); border-color: var(--puff-deep); }
.opt:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.meter-l { margin-top: 10px; font-size: 13px; font-weight: 600; }
.meter { height: 8px; margin-top: 6px; overflow: hidden; background: rgba(27, 49, 80, 0.14); border-radius: 99px; }
.meter i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--puff-deep);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.06s linear;
}
.mics-note { margin: 8px 0 0; font-size: 13px; line-height: 1.35; font-weight: 500; }
.mics-note:empty { display: none; }

.go {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--cta-ink);
  background: var(--cta);
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  min-height: 52px;
  cursor: pointer;
}
.go:active { transform: scale(0.97); }

/* First-visit welcome card. The light card from the app's welcome screen, centered over the sky:
   a two-line heading with the second line in italic, a short paragraph, then the hero button. */
.intro {
  box-sizing: border-box;
  width: min(100% - 32px, 420px);
  margin: auto;
  padding: 28px;
  color: var(--card-ink);
  font-family: var(--font-body);
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(42, 31, 99, 0.35);
}
.intro::backdrop { background: rgba(42, 31, 99, 0.35); }
.intro h2 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 500; font-size: 32px; line-height: 35px; letter-spacing: -0.015em; }
.intro h2 em { display: block; }
.intro p { margin: 0 0 36px; font-weight: 400; font-size: 18px; line-height: 25px; letter-spacing: -0.015em; }
.intro form { margin: 0; }
.intro .go { width: 100%; }
.intro[open] { animation: intro-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes intro-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
@media (prefers-reduced-motion: reduce) { .intro[open] { animation: none; } }

/* Voice-only dock: just the mic, centered, with a hint bubble above it until the first tap. */
.bar.voice {
  position: relative;
  justify-content: center;
  width: auto;
  padding: 0;
  background: transparent;
  border: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.bar.voice:focus-within { box-shadow: none; }
.bar.voice .mic {
  width: 68px;
  height: 68px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 24px rgba(42, 31, 99, 0.28);
}
.bar.voice .mic svg { width: 30px; height: 30px; }
.bar.voice .mic.on { background: var(--puff-deep); }
.bar.voice .micsel { position: absolute; left: calc(50% + 40px); top: 12px; margin: 0; }
.dock:has(.bar.voice) .mics { left: 50%; transform: translateX(-50%); }
.hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 14px);
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.hint span {
  position: relative;
  padding: 10px 16px;
  color: var(--ink);
  background: #fffaf6;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(42, 31, 99, 0.18);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
  text-align: center;
  animation: hint-bob 2.4s ease-in-out infinite;
}
.hint span::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: inherit;
  border-radius: 2px;
  transform: translateX(-50%) rotate(45deg);
}
@keyframes hint-bob { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .hint span { animation: none; } }
.dock.picking .hint { display: none; }
