:root {
  color-scheme: light dark;
  --canvas: #f5f2e9;
  --canvas-soft: #ebece3;
  --surface: #fcfaf4;
  --surface-strong: #ffffff;
  --ink: #18251d;
  --muted: #526058;
  --accent: #236044;
  --accent-soft: #dce8de;
  --line: #cfd5cc;
  --danger: #9b3c31;
  --danger-soft: #f5e3de;
  --shadow: 0 24px 70px rgb(29 48 36 / 12%);
  --radius: 18px;
  --radius-small: 12px;
  --content: 1120px;
  font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  background: var(--canvas);
  color: var(--ink);
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #111914;
    --canvas-soft: #18231c;
    --surface: #1a251e;
    --surface-strong: #202d24;
    --ink: #edf2eb;
    --muted: #b8c2b9;
    --accent: #8fc69f;
    --accent-soft: #273d2e;
    --line: #39483d;
    --danger: #ffb4a8;
    --danger-soft: #402821;
    --shadow: 0 24px 70px rgb(0 0 0 / 28%);
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  background:
    linear-gradient(90deg, transparent 0 49.9%, rgb(35 96 68 / 4%) 50%),
    var(--canvas);
  color: var(--ink);
}

button,
a,
input,
select,
textarea {
  font: inherit;
}
button,
select,
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 2;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-small);
  color: var(--canvas);
  background: var(--ink);
}
.skip-link:focus {
  top: 1rem;
}

.site-header {
  display: flex;
  height: 72px;
  max-width: var(--content);
  margin: auto;
  padding: 0 1.5rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
  color: var(--ink);
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: var(--canvas);
  background: var(--accent);
  font-family: "Iowan Old Style", Georgia, serif;
  font-weight: 700;
}

.header-note {
  color: var(--muted);
  font-size: 0.78rem;
}

.screen {
  width: min(100% - 2rem, 760px);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) 0 5rem;
}

.welcome {
  width: min(100% - 2rem, var(--content));
  padding-top: clamp(1.5rem, 4vw, 3.5rem);
}

