/* DEMO MODE — styles.css */

@font-face { font-family: "Press Start 2P"; font-style: normal; font-weight: 400; font-display: swap; src: url("/press-start-2p.woff2") format("woff2"); }
@font-face { font-family: "Press Start 2P Fallback"; src: local("Courier New"); size-adjust: 166.64%; ascent-override: 60%; descent-override: 0%; line-gap-override: 0%; }

:root {
  --bg: #0a0a12;
  --surface: #12121d;
  --surface-2: #1a1a2a;
  --line: #28283c;
  --control-line: #5e5e80;
  --text: #e9e9f2;
  --dim: #9aa0b5;
  --cyan: #45f0ff;
  --magenta: #ff3d8b;
  --gold: #ffc857;
  --green: #41ff8b;
  --red: #ff5560;
  --pixel: "Press Start 2P", "Press Start 2P Fallback", "Courier New", monospace;
  --body: -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --glow-cyan: 0 0 14px rgba(69, 240, 255, 0.35);
  --space-gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(69, 240, 255, 0.05), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(69, 240, 255, 0.3); }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: 12px; top: -48px;
  z-index: 200;
  background: var(--cyan);
  color: #05050d;
  padding: 10px 16px;
  border-radius: 6px;
  font-family: var(--mono);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s var(--ease-out);
}
.skip-link:focus-visible { transform: translateY(60px); }
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(69, 240, 255, 0.15);
}
a { color: var(--cyan); }

.site-header {
  padding: 26px var(--space-gutter) 10px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.lab-link {
  align-self: flex-start;
  font-family: var(--pixel);
  font-size: 10px;
  color: var(--dim);
  text-decoration: none;
  padding: 6px 2px;
  transition: color 0.15s, text-shadow 0.15s;
}
.lab-link:hover { color: var(--cyan); text-shadow: var(--glow-cyan); }
.level {
  margin: 0;
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--gold);
}
.wordmark {
  margin: 6px 0 4px;
  font-family: var(--pixel);
  font-size: clamp(22px, 4.5vw, 34px);
  letter-spacing: 3px;
  color: var(--text);
  text-shadow: 0 0 16px rgba(69, 240, 255, 0.55), 3px 3px 0 var(--magenta);
}
.tagline {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dim);
}
.cursor { color: var(--cyan); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

main {
  flex: 1;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px var(--space-gutter) 72px;
}
.setup-grid, .record-grid, .result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.panel-title {
  margin: 0;
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(69, 240, 255, 0.4);
}
.lead {
  margin: 10px 0 0;
  max-width: 68ch;
  color: var(--text);
  font-size: 16px;
}
.note { margin: 0; font-size: 12px; color: var(--dim); line-height: 1.5; }
.note-gold { color: var(--gold); }
.unsupported { max-width: 680px; margin: 0 auto; }

.picker-tip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--surface-2), rgba(18, 18, 29, 0.4));
}
.picker-card {
  min-height: 86px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}
.picker-card span {
  display: block;
  height: 34px;
  border: 1px solid var(--control-line);
  border-radius: 5px;
  background:
    linear-gradient(90deg, rgba(69, 240, 255, 0.16), transparent 40%),
    repeating-linear-gradient(0deg, transparent 0 6px, rgba(255, 255, 255, 0.04) 6px 7px);
}
.picker-card b, .audio-check b {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--dim);
}
.picker-card.is-tab { border-color: rgba(69, 240, 255, 0.65); box-shadow: inset 0 0 0 1px rgba(69, 240, 255, 0.2); }
.audio-check {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px dashed var(--gold);
  border-radius: 8px;
  color: var(--gold);
}
.audio-check i {
  width: 16px;
  height: 16px;
  border: 2px solid var(--gold);
  border-radius: 3px;
  box-shadow: inset 0 0 0 3px var(--bg);
  background: var(--gold);
}

