:root {
  --paper: #f5efe4;
  --paper-2: #efe6d6;
  --card: #fffdf8;
  --ink: #1d2130;
  --muted: #5b5e6c;
  --navy: #1f3a68;
  --navy-deep: #16294b;
  --gold: #7f5f2e;
  --gold-line: #a9844c;
  --gold-soft: #d8c39c;
  --line: #e3d9c6;
  --error: #9b2c2c;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 400 19px/1.55 var(--sans);
  background:
    radial-gradient(1200px 700px at 20% -10%, #fbf7ef 0%, transparent 60%),
    radial-gradient(900px 600px at 110% 110%, var(--paper-2) 0%, transparent 60%),
    var(--paper);
}
/* Fine paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .28 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.page {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 16px 56px;
  display: grid;
  gap: 32px;
}

/* ---------- Intro ---------- */
.intro { display: grid; gap: 30px; }

/* Collage: four prints in a loose grid, each face fully visible */
.collage {
  margin: 0 auto;
  width: min(100%, 360px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 14px;
  padding: 4px 6px;
}
.snap {
  margin: 0;
  padding: 6px 6px 9px;
  background: #fffefa;
  box-shadow:
    0 1px 1px rgba(60, 45, 20, .08),
    0 10px 22px -12px rgba(40, 30, 15, .4),
    0 22px 40px -30px rgba(22, 41, 75, .35);
  animation: snap-in .9s cubic-bezier(.2, .7, .2, 1) both;
}
.snap img { display: block; width: 100%; aspect-ratio: 4 / 5; height: auto; object-fit: cover; object-position: 50% 30%; }
.snap:nth-child(1) { transform: rotate(-2deg); animation-delay: .05s; }
.snap:nth-child(2) { transform: rotate(1.6deg) translateY(6px); animation-delay: .15s; }
.snap:nth-child(3) { transform: rotate(1.2deg); animation-delay: .25s; }
.snap:nth-child(3) img { object-position: 50% 12%; }
.snap:nth-child(4) { transform: rotate(-1.4deg) translateY(6px); animation-delay: .35s; }
@keyframes snap-in { from { opacity: 0; translate: 0 18px; } }
.corner {
  position: absolute;
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #2a3d63 0 50%, transparent 50%);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.25));
  opacity: .92;
}
.corner.tl { top: -6px; left: -6px; }
.corner.tr { top: -6px; right: -6px; transform: rotate(90deg); }
.corner.br { bottom: -6px; right: -6px; transform: rotate(180deg); }
.corner.bl { bottom: -6px; left: -6px; transform: rotate(270deg); }

.intro-text { text-align: center; }
.eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
h1 {
  margin: 0;
  font: 600 clamp(48px, 13vw, 76px)/.95 var(--serif);
  color: var(--navy-deep);
  letter-spacing: -.01em;
}
h1 span { display: block; font-style: italic; font-weight: 500; color: var(--navy); }
.dates {
  margin: 14px 0 0;
  font: 500 21px/1.3 var(--serif);
  color: var(--muted);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 12px;
}
.dates .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold-line); }
.flourish { display: block; width: 150px; height: 16px; margin: 22px auto; color: var(--gold-line); }
.lede { margin: 0 auto; max-width: 32em; }
.deadline {
  display: inline-block;
  margin: 18px 0 0;
  padding: 8px 18px;
  border: 1px solid var(--gold-soft);
  border-radius: 99px;
  background: rgba(255, 253, 248, .7);
  font-size: 17px;
}
.deadline strong { color: var(--navy-deep); }
.signoff { margin: 22px 0 0; color: var(--muted); font-size: 16px; }
.signoff span { font: italic 500 26px/1.35 var(--serif); color: var(--navy-deep); }

/* ---------- Card ---------- */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 18px 26px;
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 24px 50px -36px rgba(40, 30, 15, .45);
}
.card h2, .tips h2 {
  margin: 0 0 22px;
  font: 600 32px/1.1 var(--serif);
  color: var(--navy-deep);
}

.step { display: grid; grid-template-columns: 30px 1fr; gap: 12px; margin-bottom: 28px; }
.num {
  display: grid; place-items: center;
  width: 30px; height: 30px; margin-top: -2px;
  border-radius: 50%;
  border: 1px solid var(--gold-soft);
  font: 600 18px/1 var(--serif);
  color: var(--gold);
}
.step-body { min-width: 0; }
label, .label { display: block; font-weight: 600; margin-bottom: 8px; }
label.second { margin-top: 18px; }
.opt { font-weight: 400; color: var(--muted); }
input[type="text"], textarea {
  width: 100%;
  font: inherit;
  font-size: 18px;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #a39781;
  border-radius: 10px;
  padding: 13px 14px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 96px; display: block; }
input::placeholder, textarea::placeholder { color: #6b6e7a; }
input:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31, 58, 104, .16); }

