/* voicedataset: a voice-over booth on the cobanov.dev page. White (or night) surfaces, ink for the one
   button that matters, the cobanov.dev blue for selection and progress, and red only for the REC light.
   Depth comes from hairlines and a soft surface step, not shadows. Dark follows the system. */
:root {
  --bg: #ffffff;
  --soft: #f5f6f8;
  --text: #15181f;
  --muted: #5d6676;
  --faint: #6f7787;
  --line: #e4e7ec;
  --line-strong: #cfd4dc;
  --accent: #0a66e0;
  --accent-soft: #0a66e01a;
  --card: #ffffff;
  --rec: #e5484d;
  --warn: #b25e09;
  --ok: #18865e;
  --zone: #18865e24;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1116;
    --soft: #161921;
    --text: #eef0f4;
    --muted: #a3abba;
    --faint: #7f8899;
    --line: #262a35;
    --line-strong: #363b48;
    --accent: #3b8cff;
    --accent-soft: #3b8cff24;
    --card: #13161d;
    --rec: #ff6369;
    --warn: #f0a845;
    --ok: #3ccf91;
    --zone: #3ccf9126;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 500; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

.shell { width: min(880px, 100% - 32px); margin-inline: auto; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 16px; top: 12px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 14px; }

/* Header */
.masthead { border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.wordmark { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; font-size: 17px; }
.wordmark:hover { text-decoration: none; }
.logo { width: 20px; height: 20px; color: var(--accent); }
.masthead nav { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.nav-link { color: var(--muted); transition: color .15s var(--ease); }
.nav-link:hover { color: var(--text); text-decoration: none; }
.icon-link svg { width: 18px; height: 18px; display: block; }
.ui-lang {
  height: 28px; border: 1px solid var(--line); background: var(--card); border-radius: 6px;
  padding: 0 4px 0 8px; font-size: 13px; color: var(--muted); cursor: pointer;
}

/* Hero */
.hero { padding: 64px 0 32px; }
.hero h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.05; letter-spacing: -0.03em; }
.lead { color: var(--muted); font-size: 18px; line-height: 1.6; max-width: 40rem; margin-top: 16px; }
.fine { color: var(--faint); font-size: 13px; margin-top: 12px; }

/* Panels */
.app { display: grid; gap: 16px; padding-bottom: 32px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 8px; }

/* Setup */
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-wide { grid-column: 1 / -1; }
.field input, .field select, .mic select, .export select {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--bg); transition: border-color .15s var(--ease);
}
.field input:hover, .field select:hover, .mic select:hover { border-color: var(--faint); }
.field input:focus, .field select:focus, .mic select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--soft); border-radius: 12px; }
.seg button {
  display: flex; flex-direction: column; align-items: center; gap: 0; padding: 8px; border: 1px solid transparent;
  border-radius: 8px; background: transparent; cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.seg button b { font-weight: 500; font-size: 15px; }
.seg button small { font-size: 12px; color: var(--faint); min-height: 16px; font-variant-numeric: tabular-nums; }
.seg button:hover { background: var(--card); }
.seg button[aria-checked="true"] { background: var(--card); border-color: var(--line-strong); }
.seg button[aria-checked="true"] b { color: var(--accent); }

.custom-box { margin-top: 16px; }
.custom-box textarea {
  width: 100%; min-height: 140px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--bg); resize: vertical; line-height: 1.5;
}
.custom-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; font-size: 14px; }

.mic { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.mic-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mic-row select { flex: 1 1 240px; width: auto; }
.meter-wrap { flex: 1 1 220px; display: flex; align-items: center; gap: 12px; }
.meter { position: relative; flex: 1; height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; border: 1px solid var(--line); }
.meter i { position: absolute; top: 0; bottom: 0; }
/* -60 … 0 dBFS; the shaded zone is -18 … -6 dBFS */
.meter .zone { left: 70%; width: 20%; background: var(--zone); }
.meter .bar { left: 0; width: 0; background: var(--ok); }
.meter .bar.hot { background: var(--rec); }
.meter .hold { width: 2px; left: 0; background: var(--text); opacity: .55; }
.meter-db { font: 12px/1 ui-monospace, "SF Mono", Menlo, monospace; color: var(--faint); width: 64px; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.mic-info { font-size: 13px; color: var(--faint); margin-top: 8px; min-height: 20px; }
.mic-info.warn { color: var(--warn); }

/* Buttons. Ink is the strong button; the plain one is a card with a hairline. */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--card); color: var(--text); font-weight: 500; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), opacity .15s var(--ease), transform .12s var(--ease);
}
.button:hover { border-color: var(--faint); }
.button:active { transform: scale(.98); }
.button:disabled { opacity: .45; cursor: default; transform: none; }
.button:disabled:hover { border-color: var(--line-strong); }
.button.ink { background: var(--text); border-color: var(--text); color: var(--bg); }
.button.ink:hover { opacity: .88; }
.button svg { width: 18px; height: 18px; flex: none; }
.button.icon { width: 44px; padding: 0; }
kbd {
  font: 11px/1 ui-monospace, "SF Mono", Menlo, monospace; padding: 2px 6px; border-radius: 4px;
  border: 1px solid currentColor; opacity: .55;
}
.linklike { background: none; border: 0; padding: 0; cursor: pointer; font-size: 13px; color: var(--faint); text-decoration: underline; text-underline-offset: 3px; transition: color .15s var(--ease); }
.linklike.danger:hover { color: var(--rec); }

