:root {
  --bg: #f7f4ef;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --muted: #5a5650;
  --line: #e4ddd3;
  --accent: #ff6b2c;
  --accent-ink: #1a1a1a;
  --accent-soft: #ffe3d4;
  --stage: #14121a;
  --ok: #1f7a4c;
  --err: #b42318;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(26, 26, 26, 0.08);
  --font:
    'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue',
    Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid #2f6fed;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: #fff;
  padding: 10px 14px;
  z-index: 100;
}
.skip:focus {
  left: 12px;
  top: 12px;
}

.site-header,
main,
.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding-top: 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  font-size: 1.15rem;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff6b2c 0%, #ff9a5c 55%, #1a1a1a 55%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.site-header nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.site-header nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}
.site-header nav a:hover {
  color: var(--ink);
}
.nav-cta {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink) !important;
}

.hero {
  padding: 28px 0 20px;
}
.hero h1 {
  margin: 0 0 14px;
  font: 800 clamp(2rem, 5vw, 3.4rem)/1.05 var(--font);
  letter-spacing: -0.045em;
  max-width: 18ch;
}
.hero-sub {
  margin: 0 0 22px;
  max-width: 54ch;
  color: var(--muted);
  font-size: 1.05rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.trust-line {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition:
    transform 0.12s ease,
    background 0.12s ease,
    border-color 0.12s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: #e45a1f;
}
.btn-primary:hover {
  filter: brightness(1.03);
}
.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: #cfc5b8;
}
.btn-generate {
  width: 100%;
  margin-top: 8px;
  font-size: 1.02rem;
}

.tool-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 56px;
  scroll-margin-top: 16px;
}
.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--bg);
  padding: 6px;
  border-radius: 14px;
  margin-bottom: 10px;
}
.tab {
  border: 0;
  background: transparent;
  min-height: 42px;
  border-radius: 10px;
  font-weight: 700;
  color: var(--muted);
}
.tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 6px 16px rgba(26, 26, 26, 0.06);
}
.tab-blurb {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

.panel {
  display: none;
}
.panel.is-active {
  display: block;
}

.field,
.field-row,
.mode-fieldset {
  margin-bottom: 12px;
}
.field span,
.mode-fieldset legend {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 6px;
  color: var(--muted);
}
.field em {
  font-style: normal;
  font-weight: 500;
  opacity: 0.8;
}
.field input[type='text'],
.field input[type='file'],
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 11px 12px;
  min-height: 44px;
}
.field textarea {
  min-height: 96px;
  resize: vertical;
}
.field select:disabled {
  opacity: 0.7;
  background: #f3f0ea;
}
.field-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.field.grow {
  flex: 1 1 140px;
  margin-bottom: 0;
}
.check,
.radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
}
.mode-fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px 12px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.mode-fieldset legend {
  padding: 0 4px;
}

.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.openmic-photos {
  grid-template-columns: repeat(3, 1fr);
}
.upload-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-height: 120px;
  padding: 14px;
  border: 1.5px dashed #cfc5b8;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fbf8f3);
  cursor: pointer;
  overflow: hidden;
}
.upload-card.wide {
  margin-bottom: 12px;
}
.upload-card.is-invalid {
  border-color: var(--err);
  background: #fff5f4;
}
.upload-card input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-label {
  font-weight: 800;
  font-size: 0.95rem;
}
.upload-hint {
  font-size: 0.8rem;
  color: var(--muted);
}
.upload-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.upload-card:has(.upload-preview:not([hidden])) .upload-label,
.upload-card:has(.upload-preview:not([hidden])) .upload-hint {
  position: relative;
  z-index: 1;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.demo-note {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: #6a3210;
  font-size: 0.9rem;
}
.form-status {
  min-height: 1.2em;
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.form-status.is-error {
  color: var(--err);
  font-weight: 700;
}
.form-status.is-ok {
  color: var(--ok);
  font-weight: 700;
}

.preview-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.preview-frame {
  position: relative;
  width: min(100%, 360px);
  margin-inline: auto;
  aspect-ratio: 9 / 16;
  border-radius: 22px;
  overflow: hidden;
  background: var(--stage);
  box-shadow: 0 18px 50px rgba(20, 18, 26, 0.28);
  border: 1px solid #2a2733;
}
.preview-frame canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.preview-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  color: #fff;
  pointer-events: none;
}
.preview-label {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
}
.progress-wrap {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
  position: relative;
}
.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--p, 0%);
  background: var(--accent);
  border-radius: inherit;
}
#progress-text {
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 0.8rem;
}
.preview-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.section {
  padding: 48px 0;
  scroll-margin-top: 20px;
}
.section.tint {
  background: #efe8dd;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding-left: max(16px, calc(50vw - 560px));
  padding-right: max(16px, calc(50vw - 560px));
  border-block: 1px solid var(--line);
}
.section h2 {
  margin: 0 0 14px;
  font: 800 clamp(1.55rem, 3vw, 2.1rem)/1.15 var(--font);
  letter-spacing: -0.03em;
}
.section > p {
  max-width: 68ch;
  color: var(--muted);
}
.updated {
  margin-top: 18px;
  font-size: 0.95rem;
}

