:root {
  --paper: #f3eee6;
  --ink: #241c16;
  --muted: #6d5e52;
  --line: #e4d5c4;
  --card: #fffaf3;
  --seal: #8c2f2b;
  --seal-soft: #f6e6de;
  --ok: #2f5d45;
  --warn: #8a5a12;
  --shadow: 0 18px 50px rgba(36, 28, 22, 0.08);
  --radius: 18px;
  --space: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, #fff 0%, transparent 55%),
    var(--paper);
  min-height: 100vh;
}
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 36px 20px 88px; }
a { color: inherit; }

header.top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; }
.brand { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
h1 { font-size: 56px; font-weight: 500; letter-spacing: -0.03em; line-height: 0.95; margin: 0; }
.lede { color: var(--muted); max-width: 36em; line-height: 1.55; font-size: 18px; }
.seal {
  border: 1.5px solid var(--seal);
  color: var(--seal);
  padding: 8px 12px;
  letter-spacing: 0.18em;
  font-size: 12px;
  text-transform: uppercase;
  transform: rotate(-8deg);
}
.hero-actions, .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
button.primary, a.primary, button.ghost, a.ghost, button.small {
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #fffaf3;
  padding: 12px 18px;
  min-height: 44px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button.ghost, a.ghost, button.small { background: transparent; color: var(--ink); }
button.textish, a.textish, .textish {
  border: 0;
  background: transparent;
  color: var(--ink);
  min-height: 44px;
  padding: 8px 2px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
button.primary:disabled, button.ghost:disabled { opacity: 0.38; cursor: not-allowed; }
.file input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.home {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: center;
}
.want { color: var(--ink); margin-top: 12px; }
.want strong { font-weight: 600; }
.home-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transform: rotate(1.5deg);
}
.home-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 12px;
}
.home-card blockquote {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
}
.home-card-foot { display: flex; justify-content: space-between; align-items: center; }
.price { font-size: 14px; letter-spacing: 0.04em; }
.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 48px 0 0; }
.points article, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.points article { padding: 18px; }
.points h2, h2 { font-size: 20px; font-weight: 500; margin: 0 0 8px; }
.points p, .quiet { color: var(--muted); line-height: 1.5; margin: 0; }

