:root {
  --paper: #fdfbf7;
  --paper-deep: #f5ede4;
  --surface: #ffffff;
  --ink: #4a4036;
  --muted: #756b62;
  --soft: #9a8e82;
  --accent: #d97c55;
  --accent-deep: #c06540;
  --accent-pale: #f6e6d8;
  --gold: #e8c39e;
  --green: #8ea48c;
  --shadow-card: 0 0 0 1px rgba(74, 64, 54, 0.045), 0 8px 24px rgba(74, 64, 54, 0.08), 0 24px 56px -32px rgba(74, 64, 54, 0.2);
  --shadow-control: 0 0 0 1px rgba(74, 64, 54, 0.08), 0 2px 8px rgba(74, 64, 54, 0.05);
  --shadow-control-hover: 0 0 0 1px rgba(217, 124, 85, 0.34), 0 5px 14px rgba(74, 64, 54, 0.08);
  color-scheme: light;
  font-family: "Manrope", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 8%, rgba(232, 195, 158, 0.16), transparent 25rem),
    radial-gradient(circle at 96% 18%, rgba(142, 164, 140, 0.1), transparent 25rem),
    var(--paper);
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.page-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

.site-header {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
}

.brand-name {
  font-family: "Lora", Georgia, serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.brand-name em {
  color: var(--accent);
  font-weight: 500;
  font-style: italic;
}

.brand small {
  color: var(--soft);
  font-family: "Manrope", sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.privacy-link, .site-footer button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  transition-property: color;
  transition-duration: 150ms;
}
.privacy-link:hover, .site-footer button:hover { color: var(--accent); }
.privacy-link svg { width: 17px; height: 17px; }

.landing {
  min-height: calc(100vh - 92px);
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  grid-template-rows: 1fr auto;
  column-gap: clamp(44px, 7vw, 100px);
  align-items: center;
  padding: 54px 0 58px;
}

.landing-copy { align-self: center; max-width: 670px; }
.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.17em;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 750;
}

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

.landing h1, .result-heading h1 {
  max-width: 660px;
  margin: 0;
  font-family: "Lora", Georgia, serif;
  font-weight: 600;
  font-size: clamp(46px, 5.3vw, 68px);
  line-height: 1.06;
  letter-spacing: -0.042em;
}

.hero-text {
  max-width: 610px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.65;
}

.hero-actions { display: flex; align-items: center; gap: 22px; margin-top: 34px; flex-wrap: wrap; }
.time-note { color: var(--soft); font-size: 13px; }

.button {
  min-height: 48px;
  border: 0;
  border-radius: 9999px;
  padding: 0 20px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-weight: 680;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition-property: scale, background-color, color, box-shadow, opacity;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}
