/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0a0b;
  --bg2:       #111114;
  --bg3:       #18181c;
  --border:    #2a2a30;
  --border2:   #3a3a44;
  --accent:    #00e5a0;
  --accent2:   #00b87a;
  --accent-rw: #20c9e0;
  --text:      #e8e8ec;
  --text2:     #888896;
  --text3:     #555566;
  --red:       #ff4d6a;
  --font:      'Syne', sans-serif;
  --mono:      'DM Mono', monospace;
  --radius:    14px;
  --glow:      0 0 32px rgba(0,229,160,0.18);
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

.noise {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: 0.4;
}

/* ── Warmup overlay ──────────────────────────────────────────────────────── */
.warmup-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10,10,11,0.96);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s, visibility 0.6s;
}

.warmup-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.warmup-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 40px 48px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.warmup-icon {
  font-size: 36px;
  color: var(--accent);
  animation: spin 3s linear infinite;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.warmup-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.warmup-sub {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text3);
  line-height: 1.6;
}

.warmup-bar-track {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.warmup-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  width: 0%;
  transition: width 0.6s ease;
}

.warmup-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
}

/* ── Header ──────────────────────────────────────────────────────────────── */
header {
  width: 100%;
  max-width: 680px;
  padding: 32px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 22px; color: var(--accent); line-height: 1; }
.logo-text { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; color: var(--text); }

.tagline {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 300;
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-left: 34px;
}

/* ── Main ────────────────────────────────────────────────────────────────── */
main {
  width: 100%;
  max-width: 680px;
  padding: 40px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  flex: 1;
}

/* ── Mic button ──────────────────────────────────────────────────────────── */
.mic-wrapper { display: flex; flex-direction: column; align-items: center; gap: 14px; }

.mic-btn {
  position: relative;
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  background: var(--bg3);
  color: var(--text2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.3s;
  outline: none;
  -webkit-user-select: none; user-select: none;
}

.mic-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.mic-btn:not(:disabled):hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--glow); }

.mic-btn.recording {
  border-color: var(--red); color: var(--red);
  background: rgba(255,77,106,0.08);
  box-shadow: 0 0 32px rgba(255,77,106,0.22);
}

.mic-btn.processing {
  border-color: var(--accent); color: var(--accent);
  background: rgba(0,229,160,0.06);
  box-shadow: var(--glow);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%,100% { box-shadow: 0 0 20px rgba(0,229,160,0.15); }
  50%      { box-shadow: 0 0 48px rgba(0,229,160,0.35); }
}

.mic-icon { width: 36px; height: 36px; position: relative; z-index: 2; }

.ripple-ring {
  position: absolute; border-radius: 50%;
  border: 1.5px solid var(--red); opacity: 0; pointer-events: none;
}
.mic-btn.recording .ripple-ring { animation: ripple 1.8s ease-out infinite; }
.r1 { width: 120px; height: 120px; animation-delay: 0s !important; }
.r2 { width: 150px; height: 150px; animation-delay: 0.55s !important; }
.r3 { width: 180px; height: 180px; animation-delay: 1.1s !important; }

@keyframes ripple {
  0%   { transform: scale(0.7); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 0; }
}

.mic-hint { font-family: var(--mono); font-size: 12px; color: var(--text3); letter-spacing: 0.06em; transition: color 0.2s; }

/* ── Status bar ──────────────────────────────────────────────────────────── */
.status-bar {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--text2);
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 99px; padding: 6px 16px;
}

.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text3); transition: background 0.3s; flex-shrink: 0;
}
.status-dot.dot-recording { background: var(--red); box-shadow: 0 0 8px var(--red); }
.status-dot.dot-processing { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: blink 0.8s ease-in-out infinite alternate; }
.status-dot.dot-done       { background: var(--accent2); }
.status-dot.dot-error      { background: var(--red); }
@keyframes blink { to { opacity: 0.3; } }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.cards { width: 100%; display: flex; flex-direction: column; gap: 0; }

.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px 22px; transition: border-color 0.3s;
}

.card--kiny {
  border-radius: 0 0 var(--radius) var(--radius);
  border-top: 1px solid var(--border2); background: var(--bg3);
}

.card.active { border-color: var(--accent); }

.card-label {
  font-family: var(--mono); font-size: 10px; font-weight: 400;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text3);
  margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
}

.flag { font-size: 14px; }

.card-body {
  font-size: 17px; font-weight: 600; line-height: 1.55;
  min-height: 52px; color: var(--text); word-break: break-word;
}

.card--kiny .card-body { color: var(--accent-rw); }

.placeholder {
  color: var(--text3); font-weight: 400;
  font-size: 14px; font-family: var(--mono);
}

.card-arrow {
  text-align: center; font-size: 11px; color: var(--text3); padding: 6px 0;
  background: var(--bg2); border-left: 1px solid var(--border); border-right: 1px solid var(--border);
}

/* ── Play button ─────────────────────────────────────────────────────────── */
.play-btn {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 16px; padding: 8px 18px; border-radius: 99px;
  border: 1.5px solid var(--border2); background: transparent; color: var(--text2);
  font-family: var(--mono); font-size: 12px; cursor: pointer; transition: all 0.2s; outline: none;
}
.play-btn:not(:disabled):hover { border-color: var(--accent-rw); color: var(--accent-rw); box-shadow: 0 0 16px rgba(32,201,224,0.18); }
.play-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Timing strip ────────────────────────────────────────────────────────── */
.timing-strip { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.t-pill {
  font-family: var(--mono); font-size: 11px; padding: 4px 12px;
  border-radius: 99px; background: var(--bg2); border: 1px solid var(--border); color: var(--text3);
}
.t-pill--total { border-color: var(--accent2); color: var(--accent2); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer { padding: 24px; font-family: var(--mono); font-size: 11px; color: var(--text3); text-align: center; }
footer a { color: var(--text3); text-decoration: underline; text-underline-offset: 3px; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .logo-text { font-size: 22px; }
  .mic-btn   { width: 84px; height: 84px; }
  .mic-icon  { width: 30px; height: 30px; }
  main       { padding: 28px 16px 16px; }
  .card-body { font-size: 15px; }
  .warmup-card { padding: 32px 24px; }
}