.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.pick {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 84px;
  margin: 0;
  padding: 14px;
  border: 2px dashed #6f86ad;
  border-radius: 12px;
  background: linear-gradient(180deg, #f6f8fc, #eef2f9);
  color: var(--navy);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.pick:hover, .pick.over { border-color: var(--navy); background: #e8eef8; }
.pick.over { transform: scale(1.01); }
.file-input:focus-visible + .pick { outline: 3px solid rgba(31, 58, 104, .35); outline-offset: 2px; }
.pick svg { width: 32px; height: 32px; flex: none; }
.pick-text { display: grid; line-height: 1.2; }
#pick-text { font-size: 21px; font-weight: 700; }
.pick small { font-size: 15px; color: var(--muted); font-weight: 400; margin-top: 3px; }
.desk-only { display: none; }
@media (hover: hover) and (pointer: fine) { .desk-only { display: block; } }
.hint { margin: 8px 0 0; font-size: 16px; color: var(--muted); }

.tray-status {
  margin: 16px 0 0;
  font-weight: 600;
  color: var(--navy);
  display: flex; align-items: center; gap: 8px;
}
.tray-status.all-done::before {
  content: ""; width: 20px; height: 20px; border-radius: 50%; flex: none;
  background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 12.5l3.5 3.5 7.5-8' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat;
}

/* ---------- Prints (selected photos) ---------- */
.prints {
  list-style: none;
  margin: 12px 0 0;
  padding: 6px 2px 2px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 14px 12px;
}
.prints:empty { display: none; }
.print {
  position: relative;
  padding: 5px 5px 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(40, 30, 15, .18), 0 6px 14px -8px rgba(40, 30, 15, .35);
  transform: rotate(var(--tilt, 0deg));
  animation: drop .35s cubic-bezier(.2, .9, .3, 1.2) both;
}
.print:nth-child(3n+1) { --tilt: -1.6deg; }
.print:nth-child(3n+2) { --tilt: 1.2deg; }
.print:nth-child(3n) { --tilt: -.4deg; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px) scale(.94) rotate(var(--tilt, 0deg)); } }
.print .frame { position: relative; aspect-ratio: 1; overflow: hidden; background: #ece5d8; }
.print img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .2s, filter .2s; }
.print .noimg {
  display: grid; place-items: center; align-content: center; gap: 4px; height: 100%;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase;
}
.print .noimg svg { width: 26px; height: 26px; color: #9a927f; }
.print .remove {
  position: absolute; top: -9px; right: -9px;
  width: 30px; height: 30px;
  border: 2px solid #fff; border-radius: 50%;
  background: #3a3d48; color: #fff;
  font-size: 18px; line-height: 1; cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.sending .print .remove, .print[data-state="sent"] .remove { display: none; }

.print .badge {
  position: absolute; right: -8px; bottom: 4px;
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid #fff;
  display: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.print[data-state="queued"] img { opacity: .55; }
.print[data-state="working"] .frame::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.85); border-top-color: var(--navy);
  animation: spin .8s linear infinite;
  background: rgba(22, 41, 75, .15);
}
.print[data-state="working"] img { filter: saturate(.6) brightness(.9); }
@keyframes spin { to { transform: rotate(360deg); } }
.print[data-state="sent"] .badge {
  display: block;
  background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 12.5l3.5 3.5 7.5-8' fill='none' stroke='white' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 78% no-repeat;
  animation: pop .3s cubic-bezier(.2, .9, .3, 1.4) both;
}
.print[data-state="failed"] { outline: 2px solid var(--error); outline-offset: 1px; }
.print[data-state="failed"] .badge {
  display: block;
  background: var(--error) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 6.5v7M12 17v.5' fill='none' stroke='white' stroke-width='2.8' stroke-linecap='round'/%3E%3C/svg%3E") center / 78% no-repeat;
}
@keyframes pop { from { transform: scale(.3); opacity: 0; } }

.error {
  margin: 0 0 16px; padding: 12px 14px;
  border-radius: 10px; background: #fbeceb; color: var(--error); font-size: 17px;
}

.progress { margin-bottom: 18px; }
.bar { height: 10px; border-radius: 99px; background: #e8e0d1; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--navy), #2f5595); transition: width .3s; }
#progress-text { margin: 10px 0 0; font-weight: 600; }

button { font: inherit; }
.send, .secondary {
  display: block; width: 100%;
  min-height: 62px;
  border-radius: 12px;
  font-size: 20px; font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.send { border: 0; background: var(--navy); color: #fff; box-shadow: 0 10px 20px -12px rgba(22, 41, 75, .8); }
.send:hover { background: var(--navy-deep); }
.send:active { transform: translateY(1px); }
.send:disabled { opacity: .65; cursor: default; }
.secondary { border: 1.5px solid var(--navy); background: transparent; color: var(--navy); margin-top: 24px; }
.secondary:hover { background: #eef2f9; }
button:focus-visible { outline: 3px solid rgba(31, 58, 104, .35); outline-offset: 2px; }

/* ---------- Done ---------- */
.done { text-align: center; padding-top: 34px; }
.done:focus { outline: none; }
.fan { position: relative; height: 150px; margin: 0 auto 6px; }
.fan:empty { display: none; }
.fan .print {
  position: absolute; left: 50%; top: 6px;
  width: 112px; margin-left: -56px;
  animation: fanIn .6s cubic-bezier(.2, .9, .3, 1.1) both;
}
@keyframes fanIn { from { opacity: 0; transform: translateY(16px) rotate(0deg); } }
.done-mark { width: 52px; height: 52px; color: var(--navy); margin: 0 auto 6px; display: block; animation: pop .45s .25s cubic-bezier(.2, .9, .3, 1.4) both; }
.done h2 { margin-bottom: 8px; }
.done p { margin: 0 auto; max-width: 30em; }
#done-text { font-size: 21px; font-weight: 600; color: var(--navy-deep); }
.done-sub { margin-top: 10px !important; color: var(--muted); font-size: 17px; }

/* ---------- Footer ---------- */
.foot { display: grid; gap: 28px; padding: 0 4px; }
.tips h2 { font-size: 24px; margin-bottom: 10px; }
.tips ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 17px; }
.tips li { margin-bottom: 8px; }
.tips strong { color: var(--ink); }
.qr {
  display: flex; align-items: center; gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, .6);
  max-width: 440px;
}
.qr img { width: 96px; height: 96px; flex: none; padding: 8px; background: #fff; border-radius: 8px; }
.qr p { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.45; }
.qr strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 2px; }

/* ---------- Page-load reveal ---------- */
.reveal { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.intro-text .reveal:nth-child(1) { animation-delay: .15s; }
.intro-text .reveal:nth-child(2) { animation-delay: .22s; }
.intro-text .reveal:nth-child(3) { animation-delay: .3s; }
.intro-text .reveal:nth-child(4) { animation-delay: .36s; }
.intro-text .reveal:nth-child(5) { animation-delay: .42s; }
.intro-text .reveal:nth-child(6) { animation-delay: .48s; }
.intro-text .reveal:nth-child(7) { animation-delay: .54s; }
#form-card.reveal { animation-delay: .5s; }
.foot.reveal { animation-delay: .65s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes rise-tilt { from { opacity: 0; transform: translateY(18px) rotate(-3deg); } }

@media (min-width: 860px) {
  .page {
    grid-template-columns: 390px 1fr;
    column-gap: 64px;
    align-items: start;
    padding-top: 64px;
  }
  .intro { grid-row: span 3; position: sticky; top: 40px; gap: 34px; }
  .collage { width: 100%; }
  .card { padding: 36px 38px 36px; }
  .step { grid-template-columns: 34px 1fr; gap: 16px; }
  .num { width: 34px; height: 34px; }
  .foot { grid-template-columns: 1fr auto; align-items: start; }
  .qr { max-width: 300px; flex-direction: column; text-align: center; gap: 10px; }
  .qr img { width: 112px; height: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Guidance additions ---------- */
.hint.above { margin: -4px 0 8px; }
.hint strong { color: var(--ink); }
/* bigger invisible tap area around the small remove button */
.print .remove::after { content: ""; position: absolute; inset: -8px; }
.next-step {
  margin: 14px 0 0; padding: 10px 14px;
  border-radius: 10px; background: #eef2f9; color: var(--navy-deep); font-size: 17px;
}
.jump {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 22px; padding: 12px 22px;
  border-radius: 99px;
  background: var(--navy); color: #fff;
  font-weight: 700; font-size: 18px; text-decoration: none;
  box-shadow: 0 10px 20px -12px rgba(22, 41, 75, .8);
}
.jump svg { width: 20px; height: 20px; }
.jump:hover { background: var(--navy-deep); }
.jump:focus-visible { outline: 3px solid rgba(31, 58, 104, .35); outline-offset: 3px; }
#form-card { scroll-margin-top: 12px; }
/* Keep Send in reach while the form is on screen */
.has-items .send { position: sticky; bottom: 12px; z-index: 5; }
@media (max-width: 859px) {
}
@media (min-width: 860px) { .jump { display: none; } }

/* Save-this-page card on the thank-you screen */
.keep { text-align: center; }
.keep-icon { width: 34px; height: 34px; color: var(--gold); margin: 0 auto 6px; display: block; }
.keep h2 { margin-bottom: 10px; }
.keep p { margin: 0 auto; max-width: 30em; }
.keep-actions { display: grid; gap: 10px; margin-top: 18px; }
.keep-actions .secondary { margin-top: 0; }
.keep-tip { margin-top: 14px !important; }
.nopreview { display: grid; place-items: center; }

.save-note {
  display: flex; align-items: flex-start; gap: 10px; text-align: left;
  max-width: 26em; margin: 14px auto 0; padding: 12px 16px;
  border-radius: 12px; background: #eef2f9; color: var(--navy-deep); font-size: 16px; line-height: 1.45;
}
.save-note svg { width: 22px; height: 22px; flex: none; margin-top: 1px; color: var(--navy); }