.button:active:not(:disabled) { scale: 0.96; }
.button:focus-visible, .icon-button:focus-visible, .chip input:focus-visible + span, .option-card input:focus-visible + span, .segmented input:focus-visible + span, .revision-options button:focus-visible, .text-button:focus-visible, .start-over:focus-visible { outline: 3px solid rgba(217, 124, 85, 0.23); outline-offset: 3px; }
.button svg { width: 19px; height: 19px; }
.button-large { min-height: 56px; border-radius: 9999px; padding: 0 25px 0 27px; font-size: 15px; }
.button-primary { color: #fff; background: var(--accent); box-shadow: 0 4px 12px rgba(217, 124, 85, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.09); }
.button-primary:hover { background: var(--accent-deep); box-shadow: 0 7px 17px rgba(192, 101, 64, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.button-secondary { background: rgba(255, 253, 249, 0.68); color: var(--ink); box-shadow: var(--shadow-control); }
.button-secondary:hover { box-shadow: var(--shadow-control-hover); }
.button:disabled { cursor: wait; opacity: 0.65; }

.preview-card {
  justify-self: end;
  width: min(100%, 450px);
  padding: 38px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-card);
  position: relative;
}
.preview-card::before, .preview-card::after { content: ""; position: absolute; border-radius: 50%; background: var(--accent-pale); z-index: -1; }
.preview-card::before { width: 80px; height: 80px; right: -23px; top: -32px; opacity: 0.85; }
.preview-card::after { width: 42px; height: 42px; right: 48px; top: -39px; background: var(--gold); }
.preview-topline { display: flex; justify-content: space-between; align-items: center; color: var(--soft); font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; }
.preview-topline svg { color: var(--accent); }
.preview-card blockquote { margin: 34px 0 36px; font-family: "Lora", Georgia, serif; font-size: clamp(23px, 2.7vw, 31px); font-weight: 500; line-height: 1.43; letter-spacing: -0.025em; }
.preview-formula { display: flex; align-items: center; gap: 11px; color: var(--soft); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; }
.preview-formula i { height: 1px; flex: 1; background: rgba(53, 42, 39, 0.15); }

.how-it-works {
  grid-column: 1 / -1;
  align-self: end;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding-top: 72px;
}
.how-it-works div { display: flex; gap: 15px; align-items: baseline; border-top: 1px solid rgba(53, 42, 39, 0.13); padding-top: 17px; }
.how-it-works span { color: var(--accent); font: italic 16px "Lora", Georgia, serif; font-variant-numeric: tabular-nums; }
.how-it-works p { margin: 0; color: var(--muted); font-size: 13px; }

.stagger { opacity: 0; transform: translateY(12px); filter: blur(4px); animation: enter 430ms ease-out forwards; }
.stagger:nth-child(2) { animation-delay: 80ms; }
.stagger:nth-child(3) { animation-delay: 160ms; }
.stagger:nth-child(4) { animation-delay: 240ms; }
.preview-card.stagger { animation-delay: 150ms; }
.how-it-works.stagger { animation-delay: 300ms; }
@keyframes enter { to { opacity: 1; transform: translateY(0); filter: blur(0); } }

.wizard { width: min(790px, 100%); margin: 0 auto; padding: 30px 0 96px; }
.progress-row { display: grid; grid-template-columns: 44px 1fr 70px; align-items: center; gap: 18px; margin-bottom: 54px; }
.icon-button { width: 44px; height: 44px; border: 0; border-radius: 13px; background: rgba(255, 253, 249, 0.62); box-shadow: var(--shadow-control); cursor: pointer; display: grid; place-items: center; transition-property: scale, box-shadow; transition-duration: 150ms; }
.icon-button:hover { box-shadow: var(--shadow-control-hover); }
.icon-button:active { scale: 0.96; }
.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-bottom: 9px; font-variant-numeric: tabular-nums; }
.progress-track { height: 4px; border-radius: 4px; background: rgba(53, 42, 39, 0.1); overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 25%; border-radius: inherit; background: var(--accent); transition-property: width; transition-duration: 280ms; transition-timing-function: cubic-bezier(0.2, 0, 0, 1); }
.saved-status { color: var(--green); font-size: 11px; text-align: right; transition-property: opacity; transition-duration: 180ms; }
.saved-status.saving { opacity: 0.35; }

.form-step { animation: step-in 290ms ease-out both; }
@keyframes step-in { from { opacity: 0; transform: translateY(10px); filter: blur(3px); } to { opacity: 1; transform: translateY(0); filter: blur(0); } }
.step-heading { margin-bottom: 42px; }
.step-heading .eyebrow { margin-bottom: 13px; }
.step-heading h2, .result-heading h2 { margin: 0; font: 600 clamp(38px, 6vw, 56px)/1.08 "Lora", Georgia, serif; letter-spacing: -0.038em; }
.step-heading > p:last-child { max-width: 600px; margin: 17px 0 0; color: var(--muted); line-height: 1.6; font-size: 15px; }

.field-grid { display: grid; gap: 18px; }
.field-grid.two-columns { grid-template-columns: 1fr 160px; }
.field { display: block; margin: 0 0 28px; padding: 0; border: 0; }
.field > span, .field legend { display: block; margin: 0 0 10px; font-size: 13px; font-weight: 680; color: var(--ink); }
.field em { color: var(--soft); font-size: 10px; font-weight: 500; font-style: normal; text-transform: uppercase; letter-spacing: 0.06em; margin-left: 5px; }
.field input[type="text"], .field input[type="number"], .field textarea {
  display: block;
  width: 100%;
  border: 1px solid rgba(53, 42, 39, 0.15);
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.8);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(53, 42, 39, 0.025);
  outline: none;
  transition-property: border-color, box-shadow, background-color;
  transition-duration: 160ms;
}
.field input[type="text"], .field input[type="number"] { height: 52px; padding: 0 16px; }
.field textarea { min-height: 110px; padding: 15px 16px; resize: vertical; line-height: 1.55; }
.field input:hover, .field textarea:hover { border-color: rgba(53, 42, 39, 0.28); }
.field input:focus, .field textarea:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217, 124, 85, 0.11); }
.field input::placeholder, .field textarea::placeholder { color: #a89d97; }
.field.invalid input[type="text"], .field.invalid input[type="number"], .field.invalid textarea { border-color: #b64450; }
.field-hint { display: block; margin-top: 8px; color: var(--soft); font-size: 11px; line-height: 1.45; }
.field-error { display: none; margin-top: 8px; color: #a32936; font-size: 11px; }
.field.invalid > .field-error { display: block; }
.field-footer { display: flex; justify-content: space-between; gap: 15px; align-items: start; }
.char-count { flex: none; margin-top: 8px; color: var(--soft); font-size: 10px; font-variant-numeric: tabular-nums; }
.conditional-field:not([hidden]) { animation: conditional-in 220ms ease-out both; }
@keyframes conditional-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip input, .option-card input, .segmented input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { min-height: 42px; padding: 0 15px; display: inline-flex; align-items: center; border-radius: 12px; background: rgba(255, 253, 249, 0.66); box-shadow: var(--shadow-control); cursor: pointer; font-size: 13px; transition-property: color, background-color, box-shadow, scale; transition-duration: 150ms; }
.chip span:hover { box-shadow: var(--shadow-control-hover); }
.chip span:active { scale: 0.96; }
.chip input:checked + span { color: var(--accent-deep); background: var(--accent-pale); box-shadow: 0 0 0 1px rgba(217, 124, 85, 0.28), 0 4px 10px rgba(74, 64, 54, 0.06); }
.other-input { margin-top: 13px; max-width: 420px; }

.option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.option-card > span { min-height: 82px; padding: 16px 18px; display: flex; flex-direction: column; justify-content: center; border-radius: 16px; background: rgba(255, 253, 249, 0.68); box-shadow: var(--shadow-control); cursor: pointer; transition-property: background-color, box-shadow, scale; transition-duration: 150ms; }
.option-card > span:hover { box-shadow: var(--shadow-control-hover); }
.option-card > span:active { scale: 0.96; }
.option-card input:checked + span { background: var(--accent-pale); box-shadow: 0 0 0 1px rgba(217, 124, 85, 0.32), 0 6px 14px rgba(74, 64, 54, 0.07); }
.option-card b { font-size: 14px; }
.option-card small { margin-top: 6px; color: var(--muted); font-size: 11px; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; border-radius: 15px; background: rgba(53, 42, 39, 0.065); }
.segmented-compact { max-width: 420px; grid-template-columns: repeat(2, 1fr); }
.segmented span { min-height: 42px; border-radius: 11px; display: grid; place-items: center; text-align: center; padding: 5px 12px; color: var(--muted); font-size: 12px; cursor: pointer; transition-property: background-color, color, box-shadow, scale; transition-duration: 150ms; }
.segmented span:active { scale: 0.96; }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 5px rgba(53, 42, 39, 0.12); }

.privacy-note { padding: 16px 18px; border-radius: 16px; background: rgba(255, 253, 249, 0.5); display: flex; gap: 13px; color: var(--muted); }
.privacy-note svg { flex: none; width: 18px; height: 18px; color: var(--green); margin-top: 2px; }
.privacy-note p { margin: 0; font-size: 11px; line-height: 1.55; }
.privacy-note b { color: var(--ink); }

.form-actions { margin-top: 42px; padding-top: 25px; border-top: 1px solid rgba(53, 42, 39, 0.11); display: flex; justify-content: space-between; }
.generate-button { margin-left: auto; }

.loading-state { min-height: calc(100vh - 160px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 70px 20px; }
.loading-orbit { width: 94px; height: 94px; border-radius: 50%; display: grid; place-items: center; position: relative; margin-bottom: 32px; background: rgba(255, 253, 249, 0.65); box-shadow: var(--shadow-card); }
.loading-orbit > span { position: absolute; inset: -9px; border-radius: inherit; border: 1px solid rgba(217, 124, 85, 0.18); border-top-color: var(--accent); animation: spin 1.4s linear infinite; }
.loading-orbit svg { width: 34px; height: 34px; color: var(--accent); fill: rgba(217, 124, 85, 0.07); animation: breathe 1.5s ease-in-out infinite alternate; }
@keyframes spin { to { rotate: 360deg; } }
@keyframes breathe { to { scale: 1.08; } }
.loading-state .eyebrow { margin-bottom: 13px; }
.loading-state h2 { max-width: 640px; margin: 0; font: 600 clamp(32px, 5vw, 48px)/1.1 "Lora", Georgia, serif; letter-spacing: -0.035em; }
.loading-lines { width: min(360px, 76vw); margin: 35px 0 25px; display: grid; gap: 9px; }
.loading-lines i { display: block; height: 7px; border-radius: 10px; background: linear-gradient(90deg, rgba(217, 124, 85, 0.06), rgba(217, 124, 85, 0.2), rgba(217, 124, 85, 0.06)); background-size: 220% 100%; animation: shimmer 1.45s ease-in-out infinite; }
.loading-lines i:nth-child(2) { width: 86%; animation-delay: 100ms; }
.loading-lines i:nth-child(3) { width: 66%; animation-delay: 200ms; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -120% 0; } }
.loading-state > p:last-child { margin: 0; color: var(--muted); font-size: 13px; }

.result { width: min(940px, 100%); margin: 0 auto; padding: 56px 0 92px; }
.result-heading { text-align: center; margin-bottom: 42px; }
.result-heading .eyebrow { display: flex; align-items: center; justify-content: center; gap: 7px; margin-bottom: 13px; }
.result-heading .eyebrow svg { width: 15px; height: 15px; }
.result-heading h1 { margin-inline: auto; font-size: clamp(43px, 6vw, 64px); }
.result-heading > p:last-child { margin: 17px auto 0; color: var(--muted); font-size: 14px; }
.result-card { position: relative; padding: clamp(34px, 6vw, 62px); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
.quote-mark { position: absolute; top: 18px; left: 25px; color: var(--accent-pale); font: 120px/1 "Lora", Georgia, serif; user-select: none; }
.result-text { position: relative; white-space: pre-wrap; font: 400 clamp(20px, 2.5vw, 25px)/1.67 "Lora", Georgia, serif; letter-spacing: -0.012em; }
.result-card-footer { margin-top: 38px; padding-top: 19px; border-top: 1px solid rgba(53, 42, 39, 0.1); display: flex; justify-content: space-between; align-items: center; gap: 20px; color: var(--soft); font-size: 11px; }
.text-button { min-height: 40px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; transition-property: color; transition-duration: 150ms; }
.text-button:hover { color: var(--accent); }
.text-button svg { width: 15px; height: 15px; }

.copy-panel { text-align: center; margin: 28px auto 0; }
.copy-panel > .button { min-width: 230px; }
.icon-swap { width: 19px; height: 19px; display: inline-grid; place-items: center; position: relative; }
.icon-swap svg { grid-area: 1/1; transition-property: opacity, scale, filter; transition-duration: 300ms; transition-timing-function: cubic-bezier(0.2, 0, 0, 1); }
.icon-success { opacity: 0; scale: 0.25; filter: blur(4px); }
.copied .icon-default { opacity: 0; scale: 0.25; filter: blur(4px); }
.copied .icon-success { opacity: 1; scale: 1; filter: blur(0); }
.revision-panel { margin: 58px 0; padding: 27px 29px; border-radius: 22px; background: rgba(255, 253, 249, 0.5); box-shadow: var(--shadow-control); display: grid; grid-template-columns: minmax(250px, 1fr) auto; align-items: center; gap: 24px 30px; }
.revision-panel .eyebrow { margin-bottom: 7px; font-size: 9px; }
.revision-panel h3 { margin: 0; font: 600 23px/1.2 "Lora", Georgia, serif; }
.revision-panel p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.revision-options { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.revision-options button { min-height: 40px; border: 0; border-radius: 11px; padding: 0 13px; background: var(--surface); box-shadow: var(--shadow-control); cursor: pointer; font-size: 11px; transition-property: scale, box-shadow, opacity; transition-duration: 150ms; }
.revision-options button:hover { box-shadow: var(--shadow-control-hover); }
.revision-options button:active { scale: 0.96; }
.revision-options button:disabled { cursor: not-allowed; opacity: 0.46; }
.custom-revision { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid rgba(53, 42, 39, 0.1); }
.custom-revision label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 650; }
.custom-revision > div { display: flex; gap: 10px; }
.custom-revision input { width: 100%; min-width: 0; height: 46px; padding: 0 15px; border: 1px solid rgba(53, 42, 39, 0.15); border-radius: 13px; outline: none; background: rgba(255, 253, 249, 0.8); color: var(--ink); transition-property: border-color, box-shadow, background-color, opacity; transition-duration: 160ms; }
.custom-revision input:hover { border-color: rgba(53, 42, 39, 0.28); }
.custom-revision input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px rgba(217, 124, 85, 0.11); }
.custom-revision input::placeholder { color: #a89d97; }
.custom-revision .button { flex: none; min-height: 46px; }
.custom-revision input:disabled { cursor: not-allowed; opacity: 0.46; }
.revision-panel.used { opacity: 0.78; }
.revision-rollback { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 18px; border-top: 1px solid rgba(53, 42, 39, 0.1); color: var(--muted); font-size: 11px; }
.revision-rollback[hidden] { display: none; }
.revision-rollback .text-button { flex: none; color: var(--accent-dark); }

.memogift-cta { min-height: 510px; position: relative; overflow: hidden; border-radius: 32px; padding: clamp(42px, 6vw, 66px); color: #fffdf9; background: linear-gradient(135deg, #4a4036, #665648 72%, #57493e); box-shadow: 0 30px 70px -32px rgba(74, 64, 54, 0.58); display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 34px; align-items: center; }
.memogift-cta::after { content: ""; position: absolute; width: 440px; height: 440px; border-radius: 50%; right: -170px; top: -190px; border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 0 0 48px rgba(255,255,255,0.025), 0 0 0 100px rgba(255,255,255,0.018); }
.cta-copy { position: relative; z-index: 2; }
.cta-copy .eyebrow { color: var(--gold); margin-bottom: 13px; }
.cta-copy h2 { max-width: 580px; margin: 0; font: 500 clamp(34px, 4.5vw, 49px)/1.09 "Lora", Georgia, serif; letter-spacing: -0.035em; }
.cta-copy > p:not(.eyebrow, .cta-footnote) { max-width: 560px; color: rgba(255, 250, 245, 0.78); line-height: 1.6; font-size: 14px; }
.cta-copy ul { display: grid; gap: 12px; padding: 0; margin: 27px 0 30px; list-style: none; }
.cta-copy li { display: flex; gap: 11px; align-items: start; }
.cta-copy li > svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--gold); }
.cta-copy li span { display: grid; gap: 3px; }
.cta-copy li b { font-size: 13px; }
.cta-copy li small { color: rgba(255, 250, 245, 0.66); font-size: 10px; }
.button-light { color: var(--ink); background: #fffdf9; box-shadow: 0 14px 30px -15px rgba(30, 22, 16, 0.48); }
.button-light:hover { color: #fff; background: var(--accent); }
.cta-footnote { margin: 12px 0 0; color: rgba(255, 250, 245, 0.55); font-size: 10px; }
.book-mockup { width: 245px; height: 330px; position: relative; justify-self: center; rotate: 5deg; z-index: 2; perspective: 900px; }
.book-shadow { position: absolute; left: 24px; right: -25px; bottom: -17px; height: 38px; background: rgba(31, 6, 11, 0.4); filter: blur(16px); border-radius: 50%; }
.book-cover { position: absolute; inset: 0; padding: 35px 29px; border-radius: 4px 14px 14px 4px; background: #f3dfcb; color: var(--ink); box-shadow: inset 8px 0 13px rgba(74, 64, 54, 0.12), inset -4px 0 0 rgba(255,255,255,0.35), 12px 16px 30px rgba(35, 27, 20, 0.33); transform: rotateY(-7deg); display: flex; flex-direction: column; align-items: center; text-align: center; }
.book-cover::before { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(74, 64, 54, 0.24); border-radius: 2px 9px 9px 2px; }
.book-label { margin-top: 32px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.18em; }
.book-cover strong { margin-top: 10px; font: 500 29px/1.02 "Lora", Georgia, serif; overflow-wrap: anywhere; }
.book-cover i { width: 40px; height: 1px; background: rgba(108, 48, 56, 0.5); margin: 24px 0; }
.book-cover small { font: italic 13px/1.35 "Lora", Georgia, serif; }
.cta-decoration span { position: absolute; width: 150px; height: 330px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.06); rotate: 43deg; left: -85px; bottom: -190px; }
.cta-decoration span:nth-child(2) { left: -10px; bottom: -220px; }
.cta-decoration span:nth-child(3) { left: 60px; bottom: -250px; }

.start-over { min-height: 44px; margin: 30px auto 0; display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; transition-property: color, scale; transition-duration: 150ms; }
.start-over:hover { color: var(--accent); }
.start-over:active { scale: 0.96; }
.start-over svg { width: 16px; height: 16px; }

.site-footer { min-height: 115px; border-top: 1px solid rgba(53, 42, 39, 0.1); display: flex; align-items: center; gap: 26px; color: var(--soft); }
.brand-small .brand-name { font-size: 18px; }
.brand-small small { font-size: 8px; }
.site-footer p { margin: 0; font-size: 11px; flex: 1; }
.site-footer button { font-size: 11px; }

dialog { width: min(520px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 24px; background: transparent; color: var(--ink); }
dialog::backdrop { background: rgba(40, 29, 28, 0.5); backdrop-filter: blur(4px); }
.dialog-card { position: relative; padding: 38px; border-radius: 24px; background: var(--surface); box-shadow: 0 30px 80px rgba(40, 20, 20, 0.25); }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; cursor: pointer; transition-property: background-color, scale; transition-duration: 150ms; }
.dialog-close:hover { background: var(--paper); }
.dialog-close:active { scale: 0.96; }
.dialog-icon { width: 25px; height: 25px; color: var(--green); }
.dialog-card h2 { margin: 18px 0 14px; font: 600 32px/1.1 "Lora", Georgia, serif; }
.dialog-card p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.dialog-ok { margin-top: 10px; }

/* max-width обязателен: подсказки про микрофон длиннее строки и без него
   растягивают тост шире экрана телефона вместе со всей страницей */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 20; min-height: 46px; width: max-content; max-width: min(430px, calc(100% - 32px)); padding: 11px 17px; line-height: 1.4; border-radius: 14px; background: #332925; color: #fff; box-shadow: 0 12px 30px rgba(35, 20, 18, 0.24); display: flex; align-items: center; gap: 9px; font-size: 12px; opacity: 0; transform: translate(-50%, 12px); filter: blur(4px); pointer-events: none; transition-property: opacity, transform, filter; transition-duration: 220ms; }
.toast.show { opacity: 1; transform: translate(-50%, 0); filter: blur(0); }
.toast svg { width: 16px; height: 16px; color: #a7e0c4; }

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Голосовой ввод. Кнопка живёт в строке вопроса, а не поверх поля: так она
   не перекрывает текст ответа и остаётся подписанной словом, а не одной иконкой. */
.field > .field-label { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; }
.field-question { flex: 1 1 240px; min-width: 0; }
.mic-button { flex: none; min-height: 38px; padding: 0 13px; border: 0; border-radius: 11px; background: rgba(255, 253, 249, 0.82); box-shadow: var(--shadow-control); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 620; transition-property: color, background-color, box-shadow, scale; transition-duration: 150ms; }
.mic-button:hover { color: var(--accent); box-shadow: var(--shadow-control-hover); }
.mic-button:active { scale: 0.96; }
.mic-button:focus-visible { outline: 3px solid rgba(217, 124, 85, 0.23); outline-offset: 3px; }
.mic-button svg { width: 15px; height: 15px; }
.mic-button.rec { color: #fff; background: var(--accent); animation: mic-pulse 1.5s ease-out infinite; }
.mic-button.rec:hover { color: #fff; }
@keyframes mic-pulse { from { box-shadow: 0 0 0 0 rgba(217, 124, 85, 0.42); } to { box-shadow: 0 0 0 9px rgba(217, 124, 85, 0); } }

/* Сбор лидов на экране готового текста: сначала ценность, потом просьба */
.lead-card { margin: 0 0 58px; padding: 27px 29px; border-radius: 22px; background: rgba(255, 253, 249, 0.5); box-shadow: var(--shadow-control); display: grid; grid-template-columns: minmax(240px, 1fr) minmax(290px, 0.85fr); align-items: center; gap: 22px 30px; }
.lead-card .eyebrow { margin-bottom: 7px; font-size: 9px; }
.lead-card h3 { margin: 0; font: 600 23px/1.2 "Lora", Georgia, serif; }
.lead-copy p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.lead-row { display: flex; gap: 10px; }
.lead-row input { width: 100%; min-width: 0; height: 46px; padding: 0 15px; border: 1px solid rgba(53, 42, 39, 0.15); border-radius: 13px; outline: none; background: rgba(255, 253, 249, 0.8); color: var(--ink); transition-property: border-color, box-shadow, background-color; transition-duration: 160ms; }
.lead-row input:hover { border-color: rgba(53, 42, 39, 0.28); }
.lead-row input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px rgba(217, 124, 85, 0.11); }
.lead-row input::placeholder { color: #a89d97; }
.lead-row .button { flex: none; min-height: 46px; }
.lead-row .button:disabled { cursor: not-allowed; opacity: 0.6; }
/* Галочку ставят пальцем: 22 px и отступы строки дают область нажатия крупнее самого квадрата */
.consent-row { display: flex; align-items: center; gap: 10px; margin-top: 11px; padding: 6px 0; color: var(--muted); font-size: 11px; line-height: 1.45; cursor: pointer; }
.consent-row input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.consent-row a { color: var(--accent-deep); }
.lead-error { display: block; margin-top: 11px; color: #a32936; font-size: 11px; line-height: 1.45; }
.lead-error:empty { display: none; }
.lead-done { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--green); font-size: 13px; }
.lead-done svg { flex: none; width: 18px; height: 18px; }

@media (max-width: 840px) {
  .lead-card { grid-template-columns: 1fr; align-items: start; }
  .landing { grid-template-columns: 1fr; grid-template-rows: auto auto auto; gap: 52px; padding-top: 70px; }
  .preview-card { justify-self: center; width: min(520px, 92%); }
  .how-it-works { grid-column: auto; padding-top: 20px; }
  .memogift-cta { grid-template-columns: 1fr; }
  .book-mockup { display: none; }
  .revision-panel { grid-template-columns: 1fr; align-items: start; }
  .revision-options { justify-content: flex-start; }
}

@media (max-width: 600px) {
  .page-shell { width: min(100% - 28px, 1180px); }
  .site-header { height: 72px; }
  .privacy-link span { display: none; }
  .landing { min-height: auto; padding: 55px 0 68px; gap: 40px; }
  .landing h1 { font-size: clamp(43px, 14vw, 61px); }
  .hero-text { font-size: 16px; line-height: 1.55; }
  .hero-actions { align-items: stretch; flex-direction: column; gap: 12px; }
  .hero-actions .button { width: 100%; }
  .time-note { text-align: center; }
  .preview-card { width: 96%; padding: 28px 24px; border-radius: 22px; }
  .preview-card blockquote { font-size: 23px; }
  .preview-formula { font-size: 8px; }
  .how-it-works { grid-template-columns: 1fr; gap: 14px; }
  .wizard { padding-top: 16px; }
  .progress-row { grid-template-columns: 44px 1fr; margin-bottom: 41px; }
  .saved-status { display: none; }
  .step-heading { margin-bottom: 34px; }
  .step-heading h2 { font-size: 39px; }
  .field-grid.two-columns { grid-template-columns: 1fr 110px; gap: 10px; }
  .field { margin-bottom: 24px; }
  .field > span, .field legend { line-height: 1.4; }
  .field em { display: block; margin: 2px 0 0; }
  .occasion-chips .chip:nth-child(5) { display: none; }
  .option-grid { grid-template-columns: 1fr; }
  .option-card > span { min-height: 68px; }
  .segmented { grid-template-columns: 1fr; gap: 3px; }
  .segmented-compact { grid-template-columns: repeat(2, 1fr); }
  .form-actions { position: sticky; bottom: 0; z-index: 4; margin-inline: -14px; padding: 14px; background: linear-gradient(to bottom, rgba(253,251,247,0), var(--paper) 25%); border: 0; }
  .form-actions .button { min-height: 50px; }
  .result { padding-top: 42px; }
  .result-heading h1 { font-size: 43px; }
  .result-card { padding: 34px 25px; border-radius: 22px; }
  .result-text { font-size: 19px; line-height: 1.62; }
  .result-card-footer { align-items: start; flex-direction: column; gap: 4px; }
  .copy-panel > .button { width: 100%; }
  .revision-panel { margin: 46px 0; padding: 23px; }
  .revision-options button { flex: 1; min-height: 44px; }
  .custom-revision > div { flex-direction: column; }
  .custom-revision .button { width: 100%; }
  .revision-rollback { align-items: flex-start; flex-direction: column; }
  .lead-card { margin-bottom: 46px; padding: 23px; }
  .lead-row { flex-direction: column; }
  .lead-row .button { width: 100%; }
  .mic-button { min-height: 44px; }
  .memogift-cta { min-height: 0; border-radius: 25px; padding: 38px 25px; }
  .cta-copy h2 { font-size: 36px; }
  .cta-copy .button { width: 100%; }
  .site-footer { min-height: 140px; padding: 25px 0; flex-wrap: wrap; gap: 10px 18px; }
  .site-footer p { order: 3; flex-basis: 100%; }
  .dialog-card { padding: 32px 24px 25px; }
}

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