/* Copyright 2026 EmpirioLabs.ai LLC. Licensed under the Apache License, Version 2.0. */
/* EmpirioLabs AI product style (DESIGN.md): deep blue-black canvas, cyan and blue accents, Metropolis. */

@font-face { font-family: Metropolis; font-weight: 400; font-style: normal; font-display: swap;
  src: url("https://media.empiriolabs.ai/assets/email/fonts/Metropolis-Regular.woff2") format("woff2"); }
@font-face { font-family: Metropolis; font-weight: 500; font-style: normal; font-display: swap;
  src: url("https://media.empiriolabs.ai/assets/email/fonts/Metropolis-Medium.woff2") format("woff2"); }
@font-face { font-family: Metropolis; font-weight: 600; font-style: normal; font-display: swap;
  src: url("https://media.empiriolabs.ai/assets/email/fonts/Metropolis-SemiBold.woff2") format("woff2"); }

:root {
  --bg: #000815;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --blue: #0a7cff;
  --cyan: #3ec5e6;
  --text: rgba(255, 255, 255, 0.80);
  --strong: rgba(255, 255, 255, 0.94);
  --muted: rgba(255, 255, 255, 0.55);
  --danger: #ff8a8a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* a tap fires at once on a phone (runbooks/frontend-quality.md, 2026-10-18) */
html, :where(a, button, input, select, textarea, label, summary) { touch-action: manipulation; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 Metropolis, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 56px;
}

/* ---- header ---- */

.banner {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1702 / 560;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #000;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 10px;
  margin: 14px 0 0;
  font-size: 14px;
}
.links a {
  color: var(--strong);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.links a:hover { color: var(--cyan); }
.links span { color: var(--muted); }

h1 {
  margin: 28px 0 6px;
  color: #fff;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.lead {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.models {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.models a {
  color: var(--cyan);
  text-decoration: none;
  white-space: nowrap;
}
.models a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- panel ---- */

.panel {
  margin-top: 24px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin-bottom: 16px; }
.grid .field { margin-bottom: 16px; }

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.count, output {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
output { color: var(--strong); }

select, textarea {
  width: 100%;
  min-width: 0;
  color: var(--strong);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
}
select {
  height: 40px;
  padding: 0 36px 0 12px;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
select option { color: #fff; background: #0b1220; }
textarea {
  display: block;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
  min-height: 108px;
}
select:focus-visible, textarea:focus-visible, input[type="range"]:focus-visible, button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
select:disabled, textarea:disabled, input:disabled { opacity: 0.55; cursor: default; }

input[type="range"] {
  width: 100%;
  height: 40px;
  margin: 0;
  background: transparent;
  accent-color: var(--cyan);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: var(--border-strong);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--cyan);
  border: 2px solid var(--bg);
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--border-strong); }
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cyan);
  border: 2px solid var(--bg);
}

/* ---- actions ---- */

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 4px;
}

button.primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  min-width: 132px;
  padding: 0 22px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
button.primary:hover:not(:disabled) { background: #2a8dff; }
button.primary:disabled { cursor: default; background: rgba(10, 124, 255, 0.45); color: rgba(255, 255, 255, 0.75); }

/* the spinner replaces the label, so the button keeps its width while it works */
.spinner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
}
button.busy .spinner { opacity: 1; animation: spin 0.8s linear infinite; }
button.busy .label { visibility: hidden; }
@keyframes spin { to { transform: rotate(360deg); } }

.status {
  flex: 1 1 220px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.status.error { color: var(--danger); }

.bar {
  height: 4px;
  margin-top: 14px;
  border-radius: 2px;
  background: var(--surface-strong);
  overflow: hidden;
}
.bar .fill {
  width: 0;
  height: 100%;
  background: var(--cyan);
  transition: width 0.2s linear;
}
.bar.indeterminate .fill {
  width: 30%;
  animation: slide 1.2s ease-in-out infinite;
}
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

.result {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.result audio {
  flex: 1 1 300px;
  min-width: 0;
  height: 44px;
}

a.secondary {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 18px;
  color: var(--strong);
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
a.secondary:hover { border-color: var(--cyan); color: #fff; }

@media (max-width: 560px) {
  .page { padding: 16px 16px 40px; }
  h1 { margin-top: 22px; font-size: 24px; }
  .panel { padding: 16px; }
  .grid.two { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .actions button.primary { flex: 1 1 100%; }
  .result audio { flex-basis: 100%; }
  .result a.secondary { flex: 1 1 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .bar .fill { transition: none; }
  .bar.indeterminate .fill, button.busy .spinner { animation-duration: 2.4s; }
}
