* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --black: #060606;
  --white: #e8e8e3;
  --gray: #777;
  --dim: #444;
  --accent: #c8ff00;
  --border: #1a1a1a;
}
body {
  background: var(--black);
  color: var(--white);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1.5rem;
}
::selection { background: var(--accent); color: var(--black); }
.container { max-width: 45rem; width: 100%; padding: 1.5rem; }
h1 { font-family: 'JetBrains Mono', monospace; font-size: 1.2rem; font-weight: 600; margin-bottom: 0.3rem; letter-spacing: 0.04em; text-transform: uppercase; text-align: center; }
h1 span { color: var(--accent); }
h1.brand-center { text-align: center; font-size: 1.4rem; margin-bottom: 1.5rem; }
.brand-title { color: inherit; text-decoration: underline; text-underline-offset: 0.3rem; }
.brand-title:hover { color: var(--accent); }
.brand-title span { color: var(--accent); }
.end-brand { display: inline-block; margin-top: 2rem; font-family: 'JetBrains Mono', monospace; font-size: 1.6rem; font-weight: 600; animation: brand-pulse 2.5s ease-in-out infinite; text-decoration: underline; text-underline-offset: 0.375rem; text-decoration-color: #fff; }
@keyframes brand-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
.subtitle { color: var(--gray); margin-bottom: 1.5rem; font-size: 0.85rem; }
.info { font-size: 0.8rem; color: var(--gray); margin-bottom: 1.5rem; line-height: 1.5; }

/* Hero */
.hero-box {
  background: #0e0e0e; border: 0.0625rem solid var(--border); border-radius: 0.75rem;
  padding: 2.5rem; text-align: center; margin-bottom: 2rem;
}
.hero-icon {
  margin-bottom: 1rem; color: var(--accent);
  animation: hero-glow 2s ease-in-out infinite;
}
@keyframes hero-glow {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 0.5rem rgba(200,255,0,0.2)); }
  50% { opacity: 0.7; filter: drop-shadow(0 0 2.5rem rgba(200,255,0,0.8)) drop-shadow(0 0 4rem rgba(200,255,0,0.3)); }
}
.hero-box p { color: var(--gray); line-height: 1.6; }

