/* reelmint — production UI (v0.2 voice-first English) */

:root {
  --bg: #0b0d10;
  --bg-2: #0f1217;
  --card: #14171c;
  --card-2: #181c22;
  --line: #232830;
  --line-2: #2c323b;
  --text: #f3f4f6;
  --muted: #9aa1ad;
  --muted-2: #6b7280;
  --accent: #ffe100;
  --accent-2: #00e1ff;
  --accent-pink: #ff36a0;
  --accent-green: #7cfc00;
  --accent-red: #ff4d6d;
  --danger: #ff4d6d;
  --ring: 0 0 0 3px rgba(255,225,0,.18);
  --radius: 14px;
  --radius-lg: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --safe-top: env(safe-area-inset-top, 0);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0;
  background:
    radial-gradient(1100px 600px at 75% -10%, rgba(255,225,0,.07), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(0,225,255,.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 16px/1.5 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  min-height: 100dvh;
  padding-bottom: calc(2rem + var(--safe-bottom));
}

a { color: inherit; }
small { color: var(--muted-2); font-weight: 500; }

/* Top bar */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(.85rem + var(--safe-top)) 1.1rem .85rem;
  background: linear-gradient(180deg, rgba(11,13,16,.96), rgba(11,13,16,.7));
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .55rem; }
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent), 0 0 4px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: .75; }
}
.brand .name { font-weight: 600; letter-spacing: -.01em; font-size: 1.05rem; }
.brand .name b { color: var(--accent); font-weight: 700; }
.badge {
  font-size: .68rem; font-weight: 700; letter-spacing: .12em;
  padding: .2rem .55rem; border-radius: 999px;
  color: var(--accent-2);
  background: rgba(0,225,255,.08);
  border: 1px solid rgba(0,225,255,.25);
}

/* Wrapper */
.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.4rem 1.1rem 0;
}

/* Hero */
.hero { padding: 1.6rem 0 1.8rem; }
.hero-h1 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(1.85rem, 6.5vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  margin: 0 0 .9rem;
}
.hero-h1 .grad {
  display: inline-block;
  background: linear-gradient(90deg, var(--accent), #ff9d2e);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero-h1 .grad2 {
  display: inline-block;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-green));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero-sub {
  color: var(--muted);
  font-size: .98rem; line-height: 1.55;
  margin: 0 0 .8rem; max-width: 42ch;
}
.hero-meta {
  color: var(--muted-2);
  font-size: .8rem;
  display: flex; flex-wrap: wrap; gap: .25rem .55rem;
}

/* Cards / steps */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 0 rgba(255,255,255,.02) inset, 0 6px 30px rgba(0,0,0,.25);
  animation: cardIn .4s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.step-head {
  display: flex; align-items: center; gap: .65rem; margin-bottom: .85rem;
  flex-wrap: wrap;
}
.step-head h2 {
  margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -.005em;
  flex: 1;
}
.step-num {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 8px;
  font-size: .82rem; font-weight: 700;
  color: var(--accent);
  background: rgba(255,225,0,.1);
  border: 1px solid rgba(255,225,0,.25);
}
.done-num {
  color: #0b0d10; background: var(--accent-green);
  border-color: transparent;
}
.link-btn {
  appearance: none; cursor: pointer;
  background: transparent; border: 0;
  color: var(--accent-2);
  font: 500 .82rem 'Inter', sans-serif;
  padding: .35rem .5rem; border-radius: 8px;
}
.link-btn:hover { background: rgba(0,225,255,.06); }

