:root {
  color-scheme: dark;
  --bg: #0c0d16;
  --bg-soft: #111423;
  --card: rgba(22, 25, 43, 0.82);
  --card-border: rgba(255, 255, 255, 0.12);
  --text: #f7f3ff;
  --muted: #b9b4c9;
  --accent: #ff9bbd;
  --accent-2: #9be7ff;
  --danger: #ff7b7b;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 155, 189, 0.22), transparent 34rem),
    radial-gradient(circle at 88% 18%, rgba(155, 231, 255, 0.18), transparent 30rem),
    linear-gradient(145deg, #0c0d16 0%, #151225 52%, #0a0c14 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell,
.login-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.hero-card,
.login-card {
  width: min(100%, 34rem);
  border: 1px solid var(--card-border);
  border-radius: 2rem;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.hero-card {
  padding: clamp(1.25rem, 4vw, 2.2rem);
}

.login-card {
  padding: clamp(1.4rem, 5vw, 2.4rem);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 9vw, 3.25rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.muted,
.hint-text,
.mobile-note {
  color: var(--muted);
}

.orb-wrap {
  display: grid;
  place-items: center;
  padding: clamp(2rem, 8vw, 3.2rem) 0 1.25rem;
}

.voice-orb {
  width: clamp(10rem, 48vw, 14rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.42), transparent 16%),
    radial-gradient(circle at 50% 50%, rgba(255, 155, 189, 0.92), rgba(155, 231, 255, 0.58) 64%, rgba(255, 255, 255, 0.14));
  box-shadow: 0 0 0 0 rgba(255, 155, 189, 0.42), 0 32px 90px rgba(255, 155, 189, 0.28);
  transition: transform 180ms ease, filter 180ms ease;
}

.voice-orb span {
  font-size: clamp(3rem, 16vw, 5rem);
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.24));
}

.voice-orb.listening {
  animation: pulse 1.05s ease-in-out infinite;
  filter: saturate(1.18);
}

.voice-orb.thinking {
  animation: breathe 1.6s ease-in-out infinite;
}

.voice-orb.speaking {
  animation: speak 0.62s ease-in-out infinite;
  filter: saturate(1.35) brightness(1.05);
}

.voice-orb.error {
  background: radial-gradient(circle, rgba(255, 123, 123, 0.95), rgba(255, 155, 189, 0.48));
}

.status-text {
  min-height: 1.7rem;
  margin: 0.2rem 0 0;
  font-size: clamp(1.05rem, 4vw, 1.25rem);
  font-weight: 800;
  text-align: center;
}

.hint-text {
  margin: 0.6rem auto 1.45rem;
  max-width: 28rem;
  text-align: center;
  line-height: 1.55;
}

.talk-button,
.primary-button {
  width: 100%;
  min-height: 3.65rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #ffd4a3);
  color: #291421;
  font-weight: 900;
  box-shadow: 0 16px 38px rgba(255, 155, 189, 0.28);
  touch-action: manipulation;
}

.talk-button.running {
  background: linear-gradient(135deg, #d8e8ff, var(--accent-2));
  color: #07131b;
}

.talk-button:disabled,
.primary-button:disabled {
  opacity: 0.58;
  cursor: wait;
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  padding: 0.7rem 0.95rem;
}

.mobile-note {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.06);
  line-height: 1.45;
  font-size: 0.94rem;
}

.brand-mark {
  width: 3.4rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.08);
  font-size: 2rem;
}

.login-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.35rem;
}

.login-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 3.25rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 0.85rem 1rem;
  outline: none;
}

.login-form input:focus {
  border-color: rgba(155, 231, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(155, 231, 255, 0.12);
}

.login-error {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 123, 123, 0.14);
  color: #ffd4d4;
  font-weight: 800;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 155, 189, 0.4), 0 32px 90px rgba(255, 155, 189, 0.28); }
  50% { transform: scale(1.045); box-shadow: 0 0 0 22px rgba(255, 155, 189, 0), 0 32px 90px rgba(155, 231, 255, 0.24); }
}

@keyframes breathe {
  0%, 100% { transform: scale(0.99); }
  50% { transform: scale(1.035); }
}

@keyframes speak {
  0%, 100% { transform: scale(1) rotate(-0.6deg); }
  50% { transform: scale(1.06) rotate(0.8deg); }
}

@media (max-width: 520px) {
  .app-shell,
  .login-shell {
    align-items: stretch;
    padding: 0;
  }

  .hero-card,
  .login-card {
    min-height: 100svh;
    width: 100%;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .topbar {
    align-items: center;
  }

  .ghost-button {
    padding: 0.65rem 0.85rem;
  }
}