/* Question */
.question-box {
  background: #0e0e0e; border: 0.0625rem solid var(--border);
  border-radius: 0.5rem; padding: 1.5rem; margin-bottom: 1.5rem; min-height: 6.25rem;
  position: relative; text-align: center;
}
.question-box.playing { border-color: var(--accent); box-shadow: 0 0 1rem rgba(200,255,0,0.15); transition: all 0.3s; }
.question-label {
  font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
  color: #ccc; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.4rem;
}
.question-text { font-family: 'Inter', system-ui, sans-serif; font-size: 1.2rem; font-weight: 500; line-height: 1.65; white-space: pre-line; color: #fff; text-wrap: balance; letter-spacing: -0.01em; }
.question-flash { animation: q-flash 0.8s ease-out; }
@keyframes q-flash { 0% { text-shadow: 0 0 0.5rem rgba(255,255,255,0.6); } 100% { text-shadow: none; } }

.btn-tts {
  position: absolute; top: 0.8rem; right: 0.8rem;
  background: none; border: 0.0625rem solid var(--dim); color: var(--white);
  font-size: 1.3rem; width: 2.75rem; height: 2.75rem; border-radius: 50%; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; transition: all 0.2s;
  line-height: 2.625rem; text-align: center; padding: 0;
}
.btn-tts:hover { border-color: var(--accent); color: var(--accent); }
.btn-tts.playing { border-color: var(--accent); color: var(--accent); background: rgba(200,255,0,0.1); }

/* Transcript */
.transcript-box {
  background: #0a0a0a; border: 0.0625rem solid var(--border); border-radius: 0.5rem;
  padding: 1rem; margin-bottom: 1rem; min-height: 3.125rem;
}
.transcript-label {
  font-family: 'JetBrains Mono', monospace; font-size: 0.6rem;
  color: var(--accent); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.3rem;
}
.transcript-text { font-size: 0.9rem; color: var(--gray); line-height: 1.4; font-style: italic; }

/* Audio vis */
.audio-vis {
  position: relative; width: 100%; height: 7rem;
  background: #0e0e0e; border-radius: 0.5rem; overflow: hidden;
  margin-bottom: 1.5rem; border: 0.0625rem solid var(--border);
  display: flex; align-items: flex-end; justify-content: center;
}
#vizCanvas { width: 100%; height: 100%; }
.rec-badge {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: #e33; color: #fff; font-size: 0.75rem;
  padding: 0.25rem 0.625rem; border-radius: 0.25rem; font-weight: 600;
  animation: pulse 1.5s infinite;
  font-family: 'JetBrains Mono', monospace;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.timer {
  position: absolute; bottom: 0.5rem; right: 0.5rem;
  background: rgba(0,0,0,0.7); color: #fff; font-size: 0.7rem;
  padding: 0.125rem 0.375rem; border-radius: 0.1875rem;
  font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
}

/* Progress */
.progress { display: flex; gap: 0.3125rem; margin-bottom: 1.5rem; }
.progress-dot { width: 100%; height: 0.1875rem; border-radius: 0.125rem; background: var(--border); transition: background 0.3s; }
.progress-dot.done { background: var(--accent); }
.progress-dot.active { background: var(--accent); }

/* Controls */
.controls { display: flex; gap: 0.8rem; margin-top: 0.5rem; }
.btn {
  flex: 1; padding: 1.125rem 0.875rem; border: none; border-radius: 0.5rem;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; transition: all 0.15s;
}
.btn:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-small { flex: 1; font-size: 0.8rem !important; }
.btn-large { flex: 3; font-size: 1.1rem !important; }
.btn-primary { background: var(--accent); color: var(--black); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn-pulse { animation: btn-glow 2s ease-in-out infinite; }
@keyframes btn-glow {
  0%, 100% { opacity: 1; box-shadow: 0 0 0.5rem rgba(200,255,0,0.2); }
  50% { opacity: 0.7; box-shadow: 0 0 2rem rgba(200,255,0,0.5); }
}
.btn-secondary { background: transparent; color: var(--white); border: 0.0625rem solid var(--dim); }
.btn-secondary:hover:not(:disabled) { border-color: var(--white); }
.btn-accent { background: none; border: 0.125rem solid var(--accent); color: var(--accent); padding: 0.75rem 1.5rem; border-radius: 0.5rem; font-size: 1rem; cursor: pointer; font-family: 'JetBrains Mono', monospace; font-weight: 600; transition: all 0.2s; }
.btn-accent:hover { background: var(--accent); color: var(--black); }
.btn-accent.recording { background: #e33; border-color: #e33; color: #fff; animation: pulse 1.5s infinite; }

/* Form */
.form-group { margin-bottom: 1rem; display: flex; align-items: center; gap: 0.8rem; }
.form-group label { flex: 0 0 30%; font-size: 1rem; color: #fff; font-family: 'JetBrains Mono', monospace; text-align: right; font-weight: 600; }
.form-group input {
  flex: 1; padding: 0.625rem 0.75rem; background: #0e0e0e; border: 0.0625rem solid var(--border);
  border-radius: 0.375rem; color: var(--white); font-family: 'Inter', system-ui, sans-serif; font-size: 0.9rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.form-group input:focus { outline: none; border-color: var(--accent); }
.form-group input::placeholder { color: var(--dim); }
.form-group input.field-flash {
  border-color: var(--accent);
  box-shadow: 0 0 1.5rem rgba(200,255,0,0.6), 0 0 3rem rgba(200,255,0,0.2);
  animation: field-fill 1.2s ease-out;
}
@keyframes field-fill {
  0% { background: rgba(200,255,0,0.25); box-shadow: 0 0 2rem rgba(200,255,0,0.8), 0 0 4rem rgba(200,255,0,0.3); transform: scale(1.02); }
  30% { background: rgba(200,255,0,0.1); }
  100% { background: #0e0e0e; box-shadow: none; transform: scale(1); }
}

.voice-fill-area { text-align: center; margin-top: 1rem; }
.voice-fill-area.processing .voice-status {
  animation: ai-pulse 1.5s ease-in-out infinite;
}
@keyframes ai-pulse {
  0%, 100% { color: var(--dim); text-shadow: none; }
  50% { color: var(--accent); text-shadow: 0 0 1.5rem rgba(200,255,0,0.4); }
}
.voice-status {
  margin-top: 0.5rem; font-size: 0.8rem; color: var(--gray);
  font-family: 'JetBrains Mono', monospace; min-height: 1.2em;
}

/* Done */
.done-box { text-align: center; padding: 3rem 1rem; }
.done-check {
  font-size: 3.5rem; color: var(--accent); margin-bottom: 1.5rem;
  opacity: 0; transform: scale(0);
  animation: done-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s forwards;
}
@keyframes done-pop {
  0% { opacity: 0; transform: scale(0); }
  60% { opacity: 1; transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 2rem rgba(200,255,0,0.6)); }
}
.done-box h2 {
  font-family: 'JetBrains Mono', monospace; font-size: 1.5rem; margin-bottom: 0.8rem; color: var(--accent);
  opacity: 0; animation: done-fade-up 0.5s ease-out 0.5s forwards;
}
.done-box p {
  color: var(--gray); margin-bottom: 1.5rem;
  opacity: 0; animation: done-fade-up 0.5s ease-out 0.7s forwards;
}
@keyframes done-fade-up {
  0% { opacity: 0; transform: translateY(1rem); }
  100% { opacity: 1; transform: translateY(0); }
}
.thanks-sub { font-size: 1.1rem; line-height: 1.6; }

.thanks-msg {
  text-align: center; color: var(--accent); font-size: 0.9rem; font-weight: 500;
  margin-bottom: 1.5rem; font-family: 'JetBrains Mono', monospace;
}
.selfie-compact { padding: 0.6rem; margin-bottom: 0.8rem; }
.btn-selfie-sm { font-size: 0.8rem !important; padding: 0.625rem 0.75rem !important; }
.transcripts-area {
  margin-top: 1.5rem; background: #0a0a0a; border: 0.0625rem solid var(--border);
  border-radius: 0.5rem; padding: 1rem;
}
.transcripts-list { margin-top: 0.5rem; }
.transcript-item { padding: 0.6rem 0; border-bottom: 0.0625rem solid var(--border); }
.transcript-item:last-child { border-bottom: none; }
.transcript-item .t-question {
  font-family: 'JetBrains Mono', monospace; font-size: 0.65rem;
  color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2rem;
}
.transcript-item .t-text { font-size: 0.85rem; color: var(--gray); line-height: 1.4; font-style: italic; }
.transcript-item .t-loading { font-size: 0.8rem; color: var(--dim); }

/* Selfie */
.selfie-area {
  text-align: center; margin-bottom: 1.5rem;
  background: #0e0e0e; border: 0.0625rem solid var(--border); border-radius: 0.75rem;
  padding: 1rem; overflow: hidden;
}
.selfie-area video, .selfie-area img {
  width: 100%; max-width: 17.5rem; border-radius: 0.5rem; aspect-ratio: 1/1; object-fit: cover;
  margin-bottom: 0.8rem;
}
.selfie-area .btn { margin: 0.3rem; }

.screen { display: none; }
.screen.active { display: block; }

/* Mobile — scale with viewport, works on all DPIs */
@media (max-width: 50rem) {
  html { font-size: clamp(16px, calc(14px + 0.5vw), 20px); }
  body { padding-top: 0.5rem; }
  .container { padding: 1.2rem; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; }
  h1 { font-size: 1.15rem; margin-bottom: 0.5rem; }
  h1.brand-center { font-size: 1.5rem; margin-bottom: 1.5rem; }
  .question-box { padding: 1.5rem 1rem; margin-bottom: 1.5rem; min-height: 5rem; }
  .question-text { font-size: 1.35rem; line-height: 1.7; }
  .question-label { font-size: 0.85rem; margin-bottom: 0.5rem; }
  .btn-tts { width: 3rem; height: 3rem; font-size: 1.4rem; line-height: 2.85rem; }
  .audio-vis { height: 5.5rem; margin-bottom: 1.5rem; }
  .btn { font-size: 1.1rem; padding: 1.2rem 1rem; border-radius: 0.6rem; }
  .btn-small { font-size: 0.9rem !important; }
  .btn-large { font-size: 1.2rem !important; }
  .controls { gap: 0.6rem; margin-top: 0.8rem; }
  .hero-box { padding: 2.5rem 1.5rem; margin-bottom: 2rem; }
  .hero-icon svg { width: 5rem; height: 5rem; }
  .hero-box p { font-size: 1.1rem; line-height: 1.8; }
  .progress { margin-bottom: 1.5rem; }
  .progress-dot { height: 0.25rem; }
  .rec-badge { font-size: 0.9rem; padding: 0.35rem 0.75rem; }
  .timer { font-size: 0.85rem; }
  .form-group { flex-direction: column; align-items: stretch; gap: 0.4rem; margin-bottom: 1.2rem; }
  .form-group label { flex: none; text-align: left; font-size: 1.1rem; }
  .form-group input { font-size: 1.05rem; padding: 0.9rem; }
  .thanks-msg { font-size: 1rem; margin-bottom: 1.5rem; }
  .voice-fill-area { margin-top: 1.2rem; margin-bottom: 1.5rem; }
  .btn-accent { font-size: 1.15rem; padding: 1rem 2rem; }
  .done-box { padding: 3rem 1rem; }
  .done-box h2 { font-size: 1.5rem; margin-bottom: 1rem; }
  .thanks-sub { font-size: 1.15rem; }
  .end-brand { font-size: 1.3rem; }
}
