:root {
  --paper: #f2eee4;
  --paper-deep: #e9e1d3;
  --card: #fffdf7;
  --card-muted: #faf6ed;
  --ink: #12130f;
  --muted: #6d675b;
  --muted-light: #928b7c;
  --line: #d6ccbb;
  --line-strong: #b8ad99;
  --accent: #f05a32;
  --accent-deep: #c8411d;
  --accent-soft: #ffe5da;
  --dark: #171812;
  --dark-soft: #23241c;
  --cream: #f7f2e7;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --card-radius: 28px;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 34px 70px -32px rgba(62, 49, 27, 0.42), 0 4px 18px rgba(62, 49, 27, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
}

svg {
  display: block;
}

::selection {
  background: var(--accent);
  color: var(--cream);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.25;
  background-image: radial-gradient(rgba(69, 58, 38, 0.28) 0.55px, transparent 0.7px);
  background-size: 4px 4px;
  mix-blend-mode: multiply;
}

.page-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 clamp(22px, 4.2vw, 64px) 30px;
  position: relative;
  z-index: 1;
}

/* ---------- Header ---------- */

.site-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex-shrink: 0;
}

.wordmark-mark {
  width: 37px;
  height: 37px;
  border-radius: 50%;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  box-shadow: 0 4px 10px rgba(18, 19, 15, 0.18);
}

.wordmark-mark i {
  display: block;
  width: 2px;
  height: 8px;
  border-radius: 2px;
  background: var(--cream);
}

.wordmark-mark i:nth-child(2) {
  height: 15px;
  background: var(--accent);
}

.wordmark-mark i:nth-child(3) {
  height: 11px;
}

.wordmark-mark i:nth-child(4) {
  height: 6px;
}

.wordmark-text {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.wordmark-en {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-left: 1px;
  padding-top: 3px;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.header-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.server-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.52);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.13em;
  white-space: nowrap;
}

.server-badge svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.config-banner {
  margin-top: 16px;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 12px 16px;
  border: 1px solid #e3ca8a;
  border-radius: 13px;
  background: #fff3cf;
  color: #5d4a1d;
  font-size: 12px;
  line-height: 1.6;
}

.config-banner.is-error {
  border-color: #f0b8a6;
  background: var(--accent-soft);
  color: #77280f;
}

.config-banner-label {
  flex-shrink: 0;
  margin-top: 1px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 2px 7px;
  opacity: 0.75;
}

.config-banner p {
  margin: 0;
}

/* ---------- Hero / left column ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(490px, 570px);
  gap: clamp(44px, 6vw, 94px);
  align-items: start;
  padding: clamp(44px, 6.8vw, 94px) 0 clamp(40px, 5vw, 70px);
}

.hero-copy {
  position: relative;
  min-width: 0;
  padding-top: 12px;
}

.hero-copy > * {
  position: relative;
  z-index: 2;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 500;
}

.kicker-square {
  width: 7px;
  height: 7px;
  background: var(--accent);
  transform: rotate(45deg);
}

.kicker-slash {
  color: var(--line-strong);
}

.mono {
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: 0.04em;
}

.hero-title {
  margin: 22px 0 25px;
  font-family: var(--serif);
  font-size: clamp(52px, 5.8vw, 82px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.055em;
}

.accent-word {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 0.055em;
  text-underline-offset: 0.13em;
  text-decoration-color: var(--accent);
}

.hero-lead {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.85;
  letter-spacing: 0.005em;
}

.process-strip {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.2vw, 26px);
  max-width: 600px;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.process-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  flex-shrink: 0;
}

.process-num {
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--accent);
  padding-top: 3px;
}

.process-item strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.process-item p {
  margin: 3px 0 0;
  font-size: 10px;
  color: var(--muted-light);
  white-space: nowrap;
}

.process-line {
  width: 100%;
  height: 1px;
  background: var(--line);
  opacity: 0.65;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 555px;
  margin-top: 34px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 247, 0.7);
  backdrop-filter: blur(3px);
}

.privacy-icon {
  flex-shrink: 0;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
}

.privacy-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.privacy-note p {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.privacy-note strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Studio card ---------- */