.hero-grid {
  display: grid;
  min-height: calc(100dvh - 112px);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero-copy-block {
  position: relative;
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 750;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  text-wrap: balance;
}

h1 {
  margin-bottom: 1.1rem;
  font-size: clamp(2.75rem, 8vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h1 em {
  display: inline-block;
  color: var(--accent);
  font-size: 0.8em;
  font-weight: inherit;
  line-height: 1.12;
  white-space: nowrap;
}

h2 {
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.hero-copy,
.intro {
  max-width: 58ch;
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.65;
}
.hero-copy {
  max-width: 43ch;
}

.primary-action {
  display: inline-flex;
  min-height: 52px;
  padding: 0.9rem 1.4rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #f7faf7;
  background: #236044;
  box-shadow: 0 12px 28px rgb(35 96 68 / 20%);
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.primary-action:hover {
  background: #184a34;
  transform: translateY(-2px);
}
.primary-action:active {
  transform: translateY(1px) scale(0.99);
}
.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.hero-art {
  position: relative;
  overflow: hidden;
  margin: 0;
  border-radius: var(--radius);
  background: var(--canvas-soft);
  box-shadow: var(--shadow);
}

.hero-art::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgb(255 255 255 / 32%);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.trust-panel {
  display: grid;
  margin: 1.5rem 0 2rem;
  padding: clamp(1.4rem, 4vw, 2.5rem);
  gap: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.trust-heading {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.trust-heading h2 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.4rem);
}

.shield {
  display: grid;
  min-width: 64px;
  min-height: 64px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.7rem;
  font-weight: 750;
}

.promise-list {
  display: grid;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.promise-list li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
.promise-list li > span:first-child {
  color: var(--accent);
  font-weight: 800;
}
.promise-list strong {
  color: var(--ink);
}

.text-action {
  min-height: 44px;
  padding: 0.5rem 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-weight: 750;
  text-underline-offset: 0.25em;
}
.text-action:hover {
  text-decoration: underline;
}
.text-action:active {
  transform: translateY(1px);
}

.step {
  float: right;
  margin: 0.55rem 0 0 1rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.catalogue > .eyebrow,
.chosen > .eyebrow {
  margin-top: 2.3rem;
}

.catalogue h1,
.chosen h1,
.form-screen h1 {
  max-width: 13ch;
  font-size: clamp(2.5rem, 8vw, 4.4rem);
}

.form-screen {
  min-height: calc(100dvh - 72px);
}

.form-screen::before,
.catalogue::before,
.chosen::before {
  display: block;
  width: 42px;
  height: 4px;
  margin-bottom: 2rem;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.wizard-form {
  display: grid;
  gap: 1.1rem;
  margin-top: 2rem;
}

.wizard-form label:not(.check-label),
.wizard-form fieldset,
#test-personalization {
  display: grid;
  gap: 0.55rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
}

.wizard-form fieldset,
.guidance-panel,
.action-panel,
.preview-page,
.chosen-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.wizard-form fieldset {
  gap: 1rem;
  margin: 0;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.wizard-form legend {
  padding: 0 0.4rem;
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 1.15rem;
}

.wizard-form input:not([type="checkbox"]):not([type="radio"]),
.wizard-form select,
.wizard-form textarea,
#test-personalization input {
  width: 100%;
  min-height: 50px;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  color: var(--ink);
  background: var(--surface-strong);
}

.wizard-form input::placeholder,
.wizard-form textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

.wizard-form textarea {
  resize: vertical;
}

.check-label {
  display: flex;
  min-height: 48px;
  gap: 0.75rem;
  align-items: flex-start;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.45;
}

.check-label input {
  width: 22px;
  height: 22px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.summary-list {
  display: grid;
  gap: 0.75rem;
  margin: 1.2rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.guidance-panel,
.action-panel {
  margin: 1.5rem 0;
  padding: clamp(1.2rem, 4vw, 1.75rem);
}

.guidance-panel h2,
.action-panel h2 {
  margin: 1.5rem 0 0.4rem;
  font-size: 1.25rem;
}
.guidance-panel h2:first-child,
.action-panel h2:first-child {
  margin-top: 0;
}

.guidance-panel p,
.source-photograph-status,
.receipt-card p,
.action-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.source-photograph-fields,
.preview-pages,
.storybook-versions {
  display: grid;
  gap: 1rem;
}
.source-photograph-status {
  margin-bottom: 0;
  font-size: 0.85rem;
}
.preview-pages,
.storybook-versions {
  margin-block: 1.5rem;
}

.preview-page {
  padding: 1rem;
  box-shadow: 0 10px 32px rgb(29 48 36 / 8%);
}

.storybook-version {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.version-heading {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
}
.version-heading h2 {
  margin-bottom: 0;
  font-size: 1.5rem;
}
.version-heading .story-number {
  text-align: right;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.preview-illustration {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-small);
  background: var(--canvas-soft);
}

.preview-illustration img {
  display: block;
  width: 100%;
  height: auto;
}
.storybook-page .preview-illustration {
  aspect-ratio: 4 / 3;
}
.storybook-page .preview-illustration img {
  height: 100%;
  object-fit: cover;
}

.preview-watermark {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  color: rgb(255 255 255 / 82%);
  font-size: clamp(1.5rem, 8vw, 3.5rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 4px rgb(0 0 0 / 60%);
  pointer-events: none;
}

progress {
  width: 100%;
  height: 0.8rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
}
progress::-webkit-progress-bar {
  background: var(--accent-soft);
}
progress::-webkit-progress-value {
  background: var(--accent);
}
progress::-moz-progress-bar {
  background: var(--accent);
}

.catalogue .intro {
  margin-left: 0;
}
.story-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 2.3rem;
}

.story-card {
  display: grid;
  width: 100%;
  min-height: 132px;
  grid-template-columns: 34px 1fr 24px;
  gap: 0.85rem;
  padding: 1.15rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  text-align: left;
}

.story-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgb(29 48 36 / 10%);
}
.story-card:active {
  transform: translateY(1px) scale(0.995);
}
.story-card:disabled {
  cursor: wait;
  opacity: 0.65;
}

.story-number,
.story-index {
  color: var(--accent);
  font-weight: 750;
}
.story-number {
  margin: 0;
  font-size: 0.72rem;
}
.story-index {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 1.3rem;
}

.story-title {
  display: block;
  margin-bottom: 0.3rem;
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 1.22rem;
  font-weight: 700;
}

.test-story-label {
  display: inline-block;
  margin: 0 0 0.4rem;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.7rem;
  font-weight: 750;
}

.story-moral,
.story-disclosure {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}
.story-moral {
  font-size: 0.84rem;
}
.story-disclosure {
  margin-top: 0.35rem;
  font-size: 0.72rem;
}
.story-arrow {
  color: var(--accent);
  font-size: 1.2rem;
}

.loading,
.error {
  padding: 1rem;
  border-radius: var(--radius-small);
  background: var(--accent-soft);
}
.error {
  color: var(--danger);
  background: var(--danger-soft);
}

.chosen {
  text-align: center;
}
.chosen h1 {
  margin-inline: auto;
}

.chosen-mark {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 2.5rem auto 1.2rem;
  place-items: center;
  border-radius: 50%;
  color: var(--canvas);
  background: var(--accent);
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 1.4rem;
}

.chosen-card {
  margin: 2rem auto;
  padding: clamp(1.4rem, 4vw, 2rem);
  box-shadow: var(--shadow);
}
.chosen-card h2 {
  margin: 0.55rem 0 0.75rem;
  font-size: clamp(1.7rem, 5vw, 2.4rem);
}
.chosen-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.resume-copy {
  max-width: 58ch;
  margin: 0 0 1.5rem;
  color: var(--muted);
  line-height: 1.65;
}
.chosen .resume-copy,
.chosen .no-account {
  margin-inline: auto;
}
.no-account {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

footer {
  display: flex;
  max-width: var(--content);
  margin: auto;
  padding: 1.6rem 1.5rem 2.5rem;
  gap: 0.75rem 2rem;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}
footer p {
  margin: 0;
}

.noscript {
  margin: 1rem;
  padding: 1rem;
  border-radius: var(--radius-small);
  color: var(--danger);
  background: var(--danger-soft);
}

@media (min-width: 768px) {
  .hero-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  }
  .trust-panel {
    grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
    align-items: center;
  }
  .promise-list,
  .story-list,
  .preview-pages {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 767px) {
  body {
    background: var(--canvas);
  }
  .header-note {
    max-width: 13ch;
    text-align: right;
  }
  .hero-grid {
    min-height: auto;
    padding-bottom: 2rem;
  }
  .hero-art {
    order: -1;
  }
  .hero-copy-block {
    text-align: left;
  }
  footer {
    flex-direction: column;
  }
  .primary-action {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .screen:not([hidden]) {
    animation: arrive 520ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  .hero-art {
    animation: image-arrive 720ms 100ms both cubic-bezier(0.16, 1, 0.3, 1);
  }
  .primary-action,
  .story-card,
  .text-action {
    transition:
      transform 180ms cubic-bezier(0.16, 1, 0.3, 1),
      box-shadow 180ms ease,
      border-color 180ms ease,
      background-color 180ms ease;
  }
  @keyframes arrive {
    from {
      opacity: 0;
      transform: translateY(14px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  @keyframes image-arrive {
    from {
      opacity: 0;
      transform: translateY(20px) rotate(1deg) scale(0.98);
    }
    to {
      opacity: 1;
      transform: translateY(0) rotate(0) scale(1);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* Selection totals remain in reach on a long mobile Story shelf. */
.offer-copy {
  line-height: 1.6;
}
.offer-copy strong {
  white-space: nowrap;
}
.selection-bar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 max(1rem, env(safe-area-inset-bottom));
  background: var(--canvas);
  border-top: 1px solid currentColor;
}
.selection-bar p {
  margin: 0;
}
#selection-total {
  font-weight: 700;
}
#selection-hint {
  font-size: 0.875rem;
  margin-top: 0.35rem;
}
.story-card[aria-pressed="true"] {
  outline: 3px solid currentColor;
  outline-offset: -3px;
}
.story-card:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.bundle-navigation {
  margin: 2rem auto;
  max-width: 48rem;
  padding: 1rem;
  border-top: 1px solid currentColor;
}
.bundle-navigation p {
  font-weight: 700;
}
.bundle-navigation button {
  display: block;
  text-align: left;
}
.bundle-navigation [aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
}
@media (max-width: 540px) {
  .selection-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .selection-bar .primary-action {
    width: 100%;
  }
}

/* Paid return visits show only the email delivery status. */
body.email-status-only > :not(main),
body.email-status-only #bundle-navigation {
  display: none !important;
}
body.email-status-only main {
  min-height: 100svh;
  display: grid;
  align-items: center;
}
body.email-status-only #email-delivery-status {
  width: min(100%, 44rem);
  margin-inline: auto;
  text-align: center;
}

body.app-starting > main,
body.app-starting > header,
body.app-starting > footer,
body.app-starting > .skip-link {
  visibility: hidden;
}
body.email-status-only #email-delivery-status {
  min-height: 0;
  padding: 2rem 1.5rem;
}
body.email-status-only #email-delivery-status::before {
  display: none;
}
body.email-status-only #email-delivery-title {
  margin-inline: auto;
}
