:root {
  color-scheme: dark;
  --ink: #f3efe7;
  --muted: #aaa79f;
  --soft: #77756f;
  --canvas: #151618;
  --panel: #1c1d20;
  --panel-2: #232428;
  --line: #35363a;
  --line-light: #4b4b4e;
  --red: #e25b43;
  --red-dark: #a93e31;
  --gold: #d3a85b;
  --green: #86b98a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 8%, rgba(226, 91, 67, 0.11), transparent 28rem),
    var(--canvas);
  font-size: 16px;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid var(--red); color: var(--red); font-size: 24px; line-height: 1; transform: rotate(-7deg); }
.brand strong, .brand em { display: block; line-height: 1; }
.brand strong { font-size: 16px; letter-spacing: 0.02em; }
.brand em { margin-top: 5px; color: var(--gold); font-size: 13px; font-style: normal; letter-spacing: 0.13em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: 13px; }
.demo-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid #46634d; color: #b9d1bb; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.demo-badge.provider-live { border-color: #5b7041; color: #d0dfb1; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.intro-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr); gap: 80px; align-items: end; padding: 75px 0 48px; }
.eyebrow, .section-label, .card-kicker { margin: 0; color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: 0.16em; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 700px; margin-bottom: 19px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(46px, 6.4vw, 86px); font-weight: 400; line-height: 0.98; letter-spacing: -0.055em; }
.intro-text { max-width: 620px; margin-bottom: 26px; color: var(--muted); font-size: 19px; line-height: 1.55; }
.promise-row { display: flex; flex-wrap: wrap; gap: 22px; color: var(--muted); font-size: 13px; }
.promise-row span { display: inline-flex; align-items: center; gap: 7px; }
.promise-row b { color: var(--red); font-size: 11px; letter-spacing: 0.1em; }
.story-card { padding: 24px; border: 1px solid var(--line); background: rgba(28, 29, 32, 0.84); box-shadow: var(--shadow); }
.story-card p { margin: 17px 0 22px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.card-rule { height: 1px; margin-bottom: 13px; background: var(--line); }
.card-foot { color: var(--soft); font-size: 12px; }

.stepper { display: flex; align-items: center; width: 100%; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.step { display: inline-flex; align-items: center; gap: 10px; color: var(--soft); white-space: nowrap; font-size: 13px; }
.step span { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid var(--line-light); border-radius: 50%; font-size: 12px; }
.step.active { color: var(--ink); }
.step.active span { border-color: var(--red); color: var(--red); }
.step-line { flex: 1; height: 1px; margin: 0 18px; background: var(--line); }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, 0.8fr); gap: 28px; padding: 36px 0 70px; }
.panel { border: 1px solid var(--line); background: rgba(28, 29, 32, 0.94); }
.form-panel { padding: clamp(22px, 4vw, 42px); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 31px; }
.panel-heading.compact { margin-bottom: 24px; }
h2 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(27px, 3vw, 38px); font-weight: 400; line-height: 1.05; letter-spacing: -0.03em; }
.required-note { color: var(--soft); font-size: 12px; }
.field-grid { display: grid; gap: 19px; }
.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: block; margin-bottom: 20px; }
.field > span, .tone-field legend { display: block; margin-bottom: 8px; color: var(--ink); font-size: 14px; font-weight: 600; }
.field > span b { color: var(--red); }
input, select, textarea { width: 100%; border: 1px solid var(--line-light); border-radius: 0; outline: none; color: var(--ink); background: #16171a; transition: border-color 160ms ease, box-shadow 160ms ease; }
input, select { min-height: 49px; padding: 12px 13px; }
textarea { min-height: 140px; padding: 13px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #66666a; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(226, 91, 67, 0.14); }
select { 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) 21px, calc(100% - 12px) 21px; background-repeat: no-repeat; background-size: 6px 6px, 6px 6px; }
.field small { display: block; margin-top: 8px; color: var(--soft); font-size: 12px; }
.tone-field { margin: 2px 0 24px; padding: 0; border: 0; }
.tone-options { display: flex; flex-wrap: wrap; gap: 8px; }
.tone-option input { position: absolute; opacity: 0; pointer-events: none; }
.tone-option span { display: inline-block; padding: 9px 13px; border: 1px solid var(--line-light); color: var(--muted); font-size: 13px; transition: all 160ms ease; }
.tone-option input:checked + span { border-color: var(--red); color: var(--ink); background: rgba(226, 91, 67, 0.12); }
.tone-option input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.consent-box { display: grid; gap: 10px; margin: 10px 0 18px; padding: 15px; border: 1px solid #3f3d35; background: rgba(211, 168, 91, 0.05); }
.check-row { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.check-row input { flex: 0 0 auto; width: 17px; height: 17px; min-height: 17px; margin: 2px 0 0; accent-color: var(--red); }
.form-error { min-height: 20px; margin: 0 0 10px; color: #f18b77; font-size: 13px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 50px; padding: 12px 18px; border: 1px solid var(--red); border-radius: 0; font-weight: 700; transition: transform 160ms ease, background 160ms ease; }
.primary-button { color: #fff8ef; background: var(--red); }
.primary-button:disabled, .secondary-button:disabled { cursor: wait; opacity: 0.65; transform: none; }
.primary-button:hover { background: #f06b52; transform: translateY(-1px); }
.secondary-button { color: var(--ink); border-color: var(--line-light); background: transparent; }
.secondary-button:hover { border-color: var(--gold); background: rgba(211, 168, 91, 0.08); }
.privacy-note { margin: 13px 0 0; color: var(--soft); font-size: 12px; }

.side-panel { display: grid; align-content: start; gap: 18px; }
.process-panel, .policy-panel { padding: 26px; }
.process-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.process-list li { display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 18px 0; border-top: 1px solid var(--line); }
.process-list li:first-child { border-top: 0; }
.process-list li > span { color: var(--red); font-size: 12px; font-weight: 700; }
.process-list strong { display: block; margin-bottom: 4px; font-size: 14px; }
.process-list p { margin: 0; color: var(--soft); font-size: 13px; }
.beta-price { display: grid; gap: 3px; margin-top: 7px; padding-top: 19px; border-top: 1px solid var(--line); }
.beta-price span { color: var(--muted); font-size: 13px; }
.beta-price strong { color: var(--gold); font-family: Georgia, "Times New Roman", serif; font-size: 38px; font-weight: 400; }
.beta-price small, .checkout-card small { color: var(--soft); font-size: 12px; }
.policy-panel { border-color: #443d31; background: rgba(211, 168, 91, 0.05); }
.policy-panel p:last-child { margin: 15px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.results-section, .checkout-section { margin-bottom: 28px; padding: clamp(22px, 4vw, 42px); scroll-margin-top: 20px; }
.results-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.results-subtitle { max-width: 720px; margin: 10px 0 0; color: var(--muted); }
.round-count { padding: 7px 10px; border: 1px solid #3f5d46; color: #b9d1bb; font-size: 12px; white-space: nowrap; }
.song-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.song-card { position: relative; display: flex; flex-direction: column; min-height: 350px; padding: 24px; border: 1px solid var(--line-light); background: #17181b; transition: border-color 160ms ease, transform 160ms ease; }
.song-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.song-card.selected { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.song-number { color: var(--red); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; }
.song-card h3 { margin: 14px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 400; line-height: 1.08; }
.song-style { margin: 0 0 20px; color: var(--gold); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.lyric-excerpt { margin: 0 0 25px; color: var(--muted); font-family: Georgia, "Times New Roman", serif; font-size: 17px; font-style: italic; line-height: 1.45; }
.audio-preview { margin: 0 0 22px; padding: 14px; border: 1px solid #343c35; background: rgba(134, 185, 138, 0.06); }
.audio-label { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: #b9d1bb; font-size: 12px; }
.audio-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(134, 185, 138, 0.12); }
.audio-preview audio { display: block; width: 100%; height: 36px; }
.audio-placeholder { display: flex; align-items: center; gap: 8px; margin: 0 0 22px; padding: 14px; border: 1px dashed var(--line-light); color: var(--soft); font-size: 12px; line-height: 1.45; }
.audio-placeholder span { color: var(--gold); font-size: 17px; }
.song-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; margin-bottom: 20px; }
.song-meta span { padding: 5px 8px; border: 1px solid var(--line); color: var(--soft); font-size: 11px; }
.select-song { width: 100%; min-height: 44px; border: 1px solid var(--line-light); color: var(--ink); background: transparent; font-weight: 700; }
.select-song:hover, .song-card.selected .select-song { border-color: var(--red); background: rgba(226, 91, 67, 0.12); }
.results-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; margin-top: 22px; }
.results-actions span { color: var(--soft); font-size: 12px; }
.checkout-section { display: flex; align-items: center; justify-content: space-between; gap: 35px; border-color: #594836; background: linear-gradient(115deg, rgba(211, 168, 91, 0.1), rgba(28, 29, 32, 0.96) 52%); }
.checkout-copy { max-width: 600px; }
.checkout-copy h2 { margin: 9px 0 11px; }
.checkout-copy p:last-child { margin: 0; color: var(--muted); }
.checkout-card { min-width: 250px; padding: 21px; border: 1px solid var(--line-light); background: rgba(21, 22, 24, 0.74); }
.checkout-card > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.checkout-card span { color: var(--muted); font-size: 13px; }
.checkout-card strong { color: var(--gold); font-family: Georgia, "Times New Roman", serif; font-size: 29px; font-weight: 400; }
.checkout-card .primary-button { width: 100%; }
.checkout-card small { display: block; margin-top: 11px; line-height: 1.4; }
.button-loader { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255, 248, 239, 0.45); border-top-color: #fff8ef; border-radius: 50%; animation: spin 720ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.footer { display: flex; justify-content: space-between; gap: 20px; padding: 25px 0 45px; color: var(--soft); font-size: 12px; }
.is-hidden { display: none; }

@media (max-width: 900px) {
  .intro-grid { gap: 38px; grid-template-columns: minmax(0, 1fr) minmax(240px, 0.72fr); }
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .side-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .app-shell { width: min(100% - 26px, 560px); }
  .topbar { min-height: 74px; }
  .adult-note { display: none; }
  .intro-grid { grid-template-columns: 1fr; padding: 49px 0 35px; }
  h1 { font-size: clamp(45px, 14vw, 72px); }
  .intro-text { font-size: 17px; }
  .story-card { max-width: none; }
  .stepper { overflow-x: auto; }
  .step-line { min-width: 30px; margin: 0 10px; }
  .two-up, .song-options, .side-panel { grid-template-columns: 1fr; }
  .form-panel, .process-panel, .policy-panel, .results-section, .checkout-section { padding: 22px 18px; }
  .panel-heading, .results-heading, .checkout-section { flex-direction: column; }
  .checkout-card { width: 100%; min-width: 0; }
  .footer { flex-direction: column; gap: 8px; padding-bottom: 28px; }
}

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