.studio-wrap {
  min-width: 0;
  align-self: start;
}

.studio-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.studio-hardware {
  height: 38px;
  padding: 0 22px;
  background: var(--dark);
  color: #aaa697;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.13em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hardware-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 90, 50, 0.15);
}

.hardware-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #d5d0c2;
}

.hardware-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c7ea7b;
  box-shadow: 0 0 8px rgba(199, 234, 123, 0.6);
}

.hardware-status b {
  font-weight: 400;
}

.studio-panel {
  padding: clamp(24px, 3vw, 32px) clamp(22px, 3.1vw, 34px) clamp(24px, 2.7vw, 30px);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.section-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.16em;
  font-weight: 500;
}

.panel-heading h2,
.state-panel h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(27px, 2.5vw, 32px);
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.step-badge {
  flex-shrink: 0;
  margin-top: 2px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.field-block {
  margin-bottom: 21px;
}

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

.field-label-row label,
.field-label-row .field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.015em;
}

.field-required {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.char-count {
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 9px;
}

.drop-wrap {
  position: relative;
}

.dropzone {
  position: relative;
  width: 100%;
  min-height: 146px;
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: var(--card-muted);
  display: flex;
  align-items: center;
  gap: 17px;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.dropzone:hover {
  border-color: var(--accent);
  background: #fff8f2;
}

.drop-wrap.is-dragging .dropzone {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-soft);
  transform: scale(1.01);
}

.drop-icon {
  flex-shrink: 0;
  width: 49px;
  height: 49px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 180ms ease;
}

.dropzone:hover .drop-icon {
  transform: translateY(-2px);
}

.drop-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.drop-copy strong {
  font-size: 13px;
  font-weight: 600;
}

.drop-copy span {
  color: var(--muted-light);
  font-size: 9.5px;
  line-height: 1.5;
}

.drop-corner {
  position: absolute;
  right: 17px;
  top: 14px;
  color: var(--line-strong);
  font-size: 16px;
  line-height: 1;
  font-weight: 300;
}

.field-hint {
  margin: 8px 0 0;
  color: var(--muted-light);
  font-size: 9.5px;
  line-height: 1.6;
}

.field-hint.is-error {
  color: var(--accent-deep);
}

/* File preview */

.file-preview {
  border-radius: 18px;
  background:
    radial-gradient(circle at 95% 0%, rgba(240, 90, 50, 0.2), transparent 30%),
    var(--dark);
  color: var(--cream);
  padding: 16px 18px 13px;
  box-shadow: 0 14px 28px -18px rgba(20, 19, 14, 0.8);
  overflow: hidden;
}

.preview-top {
  display: flex;
  align-items: center;
  gap: 11px;
}

.sample-play {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.sample-play:hover {
  transform: scale(1.05);
  background: #ff704b;
}

.sample-play svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.sample-play .icon-pause,
.sample-play.is-playing .icon-play {
  display: none;
}

.sample-play.is-playing .icon-pause {
  display: block;
}

.preview-file {
  min-width: 0;
  flex: 1;
}

.preview-file strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.preview-file span {
  display: block;
  margin-top: 3px;
  color: #918d80;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.icon-button {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  color: #918d80;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream);
}

.icon-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.upload-wave-wrap {
  position: relative;
  height: 66px;
  margin: 10px 0 4px;
}

.upload-wave {
  width: 100%;
  height: 66px;
  display: block;
}

.wave-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #777465;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.wave-loading[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.preview-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: #777465;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.04em;
}

.preview-bottom #sampleStatus {
  color: #b7b2a4;
}

/* Text area */

.textarea-shell {
  position: relative;
}

textarea {
  display: block;
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card-muted);
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.7;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

textarea::placeholder {
  color: #a49c8d;
}

