@font-face {
  font-family: Inter;
  src: url("/assets/inter-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  font-family: Inter, system-ui, sans-serif;
  font-synthesis: none;
  color: #111827;
  background: #fff;
  --ink: #111827;
  --muted: #4b5563;
  --border: #d1d5db;
  --line: #e5e7eb;
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:where(button, a, textarea, select):focus-visible {
  outline: 2px solid var(--primary-600);
  outline-offset: 3px;
}
a { color: var(--primary-700); text-underline-offset: .16em; }
a:hover { color: var(--primary-800); }

main {
  width: min(100% - clamp(2rem, 6vw, 4rem), 58rem);
  margin: 0 auto;
  padding: clamp(1.75rem, 5vw, 3.25rem) 0 clamp(2rem, 6vw, 4rem);
}
.intro { margin: 0 0 clamp(1.6rem, 4vw, 2.5rem); }
.intro h1 {
  max-width: 49rem;
  margin: 0 0 .85rem;
  font-size: clamp(2.125rem, 5vw, 3.125rem);
  line-height: 1.1;
  letter-spacing: -.045em;
  font-weight: 750;
}
.intro h2 {
  margin: 0 0 .45rem;
  max-width: 42rem;
  font-size: clamp(1.075rem, 2.3vw, 1.3rem);
  line-height: 1.45;
  font-weight: 650;
  letter-spacing: -.015em;
}
p { line-height: 1.6; }
.intro p { margin: 0; max-width: 38rem; color: var(--muted); }

.editor {
  padding: clamp(1.125rem, 3vw, 1.875rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 3px 10px rgb(17 24 39 / .04);
}
.form-picker {
  display: grid;
  gap: .625rem;
  padding-bottom: 1.375rem;
  margin-bottom: 1.375rem;
  border-bottom: 1px solid var(--line);
}
.form-picker label, .input-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.select-control { position: relative; }
.select-control::after {
  position: absolute;
  content: "";
  display: block;
  top: calc(50% - .27rem);
  inset-inline-end: 1.15rem;
  width: .54rem;
  height: .54rem;
  border-right: 2px solid var(--primary-700);
  border-bottom: 2px solid var(--primary-700);
  transform: rotate(45deg);
  pointer-events: none;
}
select {
  appearance: none;
  width: 100%;
  min-height: 2.875rem;
  padding: .625rem 2.65rem .625rem .9rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: #f9fafb;
  color: var(--ink);
}
select:hover:not(:disabled) { border-color: #9ca3af; }
select:disabled { color: var(--muted); }

.mode-picker {
  display: inline-flex;
  gap: .25rem;
  max-width: 100%;
  padding: .25rem;
  margin: .75rem 0 1rem;
  border-radius: .65rem;
  background: #f3f4f6;
}
.mode-picker button {
  min-height: 2.25rem;
  padding: .4rem .85rem;
  border: 1px solid transparent;
  border-radius: .45rem;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: .9375rem;
}
.mode-picker button:not(:disabled):hover { color: var(--primary-700); }
.mode-picker button[aria-pressed="true"] {
  color: var(--primary-700);
  border-color: var(--primary-200);
  background: #fff;
  box-shadow: 0 1px 2px rgb(17 24 39 / .08);
}

.privacy {
  padding: .75rem .9rem;
  margin-bottom: 1rem;
  border: 1px solid var(--primary-200);
  border-radius: .5rem;
  background: var(--primary-50);
  color: var(--primary-900);
}
.privacy p { margin: 0; font-size: .875rem; }
.privacy strong { font-weight: 700; }
.privacy a { font-weight: 650; }
textarea {
  display: block;
  width: 100%;
  min-height: 9.5rem;
  resize: vertical;
  padding: .85rem .9rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  line-height: 1.55;
  color: var(--ink);
  background: #fff;
}
textarea::placeholder { color: #6b7280; opacity: 1; }
.record-area {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: .75rem;
  min-height: 9.5rem;
  padding: 1rem;
  border: 1px dashed #93c5fd;
  border-radius: .5rem;
  background: #f9fafb;
}
.record-state { color: var(--muted); text-align: center; }
audio { width: min(100%, 22rem); }
.hint, .status { font-size: .875rem; color: var(--muted); }
.hint { margin: .55rem 0 1.125rem; }
.status { margin: .7rem 0; }
.status:empty, #challenge:empty { display: none; }
.status[data-kind="error"] { color: #991b1b; }
.status[data-kind="success"] { color: #166534; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem 1rem;
  padding-top: .125rem;
}
.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  border: 1px solid transparent;
  border-radius: .5rem;
  padding: .6rem .95rem;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}
.primary { background: var(--primary-700); color: #fff; }
.primary:hover:not(:disabled) { background: var(--primary-800); color: #fff; }
.primary:disabled { background: var(--primary-100); color: var(--primary-900); }
.secondary { border-color: var(--primary-200); background: #fff; color: var(--primary-700); }
.secondary:hover:not(:disabled) { background: var(--primary-50); }
.secondary:disabled, .mode-picker button:disabled, .text-button:disabled { opacity: .55; }
.text-button {
  min-height: 2.5rem;
  padding: .4rem .125rem;
  border: 0;
  background: transparent;
  color: var(--primary-700);
  text-decoration: underline;
  text-underline-offset: .18em;
  font-size: .9375rem;
  font-weight: 550;
}
.text-button:hover:not(:disabled) { color: var(--primary-800); }

.demo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.25rem;
  padding: clamp(1.125rem, 3vw, 1.625rem);
  border: 1px solid var(--primary-200);
  border-radius: .875rem;
  background: var(--primary-50);
}
.demo h2, .form-guides h2 {
  margin: 0 0 .375rem;
  font-size: clamp(1.125rem, 2.4vw, 1.375rem);
  line-height: 1.3;
  letter-spacing: -.025em;
}
.demo p { margin: 0; max-width: 34rem; color: var(--muted); }
.demo .primary { white-space: nowrap; }

.processing {
  width: min(calc(100% - 2rem), 32rem);
  max-height: calc(100% - 2rem);
  padding: clamp(1rem, 4vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 20px 60px rgb(17 24 39 / .22);
}
.processing::backdrop { background: rgb(17 24 39 / .46); }
.processing-head { display: flex; align-items: flex-start; gap: .875rem; }
.processing-head h2 {
  margin: 0 0 .25rem;
  font-size: clamp(1.125rem, 4vw, 1.375rem);
  line-height: 1.3;
  letter-spacing: -.025em;
}
.processing-head p { margin: 0; color: var(--muted); }
.spinner {
  flex: 0 0 1.5rem;
  height: 1.5rem;
  margin-top: .125rem;
  border: 2px solid var(--primary-200);
  border-top-color: var(--primary-700);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.processing .demo { grid-template-columns: 1fr; gap: .875rem; }
.processing .demo .primary { justify-self: start; }
.processing > .text-button { display: block; margin: .5rem auto -.25rem; }

.form-guides { margin-top: clamp(2rem, 5vw, 3.5rem); }
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.guide {
  padding: 1.125rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: #fff;
}
.guide h3 { margin: 0 0 .45rem; font-size: 1rem; line-height: 1.4; font-weight: 700; }
.guide p { margin: 0; color: var(--muted); font-size: .9375rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 630px) {
  .demo, .guide-grid { grid-template-columns: 1fr; }
  .demo .primary { justify-self: start; }
}
@media (max-width: 430px) {
  select { font-size: .9375rem; }
  .actions > * { width: 100%; }
}
