/* ==========================================================================
   The anniversary gate — old-school, light and colourful on purpose.
   Retro "desktop windows" on cream paper; chunky ink borders, solid shadows.
   ========================================================================== */

:root {
  --paper: #FFF6E5;
  --ink: #1F1A17;
  --ink-2: #4A413B;
  --pink: #FF6FA8;
  --pink-soft: #FFD6E7;
  --yellow: #FFD23F;
  --yellow-soft: #FFF0B8;
  --blue: #5AA9FF;
  --blue-soft: #D6EAFF;
  --green: #36CF8A;
  --green-soft: #CFF5E3;
  --orange: #FF8C42;
  --orange-soft: #FFE0CB;
  --red: #FF5A5F;

  --display: "Bagel Fat One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pixel: "VT323", ui-monospace, monospace;
  --type: "Courier Prime", "Courier New", monospace;
  --script: "Homemade Apple", "Brush Script MT", cursive;

  --border: 2.5px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --ease: cubic-bezier(.34, 1.56, .64, 1);   /* a little bounce — this page is allowed to be playful */

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background-color: var(--paper);
  background-image: radial-gradient(rgb(31 26 23 / .14) 1.2px, transparent 1.4px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, p, ol, fieldset { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

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

/* Background doodles ------------------------------------------------------ */

.deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.deco__star { position: absolute; font-size: 2.5rem; line-height: 1; }
.deco__star--1 { top: 9%; left: 7%; color: var(--yellow); -webkit-text-stroke: 2px var(--ink); animation: spin 14s linear infinite; }
.deco__star--2 { bottom: 12%; right: 8%; color: var(--pink); font-size: 3.25rem; -webkit-text-stroke: 2px var(--ink); animation: spin 18s linear infinite reverse; }
.deco__dot { position: absolute; border: var(--border); border-radius: 50%; }
.deco__dot--1 { top: 18%; right: 12%; width: 54px; height: 54px; background: var(--blue); }
.deco__dot--2 { bottom: 18%; left: 9%; width: 34px; height: 34px; background: var(--green); }
.deco__squiggle {
  position: absolute;
  top: 62%; right: 3%;
  width: 90px; height: 20px;
  background: repeating-linear-gradient(135deg, var(--orange) 0 6px, transparent 6px 12px);
  border: var(--border);
  border-radius: 999px;
  transform: rotate(-12deg);
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 40rem) {
  .deco__dot--1, .deco__squiggle { display: none; }
  .deco__star--1 { top: 3%; left: 4%; font-size: 1.75rem; }
  .deco__star--2 { bottom: 3%; right: 4%; font-size: 2rem; }
}

/* Stage & progress -------------------------------------------------------- */

.stage {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 1.5rem;
  min-height: 100svh;
  padding: clamp(1.25rem, 4vw, 3rem) 1rem clamp(2rem, 6vw, 4rem);
}

.progress {
  display: flex;
  gap: .5rem;
  padding: 0;
  list-style: none;
  font-family: var(--pixel);
  font-size: 1.2rem;
  line-height: 1;
}
.progress li {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem .75rem .35rem .4rem;
  border: var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  transition: background-color .3s, transform .4s var(--ease);
}
.progress li span {
  display: inline-grid;
  place-items: center;
  width: 1.4rem; height: 1.4rem;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 1rem;
}
.progress li.is-current { background: var(--yellow); color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.progress li.is-done { background: var(--green-soft); }

/* Screens ----------------------------------------------------------------- */

.screen { width: min(100%, 44rem); align-self: start; }
.screen[hidden] { display: none; }
.screen.is-entering { animation: pop-in .6s var(--ease) both; }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(24px) scale(.96) rotate(-1deg); }
}

/* Retro window ------------------------------------------------------------ */

.window {
  border: var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.window__bar {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .55rem .9rem;
  border-bottom: var(--border);
  font-family: var(--pixel);
  font-size: 1.35rem;
  line-height: 1;
}
.window__dots { display: inline-flex; gap: .4rem; }
.window__dots i { width: 13px; height: 13px; border: 2px solid var(--ink); border-radius: 50%; background: #fff; }
.window__dots i:nth-child(1) { background: var(--red); }
.window__dots i:nth-child(2) { background: var(--yellow); }
.window__dots i:nth-child(3) { background: var(--green); }
.window__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.window--pink .window__bar  { background: var(--pink); }
.window--blue .window__bar  { background: var(--blue); }
.window--paper .window__bar { background: var(--yellow); }

.window__body { position: relative; padding: clamp(1.5rem, 5vw, 2.75rem); text-align: center; }

/* Type -------------------------------------------------------------------- */

.big {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.1rem, 1.4rem + 3.4vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -.01em;
}
.big--md { font-size: clamp(1.8rem, 1.3rem + 2.4vw, 2.75rem); }
.big__name {
  display: inline-block;
  margin-top: .25rem;
  color: var(--pink);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-2deg);
}

.sub { margin-top: 1rem; font-size: 1.15rem; font-weight: 500; }
.tiny { margin-top: .25rem; font-size: .8rem; color: var(--ink-2); font-style: italic; }
.tiny--inline { margin: 0; }
.kicker { font-family: var(--pixel); font-size: 1.5rem; color: var(--pink); line-height: 1; margin-bottom: .75rem; }

.sticker {
  margin: 0 auto 1.25rem;
  display: grid;
  place-items: center;
  width: clamp(4rem, 12vw, 5.5rem);
  aspect-ratio: 1;
  border: var(--border);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: var(--shadow-sm);
  font-family: var(--display);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  line-height: 1;
  transform: rotate(12deg);
  animation: wobble 3s ease-in-out infinite;
}
.sticker sup { font-size: .4em; }
@keyframes wobble { 50% { transform: rotate(4deg) scale(1.05); } }

/* Buttons ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 3.1rem;
  padding: .7rem 1.6rem;
  border: var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.1;
  transition: transform .15s ease, box-shadow .15s ease, background-color .2s;
  touch-action: manipulation;
}
.btn:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--no { background: var(--green); font-size: 1.2rem; padding-inline: 2.25rem; }
.btn--yes { background: var(--red); color: #fff; }
.btn--primary { background: var(--pink); }
.btn--ghost { background: #fff; font-weight: 500; }

/* The runaway "Yes" — once it starts running it leaves the flow */
.btn--yes.is-running {
  position: fixed;
  z-index: 50;
  margin: 0;
  transition: left .35s var(--ease), top .35s var(--ease), transform .2s;
}

/* Screen 1 — question ----------------------------------------------------- */

.question {
  margin-top: 2rem;
  padding: 1.5rem 1rem 1.25rem;
  border: 2.5px dashed var(--ink);
  border-radius: 14px;
  background: var(--pink-soft);
}
.question__text { font-family: var(--display); font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); line-height: 1.1; }
.question__buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 1.5rem; margin-top: 1.25rem; min-height: 3.5rem; }

.toast { min-height: 1.6em; margin-top: 1rem; font-family: var(--pixel); font-size: 1.35rem; line-height: 1.2; color: var(--ink); }
.toast--left { text-align: left; }
.toast.is-pop { animation: toast-pop .45s var(--ease); }
@keyframes toast-pop { from { transform: scale(.85); opacity: 0; } }

/* Screen 2 — wishlist ----------------------------------------------------- */

.wishes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.75rem 0 0;
  padding: 0;
  border: 0;
}
.wish {
  position: relative;
  display: grid;
  justify-items: center;
  gap: .35rem;
  padding: 1.25rem .75rem 1rem;
  border: var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .35s var(--ease), box-shadow .2s, background-color .25s;
  -webkit-tap-highlight-color: transparent;
}
.wish input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.wish__emoji { font-size: clamp(2.5rem, 8vw, 3.25rem); line-height: 1; transition: transform .45s var(--ease); }
.wish__name { font-family: var(--display); font-size: 1.35rem; line-height: 1.1; }
.wish::after {
  content: "\2713";
  position: absolute;
  top: -12px; right: -12px;
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: var(--border);
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  transform: scale(0);
  transition: transform .35s var(--ease);
}
.wish:hover { transform: translateY(-3px) rotate(-1deg); }
.wish:hover .wish__emoji { transform: scale(1.12) rotate(-6deg); }
.wish:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 3px; }
.wish:has(input:checked) { transform: translateY(-3px) rotate(1deg); box-shadow: 5px 5px 0 var(--ink); }
.wish:has(input:checked)::after { transform: scale(1); }
.wish--pink:has(input:checked)   { background: var(--pink-soft); }
.wish--green:has(input:checked)  { background: var(--green-soft); }
.wish--orange:has(input:checked) { background: var(--orange-soft); }
.wish--yellow:has(input:checked) { background: var(--yellow-soft); }