.banner {
  background: var(--seal-soft);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 16px 0;
}
.banner[hidden] { display: none; }
.layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; margin-top: 18px; }
.panel { padding: 16px; }
.photo-frame {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  background: #efe6da center/cover no-repeat;
  display: grid;
  place-items: end stretch;
  color: #fffaf3;
  transition: box-shadow 200ms ease;
}
.photo-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(36, 28, 22, 0.72), rgba(36, 28, 22, 0.05) 55%),
    url("/sample-photo.png") center/cover;
}
.photo-frame.has-photo::before { display: none; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.frame-copy { position: relative; z-index: 1; padding: 16px; }
.frame-copy strong { display: block; font-size: 22px; font-weight: 500; }
.photo-frame.has-photo .frame-copy { display: none; }
.photo-frame.listening { box-shadow: 0 0 0 6px rgba(140, 47, 43, 0.16); }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; list-style: none; padding: 0; margin: 0 0 14px; }
.steps li {
  border-top: 2px solid var(--line);
  padding-top: 8px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.steps li.done { border-color: var(--ok); color: var(--ok); }
.steps li.now { border-color: var(--seal); color: var(--ink); }

.now {
  min-height: 3.2em;
  font-size: 28px;
  line-height: 1.25;
  margin: 0 0 8px;
}
.live { color: var(--seal); min-height: 1.4em; margin: 0; }
.status { min-height: 1.4em; color: var(--muted); font-size: 14px; }
.voice { margin: 4px 0 0; }

.log {
  max-height: 240px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bubble {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 14px;
  line-height: 1.45;
  animation: rise 200ms ease;
}
.bubble.you { align-self: flex-end; background: var(--ink); color: #fffaf3; }
.bubble.assistant { align-self: flex-start; background: #f6efe4; }
.bubble .who { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.7; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: #f6efe4;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 14px;
  animation: rise 200ms ease;
}
.chip.warn { color: var(--warn); }
.tools { font-size: 14px; color: var(--ok); }
.tools.warn { color: var(--warn); }
.compare {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.compare p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.45;
}
.compare .heard { background: #f3f7f4; }
.compare .refused { background: var(--seal-soft); }
.compare span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
button.quote-line {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  min-height: 44px;
  cursor: pointer;
}
.chip { cursor: pointer; }
.source {
  width: min(100%, 440px);
  margin: 14px auto 0;
  padding: 14px 16px 6px;
  background: #fffaf3;
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.source p, .later p { margin: 0 0 8px; line-height: 1.4; }
.later {
  width: min(100%, 440px);
  margin: 18px auto 0;
  padding: 18px 18px 8px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.later label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}
.later input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--ink);
  font: inherit;
}
.later button { margin-top: 4px; }
.source mark { background: #f3d2c4; color: inherit; padding: 0 3px; border-radius: 3px; }
details { margin-top: 12px; color: var(--muted); }
details input, .pass input {
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  min-height: 44px;
  color: var(--ink);
}
pre.card {
  white-space: pre-wrap;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  line-height: 1.6;
}

#card-panel.panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 28px 0 0;
}
.card-head { width: min(100%, 680px); display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.card-panel.arrive .keepsake { animation: rise 200ms ease; }
.papers {
  display: flex;
  gap: 0;
  padding: 4px;
  background: #e7dccc;
  border-radius: 999px;
}
.papers button {
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
}
.papers button[aria-pressed="true"] { background: var(--ink); color: #fffaf3; }
.keepsake {
  width: min(100%, 440px);
  margin: 18px auto 0;
  padding: 28px 28px 22px;
  display: grid;
  align-content: start;
  gap: 14px;
  box-shadow: 0 24px 60px rgba(36, 28, 22, 0.12);
}
.keepsake img { width: 100%; object-fit: cover; background: #efe6da; }
.keepsake blockquote { margin: 0; }
.keepsake button.quote-line { min-height: 0; padding: 0 0 10px; font-size: 22px; line-height: 1.35; }
.keepsake .seal { justify-self: end; margin-top: 8px; }
.keepsake.letter {
  background: #fffaf3;
  border: 1px solid #eadfD2;
  border-radius: 6px;
}
.keepsake.letter img {
  aspect-ratio: 4 / 3;
  border-radius: 2px;
  box-shadow: 0 10px 24px rgba(36, 28, 22, 0.16);
}
.keepsake.letter #keepsake-date {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.keepsake.back {
  width: min(100%, 420px);
  background: #efe2cf;
  border-radius: 2px;
  padding: 18px 18px 16px;
}
.keepsake.back img {
  aspect-ratio: 1;
  border: 12px solid #fff;
  border-bottom-width: 36px;
  border-radius: 1px;
  box-shadow: 0 12px 28px rgba(36, 28, 22, 0.18);
}
.keepsake.back button.quote-line { font-size: 18px; }
.keepsake.postcard {
  width: min(100%, 680px);
  min-height: 360px;
  padding: 26px 26px 18px;
  border-radius: 2px;
  border: 1px solid #241c16;
  background:
    linear-gradient(90deg, transparent 57%, rgba(36, 28, 22, 0.14) 57%, rgba(36, 28, 22, 0.14) 57.4%, transparent 57.4%),
    #f6f0e6;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-areas:
    "words photo"
    "words date"
    "words seal";
  column-gap: 28px;
  align-content: stretch;
}
.keepsake.postcard img { grid-area: photo; aspect-ratio: 1; width: 100%; border-radius: 2px; }
.keepsake.postcard #keepsake-date { grid-area: date; align-self: end; }
.keepsake.postcard #card-preview { grid-area: words; align-self: center; }
.keepsake.postcard .seal { grid-area: seal; align-self: end; }
.receipt {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f3f7f4;
  color: var(--ok);
}
.pay {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}
.pay[hidden], .receipt[hidden], #paid[hidden], #locked[hidden] { display: none; }
.story-video { width: min(100%, 280px); margin-top: 12px; border-radius: 16px; background: #241c16; }
footer, .foot { margin-top: 28px; color: var(--muted); font-size: 13px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 800px) {
  h1 { font-size: 40px; }
  .home, .points, .layout { grid-template-columns: 1fr; }
  .home-card { transform: none; }
  .now { font-size: 24px; }
  .keepsake, .keepsake.postcard, .keepsake.back { width: 100%; }
  .keepsake.postcard {
    grid-template-columns: 1fr;
    grid-template-areas: "photo" "date" "words" "seal";
    background: #f6f0e6;
  }
}