/* Recorder: the script line, the waveform under it, and the REC button */
.recorder { padding: 24px 24px 20px; transition: border-color .15s var(--ease); }
.recorder.recording { border-color: var(--rec); }
.rec-head { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--muted); font-weight: 500; }
.counter { font-variant-numeric: tabular-nums; color: var(--faint); font-weight: 400; }
.note { font-size: 13px; color: var(--faint); margin-top: 4px; min-height: 20px; }
.sentence {
  font-size: clamp(22px, 3.3vw, 30px); line-height: 1.4; font-weight: 500;
  margin: 24px 0 20px; min-height: 2.8em; overflow-wrap: break-word; hyphens: auto;
}
.blank {
  display: inline-block; min-width: 4.5em; height: 1em; margin: 0 2px; vertical-align: -0.12em;
  border-bottom: 2px solid var(--line-strong);
}
.wave { display: block; width: 100%; height: 64px; }
.controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.button.rec { min-width: 168px; height: 48px; border-radius: 12px; font-size: 16px; }
.rec-icon { width: 10px; height: 10px; border-radius: 50%; background: var(--rec); transition: border-radius .15s var(--ease), background-color .15s var(--ease); }
.recording .button.rec { background: var(--rec); border-color: var(--rec); color: #fff; opacity: 1; }
.recording .rec-icon { border-radius: 2px; background: #fff; }
.status { margin-top: 16px; min-height: 44px; font-size: 14px; color: var(--muted); text-align: center; }
.status p + p { margin-top: 4px; }
.status .warn { color: var(--warn); }
.status .rec-time { color: var(--rec); font-variant-numeric: tabular-nums; font-weight: 500; }

/* Progress */
.progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; margin-bottom: 12px; }
.progress-head strong { font-weight: 500; font-variant-numeric: tabular-nums; }
.grid { display: flex; flex-wrap: wrap; gap: 4px; }
.grid button {
  width: 16px; height: 16px; padding: 0; border-radius: 4px; border: 0; cursor: pointer;
  background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .15s var(--ease);
}
.grid button:hover { box-shadow: inset 0 0 0 1px var(--faint); }
.grid button.done { background: var(--accent); box-shadow: none; }
.grid button.flag { background: var(--warn); box-shadow: none; }
.grid button.cur { outline: 2px solid var(--text); outline-offset: 1px; }

/* Export */
.export-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.export h2 { font-size: 20px; }
.export-head .muted { margin-top: 4px; font-size: 14px; font-variant-numeric: tabular-nums; }
.export-actions { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.field.inline select { width: 192px; height: 44px; }
.export-note { margin: 16px 0 8px; }

/* How it works */
.how { padding: 48px 0 32px; }
.how h2 { font-size: 26px; }
.steps { list-style: none; padding: 0; margin: 20px 0 32px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; counter-reset: step; }
.steps li { counter-increment: step; padding: 16px; border-radius: 12px; background: var(--soft); font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.steps li strong { color: var(--text); font-size: 15px; font-weight: 500; }
.steps li strong::before { content: counter(step) "  "; color: var(--faint); font-variant-numeric: tabular-nums; }
.two { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; }
.how h3 { font-size: 16px; margin-bottom: 12px; }
.tips { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; display: grid; gap: 8px; }
.tree {
  margin: 0 0 12px; padding: 16px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line);
  font: 12px/1.65 ui-monospace, "SF Mono", Menlo, monospace; overflow-x: auto; color: var(--text);
}
.tree .c { color: var(--faint); }

/* Footer */
.footer-inner { border-top: 1px solid var(--line); padding: 24px 0 32px; margin-top: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--faint); }
.footer-inner nav { display: flex; gap: 20px; }
.footer-inner a { color: var(--muted); }

@media (max-width: 680px) {
  .hide-sm { display: none; }
  .hero { padding: 40px 0 24px; }
  .lead { font-size: 17px; }
  .setup-grid { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .recorder { padding: 20px 16px 16px; }
  .controls { gap: 8px; }
  .button.rec { min-width: 0; flex: 1; }
  .button kbd, .keys { display: none; }
  .steps, .two { grid-template-columns: 1fr; }
  .export-actions, .export-actions .button, .field.inline, .field.inline select { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
