/* Ka-Ching Lite — dark, streamer-friendly, one stylesheet. */

:root {
  --bg: #0b0c10;
  --bg-raised: #14161d;
  --bg-sunken: #090a0e;
  --line: #23262f;
  --line-soft: #1a1d24;
  --text: #e8e9ec;
  --text-dim: #9aa0ab;
  --text-faint: #6b7280;
  --accent: #f08000;
  --accent-soft: rgba(240, 128, 0, 0.14);
  --accent-line: rgba(240, 128, 0, 0.42);
  --good: #3fb950;
  --warn: #d9a441;
  --bad: #e5534b;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(240, 128, 0, 0.10), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: 1.05rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); }

kbd {
  font: 600 0.75em var(--mono);
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.1em 0.4em;
}

/* --- chrome ------------------------------------------------------------- */

.site-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand em { color: var(--accent); font-style: normal; font-weight: 600; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 8px; background: var(--accent); color: #12130f; font-weight: 800;
}
.site-head nav { display: flex; gap: 1.25rem; font-size: 0.9rem; }
.site-head nav a { color: var(--text-dim); }

main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 3rem) 5rem; }

.hero { padding: clamp(3rem, 9vw, 6rem) 0 2.5rem; max-width: 46rem; }
.lede { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--text-dim); margin: 0 0 1rem; }
.lede-sub { color: var(--text-faint); margin: 0; }

.notice {
  margin: 1.5rem 0 0; padding: 0.7rem 0.95rem;
  border: 1px solid var(--accent-line); border-radius: var(--radius);
  background: var(--accent-soft); color: #f7d3ab; font-size: 0.92rem;
}

/* --- tool --------------------------------------------------------------- */

.tool {
  border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(180deg, var(--bg-raised), var(--bg-sunken));
  padding: clamp(1.1rem, 3vw, 2rem);
}

.controls { display: flex; gap: 1rem; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.82rem; color: var(--text-dim); }
.field.grow { flex: 1 1 18rem; }
select, input[type="text"], input[type="email"] {
  font: inherit; color: var(--text);
  background: var(--bg-sunken); border: 1px solid var(--line);
  border-radius: 9px; padding: 0.5rem 0.65rem;
}
select:focus-visible, input:focus-visible, button:focus-visible, .dropzone:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: #f7d3ab; border-radius: 999px; padding: 0.15rem 0.35rem 0.15rem 0.7rem; font-size: 0.83rem;
}
.chip button { background: none; border: 0; color: inherit; cursor: pointer; font-size: 0.9em; padding: 0 0.25rem; }

.hint { color: var(--text-faint); font-size: 0.85rem; margin: 0.6rem 0 0; }

.dropzone {
  margin-top: 1.25rem; display: grid; gap: 0.35rem; place-items: center;
  padding: clamp(2rem, 6vw, 3.5rem); text-align: center; cursor: pointer;
  border: 2px dashed var(--line); border-radius: var(--radius);
  background: var(--bg-sunken); transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone strong { font-size: 1.15rem; }
.dropzone span { color: var(--text-faint); font-size: 0.88rem; }

.turnstile { margin-top: 0.75rem; min-height: 0; }

.progress { margin-top: 1.25rem; }
.progress-row { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-dim); margin-bottom: 0.4rem; }
.bar { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; position: relative; }
.bar::after {
  content: ''; position: absolute; inset: 0 auto 0 0; width: var(--fill, 0%);
  background: linear-gradient(90deg, var(--accent), #ffb04d); border-radius: inherit;
  transition: width .25s ease;
}
.bar.is-indeterminate::after { animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { left: -35%; } 100% { left: 100%; } }

.error {
  margin-top: 1rem; padding: 0.7rem 0.95rem; border-radius: var(--radius);
  border: 1px solid rgba(229, 83, 75, 0.45); background: rgba(229, 83, 75, 0.12); color: #ffb9b4;
}
.ratelimit {
  margin-top: 1rem; padding: 0.9rem 1rem; border-radius: var(--radius);
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  display: grid; gap: 0.3rem; font-size: 0.92rem;
}

/* --- workspace ---------------------------------------------------------- */

.workspace { display: none; gap: 1.5rem; margin-top: 1.5rem; }
body[data-stage="reviewing"] .workspace,
body[data-stage="rendering"] .workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); }
body[data-stage="reviewing"] .dropzone,
body[data-stage="rendering"] .dropzone,
body[data-stage="working"] .dropzone,
body[data-stage="done"] .dropzone { display: none; }

