:root {
  --cream: #fbf1ea; --paper: #fffaf6; --ink: #3a1e27; --muted: #6f4f57;
  --burgundy: #6b1f33; --wine: #8a2c47; --rose: #c9808c; --rose-text: #8c4655;
  --dusty: #ecd2d4; --blush: #f8e4e2; --gold: #d9b48a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink); font: 1.0625rem/1.65 var(--sans);
  background:
    radial-gradient(60% 40% at 90% 0%, rgba(233,170,180,.45), transparent 70%),
    radial-gradient(55% 40% at 5% 100%, rgba(217,180,138,.35), transparent 70%),
    radial-gradient(70% 50% at 50% 45%, #fff6f1, transparent 80%),
    linear-gradient(180deg, #f9e8e4, var(--cream) 55%, #f6e3dc);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--burgundy); color: #fff; padding: .6rem 1rem; z-index: 5; }
.skip:focus { left: 0; }
.stage { max-width: 34rem; margin: 0 auto; padding: 2.6rem 1rem 2.5rem; }

/* the letter */
.paper {
  position: relative; background: linear-gradient(180deg, #fffdfa, var(--paper));
  border: 1px solid rgba(201,128,140,.35); border-radius: 1.6rem; padding: 3.1rem 1.4rem 1.4rem;
  box-shadow: 0 1px 0 #fff inset, 0 2px 0 rgba(217,180,138,.25), 0 24px 50px -24px rgba(107,31,51,.45), 0 8px 18px -10px rgba(201,128,140,.45);
  transform-origin: top center; animation: open .8s cubic-bezier(.2,.7,.2,1) backwards;
}
.paper::before { /* thin inner gold line, like stationery */
  content: ""; position: absolute; inset: 7px; border-radius: 1.25rem; border: 1px solid rgba(217,180,138,.45); pointer-events: none;
}
.seal {
  position: absolute; top: -1.9rem; left: 50%; width: 3.8rem; height: 3.8rem; margin-left: -1.9rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.7rem; line-height: 1;
  background: radial-gradient(circle at 32% 28%, #fff, #fbe3e3 55%, #f1c2c8);
  border: 3px solid #fff; box-shadow: 0 10px 22px -8px rgba(107,31,51,.55), 0 0 0 1px rgba(201,128,140,.5);
  animation: pop .7s cubic-bezier(.3,1.4,.5,1) .15s backwards;
}
.seal::before { content: attr(data-emoji) / ""; }
.eyebrow { margin: 0 0 .45rem; text-align: center; font-size: .76rem; letter-spacing: .22em; text-transform: uppercase; color: var(--rose-text); font-weight: 600; }
h1 {
  font: 600 clamp(1.95rem, 7.4vw, 2.5rem)/1.15 var(--serif); color: var(--burgundy); text-align: center;
  margin: 0 0 .3rem; letter-spacing: -.01em;
}
h1:focus { outline: none; }
h1::after { /* small flourish */
  content: "✦"; display: block; margin: .6rem auto 1.1rem; font-size: .8rem; color: var(--gold); letter-spacing: .6em; text-indent: .6em;
}
.copy p { margin: 0 0 1rem; text-align: center; max-width: 30em; margin-inline: auto; animation: rise .6s ease backwards; animation-delay: calc(var(--i, 0) * 120ms + 150ms); }
.sections { display: grid; gap: .75rem; margin-bottom: 1rem; }
.sections p {
  margin: 0; padding: .85rem 1rem; border-radius: 1rem 1rem 1rem .35rem; background: linear-gradient(180deg, #fff, var(--blush));
  border: 1px solid var(--dusty); box-shadow: 0 6px 14px -12px rgba(107,31,51,.5);
  animation: rise .65s ease backwards; animation-delay: calc(var(--i, 0) * 170ms + 250ms);
}
.sections p:last-child { background: linear-gradient(180deg, #fff, #fbe9e6); border-color: rgba(201,128,140,.5); }

/* choices */
.choices { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .7rem; }
.choice {
  position: relative; width: 100%; min-height: 3.5rem; text-align: left; cursor: pointer;
  padding: .6rem .9rem .6rem .6rem; border-radius: 1.1rem; font: 500 1rem/1.35 var(--sans); color: var(--burgundy);
  background: linear-gradient(180deg, #fff, #fff8f6); border: 1.5px solid var(--dusty);
  box-shadow: 0 8px 18px -14px rgba(107,31,51,.55);
  display: flex; align-items: center; gap: .75rem;
  transition: transform .18s, box-shadow .2s, border-color .2s, background .2s;
}
.choice[data-icon]:not([data-icon=""])::before {
  content: attr(data-icon) / ""; flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.15rem; background: linear-gradient(145deg, #fde9e8, #f6d3d6); box-shadow: inset 0 0 0 1px rgba(201,128,140,.35);
}
.choice:not([data-icon]), .choice[data-icon=""] { padding-left: 1rem; justify-content: center; }
.choice::after { content: "›" / ""; margin-left: auto; font-size: 1.5rem; line-height: 1; color: var(--rose); transition: transform .2s; }
.choice:not([data-icon])::after, .choice[data-icon=""]::after { content: none; }
.choice .lbl { flex: 1; }
.choice:hover { border-color: var(--rose); background: linear-gradient(180deg, #fff, var(--blush)); transform: translateY(-1px); box-shadow: 0 12px 22px -14px rgba(107,31,51,.6); }
.choice:hover::after { transform: translateX(3px); }
.choice:active { transform: scale(.99); }
.choice[disabled] { opacity: .6; cursor: progress; }
.choice .earlier { font-size: .72rem; color: var(--muted); font-weight: 500; white-space: nowrap; background: var(--blush); padding: .1rem .5rem; border-radius: 99px; }
.choice.was-picked { border-color: var(--rose); background: linear-gradient(180deg, #fff, var(--blush)); }
:where(a, button):focus-visible { outline: 3px solid var(--burgundy); outline-offset: 3px; }

/* optional note */
.notebox { margin: 1.2rem 0 0; padding: .2rem 1rem .9rem; border-radius: 1.1rem; border: 1.5px dashed rgba(201,128,140,.6); background: rgba(255,255,255,.6); }
.notebox summary { cursor: pointer; min-height: 2.9rem; display: flex; align-items: center; gap: .5rem; color: var(--burgundy); font-weight: 600; list-style: none; }
.notebox summary::-webkit-details-marker { display: none; }
.notebox summary::before { content: "✍️" / ""; }
.notebox summary::after { content: "+" / ""; margin-left: auto; font-size: 1.3rem; color: var(--rose); }
.notebox[open] summary::after { content: "–" / ""; }
.notebox label { display: block; margin: .2rem 0 .5rem; font-size: .95rem; }
.notebox textarea { width: 100%; min-height: 7.5rem; padding: .75rem .85rem; font: 1rem/1.5 var(--sans); color: var(--ink); background: #fff; border: 1.5px solid var(--dusty); border-radius: .9rem; resize: vertical; }
.notebox .hint { margin: .5rem 0 .7rem; font-size: .84rem; color: var(--muted); }
.notebox .save { justify-content: center; min-height: 3rem; }
.notebox .notemsg { margin: .5rem 0 0; min-height: 1.2em; font-size: .88rem; color: var(--burgundy); }

/* footer */
.foot { margin-top: 1.4rem; padding-top: .9rem; border-top: 1px dashed rgba(201,128,140,.5); font-size: .85rem; color: var(--muted); text-align: center; }
.foot .row { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1rem; align-items: center; margin-bottom: .4rem; }
.link {
  background: none; border: 0; padding: .55rem .15rem; min-height: 2.75rem; font: inherit; color: var(--burgundy);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.privacy { margin: 0 0 .3rem; }
.alert { margin-top: 1rem; padding: .8rem 1rem; border-radius: .9rem; background: #fdeceb; border: 1px solid #e3a5a5; color: #6a1b1b; }
.alert .link { color: #6a1b1b; }
.note { margin-top: 1rem; padding: .8rem 1rem; border-radius: .9rem; background: var(--blush); border: 1px solid var(--dusty); }
.closed .copy, .closed p { text-align: center; }

@keyframes open { from { opacity: 0; transform: translateY(14px) scaleY(.94); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.4) rotate(-12deg); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (min-width: 40rem) { .stage { padding-top: 4.5rem; } .paper { padding: 3.3rem 2.3rem 1.8rem; } }
