:root {
  color-scheme: dark;
  --bg: #080b11;
  --panel: rgba(16, 21, 31, 0.72);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f4f6f8;
  --muted: #8a94a4;
  --cyan: #54e6d6;
  --blue: #63a9ff;
  --danger: #ff7474;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -20%, rgba(48, 119, 144, 0.18), transparent 42%),
    linear-gradient(155deg, #0b1018 0%, var(--bg) 55%, #07090e 100%);
  color: var(--text);
}

button, input { font: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.08;
  pointer-events: none;
}
.ambient-one { top: 10%; left: -20rem; background: var(--cyan); }
.ambient-two { right: -22rem; bottom: 0; background: var(--blue); }

.shell {
  position: relative;
  width: min(100% - 40px, 1080px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 max(24px, env(safe-area-inset-bottom));
}

.topbar, footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid rgba(84, 230, 214, 0.4);
  border-radius: 50%;
  box-shadow: inset 0 0 20px rgba(84, 230, 214, 0.09);
}

.brand-mark i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}

.brand strong { display: block; font-size: 14px; letter-spacing: 0.23em; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; letter-spacing: 0.18em; }

.connection {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e3ac57;
  box-shadow: 0 0 10px currentColor;
}
.connection.online .connection-dot { background: var(--cyan); }
.connection.error .connection-dot { background: var(--danger); }

.hero { margin-top: clamp(68px, 10vh, 120px); text-align: center; }
.eyebrow { margin: 0 0 16px; color: var(--cyan); font-size: 10px; letter-spacing: 0.28em; }
.hero h1 { margin: 0; font-size: clamp(38px, 7vw, 74px); font-weight: 550; line-height: 0.98; letter-spacing: -0.045em; }
.hero h1 em { color: #aeb8c7; font-style: normal; font-weight: 360; }
.hero-copy { max-width: 520px; margin: 24px auto 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
kbd { padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,0.04); color: #cbd2db; font: inherit; }

.voice-panel { display: grid; justify-items: center; margin: 58px 0 54px; }
.rings { position: relative; display: grid; width: 158px; height: 158px; place-items: center; }
.rings > span { position: absolute; border: 1px solid rgba(84,230,214,0.13); border-radius: 50%; transition: 400ms ease; }
.rings > span:nth-child(1) { inset: 0; }
.rings > span:nth-child(2) { inset: 14px; }
.rings > span:nth-child(3) { inset: 28px; border-color: rgba(84,230,214,0.22); }
.rings.recording > span { animation: pulse-ring 1.6s ease-out infinite; }
.rings.recording > span:nth-child(2) { animation-delay: 180ms; }
.rings.recording > span:nth-child(3) { animation-delay: 360ms; }

.voice-button {
  z-index: 1;
  display: grid;
  width: 76px;
  height: 76px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(84, 230, 214, 0.55);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, rgba(106, 255, 236, 0.2), rgba(8, 19, 24, 0.92));
  box-shadow: 0 0 45px rgba(84, 230, 214, 0.13), inset 0 0 26px rgba(84, 230, 214, 0.08);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 240ms ease;
  -webkit-tap-highlight-color: transparent;
}
.voice-button:hover { transform: scale(1.04); box-shadow: 0 0 54px rgba(84, 230, 214, 0.23); }
.voice-button:active { transform: scale(0.96); }
.voice-button:disabled { cursor: wait; filter: saturate(0.4); }
.voice-button svg { width: 27px; fill: none; stroke: var(--cyan); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.45; }

.voice-state { margin: 17px 0 0; font-size: 14px; }
.voice-hint { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.replay-button {
  margin-top: 14px;
  padding: 10px 16px;
  border: 1px solid rgba(84, 230, 214, 0.38);
  border-radius: 999px;
  background: rgba(84, 230, 214, 0.1);
  color: #dffef9;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.04em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.replay-button:hover { background: rgba(84, 230, 214, 0.17); }
.replay-button:active { transform: scale(0.97); }
.replay-button[hidden] { display: none; }
.timer { min-height: 15px; margin-top: 8px; color: var(--cyan); font: 10px ui-monospace, monospace; letter-spacing: 0.15em; opacity: 0; }
.recording + .voice-state { color: var(--cyan); }

.conversation {
  min-height: 115px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 22px 70px rgba(0,0,0,0.18);
  backdrop-filter: blur(16px);
}
.empty-state { display: flex; gap: 16px; align-items: center; min-height: 77px; color: var(--muted); }
.empty-state span { color: rgba(84,230,214,0.5); font: 10px ui-monospace, monospace; }
.empty-state p { margin: 0; font-size: 12px; line-height: 1.6; }
.messages { display: grid; gap: 16px; }
.message { display: grid; gap: 7px; animation: reveal 350ms ease both; }
.message + .message { padding-top: 16px; border-top: 1px solid var(--line); }
.message-label { color: var(--muted); font-size: 9px; letter-spacing: 0.18em; }
.message p { margin: 0; color: #dfe4ea; font-size: 14px; line-height: 1.62; }
.message.user p { color: #98a3b1; }

.text-composer {
  display: flex;
  gap: 10px;
  margin: 14px 0 30px;
  padding: 7px 7px 7px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(11, 15, 23, 0.65);
}
.text-composer:focus-within { border-color: rgba(84,230,214,0.38); }
.text-composer input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; }
.text-composer input::placeholder { color: #647081; }
.text-composer button { display: grid; width: 38px; height: 38px; padding: 0; place-items: center; border: 0; border-radius: 10px; background: rgba(84,230,214,0.1); cursor: pointer; }
.text-composer button svg { width: 18px; fill: none; stroke: var(--cyan); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.4; }

footer { color: #596575; font: 9px ui-monospace, monospace; letter-spacing: 0.13em; }
.phone-link { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: #718093; font: inherit; letter-spacing: inherit; cursor: pointer; }
.phone-link:hover { border-color: rgba(84,230,214,0.35); color: var(--cyan); }
.shortcut { display: flex; gap: 4px; align-items: center; }
.shortcut kbd { padding: 2px 5px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes pulse-ring { 0% { opacity: 0.75; transform: scale(0.8); } 75%, 100% { opacity: 0; transform: scale(1.28); } }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 620px) {
  .shell { width: min(100% - 28px, 540px); padding-top: max(18px, env(safe-area-inset-top)); }
  .hero { margin-top: 58px; }
  .hero h1 { font-size: clamp(36px, 12vw, 53px); }
  .hero-copy { max-width: 330px; font-size: 13px; }
  .voice-panel { margin: 42px 0 38px; }
  .conversation { border-radius: 17px; }
  footer .shortcut { display: none; }
  footer { flex-wrap: wrap; gap: 12px; }
}

@media (min-width: 621px) and (max-height: 900px) {
  .shell { padding-top: 20px; }
  .hero { margin-top: 38px; }
  .hero h1 { font-size: clamp(42px, 6vw, 62px); }
  .hero-copy { margin-top: 15px; }
  .voice-panel { margin: 26px 0 24px; }
  .rings { width: 132px; height: 132px; }
  .rings > span:nth-child(2) { inset: 12px; }
  .rings > span:nth-child(3) { inset: 24px; }
  .voice-button { width: 68px; height: 68px; }
  .conversation { min-height: 96px; padding: 12px 18px; }
  .empty-state { min-height: 70px; }
  .text-composer { margin-bottom: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; }
}