video {
  width: 100%; border-radius: var(--radius); background: #000;
  border: 1px solid var(--line); display: block; max-height: 62vh;
}

.timeline { margin-top: 0.6rem; }
.tl-track {
  position: relative; height: 34px; border-radius: 8px; cursor: pointer;
  background: var(--bg-sunken); border: 1px solid var(--line);
}
.tl-ticks { position: absolute; inset: 0; }
.tl-tick {
  position: absolute; top: 4px; width: 4px; height: 26px; margin-left: -2px;
  padding: 0; border: 0; border-radius: 3px; cursor: pointer;
  background: var(--accent); transition: transform .1s, box-shadow .1s;
}
.tl-tick:hover, .tl-tick.is-selected { transform: scaleX(2.2); box-shadow: 0 0 0 1px var(--bg-sunken); }
.tl-tick.status-not_found { background: var(--warn); }
.tl-tick.status-error { background: var(--bad); }
.tl-tick.status-pending { background: var(--text-faint); }
.tl-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; opacity: .8; pointer-events: none; }

.stage-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.9rem; }
.summary { color: var(--text-dim); font-size: 0.9rem; margin-right: auto; }

.btn {
  font: 600 0.95rem/1 var(--font); border-radius: 9px; padding: 0.65rem 1.05rem;
  border: 1px solid transparent; cursor: pointer;
}
.btn.primary { background: var(--accent); color: #12130f; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); }

/* --- marker list -------------------------------------------------------- */

.side-col { min-width: 0; }
.side-col h2 { margin-top: 1.4rem; }
.side-col h2:first-child { margin-top: 0; }

.marker-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; max-height: 42vh; overflow: auto; }
.marker-empty { color: var(--text-faint); font-size: 0.88rem; padding: 0.75rem; border: 1px dashed var(--line); border-radius: 10px; }

.marker {
  border: 1px solid var(--line); border-left: 3px solid var(--line);
  border-radius: 10px; background: var(--bg-sunken); padding: 0.5rem 0.6rem;
  display: grid; gap: 0.4rem;
}
.marker.status-ok { border-left-color: var(--good); }
.marker.status-not_found { border-left-color: var(--warn); }
.marker.status-error { border-left-color: var(--bad); }
.marker.is-selected { border-color: var(--accent); background: var(--accent-soft); }

.marker-main { display: flex; align-items: center; gap: 0.5rem; }
.marker-time {
  font: 600 0.78rem var(--mono); color: var(--text-dim); background: none;
  border: 1px solid var(--line); border-radius: 6px; padding: 0.15rem 0.35rem; cursor: pointer;
}
.marker-time:hover { color: var(--accent); border-color: var(--accent); }
.marker-thumb { width: 26px; height: 36px; object-fit: cover; border-radius: 3px; background: var(--line-soft); flex: none; }
.marker-thumb.is-empty { display: inline-block; }
.marker-name { flex: 1 1 auto; min-width: 0; font-size: 0.9rem; padding: 0.3rem 0.45rem; }