.actions { display: flex; justify-content: center; margin-top: 1.5rem; }
.actions--split { justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

/* Screen 3 — the document ------------------------------------------------- */

.window--paper .window__body { background: #FFFDF6; }
.doc { padding-top: clamp(1.25rem, 3vw, 1.75rem) !important; text-align: left; font-family: var(--type); font-size: .98rem; line-height: 1.65; }
.doc p + p { margin-top: 1rem; }
.doc__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.4rem);
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
}
.doc__subtitle { margin: .35rem 0 0; text-align: center; color: var(--ink-2); }
.doc__aside { color: var(--ink-2); font-style: italic; }

/* The NDA window fits the screen: title on top, signature at the bottom,
   and only the clause box in between scrolls. */
[data-screen="3"] .window {
  display: flex;
  flex-direction: column;
  height: calc(100svh - 6.25rem);
  min-height: 30rem;             /* very short screens fall back to page scrolling */
}
[data-screen="3"] .window__bar { flex: none; }
[data-screen="3"] .doc {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding-bottom: 1.25rem;
}
[data-screen="3"] .doc > * { flex: none; }
.doc__preamble { margin-bottom: 1.25rem; }

/* Only the clause list scrolls; the rest of the document stays put. */
.clauses-box {
  position: relative;
  flex: 1 1 auto !important;
  min-height: 8rem;
  margin-top: 1rem;
  padding: 1.1rem 1rem 1.1rem .5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: var(--border);
  border-radius: 12px;
  background:
    /* soft fades that appear only when there is more to scroll */
    linear-gradient(#FFFDF6 30%, rgb(255 253 246 / 0)) top / 100% 2.5rem no-repeat local,
    linear-gradient(rgb(255 253 246 / 0), #FFFDF6 70%) bottom / 100% 2.5rem no-repeat local,
    linear-gradient(rgb(31 26 23 / .12), rgb(31 26 23 / 0)) top / 100% .9rem no-repeat scroll,
    linear-gradient(rgb(31 26 23 / 0), rgb(31 26 23 / .12)) bottom / 100% .9rem no-repeat scroll,
    #FFFDF6;
  box-shadow: inset 0 0 0 3px var(--yellow-soft);
  scrollbar-width: thin;
  scrollbar-color: var(--pink) var(--pink-soft);
}
.clauses-box:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.clauses-box::-webkit-scrollbar { width: 10px; }
.clauses-box::-webkit-scrollbar-track { background: var(--pink-soft); border-radius: 0 10px 10px 0; }
.clauses-box::-webkit-scrollbar-thumb { background: var(--pink); border: 2px solid var(--ink); border-radius: 10px; }

.clauses-hint {
  margin-top: .5rem !important;
  font-family: var(--pixel);
  font-size: 1.15rem;
  line-height: 1;
  text-align: center;
  color: var(--ink-2);
  transition: opacity .4s;
}
.clauses-hint.is-done { color: var(--ink); }

.clauses { margin: 0; padding-left: 1.75rem; }
.clauses li { padding-left: .35rem; }
.clauses li + li { margin-top: .9rem; }
.clauses li::marker { font-weight: 700; color: var(--pink); }
.clauses strong { font-weight: 700; }
[data-wish-list] { background: var(--yellow-soft); padding: 0 .2em; }

.doc__fineprint {
  margin-top: 1.75rem !important;
  padding: 1rem 1.1rem;
  border: 2px dashed var(--pink);
  border-radius: 10px;
  background: var(--pink-soft);
  font-size: .9rem;
}

.stamp {
  position: relative;
  z-index: 2;
  align-self: flex-end;
  margin: -.4rem -.35rem -2.1rem 0;
  padding: .4rem .7rem;
  border: 3px double var(--red);
  border-radius: 8px;
  color: var(--red);
  font-family: var(--type);
  font-weight: 700;
  font-size: .8rem;
  line-height: 1.1;
  letter-spacing: .12em;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(14deg);
  opacity: .8;
}

.sign { margin-top: 1rem; padding-top: 1rem; border-top: 2px solid var(--ink); font-family: var(--body); }
.sign__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.sign__label { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.sign__line {
  display: flex;
  align-items: flex-end;
  min-height: 2.6rem;
  margin-top: .15rem;
  border-bottom: 2px solid var(--ink);
}
.script { font-family: var(--script); font-size: 1.3rem; line-height: 1.4; color: #1D3FA8; transform: rotate(-3deg); transform-origin: left bottom; }
.sign__who { margin-top: .35rem !important; font-size: .85rem; color: var(--ink-2); }
.sign__input {
  width: 100%;
  margin-top: .6rem;
  padding: .6rem .8rem;
  border: var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 1rem;
}
.sign__input:focus-visible { outline: none; box-shadow: var(--shadow-sm); background: var(--yellow-soft); }

.check { display: flex; align-items: flex-start; gap: .65rem; margin-top: .85rem; font-size: .95rem; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; accent-color: var(--pink); flex: none; }

/* Confetti ---------------------------------------------------------------- */

.confetti { position: fixed; inset: 0; z-index: 99; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 16px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  animation: fall var(--dur, 2.4s) cubic-bezier(.25, .6, .45, 1) forwards;
}
@keyframes fall {
  to { transform: translate3d(var(--dx, 0), 110vh, 0) rotate(var(--rot, 540deg)); }
}

/* Progress: the locked 4th step ------------------------------------------- */

.progress { flex-wrap: wrap; justify-content: center; }
.progress li.is-locked { background: #F1ECE3; color: #8A8178; border-style: dashed; }
.progress li.is-locked span { background: transparent; font-size: .9rem; }
.progress li.is-unlocked { animation: unlock .8s var(--ease); }
@keyframes unlock { 40% { transform: scale(1.25) rotate(-6deg); } }

/* Step 4 — scrapbook -------------------------------------------------------- */

.screen--wide { width: min(100%, 62rem); }
.window--green .window__bar { background: var(--green); }

.scrapbook {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.25rem) clamp(1rem, 2.5vw, 2rem);
  margin: clamp(1.75rem, 4vw, 2.75rem) 0 1rem;
  padding: .75rem .5rem 0;
  list-style: none;
}
.scrapbook li:nth-child(odd)  { --tilt: -3deg; }
.scrapbook li:nth-child(even) { --tilt: 2.5deg; }
.scrapbook li:nth-child(3n)   { --tilt: -1.5deg; }
.scrapbook li:nth-child(4n)   { --tilt: 3.5deg; }

.screen[data-screen="4"].is-active .scrapbook li {
  animation: drop-in .7s var(--ease) calc(.25s + var(--i) * .12s) both;
}
@keyframes drop-in {
  from { opacity: 0; transform: translateY(-60px) rotate(calc(var(--tilt) * -4)) scale(1.1); }
}

.polaroid {
  position: relative;
  display: block;
  width: 100%;
  padding: .65rem .65rem 0;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  box-shadow: 4px 5px 0 rgb(31 26 23 / .85);
  text-align: center;
  transform: rotate(var(--tilt, 0deg));
  transition: transform .45s var(--ease), box-shadow .3s;
}
.polaroid:hover, .polaroid:focus-visible {
  z-index: 2;
  transform: rotate(0deg) scale(1.05) translateY(-4px);
  box-shadow: 8px 10px 0 rgb(31 26 23 / .85);
}
.polaroid__img { display: block; aspect-ratio: 1; overflow: hidden; background: #EDE6DA; border: 1px solid rgb(31 26 23 / .15); }
.polaroid__img img { width: 100%; height: 100%; object-fit: cover; }
.polaroid__ph {
  display: grid;
  place-content: center;
  gap: .25rem;
  height: 100%;
  background: repeating-linear-gradient(45deg, #F6EFE3 0 12px, #EFE6D6 12px 24px);
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--ink-2);
}
.polaroid__ph small { font-family: var(--type); font-size: .65rem; }
.polaroid__cap {
  display: block;
  min-height: 3.1rem;
  padding: .6rem .25rem .7rem;
  font-family: var(--script);
  font-size: .82rem;
  line-height: 1.6;
  color: #1D3FA8;
}
.polaroid__tape {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 84px;
  height: 24px;
  margin-left: -42px;
  opacity: .8;
  transform: rotate(calc(var(--tilt, 0deg) * -2));
  background: repeating-linear-gradient(90deg, rgb(255 255 255 / .35) 0 6px, transparent 6px 12px);
  border-left: 2px dashed rgb(0 0 0 / .08);
  border-right: 2px dashed rgb(0 0 0 / .08);
}
.polaroid--pink   .polaroid__tape { background-color: var(--pink); }
.polaroid--yellow .polaroid__tape { background-color: var(--yellow); }
.polaroid--blue   .polaroid__tape { background-color: var(--blue); }
.polaroid--green  .polaroid__tape { background-color: var(--green); }

/* The envelope and his message */
.envelope { margin: clamp(2rem, 5vw, 3rem) auto 0; width: min(100%, 34rem); }
.envelope__closed {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: var(--border);
  border-radius: 12px;
  background: var(--pink-soft);
  box-shadow: var(--shadow);
  animation: nudge 2.4s ease-in-out 1.5s infinite;
}
.envelope__closed:hover { animation-play-state: paused; transform: translateY(-3px) rotate(-1deg); }
@keyframes nudge {
  0%, 80%, 100% { transform: rotate(0); }
  85% { transform: rotate(-2deg); }
  90% { transform: rotate(2deg); }
  95% { transform: rotate(-1deg); }
}
.envelope__flap {
  position: absolute;
  inset: 0 0 45% 0;
  background: var(--pink);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-bottom: 0;
}
.envelope__flap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, transparent 49.3%, var(--ink) 49.5% 50.5%, transparent 50.7%),
              linear-gradient(to bottom left, transparent 49.3%, var(--ink) 49.5% 50.5%, transparent 50.7%);
}
.envelope__seal {
  position: absolute;
  top: 42%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border: var(--border);
  border-radius: 50%;
  background: var(--red);
  font-size: 1.6rem;
  box-shadow: var(--shadow-sm);
}
.envelope__label {
  position: absolute;
  left: 0; right: 0; bottom: 12%;
  display: grid;
  gap: .2rem;
  font-family: var(--display);
  font-size: clamp(1.05rem, .9rem + .8vw, 1.4rem);
}
.envelope__label small { font-family: var(--pixel); font-size: 1.2rem; color: var(--ink-2); }

.letterpaper {
  position: relative;
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 2.5rem) clamp(1.5rem, 4vw, 2.25rem) clamp(2.5rem, 6vw, 3.5rem);
  border: var(--border);
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent calc(clamp(2.5rem, 6vw, 3.5rem) - 14px), rgb(255 90 95 / .45) calc(clamp(2.5rem, 6vw, 3.5rem) - 14px) calc(clamp(2.5rem, 6vw, 3.5rem) - 12px), transparent 0),
    repeating-linear-gradient(transparent 0 calc(2.05rem - 1px), rgb(90 169 255 / .35) calc(2.05rem - 1px) 2.05rem),
    #FFFEF9;
  background-position: 0 0, 0 1.1rem, 0 0;
  box-shadow: var(--shadow);
  text-align: left;
  font-family: var(--script);
  font-size: clamp(.92rem, .85rem + .35vw, 1.08rem);
  line-height: 2.05rem;
  color: #1D3FA8;
}
.letterpaper p + p { margin-top: 1rem; }
.letterpaper__sign { margin-top: 1.5rem !important; text-align: right; }
.letterpaper.is-opening { animation: unfold .9s var(--ease) both; transform-origin: top; }
@keyframes unfold {
  from { opacity: 0; transform: perspective(900px) rotateX(-70deg) translateY(-20px); }
}

@media (max-width: 47.99rem) {
  .scrapbook { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .polaroid__cap { font-size: .72rem; }
}

/* Photo viewer ------------------------------------------------------------ */

.lightbox {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: clamp(1rem, 4vw, 2.5rem);
  border: 0;
  background: transparent;
  overflow: hidden;
}
.lightbox[open] { display: grid; place-items: center; animation: fade .3s ease; }
.lightbox::backdrop { background: rgb(31 26 23 / .82); }
.lightbox__figure {
  display: grid;
  justify-items: center;
  gap: .75rem;
  max-width: min(92vw, 60rem);
  padding: .8rem .8rem 0;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  box-shadow: 8px 10px 0 var(--ink);
  transform: rotate(-1deg);
}
.lightbox__frame img, .lightbox__frame .polaroid__ph { display: block; max-width: 100%; max-height: 72svh; width: auto; height: auto; }
.lightbox__frame .polaroid__ph { width: min(80vw, 30rem); aspect-ratio: 1; }
.lightbox__frame img.is-swapping { animation: pop-in .4s var(--ease); }
.lightbox__cap { min-height: 2.5rem; padding: .25rem .5rem .9rem; font-family: var(--script); font-size: 1.05rem; color: #1D3FA8; text-align: center; }
.lightbox__btn {
  position: fixed;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: var(--border);
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-size: 1.8rem;
  line-height: 1;
}
.lightbox__btn--prev  { left: 1rem; top: 50%; margin-top: -1.5rem; }
.lightbox__btn--next  { right: 1rem; top: 50%; margin-top: -1.5rem; }
.lightbox__btn--close { right: 1rem; top: 1rem; background: var(--yellow); }
.lightbox__count { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); font-family: var(--pixel); font-size: 1.3rem; color: #fff; }
@media (max-width: 40rem) {
  .lightbox__btn--prev, .lightbox__btn--next { top: auto; bottom: 1rem; margin: 0; }
}

/* NDA evidence photos ------------------------------------------------------ */

.exhibit {
  position: relative;
  float: right;
  width: clamp(92px, 22%, 130px);
  margin: .35rem 0 .75rem 1rem;
  padding: .35rem .35rem .2rem;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(3deg);
}
.clauses li:nth-child(even) .exhibit { transform: rotate(-3deg); }
.exhibit img, .exhibit__ph { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.exhibit__ph {
  display: grid;
  place-items: center;
  padding: .25rem;
  background: repeating-linear-gradient(45deg, #F6EFE3 0 8px, #EFE6D6 8px 16px);
  font-size: .62rem;
  line-height: 1.2;
  text-align: center;
  color: var(--ink-2);
}
.exhibit figcaption { padding-top: .25rem; font-size: .62rem; line-height: 1.25; text-align: center; }
.exhibit figcaption b { display: block; color: var(--red); letter-spacing: .06em; text-transform: uppercase; }
.exhibit__clip {
  position: absolute;
  top: -12px;
  left: 18px;
  width: 14px;
  height: 30px;
  border: 2.5px solid #8A8F98;
  border-radius: 8px;
  transform: rotate(-8deg);
}
.clauses li::after { content: ""; display: block; clear: both; }   /* keep the floated photo inside its clause */

/* The "No" celebration ---------------------------------------------------- */

.celebrate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgb(255 255 255 / .85), rgb(255 255 255 / 0) 55%),
    repeating-conic-gradient(from 0deg at 50% 45%, #FFD6E7 0 15deg, #FFF0B8 15deg 30deg);
  cursor: pointer;
  animation: fade .35s ease both;
}
.celebrate[hidden] { display: none; }
.celebrate::before {
  /* the sunburst slowly turns — pure party */
  content: "";
  position: absolute;
  inset: -50%;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgb(255 111 168 / .12) 0 10deg, transparent 10deg 20deg);
  animation: spin 24s linear infinite;
}
.celebrate.is-leaving { animation: fade-out .4s ease forwards; }
@keyframes fade-out { to { opacity: 0; } }

.celebrate__card {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  width: min(34rem, 100%);
  text-align: center;
}

.celebrate__face {
  display: grid;
  place-items: center;
  width: clamp(150px, 38vw, 210px);
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden;
  font-size: clamp(5.5rem, 22vw, 8rem);
  line-height: 1;
  animation: pop-face .7s var(--ease) both, dance 1s ease-in-out .7s infinite;
}
.celebrate__face img { width: 100%; height: 100%; object-fit: cover; }
@keyframes pop-face { from { transform: scale(0) rotate(-30deg); } }
@keyframes dance {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  25%      { transform: rotate(0deg) translateY(-14px) scale(1.04); }
  50%      { transform: rotate(8deg) translateY(0); }
  75%      { transform: rotate(0deg) translateY(-14px) scale(1.04); }
}

.celebrate__text {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .1em .3em;
  font-family: var(--display);
  font-size: clamp(2rem, 1.2rem + 4vw, 3.6rem);
  line-height: 1.1;
  color: var(--pink);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--ink);
}
.celebrate__text span {
  display: inline-block;
  animation: word-in .6s var(--ease) calc(.35s + var(--w) * .12s) both, bob 1.6s ease-in-out calc(1.2s + var(--w) * .1s) infinite;
}
.celebrate__text span:nth-child(even) { color: var(--yellow); }
@keyframes word-in { from { opacity: 0; transform: translateY(40px) scale(.4) rotate(-10deg); } }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-3deg); } }