/* Dropzone */
.dropzone {
  display: block; cursor: pointer; user-select: none;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 1.3rem 1rem;
  text-align: center;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.dropzone:hover { border-color: var(--accent); background: #11141a; }
.dropzone.drag { border-color: var(--accent); background: rgba(255,225,0,.06); transform: scale(.997); }
.dz-inner svg { color: var(--muted); margin-bottom: .55rem; }
.dz-title { font-weight: 600; font-size: 1rem; margin-bottom: .25rem; }
.dz-sub { color: var(--muted); font-size: .82rem; }
.ring {
  width: 36px; height: 36px; margin: 0 auto .6rem;
  border: 3px solid var(--line-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.probe { margin-top: .8rem; }
.probe-row {
  display: flex; flex-wrap: wrap; gap: .35rem .9rem;
  font-size: .85rem; color: var(--muted);
  padding: .65rem .8rem; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 10px;
}
.probe b { color: var(--text); font-weight: 600; }

/* Voice card */
.voice-card .voice-help {
  color: var(--muted); font-size: .9rem; line-height: 1.5;
  margin: 0 0 1.1rem;
}
.mic-wrap {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.mic {
  position: relative;
  flex-shrink: 0;
  width: 76px; height: 76px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffea3a, var(--accent));
  border: 0; cursor: pointer;
  color: #0b0d10;
  display: grid; place-items: center;
  box-shadow:
    0 1px 0 rgba(255,255,255,.5) inset,
    0 10px 24px -10px rgba(255,225,0,.6),
    0 2px 12px rgba(255,225,0,.18);
  transition: transform .12s ease;
}
.mic:active { transform: scale(.97); }
.mic:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(255,225,0,.25); }
.mic.recording {
  background: linear-gradient(180deg, #ff6b85, var(--accent-red));
  color: #fff;
  animation: micThrob 1.1s ease-in-out infinite;
}
@keyframes micThrob {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.mic-pulse {
  position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(255,225,0,.45);
  pointer-events: none; opacity: 0;
}
.mic.recording .mic-pulse {
  opacity: 1; border-color: rgba(255,77,109,.6);
  animation: micRing 1.4s ease-out infinite;
}
@keyframes micRing {
  from { transform: scale(.9); opacity: .8; }
  to   { transform: scale(1.5); opacity: 0; }
}
.mic-meta { flex: 1; min-width: 0; }
.mic-state {
  font-weight: 600; font-size: 1rem; margin-bottom: .2rem;
}
.mic-state.live { color: var(--accent-red); }
.mic-time { color: var(--muted); font-size: .82rem; }

.voice-or {
  text-align: center; margin: 1.2rem 0 .75rem;
  position: relative; color: var(--muted-2); font-size: .78rem;
}
.voice-or::before, .voice-or::after {
  content: ''; position: absolute; top: 50%;
  width: calc(50% - 5.5rem); height: 1px;
  background: var(--line);
}
.voice-or::before { left: 0; }
.voice-or::after { right: 0; }
.voice-or span { background: var(--card); padding: 0 .55rem; }

/* Preset chips */
.presets {
  display: flex; flex-wrap: wrap; gap: .4rem;
}
.chip {
  appearance: none; cursor: pointer;
  padding: .45rem .75rem; border-radius: 999px;
  font: 600 .85rem/1 'Inter', sans-serif;
  color: var(--text);
  background: var(--card-2);
  border: 1px solid var(--line-2);
  transition: all .15s ease;
}
.chip:hover { border-color: var(--accent); }
.chip.active {
  color: #0b0d10;
  background: var(--accent);
  border-color: var(--accent);
}

/* Field */
.field { display: block; margin-bottom: .9rem; position: relative; }
.field-label {
  display: block; font-size: .8rem; color: var(--muted);
  margin-bottom: .35rem; font-weight: 500;
}
.field input[type=text], .field select, .field textarea {
  width: 100%;
  padding: .8rem .9rem;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 11px;
  font: 500 1rem/1.3 'Inter', sans-serif;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
.field .count {
  position: absolute; right: .65rem; bottom: .7rem;
  font-size: .72rem; color: var(--muted-2);
  background: var(--bg-2); padding: 0 .25rem;
}

.row.two {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: .8rem;
}
@media (max-width: 420px) {
  .row.two { grid-template-columns: 1fr; }
}

/* Hashtag chips */
.hashtag-row {
  display: flex; flex-wrap: wrap; gap: .35rem;
  padding: .55rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  min-height: 44px;
}
.hashtag {
  font: 500 .78rem 'Inter', sans-serif;
  padding: .25rem .55rem;
  border-radius: 999px;
  color: var(--accent-2);
  background: rgba(0,225,255,.07);
  border: 1px solid rgba(0,225,255,.22);
  cursor: pointer;
  user-select: none;
  transition: opacity .15s ease;
}
.hashtag.removed {
  text-decoration: line-through;
  opacity: .35;
  color: var(--muted);
  border-color: var(--line);
  background: transparent;
}

/* Toggle */
.toggle {
  display: flex; align-items: center; gap: .7rem;
  padding: .8rem .9rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .slider {
  position: relative;
  width: 38px; height: 22px; border-radius: 999px;
  background: var(--line-2);
  transition: background .15s;
  flex-shrink: 0;
}
.toggle .slider::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  transition: transform .15s;
}
.toggle input:checked + .slider { background: var(--accent); }
.toggle input:checked + .slider::after { transform: translateX(16px); }
.toggle-label { font-weight: 500; font-size: .92rem; }

/* Buttons */
.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  width: 100%;
  padding: .95rem 1rem;
  border-radius: 12px;
  border: 0; cursor: pointer;
  font: 700 1rem 'Inter', sans-serif;
  color: #0b0d10;
  background: linear-gradient(180deg, #ffea3a, var(--accent));
  box-shadow: 0 1px 0 rgba(255,255,255,.45) inset, 0 8px 24px -8px rgba(255,225,0,.5);
  text-decoration: none;
  transition: transform .08s ease, filter .15s ease;
}
.primary:not([disabled]):active { transform: translateY(1px); }
.primary:not([disabled]):hover { filter: brightness(1.04); }
.primary[disabled] { opacity: .45; cursor: not-allowed; }

.ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .8rem 1rem;
  border-radius: 11px;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--line-2);
  cursor: pointer;
  font: 600 .92rem 'Inter', sans-serif;
}
.ghost:hover { border-color: var(--accent-2); }

.cta-card { padding-top: 1rem; padding-bottom: 1rem; }
.micro { color: var(--muted); font-size: .78rem; margin: .55rem 0 0; text-align: center; }

/* Steps list */
.steps-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.steps-list li {
  display: flex; align-items: center; gap: .55rem;
  font-size: .9rem; color: var(--muted);
  padding: .35rem 0;
  transition: color .2s;
}
.steps-list li .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--line-2); flex-shrink: 0;
}
.steps-list li.active { color: var(--text); font-weight: 500; }
.steps-list li.active .dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.steps-list li.done { color: var(--accent-green); }
.steps-list li.done .dot { background: var(--accent-green); }

/* Progress bar */
.bar {
  height: 10px; background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px; overflow: hidden;
}
#bar-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 999px;
  transition: width .4s ease;
}

/* Done card */
#player {
  width: 100%; background: #000;
  border-radius: 12px; aspect-ratio: 9/16;
  margin: .3rem 0 .9rem;
  border: 1px solid var(--line);
}
.actions {
  display: grid; gap: .55rem;
  grid-template-columns: 1fr;
}
@media (min-width: 480px) {
  .actions { grid-template-columns: 1.4fr 1fr 1fr; }
}
.copy-block { margin-top: 1rem; }
.copy-block summary {
  color: var(--muted); font-size: .85rem; cursor: pointer;
  padding: .35rem 0;
}
.copy-block textarea {
  width: 100%; min-height: 110px;
  margin: .55rem 0;
  font: 500 .85rem/1.45 'Inter', sans-serif;
  padding: .75rem .85rem;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  resize: vertical;
}

/* Error */
.error-card h2 { color: var(--danger); }
.error-card pre {
  white-space: pre-wrap; word-break: break-word;
  background: var(--bg-2);
  padding: .8rem; border-radius: 10px;
  font-size: .8rem;
  color: var(--danger);
  margin: 0 0 .7rem;
}

/* Footer */
.foot {
  text-align: center; color: var(--muted-2);
  font-size: .76rem;
  padding: 1.6rem 1rem 0;
  border-top: 1px solid var(--line);
  margin-top: 2rem;
}
.foot-meta { margin-top: .25rem; color: var(--muted-2); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  background: var(--card); color: var(--text);
  padding: .7rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .88rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  z-index: 100;
  animation: toastIn .25s ease both;
  max-width: calc(100vw - 2rem);
}
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.success { border-color: var(--accent-green); color: var(--accent-green); }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.hide { display: none !important; }