.marker-meta { display: flex; align-items: center; gap: 0.35rem; }
.price {
  font: 700 0.95rem var(--font); color: var(--accent); background: none;
  border: 1px solid transparent; border-radius: 6px; padding: 0.15rem 0.4rem; cursor: pointer; margin-right: auto;
}
.price:hover { border-color: var(--line); }
.price.is-manual { color: var(--warn); }
.price-input { width: 7rem; font: 700 0.9rem var(--font); margin-right: auto; }
.foil {
  background: none; border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
  color: var(--text-faint); padding: 0.15rem 0.4rem;
}
.foil.is-on { color: #7fd4ff; border-color: #2b5f77; background: rgba(127, 212, 255, 0.1); }
.marker-sound { font-size: 0.8rem; padding: 0.2rem 0.3rem; }
.marker.sound-manual .marker-sound { border-color: var(--accent-line); }
.icon-btn {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  color: var(--text-dim); cursor: pointer; padding: 0.15rem 0.4rem; font-size: 0.8rem;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn.danger:hover { color: var(--bad); border-color: var(--bad); }
.marker-note { margin: 0; font-size: 0.78rem; color: var(--text-faint); }

/* --- ladder ------------------------------------------------------------- */

.ladder { display: grid; gap: 0.3rem; }
.rung {
  display: grid; grid-template-columns: auto 4.5rem 1fr auto 4.5rem auto;
  align-items: center; gap: 0.45rem; font-size: 0.83rem;
  padding: 0.3rem 0.4rem; border: 1px solid var(--line-soft); border-radius: 8px;
}
.rung.is-manual { opacity: 0.55; }
.rung-name { font-weight: 600; }
.rung-band { color: var(--text-faint); font-family: var(--mono); font-size: 0.75rem; }
.rung-ceiling { color: var(--text-faint); display: flex; align-items: center; gap: 0.2rem; }
.ceiling { width: 3.6rem; padding: 0.15rem 0.3rem; font-size: 0.8rem; }
.volume { width: 4.5rem; accent-color: var(--accent); }
.ladder-total { margin: 0.5rem 0 0; color: var(--text-dim); font-size: 0.85rem; }

/* --- autocomplete ------------------------------------------------------- */

.ac-popup {
  position: absolute; z-index: 50; max-height: 15rem; overflow: auto;
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: 9px; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55); padding: 0.2rem;
}
.ac-item {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  color: var(--text); font: inherit; font-size: 0.87rem; padding: 0.35rem 0.5rem;
  border-radius: 6px; cursor: pointer;
}
.ac-item:hover, .ac-item.is-active { background: var(--accent-soft); color: #f7d3ab; }

/* --- done / waitlist / explainer ---------------------------------------- */

.done-card { display: none; margin-top: 1.5rem; }
body[data-stage="done"] .done-card { display: block; }

.waitlist {
  margin-top: 2.5rem; padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--accent-line); border-radius: 18px; background: var(--accent-soft);
}
.waitlist h2 { color: var(--text); text-transform: none; letter-spacing: -0.01em; font-size: 1.5rem; }
.waitlist p { color: var(--text-dim); max-width: 46rem; }
#waitlist-form { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
#waitlist-form input { flex: 1 1 15rem; }

.explainer { margin-top: 3rem; max-width: 52rem; }
.explainer ol { padding-left: 1.2rem; color: var(--text-dim); }
.explainer li { margin-bottom: 0.5rem; }
.explainer strong { color: var(--text); }
.explainer p { color: var(--text-dim); }

.about { border-top: 1px solid var(--line-soft); padding-top: 2.25rem; }
.about p { margin: 0 0 1rem; }
.about .about-lede {
  font-size: 1.1rem;
  color: var(--text);
  border-left: 3px solid var(--accent-line);
  padding-left: 0.9rem;
}
.about p:last-of-type { margin-bottom: 0; }

.site-foot {
  border-top: 1px solid var(--line-soft); padding: 1.5rem clamp(1rem, 4vw, 3rem);
  display: grid; gap: 0.3rem; color: var(--text-faint); font-size: 0.82rem;
}

/* --- mobile / unsupported ------------------------------------------------ */

@media (max-width: 940px) {
  body[data-stage="reviewing"] .workspace,
  body[data-stage="rendering"] .workspace { grid-template-columns: minmax(0, 1fr); }
}

body[data-blocked] .tool > *:not(.controls):not(#set-chips):not(#set-hint) { display: none; }
body[data-blocked] .notice { display: block; }
body[data-blocked] .tool { opacity: 0.85; }

@media (prefers-reduced-motion: reduce) {
  .bar.is-indeterminate::after { animation: none; }
  * { transition: none !important; }
}