.celebrate__go { animation: word-in .6s var(--ease) 1.2s both; }

.celebrate__hearts { position: absolute; inset: 0; pointer-events: none; }
.heart {
  position: absolute;
  bottom: -3rem;
  left: var(--x);
  font-size: var(--s);
  animation: rise var(--dur) ease-in forwards;
}
@keyframes rise {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translate(var(--dx), -115vh) rotate(var(--r)); opacity: .9; }
}

/* The note card after the wishlist ---------------------------------------- */

.window--yellow .window__bar { background: var(--yellow); }

.note-card {
  width: min(28rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.note-card::backdrop { background: rgb(255 111 168 / .35); }
.note-card[open] { animation: card-in .6s var(--ease); }
.note-card[open]::backdrop { animation: fade .4s ease; }
@keyframes card-in { from { opacity: 0; transform: translateY(40px) rotate(-4deg) scale(.9); } }
@keyframes fade { from { opacity: 0; } }

.note-card .window { transform: rotate(-1.5deg); }
.note-card__body { padding-top: 1.75rem; }
.note-card__face {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin: 0 auto 1rem;
  border: var(--border);
  border-radius: 50%;
  background: var(--pink-soft);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  font-size: 3.5rem;
  line-height: 1;
  animation: hop .6s ease-in-out .6s 2 alternate;
}
.note-card__face img { width: 100%; height: 100%; object-fit: cover; }
.note-card__message {
  margin-top: .5rem;
  font-family: var(--script);
  font-size: clamp(1.05rem, .95rem + .6vw, 1.3rem);
  line-height: 1.9;
  color: #1D3FA8;
}
.note-card__sign { margin-top: .75rem; font-family: var(--pixel); font-size: 1.3rem; }
.note-card__answers { display: grid; gap: .75rem; margin-top: 1.5rem; }

/* Husband reactions ------------------------------------------------------- */

.reactions { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }

.me {
  --size: clamp(110px, 22vw, 170px);
  position: absolute;
  transition: transform .65s var(--ease);
}
.me.is-out { transition: transform .45s cubic-bezier(.5, 0, .75, 0); }

/* Hidden just off the edge it comes from… */
.me--left   { left: 0;   transform: translate(-130%, -50%); }
.me--right  { right: 0;  transform: translate(130%, -50%); }
.me--bottom { bottom: 0; transform: translate(-50%, 130%); }
.me--top    { top: 0;    transform: translate(-50%, -130%); }
/* …and peeking in. */
.me--left.is-in   { transform: translate(18px, -50%); }
.me--right.is-in  { transform: translate(-18px, -50%); }
.me--bottom.is-in { transform: translate(-50%, -18px); }
.me--top.is-in    { transform: translate(-50%, 18px); }

.me__inner { position: relative; display: flex; align-items: center; gap: .75rem; }
.me--right  .me__inner { flex-direction: row-reverse; }
.me--bottom .me__inner { flex-direction: column-reverse; }
.me--top    .me__inner { flex-direction: column; }

.me__face {
  position: relative;
  flex: none;
  width: var(--size);
  aspect-ratio: 1;
  border: var(--border);
  border-radius: 50%;
  background: var(--yellow-soft);
  box-shadow: var(--shadow);
}
.me__face img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.me__emoji { display: grid; place-items: center; width: 100%; height: 100%; font-size: calc(var(--size) * .6); line-height: 1; }

.me__bubble {
  max-width: 15rem;
  padding: .7rem .95rem;
  border: var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.2;
  opacity: 0;
  transform: scale(.5) rotate(-6deg);
  transition: opacity .3s, transform .5s var(--ease) .35s;
}
.me--cry .me__bubble { background: var(--blue-soft); }
.me--happy .me__bubble { background: var(--green-soft); }
.me--faint .me__bubble { background: var(--pink-soft); }
.me.is-in .me__bubble { opacity: 1; transform: none; transition-delay: .35s; }

/* Crying: sobbing shake, two tear streams, a steady drip, 💧 rain */
.me--cry.is-in .me__face { animation: sob .26s ease-in-out .55s infinite alternate; }
@keyframes sob {
  from { transform: translateX(-3px) rotate(-3deg); }
  to   { transform: translateX(3px) rotate(3deg); }
}
.tear {
  position: absolute;
  width: 9%;
  height: 52%;
  margin-left: -4.5%;
  border: 1.5px solid rgb(31 26 23 / .35);
  border-top: 0;
  border-radius: 0 0 50% 50% / 0 0 18% 18%;
  background: linear-gradient(rgb(124 196 255 / .95), rgb(124 196 255 / .6));
  transform: scaleY(0);
  transform-origin: top;
  animation: stream .9s ease-out calc(.5s + var(--i) * .15s) forwards;
}
.tear::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 14px;
  height: 18px;
  margin-left: -7px;
  border: 1.5px solid var(--ink);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: #7CC4FF;
  animation: drip .75s ease-in calc(1.2s + var(--i) * .3s) infinite;
}
.me__face:has(.me__emoji) .tear { display: none; }
@keyframes stream { to { transform: scaleY(1); } }
@keyframes drip {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(46px); opacity: 0; }
}

