:root {
  --bg: #0b0c10;
  --ink: #f4f1ea;
  --muted: #9aa0ac;
  --line: rgba(244, 241, 234, 0.12);
  --card: rgba(255, 255, 255, 0.035);
  --accent: #ff6b4a;
  --accent-2: #6ad0c9;
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
}

.aurora {
  position: fixed;
  inset: -30vh -10vw auto;
  height: 80vh;
  background:
    radial-gradient(40vw 40vw at 20% 20%, rgba(255, 107, 74, 0.22), transparent 60%),
    radial-gradient(35vw 35vw at 80% 10%, rgba(106, 208, 201, 0.18), transparent 60%);
  filter: blur(20px);
  z-index: 0;
  pointer-events: none;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) 22px 48px;
}

.masthead {
  text-align: center;
  margin-bottom: clamp(28px, 5vw, 52px);
}

.wordmark {
  font-family: "Fraunces", serif;
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.wordmark span {
  color: var(--accent);
}

.tagline {
  color: var(--muted);
  margin: 0.4rem 0 0;
  font-size: 1.02rem;
}

.board {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(8px);
}

.panel--result {
  grid-column: 1 / -1;
}

.step {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 280px;
  border: 1.5px dashed var(--line);
  border-radius: 16px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover,
.dropzone.is-drag {
  border-color: var(--accent);
  background: rgba(255, 107, 74, 0.06);
}

.dropzone__hint {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--muted);
  text-align: center;
}

.dropzone__hint strong {
  color: var(--ink);
  font-size: 1.05rem;
}

#preview {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 14px;
}

.panel--ask {
  display: flex;
  flex-direction: column;
}

.mic {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 0 24px;
  border: none;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

.mic:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.mic__icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(150deg, #1a1c22, #101116);
  border: 1px solid var(--line);
  color: var(--accent-2);
  transition: transform 0.15s, color 0.15s;
}

.mic__ring {
  position: absolute;
  top: 28px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
}

.mic.is-recording .mic__icon {
  color: var(--accent);
  transform: scale(1.04);
}

.mic.is-recording .mic__ring {
  opacity: 1;
  animation: pulse 1.3s ease-out infinite;
}

@keyframes pulse {
  from {
    transform: scale(1);
    opacity: 0.7;
  }
  to {
    transform: scale(1.7);
    opacity: 0;
  }
}

.mic__label {
  font-size: 0.92rem;
  color: var(--muted);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  margin: 4px 0 14px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.text-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  font: inherit;
  margin-bottom: 16px;
}

.text-input:focus {
  outline: none;
  border-color: var(--accent-2);
}

.ask-btn {
  margin-top: auto;
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #1a0d09;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}

.ask-btn:hover:not(:disabled) {
  filter: brightness(1.05);
}

.ask-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.ask-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ask-btn.is-busy {
  color: transparent;
  position: relative;
}

.ask-btn.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(26, 13, 9, 0.4);
  border-top-color: #1a0d09;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.heard {
  color: var(--muted);
  font-style: italic;
  margin: 0 0 10px;
}

.heard:empty {
  display: none;
}

.answer {
  font-family: "Fraunces", serif;
  font-size: 1.3rem;
  line-height: 1.45;
  margin: 0 0 18px;
}

.replay {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--accent-2);
  border-radius: 10px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.replay:hover {
  border-color: var(--accent-2);
}

.status {
  min-height: 1.4em;
  text-align: center;
  color: var(--accent-2);
  font-size: 0.9rem;
  margin: 22px 0 0;
}

.status.is-error {
  color: var(--accent);
}

.footnote {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 34px;
}

@media (max-width: 760px) {
  .board {
    grid-template-columns: 1fr;
  }
}