textarea:hover {
  border-color: var(--line-strong);
}

textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(18, 19, 15, 0.06);
}

#textInput {
  min-height: 112px;
  padding-bottom: 28px;
}

.textarea-mark {
  position: absolute;
  right: 12px;
  bottom: 9px;
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.prompt-chips button {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.prompt-chips button:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: #fff8f2;
}

/* Advanced */

.advanced-block {
  margin: 0 0 19px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-muted);
  overflow: hidden;
}

.advanced-block summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 10.5px;
  font-weight: 600;
  user-select: none;
}

.advanced-block summary::-webkit-details-marker {
  display: none;
}

.advanced-block summary svg {
  width: 13px;
  height: 13px;
  margin-left: 3px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 180ms ease;
}

.advanced-block[open] summary svg {
  transform: rotate(180deg);
}

.advanced-optional {
  margin-left: auto;
  color: var(--muted-light);
  font-size: 8.5px;
  font-weight: 400;
}

.advanced-body {
  padding: 0 14px 14px;
  display: grid;
  gap: 8px;
}

.advanced-body label {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 500;
}

.advanced-body textarea {
  min-height: 58px;
  background: var(--card);
  font-size: 11.5px;
  padding: 10px 12px;
}

.select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 2px;
}

.select-shell {
  position: relative;
  min-width: 150px;
}

.select-shell select {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  padding: 7px 30px 7px 10px;
  font-size: 10.5px;
  cursor: pointer;
}

.select-shell svg {
  position: absolute;
  right: 9px;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.4;
  pointer-events: none;
}

/* Consent + submit */

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.65;
  cursor: pointer;
}

.consent-row input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.custom-check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease, border-color 150ms ease;
}

.custom-check svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: var(--cream);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 150ms ease, transform 150ms ease;
}

.consent-row input:checked + .custom-check {
  background: var(--ink);
  border-color: var(--ink);
}

.consent-row input:checked + .custom-check svg {
  opacity: 1;
  transform: scale(1);
}

.consent-row input:focus-visible + .custom-check {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.consent-row.is-error {
  color: var(--accent-deep);
}

.consent-row.is-error .custom-check {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.primary-button {
  width: 100%;
  min-height: 55px;
  border-radius: 15px;
  background: var(--ink);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 9px 8px 21px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #21221b;
  box-shadow: 0 13px 24px -14px rgba(18, 19, 15, 0.66);
}

.primary-button:active:not(:disabled) {
  transform: translateY(0);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.primary-arrow {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 180ms ease;
}

.primary-button:hover:not(:disabled) .primary-arrow {
  transform: translate(2px, -2px);
}

.primary-arrow svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-button.is-busy .primary-arrow svg {
  animation: spin 900ms linear infinite;
}

.secure-line {
  margin: 11px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted-light);
  font-size: 8.5px;
  line-height: 1.5;
  text-align: center;
}

.secure-line svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.studio-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 13px 0 0;
  color: var(--muted-light);
  font-size: 8.5px;
}

.studio-caption .mono {
  font-size: 7px;
  letter-spacing: 0.13em;
}

/* ---------- Progress state ---------- */

.state-panel {
  min-height: 660px;
  display: flex;
  flex-direction: column;
}

.state-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.state-topline .section-eyebrow {
  margin: 0;
}

.progress-percent {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent-deep);
}

.progress-disc-wrap {
  position: relative;
  width: 198px;
  height: 198px;
  margin: 50px auto 35px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-halo {
  position: absolute;
  width: 155px;
  height: 155px;
  border-radius: 50%;
  background: rgba(240, 90, 50, 0.3);
  filter: blur(42px);
  opacity: 0.55;
  animation: breathe 3.4s ease-in-out infinite;
}

.progress-disc {
  --progress: 12;
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 27%, rgba(255, 255, 255, 0.13), transparent 32%),
    repeating-radial-gradient(circle at 50% 50%, transparent 0 3px, rgba(255, 255, 255, 0.045) 4px 5px),
    var(--dark);
  box-shadow: 0 24px 40px -18px rgba(20, 19, 14, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-disc::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent) calc(var(--progress) * 1%),
    rgba(184, 173, 153, 0.45) 0
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  transition: background 300ms linear;
}