.drop {
  position: absolute;
  top: 45%;
  left: var(--x);
  font-size: 1.35rem;
  opacity: 0;
  animation: rain 1.3s ease-in calc(.7s + var(--d)) infinite;
}
@keyframes rain {
  0%   { opacity: 0; transform: translate(0, 0) scale(.6); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), 150px) scale(1); }
}

/* Relieved: a little bounce and sparkles */
.me--happy.is-in .me__face { animation: hop .5s ease-in-out .5s 3 alternate; }
@keyframes hop { to { transform: translateY(-14px) rotate(-4deg); } }
.spark {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 1.3rem;
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: spark 1.1s ease-out calc(.5s + var(--d)) forwards;
}
@keyframes spark {
  0%   { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) rotate(calc(-1 * var(--a))); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(var(--size) * -.85)) rotate(calc(-1 * var(--a))); }
}

/* All four: he faints */
.me--faint.is-in .me__face { animation: faint 1.3s var(--ease) .6s forwards; }
@keyframes faint {
  30%  { transform: rotate(12deg); }
  55%  { transform: rotate(-8deg); }
  100% { transform: rotate(-100deg) translateX(-12%); }
}

@media (max-width: 40rem) {
  .me__bubble { max-width: 10rem; font-size: .92rem; }
}