.card-grid {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}
.card-grid.three {
  grid-template-columns: 1fr;
}
.card-grid.examples {
  grid-template-columns: 1fr;
}
.card,
.example-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card h3,
.example-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.card p,
.example-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.95rem;
}
.example-thumb {
  height: 120px;
  border-radius: 12px;
  margin-bottom: 12px;
  background-size: cover;
  background-position: center;
}
.duo-a {
  background: linear-gradient(135deg, #ff8a4c, #2b1d3a 60%);
}
.duo-b {
  background: linear-gradient(135deg, #6ec6ff, #1a1a1a 65%);
}
.om-a {
  background: linear-gradient(135deg, #f2c94c, #3d2b1f);
}
.om-b {
  background: linear-gradient(135deg, #7dffa3, #10241a);
}
.fact-a {
  background: linear-gradient(135deg, #9bb7ff, #1e2440);
}
.fact-b {
  background: linear-gradient(135deg, #ffb4d9, #3a1830);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.95rem;
}
th,
td {
  text-align: left;
  padding: 14px 16px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
thead th {
  background: #f3eee6;
  font-size: 0.85rem;
}
tbody th {
  width: 9rem;
  color: var(--muted);
  font-weight: 700;
}
tr:last-child th,
tr:last-child td {
  border-bottom: 0;
}

.steps {
  margin: 18px 0 0;
  padding-left: 1.2rem;
  max-width: 60ch;
}
.steps li {
  padding: 8px 0;
}

.faq-list details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 8px 0;
}
.faq-list summary {
  cursor: pointer;
  font-weight: 750;
  list-style: none;
}
.faq-list summary::-webkit-details-marker {
  display: none;
}
.faq-list details p {
  margin: 10px 0 0;
  color: var(--muted);
}

.closing {
  text-align: center;
  background: var(--ink);
  color: #f7f4ef;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 56px 20px;
}
.closing p {
  margin: 0 auto 18px;
  max-width: 42ch;
  color: #cfc8bf;
}
.closing .btn-primary {
  color: var(--ink);
}

.site-footer {
  padding: 40px 0 56px;
  display: grid;
  gap: 18px;
}
.footer-brand p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 40ch;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
}
.site-footer nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
.site-footer nav a:hover {
  color: var(--ink);
}
.footer-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  z-index: 50;
  box-shadow: var(--shadow);
  max-width: min(92vw, 420px);
  font-weight: 650;
}

.legal {
  padding: 40px 0 80px;
  max-width: 720px;
}
.legal h1 {
  font: 800 2.2rem/1.1 var(--font);
  letter-spacing: -0.04em;
  margin: 0 0 12px;
}
.legal p {
  color: var(--muted);
}

@media (min-width: 768px) {
  .card-grid.three {
    grid-template-columns: repeat(3, 1fr);
  }
  .card-grid.examples {
    grid-template-columns: repeat(2, 1fr);
  }
  .openmic-photos {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .tool-shell {
    padding: 22px;
  }
  .tool-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.8fr);
    align-items: start;
    gap: 28px;
  }
  .preview-col {
    position: sticky;
    top: 18px;
  }
  .preview-frame {
    width: 100%;
    max-width: 380px;
    margin-inline: 0 0 auto;
  }
  .card-grid.examples {
    grid-template-columns: repeat(3, 1fr);
  }
  .hero {
    padding-top: 40px;
  }
}

@media (max-width: 640px) {
  .site-header nav a:not(.nav-cta) {
    display: none;
  }
  .photo-grid {
    grid-template-columns: 1fr 1fr;
  }
  .openmic-photos {
    grid-template-columns: 1fr;
  }
  .tabs {
    grid-template-columns: 1fr;
  }
}

/* Mock audio controls */

.audio-selection {
  margin: 8px 0 16px;
  min-width: 0;
}
.audio-filename {
  overflow-wrap: anywhere;
  font-size: 14px;
}
.audio-trim {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.audio-trim legend {
  font-weight: 600;
  padding: 0 4px;
}
.audio-trim output {
  display: block;
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}
.audio-trim input[type='range'] {
  width: 100%;
  min-height: 44px;
  padding: 0;
  accent-color: var(--accent);
}
.audio-trim p {
  color: var(--muted);
  font-size: 13px;
}
select option:disabled {
  color: var(--muted);
}

.tool-form-col,
.preview-col {
  min-width: 0;
}