.progress-disc::after {
  content: "";
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-wave {
  height: 49px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.progress-wave i {
  display: block;
  width: 2.5px;
  height: 12px;
  border-radius: 2px;
  background: var(--accent);
  animation: wavePulse 1.1s ease-in-out infinite;
}

.progress-wave i:nth-child(2) {
  animation-delay: -0.82s;
  height: 27px;
}

.progress-wave i:nth-child(3) {
  animation-delay: -0.64s;
  height: 39px;
}

.progress-wave i:nth-child(4) {
  animation-delay: -0.46s;
  height: 22px;
}

.progress-wave i:nth-child(5) {
  animation-delay: -0.28s;
  height: 45px;
}

.progress-wave i:nth-child(6) {
  animation-delay: -0.1s;
  height: 24px;
}

.progress-wave i:nth-child(7) {
  animation-delay: -0.55s;
  height: 36px;
}

.progress-wave i:nth-child(8) {
  animation-delay: -0.73s;
  height: 18px;
}

.progress-wave i:nth-child(9) {
  animation-delay: -0.91s;
  height: 10px;
}

.progress-copy {
  text-align: center;
  max-width: 400px;
  margin: 0 auto;
}

.progress-copy h2 {
  font-size: clamp(27px, 2.5vw, 33px);
}

.progress-copy p {
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.75;
}

.progress-track {
  height: 7px;
  margin: 30px 0 27px;
  border-radius: 99px;
  background: var(--paper-deep);
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  width: 12%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 700ms cubic-bezier(0.22, 0.7, 0.28, 1);
}

.stage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 15px;
}

.stage-list li {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted-light);
}

.stage-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.stage-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.stage-text strong {
  font-size: 11px;
  font-weight: 500;
}

.stage-text small {
  font-size: 9px;
  color: var(--muted-light);
}

.stage-state {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  color: var(--muted-light);
}

.stage-list li.is-done {
  color: var(--ink);
}

.stage-list li.is-done .stage-dot {
  background: var(--ink);
  border-color: var(--ink);
}

.stage-list li.is-active {
  color: var(--ink);
}

.stage-list li.is-active .stage-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(240, 90, 50, 0.14);
}

.stage-list li.is-active .stage-state {
  color: var(--accent-deep);
}

.progress-footnote {
  margin: auto 0 0;
  padding-top: 26px;
  color: var(--muted-light);
  font-size: 8.5px;
  line-height: 1.6;
  text-align: center;
}

/* ---------- Result state ---------- */

.result-panel {
  min-height: 560px;
}

.ready-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid #c0d99a;
  border-radius: 999px;
  background: #f0f8e4;
  color: #4a621f;
  font-size: 8.5px;
}

.ready-pill i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #6a932d;
}

.result-heading {
  margin: 38px 0 22px;
}

.result-heading h2 {
  font-size: clamp(34px, 3.2vw, 42px);
}

.result-heading p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.result-card {
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(240, 90, 50, 0.2), transparent 37%),
    var(--dark);
  color: var(--cream);
  padding: 19px;
  box-shadow: 0 20px 35px -22px rgba(20, 19, 14, 0.9);
}

.result-player {
  display: flex;
  align-items: center;
  gap: 14px;
}

.result-play {
  flex-shrink: 0;
  width: 49px;
  height: 49px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.result-play:hover {
  transform: scale(1.04);
  background: #ff714c;
}

.result-play svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
}

.result-play .icon-pause,
.result-play.is-playing .icon-play {
  display: none;
}

.result-play.is-playing .icon-pause {
  display: block;
}