@media (prefers-reduced-motion: reduce) {
  .me { transition: opacity .3s; opacity: 0; }
  .me.is-in { opacity: 1; }
  .me--left, .me--left.is-in     { transform: translate(18px, -50%); }
  .me--right, .me--right.is-in   { transform: translate(-18px, -50%); }
  .me--bottom, .me--bottom.is-in { transform: translate(-50%, -18px); }
  .me--top, .me--top.is-in       { transform: translate(-50%, 18px); }
  .tear { transform: none; }
  .tear::after { display: none; }
}

/* Small screens ----------------------------------------------------------- */

@media (max-width: 40rem) {
  .progress { font-size: 1.05rem; }
  .progress li { padding-right: .6rem; }
  .window__body { padding-top: 2rem; }
  .sign__grid { gap: 1rem; }
  .sign__label { font-size: .68rem; }
  .sign__input { padding: .5rem .6rem; }
  .doc { font-size: .9rem; }
  [data-screen="3"] .window { height: calc(100svh - 6rem); }
  .doc__title { font-size: 1.4rem; }
  .sign .actions { gap: .6rem; }
  .sign .btn { min-height: 2.75rem; padding-block: .5rem; }
  .actions--split { flex-wrap: nowrap; }
  .sign .btn { padding-inline: .9rem; font-size: .9rem; }
  .sign .btn--primary { flex: 1; }
  .hide-sm { display: none; }
  .stamp { font-size: .6rem; margin-bottom: -1.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .confetti { display: none; }
}

.sign .actions { margin-top: 1rem; }
.sign .toast { min-height: 0; margin-top: .5rem; }
.sign .toast:empty { display: none; }

.stage:has([data-screen="3"]:not([hidden])) { padding-block: 1rem; }
.doc .stamp { margin-top: -.4rem; }
.script { white-space: nowrap; }
@media (max-width: 40rem) { .script { font-size: 1.05rem; } }
.celebrate__from { margin-top: -.5rem; font-family: var(--pixel); font-size: 1.6rem; line-height: 1; animation: word-in .6s var(--ease) 1s both; }
[hidden] { display: none !important; }
@media (max-width: 40rem) { .progress { gap: .3rem; flex-wrap: nowrap; font-size: .95rem; } .progress li { gap: .3rem; padding: .28rem .5rem .28rem .28rem; } .progress li span { width: 1.15rem; height: 1.15rem; font-size: .85rem; } .deco__star--1 { display: none; } }
.polaroid__ph small { padding: 0 .35rem; overflow-wrap: anywhere; }
.sign__hint { min-height: 1.2em; margin-top: .3rem !important; font-family: var(--pixel); font-size: 1.1rem; line-height: 1.1; color: var(--ink-2); }
.sign__input.is-valid { border-color: var(--green); background: var(--green-soft); }
.sign__input.is-wrong { border-color: var(--red); animation: shake .35s ease; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.polaroid__img img { object-position: 50% 62%; }
.big__nick { display: block; margin-top: .6rem; font-family: var(--pixel); font-size: clamp(1.3rem, 1rem + 1vw, 1.7rem); line-height: 1; letter-spacing: .02em; color: var(--ink-2); }
.check.is-locked { opacity: .55; cursor: not-allowed; }
.check.is-locked input { pointer-events: none; }
.clauses-box.is-nudge { animation: shake .35s ease 2; }
.clauses-hint.is-pop { animation: toast-pop .45s var(--ease); color: var(--red); }
