/* FreeAudio.org — dark bento UI, zero external fonts/CDNs */
:root {
  --bg: #0b0e14;
  --panel: #12161f;
  --panel2: #171c28;
  --line: #232a3a;
  --txt: #e6e9f0;
  --muted: #8b93a7;
  --acc: #5eead4;
  --acc2: #818cf8;
  --warn: #fbbf24;
  --bad: #f87171;
  --good: #34d399;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(94,234,212,0.07), transparent 60%),
    radial-gradient(900px 420px at 10% 0%, rgba(129,140,248,0.08), transparent 55%),
    var(--bg);
  color: var(--txt);
  line-height: 1.55;
}
a { color: var(--acc); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.hero { max-width: 1080px; margin: 0 auto; padding: 48px 24px 12px; text-align: center; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 0; letter-spacing: -0.02em; }
.hero .accent { color: var(--acc); }
.hero p { color: var(--muted); max-width: 640px; margin: 12px auto 0; }

.tabs {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  max-width: 1080px; margin: 24px auto 0; padding: 0 24px;
}
.tab {
  background: var(--panel); color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 18px; font-size: 0.92rem; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.tab:hover { color: var(--txt); border-color: var(--acc2); }
.tab.active { color: var(--bg); background: var(--acc); border-color: var(--acc); font-weight: 600; }

main { max-width: 1080px; margin: 24px auto 64px; padding: 0 24px; }
.tabpane { display: none; }
.tabpane.active { display: block; }

.bento {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-bottom: 16px;
}
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}
.card h3 { margin: 0 0 14px; font-size: 1.02rem; letter-spacing: 0.01em; }
.card h3::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--acc); margin-right: 8px; vertical-align: 2px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
button {
  background: var(--acc); color: var(--bg); border: 0; border-radius: 10px;
  padding: 9px 16px; font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--acc); border: 1px solid var(--line); font-weight: 500; }
button.ghost:hover { border-color: var(--acc); }

.grid-form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
label { display: block; font-size: 0.82rem; color: var(--muted); }
input, select, textarea {
  width: 100%; margin-top: 5px; background: var(--panel2); color: var(--txt);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
  font-size: 0.92rem; font-family: inherit;
}
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8rem; resize: vertical; }
input:focus, select:focus, textarea:focus, .dropzone:focus { outline: 2px solid var(--acc2); outline-offset: 1px; }

.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 34px 18px; text-align: center; color: var(--muted);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--acc); background: rgba(94,234,212,0.05); color: var(--txt); }

.out {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; font-size: 0.88rem; overflow-x: auto; min-height: 2.4em;
}
.out table { border-collapse: collapse; width: 100%; font-size: 0.82rem; }
.out th, .out td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.out th:first-child, .out td:first-child { text-align: left; }
.out th { color: var(--muted); font-weight: 600; }
.out tr.best td { color: var(--good); font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.stat .k { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat .v { font-size: 1.15rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .v.bad { color: var(--bad); }
.stat .v.warn { color: var(--warn); }
.stat .v.good { color: var(--good); }

.waveform { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; overflow-x: auto; }
.waveform svg { display: block; min-width: 480px; }

.muted { color: var(--muted); }
.report-md { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; white-space: pre-wrap; font-size: 0.82rem; }
.warn-text { color: var(--warn); }
.bad-text { color: var(--bad); }
.good-text { color: var(--good); }

.foot {
  max-width: 1080px; margin: 0 auto; padding: 28px 24px 48px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem;
  text-align: center;
}
.foot p { margin: 6px 0; }

@media (max-width: 640px) {
  .hero { padding-top: 32px; }
  .card { padding: 16px; }
}