.result-wave-area {
  position: relative;
  flex: 1;
  min-width: 0;
}

.result-wave {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
}

.result-wave .bar {
  flex: 1;
  min-width: 1px;
  max-width: 4px;
  border-radius: 99px;
  background: #494b3e;
  transition: background 100ms linear, transform 100ms linear;
}

.result-wave .bar.is-played {
  background: var(--accent);
}

.seek-range {
  position: absolute;
  left: -3px;
  top: 0;
  width: calc(100% + 6px);
  height: 46px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.result-wave-area:has(.seek-range:focus-visible) .result-wave {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.result-times {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: #8e8a7c;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.05em;
}

.result-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: #817d70;
  font-size: 8px;
}

.ai-tag {
  padding: 3px 6px;
  border: 1px solid rgba(199, 234, 123, 0.28);
  border-radius: 4px;
  background: rgba(199, 234, 123, 0.08);
  color: #c7ea7b;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.05em;
}

.result-quote {
  margin: 19px 0 22px;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.secondary-button {
  flex: 1;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease;
}

.secondary-button:hover {
  border-color: var(--ink);
  background: var(--card-muted);
}

.secondary-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-button {
  min-height: 48px;
  padding: 0 17px;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.text-button:hover {
  color: var(--ink);
  background: var(--card-muted);
}

.result-expire {
  margin: 20px 0 0;
  color: var(--muted-light);
  font-size: 8.5px;
  line-height: 1.6;
  text-align: center;
}

/* ---------- Error state ---------- */

.error-panel {
  min-height: 600px;
}

.error-code {
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--accent-deep);
  letter-spacing: 0.08em;
}

.error-symbol {
  width: 66px;
  height: 66px;
  margin: 48px 0 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid #efb7a4;
  color: var(--accent-deep);
  font-family: var(--serif);
  font-size: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-copy h2 {
  font-size: clamp(31px, 3vw, 38px);
}

.error-copy p {
  margin: 12px 0 0;
  color: var(--accent-deep);
  font-size: 11.5px;
  line-height: 1.7;
}

.error-tips {
  margin: 30px 0 24px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-muted);
}

.error-tips strong {
  font-size: 10px;
  font-weight: 600;
}

.error-tips ul {
  margin: 9px 0 0;
  padding-left: 17px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.8;
}

.error-panel .primary-button {
  margin-top: auto;
}

/* ---------- Footer + toast ---------- */

.site-footer {
  position: relative;
  z-index: 4;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 8px;
  border-top: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 9px;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-footer .mono {
  font-size: 7px;
  letter-spacing: 0.12em;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  transform: translate(-50%, 18px);
  max-width: min(460px, calc(100vw - 40px));
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 14px 32px rgba(18, 19, 15, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Motion ---------- */

.reveal {
  opacity: 0;
  transform: translateY(13px);
  animation: revealIn 700ms cubic-bezier(0.2, 0.7, 0.25, 1) forwards;
}

.reveal-1 {
  animation-delay: 60ms;
}

.reveal-2 {
  animation-delay: 120ms;
}

.reveal-3 {
  animation-delay: 200ms;
}

.reveal-4 {
  animation-delay: 290ms;
}

.reveal-5 {
  animation-delay: 370ms;
}

@keyframes revealIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes wavePulse {
  0%,
  100% {
    transform: scaleY(0.45);
    opacity: 0.65;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.38;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.62;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(440px, 520px);
    gap: 42px;
  }

  .hero-title {
    font-size: clamp(48px, 6vw, 68px);
  }

  .process-strip {
    gap: 14px;
  }

  .process-line {
    display: none;
  }
}

@media (max-width: 940px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-top: 48px;
  }

  .hero-copy {
    padding-top: 0;
  }

  .hero-title {
    font-size: clamp(54px, 9.4vw, 78px);
  }

  .hero-lead {
    max-width: 620px;
    font-size: 15px;
  }

  .privacy-note {
    max-width: 620px;
  }

  .studio-wrap {
    width: min(100%, 640px);
    margin: 0 auto;
  }
}

@media (max-width: 680px) {
  .page-shell {
    padding: 0 18px 22px;
  }

  .site-header {
    min-height: 76px;
    gap: 12px;
  }

  .wordmark-mark {
    width: 33px;
    height: 33px;
  }

  .wordmark-text {
    font-size: 19px;
  }

  .wordmark-en {
    display: none;
  }

  .header-center {
    display: none;
  }

  .server-badge {
    margin-left: auto;
    font-size: 6.5px;
    padding: 7px 9px;
    letter-spacing: 0.08em;
  }

  .server-badge svg {
    width: 11px;
    height: 11px;
  }

  .config-banner {
    margin-top: 13px;
    padding: 11px 13px;
    font-size: 10.5px;
  }

  .config-banner-label {
    display: none;
  }

  .hero {
    padding-top: 34px;
    gap: 36px;
  }

  .hero-title {
    margin-top: 18px;
    font-size: clamp(46px, 13.5vw, 64px);
    line-height: 1.12;
  }

  .hero-lead {
    font-size: 13px;
    line-height: 1.8;
  }

  .process-strip {
    margin-top: 26px;
    padding-top: 20px;
    gap: 10px;
    justify-content: space-between;
  }

  .process-item {
    gap: 6px;
  }

  .process-item strong {
    font-size: 11.5px;
  }

  .process-item p {
    display: none;
  }

  .privacy-note {
    margin-top: 25px;
    padding: 12px 13px;
  }

  .privacy-note p {
    font-size: 9.5px;
  }

  .studio-card {
    border-radius: 22px;
  }

  .studio-hardware {
    padding: 0 17px;
    height: 34px;
    font-size: 6.5px;
  }

  .hardware-status {
    display: none;
  }

  .studio-panel {
    padding: 22px 17px 20px;
  }

  .panel-heading {
    margin-bottom: 20px;
  }

  .panel-heading h2 {
    font-size: 27px;
  }

  .step-badge {
    display: none;
  }

  .dropzone {
    min-height: 133px;
    padding: 18px;
    gap: 14px;
  }

  .drop-icon {
    width: 43px;
    height: 43px;
  }

  .drop-copy strong {
    font-size: 12px;
  }

  .drop-copy span {
    font-size: 8.5px;
  }

  .drop-corner {
    right: 14px;
    top: 11px;
  }

  .file-preview {
    padding: 13px 14px 11px;
  }

  .upload-wave-wrap,
  .upload-wave {
    height: 56px;
  }

  .prompt-chips button {
    font-size: 8.5px;
  }

  .advanced-optional {
    display: none;
  }

  .consent-row {
    font-size: 9px;
  }

  .secure-line {
    align-items: flex-start;
    font-size: 8px;
  }

  .state-panel,
  .result-panel,
  .error-panel {
    min-height: 560px;
  }

  .progress-disc-wrap {
    margin: 40px auto 30px;
  }

  .progress-track {
    margin: 27px 0 24px;
  }

  .stage-text small {
    display: none;
  }

  .result-heading {
    margin-top: 30px;
  }

  .result-heading h2 {
    font-size: 35px;
  }

  .result-card {
    padding: 15px;
  }

  .result-wave {
    gap: 1.5px;
  }

  .result-actions {
    gap: 7px;
  }

  .text-button {
    padding: 0 12px;
  }

  .error-symbol {
    margin-top: 38px;
  }

  .site-footer {
    flex-wrap: wrap;
    gap: 9px 20px;
    font-size: 8px;
  }

  .footer-links {
    order: 3;
    width: 100%;
    gap: 14px;
  }

  .site-footer > .mono {
    display: none;
  }
}

@media (max-width: 390px) {
  .hero-title {
    font-size: 43px;
  }

  .process-num {
    display: none;
  }

  .result-player {
    gap: 10px;
  }

  .result-play {
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
