:root {
  color-scheme: light;
  --ink: #522d38;
  --muted: #745450;
  --berry: #843d52;
  --paper: #fff8e9;
  --display: Georgia, "Times New Roman", serif;
  --script: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  --grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.83' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' opacity='.2' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background:
    var(--grain),
    radial-gradient(ellipse at 16% 15%, #f8efdf 0%, transparent 50%),
    radial-gradient(ellipse at 85% 85%, #efd7cf 0%, transparent 60%),
    #f2e5d3;
  color: var(--ink);
  font: 1rem/1.5 "Trebuchet MS", system-ui, sans-serif;
}

.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }

.masthead {
  width: min(76rem, 100%);
  margin-inline: auto;
  padding: 1.65rem clamp(1.15rem, 5vw, 3.5rem) 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--berry);
}

.masthead, main { position: relative; z-index: 1; }
.masthead { transition: opacity 380ms ease-out; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: #000; opacity: 0; transition: opacity 380ms ease-out; }
body.studio-forming::before { opacity: 1; transition: none; }
body.studio-forming .masthead { visibility: hidden; opacity: 0; }
.progress { display: flex; align-items: center; gap: .45rem; min-height: 1.25rem; }
.progress span { width: .52rem; height: .52rem; border: 1px solid #a67777; border-radius: 50%; }
.progress .visited { background: #cd99a3; }
.progress [aria-current="step"] { background: var(--berry); width: 1.3rem; border-color: var(--berry); border-radius: 1rem; }

main { flex: 1; display: grid; }
.scene { display: grid; place-items: center; padding: clamp(2rem, 6vh, 4rem) 1.25rem; }
.scene.arriving .composition { animation: appear 450ms ease-out both; }
.composition { width: min(100%, 43rem); position: relative; }
.cover { width: min(100%, 45rem); }

.sheet {
  position: relative;
  text-align: center;
  isolation: isolate;
  padding: 2rem;
}

.sheet, .picture::before {
  border: 1px solid #ebd8bf;
  border-radius: 5px 3px 6px 3px;
  background: var(--grain), linear-gradient(140deg, #fffaec, var(--paper) 65%, #fff2df);
  box-shadow: 0 3px 4px #74503d12, 0 21px 50px -23px #70443d60;
}

.greeting-sheet {
  padding: clamp(2rem, 6vw, 3.3rem) clamp(.6rem, 3vw, 2rem) clamp(3rem, 8vw, 4.6rem);
}

.greeting-sheet::before {
  content: "";
  position: absolute;
  inset: .7rem;
  border: 1px dashed #cc9e93;
  border-radius: 3px;
  opacity: .65;
  z-index: -1;
}

.cover::before {
  content: "";
  position: absolute;
  inset: 1rem .45rem .4rem;
  transform: rotate(3deg);
  border-radius: 3px;
  background: var(--grain), repeating-linear-gradient(transparent 0 20px, #c68c8d30 20px 21px), #edc7c4;
  box-shadow: 0 5px 18px #70443d26;
}

.tape {
  position: absolute;
  display: block;
  width: clamp(4.4rem, 16vw, 7rem);
  height: 1.7rem;
  z-index: 2;
  background: var(--grain), repeating-linear-gradient(90deg, #fff3 0 1px, transparent 1px 4px), var(--tape);
  clip-path: polygon(2% 0, 97% 1%, 99% 12%, 96% 20%, 100% 31%, 97% 45%, 99% 58%, 96% 72%, 100% 86%, 97% 98%, 1% 100%, 3% 89%, 0 75%, 3% 62%, 1% 48%, 3% 37%, 0 24%, 3% 13%);
  pointer-events: none;
}

.tape-pink { --tape: #e6a3b3e5; top: -.55rem; left: -.45rem; transform: rotate(-14deg); }
.tape-green { --tape: #bec9a6e8; right: -.6rem; bottom: .4rem; transform: rotate(-16deg); }
.envelope { width: clamp(9.4rem, 29vw, 15rem); display: block; margin: 0 auto .2rem; animation: bob 5s ease-in-out infinite; }

h1, h2 { margin: 0; font-family: var(--display); text-wrap: balance; }
h1 { font-size: clamp(2.35rem, 11vw, 6.35rem); letter-spacing: -.071em; line-height: 1.03; }
h2 { font-size: clamp(1.9rem, 6vw, 3.65rem); letter-spacing: -.052em; line-height: 1.07; }
h1:focus, h2:focus { outline: none; }

.undermark { white-space: nowrap; position: relative; isolation: isolate; }
.undermark::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: .02em;
  right: -.04em;
  bottom: .04em;
  height: .145em;
  border-radius: 61% 36% 52% 30%;
  background: #e8a3b2;
  transform: rotate(-3deg);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  max-width: 100%;
  min-height: 3rem;
  padding: .65rem 1.35rem;
  border: 1px solid #743248;
  border-radius: 999px;
  background: var(--berry);
  color: #fff8ee;
  box-shadow: 0 3px 0 #602c3c, inset 0 1px 0 #ffffff26;
  font: 700 1rem/1.25 "Trebuchet MS", system-ui, sans-serif;
  cursor: pointer;
  transition: background-color 180ms, translate 180ms, box-shadow 180ms;
}
.button svg { width: .93rem; height: .93rem; color: #f6bdca; flex: none; }
.button:focus-visible { outline: 3px solid #9a5266; outline-offset: 5px; }
@media (hover: hover) { .button:hover { background: #743248; translate: 0 -2px; box-shadow: 0 5px 0 #602c3c; } }
.button:active { translate: 0 2px; box-shadow: 0 1px 0 #602c3c; }
.greeting-sheet .button { margin-top: clamp(1.6rem, 5vw, 2.7rem); min-width: 7.4rem; }

.doodle { position: absolute; pointer-events: none; width: 2rem; height: 2rem; }
.cover-star { top: 22%; left: -1.25rem; z-index: 1; color: #c49351; transform: rotate(13deg); animation: sway 4.5s ease-in-out infinite; }
.cover-heart { right: -.8rem; top: 8%; z-index: 1; width: 2.8rem; height: 2.8rem; color: #a65a6b; transform: rotate(20deg); animation: sway 5.3s ease-in-out infinite reverse; }
.clay-stamp {
  position: absolute;
  left: 3%;
  bottom: -1.35rem;
  display: grid;
  place-items: center;
  width: clamp(3.5rem, 9vw, 5.7rem);
  aspect-ratio: 1 / 1.1;
  border: 4px dotted #fff3d8;
  background: var(--grain), #d9dbbf;
  outline: 2px solid #f7ebd0;
  box-shadow: 0 3px 8px #70443d35;
  transform: rotate(-13deg);
  pointer-events: none;
}
.clay-stamp svg { width: 70%; height: 75%; }

.studio { width: min(100%, 43rem, max(29rem, 109svh)); }
.picture {
  --clay-ink: #fff5e3;
  position: relative;
  isolation: isolate;
  padding: .6rem .6rem .85rem;
  border: 1px solid transparent;
}
.picture::before { content: ""; position: absolute; z-index: -1; inset: -1px; visibility: hidden; }
.picture .tape { top: -.55rem; left: .6rem; bottom: auto; right: auto; transform: rotate(-12deg); visibility: hidden; }
.picture.is-glazed::before, .picture.is-glazed .tape { visibility: visible; animation: scrapbook-pop 420ms cubic-bezier(.16,.9,.35,1) both; }
.pottery-art { aspect-ratio: 720 / 416; overflow: hidden; border-radius: 2px; }
.pottery-art svg { display: block; width: 100%; height: 100%; }
.picture:not(.is-glazed) .clay-color-only { display: none; }
.picture:not(.is-glazed) .clay-character { stroke: #000; }
.picture:not(.is-glazed) .clay-character [fill]:not([fill="none"]) { fill: var(--clay-ink); }
.picture:not(.is-glazed) .clay-wheel [fill]:not([fill="none"]) { fill: #000; }
.picture:not(.is-glazed) .clay-wheel :is(path, ellipse) { stroke: var(--clay-ink); stroke-opacity: 1; }
.picture:not(.is-glazed) :is([data-clay="body"], [data-clay="back"], [data-clay="front"]) { fill: var(--clay-ink); stroke: var(--clay-ink); }
.picture:not(.is-glazed) :is([data-clay="rings"], [data-clay="rim"]) { stroke: #000; stroke-opacity: 1; }
.picture:not(.is-glazed) [data-clay="rim"] { fill: #000; }
.picture:not(.is-glazed) [data-clay="rim"]:not([opacity="0"]) { opacity: 1; }
.picture:not(.is-glazed) [data-clay="ripples"] { stroke: var(--clay-ink); }
.clay-entry {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: clay-emerge var(--entry-duration, .95s) var(--entry-delay, 0s) cubic-bezier(.22,.72,.3,1) both;
}
.clay-wheel { --entry-duration: .7s; }
.clay-entry-left { --entry-delay: .55s; --entry-lean: -10deg; }
.clay-entry-right { --entry-delay: 1s; --entry-lean: 10deg; }
.clay-character { transform-box: fill-box; transform-origin: center bottom; animation: clay-sway 3s ease-in-out infinite alternate; }
.clay-character-right { animation-direction: alternate-reverse; animation-delay: -1.2s; }
.clay-wheel-streak { stroke-dasharray: 22 21 7 15; animation: clay-wheel .65s linear infinite; }
.clay-heart-reveal, .studio-heart { opacity: 0; transition: opacity 650ms ease-in-out; }
.is-glazed .clay-heart-reveal, .is-glazed .studio-heart { opacity: 1; }
.is-glazed .studio-heart { animation: scrapbook-pop 420ms 75ms cubic-bezier(.16,.9,.35,1) both; }
.studio-heart { right: -.4rem; bottom: -.45rem; transform: rotate(16deg); color: #c97e91; }
.is-glazed [data-clay="shine"] { animation: clay-glaze 3s ease-in-out infinite; }
.studio-caption { text-align: center; padding-top: 1.1rem; }
.studio-caption[hidden] { display: block !important; visibility: hidden; }
.studio-caption:not([hidden]) { animation: appear 550ms ease-out both; }
.studio-caption h2 { font-size: clamp(1.72rem, 5vw, 3rem); }
.studio-caption .button { margin-top: 1rem; }
#studio { padding-block: clamp(1.2rem, 3vh, 2.8rem); }

.itinerary { width: min(100%, 38rem); }
.itinerary-sheet { padding: clamp(1.45rem, 5vw, 3.4rem); }
.itinerary-sheet .tape { left: 50%; transform: translateX(-50%) rotate(-4deg); top: -.75rem; }
.timeline { margin: 1.65rem auto 1.75rem; padding: 0; list-style: none; text-align: left; }
.timeline li {
  display: grid;
  grid-template-columns: 8.4rem 1fr;
  align-items: baseline;
  gap: .55rem 1.15rem;
  padding: .65rem .8rem;
  margin-block: .45rem;
  border-radius: 3px 7px 4px 4px;
  background: var(--row, #f5e8c9);
}
.timeline li:nth-child(2) { --row: #f5dedb; }
.timeline li:nth-child(3) { --row: #e6ead5; }
.timeline li:nth-child(4) { --row: #eee0eb; }
.time { color: var(--ink); font: 700 clamp(.86rem, 3vw, 1.06rem)/1.45 var(--script); white-space: nowrap; }
.itinerary-star { color: #a87a46; bottom: 2.3rem; right: -.9rem; transform: rotate(19deg); }

.invitation-sheet { padding: 2rem 1rem .9rem; }
.invitation-sheet .tape { right: auto; left: -.35rem; bottom: auto; top: -.4rem; transform: rotate(-11deg); }
.invite-heart { width: 2.15rem; height: 2.15rem; color: #ae5b70; transform: rotate(-12deg); margin-bottom: .5rem; }
.chase {
  position: relative;
  width: 100%;
  height: clamp(10rem, 27vh, 14.5rem);
  margin-top: .9rem;
  border-top: 1px dashed #cea49a;
}
#yes {
  position: absolute;
  top: var(--y, 50%);
  left: var(--x, 50%);
  transform: translate(-50%, -50%);
  transition: top 250ms cubic-bezier(.22,.8,.28,1), left 250ms cubic-bezier(.22,.8,.28,1), background-color 180ms;
  min-width: 6.3rem;
  touch-action: manipulation;
}

.celebration-sheet { padding: clamp(2rem, 8vw, 4.3rem) .8rem; }
.keepsake { position: relative; width: min(55%, 12rem); margin: 0 auto 1.25rem; }
.keepsake-vase { width: 82%; display: block; margin-inline: auto; }
.keepsake-sparkle { color: #b8854c; left: 0; top: .7rem; }
.keepsake-heart { color: #bd7588; right: -.6rem; bottom: 1.4rem; transform: rotate(13deg); }
#heart-burst { position: absolute; inset: 0; pointer-events: none; }
.particle {
  position: absolute;
  left: 50%;
  top: 55%;
  width: var(--size);
  height: var(--size);
  color: var(--color);
  animation: burst 1.05s var(--delay) cubic-bezier(.16,.58,.35,1) both;
}
.curtain { position: fixed; inset: 0; z-index: 5; background: #000; opacity: 0; pointer-events: none; }
body.transitioning .curtain { pointer-events: auto; }

@keyframes appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bob { 50% { transform: translateY(-5px) rotate(1.5deg); } }
@keyframes sway { 50% { rotate: -10deg; translate: 0 -4px; } }
@keyframes clay-sway { to { transform: scale(1.026, .97) rotate(2deg); } }
@keyframes clay-emerge {
  0% { transform: scale(0, 0); }
  24% { transform: scale(.27, .08); }
  65% { transform: scale(.9, 1.11) rotate(var(--entry-lean, 0deg)); }
  82% { transform: scale(1.05, .94); }
  100% { transform: scale(1); }
}
@keyframes scrapbook-pop {
  0% { opacity: 0; scale: .94; }
  62% { opacity: 1; scale: 1.018; }
  100% { opacity: 1; scale: 1; }
}
@keyframes clay-wheel { to { stroke-dashoffset: -65; } }
@keyframes clay-glaze { 50% { translate: 21px 0; opacity: .53; } }
@keyframes burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.45); }
  18% { opacity: 1; }
  65% { opacity: .94; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--spin)) scale(.65); }
}

@media (max-width: 430px) {
  .masthead { padding-top: 1.05rem; }
  .timeline li { grid-template-columns: minmax(6.6rem, auto) 1fr; gap: .55rem; padding-inline: .45rem; }
  .itinerary-sheet { padding-inline: .85rem; }
  .cover-star { left: -.8rem; width: 1.45rem; }
  .cover-heart { right: -.65rem; width: 2rem; }
}
@media (max-width: 340px) {
  .timeline li { grid-template-columns: 1fr; gap: .15rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