.control-row, .record-actions, .download-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  min-height: 40px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s var(--ease-out), border-color 0.12s, box-shadow 0.12s, color 0.12s;
}
.btn:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(69, 240, 255, 0.22);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn:not([href])[download] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--cyan); border-color: var(--cyan); color: #05050d; }
.btn-primary:hover { box-shadow: 0 0 18px rgba(69, 240, 255, 0.5); }
.btn-ghost { background: transparent; }
.btn-huge { min-height: 58px; padding: 16px 22px; font-family: var(--pixel); font-size: 12px; }

.switch {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--dim);
  cursor: pointer;
  font-family: var(--pixel);
  font-size: 10px;
}
.switch input { width: 20px; height: 20px; accent-color: var(--cyan); }
.meter-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}
.meter-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}
.meter {
  height: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}
.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--red));
  transition: width 0.08s linear;
}
.badge-line { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.badge-line span {
  border: 1px solid rgba(65, 255, 139, 0.45);
  border-radius: 999px;
  color: var(--green);
  padding: 6px 9px;
  font-family: var(--mono);
  font-size: 11px;
}
.choice-list { margin: 0; display: grid; gap: 10px; }
.choice-list div {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.choice-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.choice-list dt { color: var(--gold); font-family: var(--pixel); font-size: 9px; }
.choice-list dd { margin: 0; color: var(--dim); font-size: 13px; }

.record-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.rec-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  color: var(--gold);
}
.rec-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 14px rgba(255, 85, 96, 0.6);
}
.rec-dot.is-live { animation: rec-pulse 1s ease-in-out infinite; }
@keyframes rec-pulse { 50% { transform: scale(0.68); opacity: 0.55; } }
.video-frame {
  display: block;
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 4px),
    #05050d;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.result-heading {
  margin: 0;
  font-family: var(--pixel);
  font-size: clamp(12px, 2.6vw, 16px);
  color: var(--green);
  text-shadow: 0 0 12px rgba(65, 255, 139, 0.5);
}
.result-meta {
  margin: 0;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 13px;
}

.timeline {
  position: relative;
  min-height: 94px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}
.thumb-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(84px, 1fr);
  height: 90px;
}
.thumb-strip:empty::before {
  content: "timeline loading";
  display: grid;
  place-items: center;
  height: 90px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
}
.thumb-strip img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-right: 1px solid var(--line);
}
.timeline input[type="range"] {
  position: absolute;
  left: 8px;
  right: 8px;
  width: calc(100% - 16px);
  accent-color: var(--cyan);
}
#trimStart { bottom: 24px; }
#trimEnd { bottom: 4px; accent-color: var(--magenta); }
.trim-times {
  display: flex;
  justify-content: space-between;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 12px;
}
.progress-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}
.progress-shell::before {
  content: "";
  grid-column: 1;
  grid-row: 1;
  height: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}
.progress-bar {
  grid-column: 1;
  grid-row: 1;
  z-index: 1;
  width: 0;
  height: 10px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(69, 240, 255, 0.35);
}
.progress-shell span { grid-column: 2; }

.toasts {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(440px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.22s var(--ease-out) both;
}
.toast-info { border-left-color: var(--cyan); }
.toast-success { border-left-color: var(--green); }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity 0.25s, transform 0.25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 22px var(--space-gutter);
  text-align: center;
  color: var(--dim);
  font-size: 13px;
}
.site-footer p { margin: 0 0 6px; }
.site-footer p:last-child { margin-bottom: 0; }
.site-footer a { color: var(--cyan); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-shadow: var(--glow-cyan); }

@media (min-width: 768px) {
  .setup-grid { grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr); }
}
@media (min-width: 1024px) {
  .result-grid { grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr); align-items: start; }
}
@media (pointer: coarse) {
  .btn, .switch { min-height: 44px; }
  .timeline input[type="range"] { min-height: 40px; }
}
@media (max-width: 520px) {
  .picker-tip { grid-template-columns: 1fr; }
  .audio-check { grid-column: auto; }
  .choice-list div { grid-template-columns: 1fr; }
  .record-head, .progress-shell { grid-template-columns: 1fr; display: grid; }
  .progress-shell span { grid-column: 1; }
  .wordmark { letter-spacing: 1px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .cursor, .rec-dot.is-live { animation: none; }
}
