/* Jamie & Stefan. The site is designed like a stationery suite: paper, hairlines,
   one serif, small spaced capitals for dates, and the watercolour flowers as the only ornament. */

:root {
  --paper: #fbf8f1;
  --wash: #f8eeea;
  --card: #fffdf9;
  --ink: #2b332e;
  --soft: #636b64;
  --green: #50674c;
  --green-deep: #3b5238;
  --on-green: #f4f0e6;
  --coral: #cf9084;   /* blush, decorative and large type only */
  --sage-ink: #566b50; /* sage dark enough for small text */
  --leaf: #8a9a78;
  --rule: #dcd7ca;
  --field-border: #878477;
  --error-ink: #973e30;
  --display: "Cormorant Garamond", "Cormorant", Garamond, Georgia, serif;
  --text: "Hanken Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --measure: 34rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  /* A faint paper grain so flat colour doesn't look like a screen. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .24 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 6rem; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper) var(--grain);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
::selection { background: #f4dcd5; }

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); transition: color 0.2s, text-decoration-color 0.2s; }
a:hover { color: var(--sage-ink); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--sage-ink); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.05; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(2.5rem, 5.6vw, 4rem); letter-spacing: -0.012em; }
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

.wrap { max-width: 78rem; margin: 0 auto; padding-inline: var(--gutter); }
.caps { font-size: 0.85rem; letter-spacing: 0.02em; }
.prose { max-width: var(--measure); }
.prose p { color: #333d37; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: 0.5rem 0.75rem; z-index: 30; }

/* Monogram: the hand-lettered J & S */
.mono { display: block; flex: none; line-height: 0; }
.mono img { width: 4.6rem; height: auto; }
footer .mono { display: inline-block; margin-bottom: 1.5rem; }
footer .mono img { width: 8.5rem; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 2.75rem;
  background: var(--green); color: var(--on-green);
  border: 0; border-radius: 999px;
  padding: 0.8rem 1.9rem 0.9rem;
  font: 400 1.25rem/1.1 var(--display);
  text-decoration: none; cursor: pointer;
  transition: background 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
  box-shadow: none;
}
.button:hover { background: var(--green-deep); color: var(--on-green); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { opacity: 0.65; cursor: wait; }

/* Navigation */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 20; transition: background 0.3s, box-shadow 0.3s; }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.6rem; }
.nav .mono { display: grid; place-items: center; min-height: 2.75rem; }
.nav.scrolled { background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--rule); }
.nav nav { display: flex; align-items: center; gap: clamp(0.9rem, 2.6vw, 2.2rem); }
.nav nav a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem;
  text-decoration: none; font-family: var(--display); font-size: 1.25rem; line-height: 1.1;
}
.nav nav a:not(.pill):hover { text-decoration: underline; }
.nav nav a.pill { background: var(--green); color: var(--on-green); border-radius: 999px; padding-inline: 1.1rem; }
.nav nav a.pill:hover { background: var(--green-deep); }
.nav.static { position: static; }
@media (max-width: 30rem) {
  .nav .wrap { gap: 0.5rem; padding-inline: 1rem; }
  .nav .mono img { width: 3.25rem; }
  .nav nav { gap: clamp(0.25rem, 1.7vw, 0.75rem); }
  .nav nav a { font-size: 1.125rem; padding-inline: 0.2rem; }
  .nav nav a.pill { padding-inline: 0.65rem; }
}

/* Hero: the invitation */
.hero {
  min-height: 100svh; max-width: 69rem;
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(2.2rem, 6vw, 5.25rem);
  padding-block: clamp(5.25rem, 12vh, 7rem) clamp(3rem, 6vh, 4.5rem);
}
.invite { text-align: center; }
.invite .pre { font-family: var(--display); font-style: italic; font-size: clamp(1.25rem, 2vw, 1.5rem); color: var(--soft); margin: 0 0 clamp(1rem, 2.4vw, 1.75rem); }
.invite h1 { font-size: clamp(4rem, 8.4vw, 7rem); line-height: 0.9; letter-spacing: -0.015em; }
.invite h1 span { display: block; }
.invite h1 .amp { font-size: 0.45em; line-height: 1.24; color: var(--coral); letter-spacing: 0; }
.invite .when { font-family: var(--display); font-size: clamp(1.35rem, 2.2vw, 1.65rem); line-height: 1.3; margin: clamp(1.5rem, 3vw, 2.25rem) 0 0; }
.invite .where { font-family: var(--display); font-size: clamp(1.15rem, 1.8vw, 1.35rem); line-height: 1.3; color: var(--soft); margin: 0.2rem 0 0; }
.invite .cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.9rem 1.5rem; margin-top: clamp(1.75rem, 3.5vw, 2.5rem); }

.arch { position: relative; width: min(100%, 25rem, 57svh); margin-inline: auto; }
.arch::before { content: ""; position: absolute; inset: -0.85rem; border: 1px solid var(--coral); border-radius: 999px 999px 1.1rem 1.1rem; pointer-events: none; }
.arch .photo { width: 100%; aspect-ratio: 3 / 4.15; object-fit: cover; object-position: 50% 30%; border-radius: 999px 999px 0.5rem 0.5rem; }
.arch .spray { position: absolute; width: 58%; left: -27%; bottom: -9%; transform: rotate(-8deg); filter: drop-shadow(0 6px 10px rgb(60 40 20 / 0.12)); pointer-events: none; }

@media (max-width: 46rem) {
  .hero { min-height: 0; grid-template-columns: 1fr; padding-block: 5.75rem 2.75rem; gap: 2.55rem; }
  .invite .pre { margin-bottom: 0.9rem; }
  .invite h1 { font-size: clamp(2.8rem, 11.75vw, 5.6rem); line-height: 1; }
  .invite h1 span { display: inline-block; }
  .invite h1 .amp { font-size: 0.75em; }
  .invite .when { margin-top: 1.15rem; }
  .invite .cta { margin-top: 1.4rem; }
  .arch { width: min(80%, 22rem); }
  .arch .photo { aspect-ratio: 4 / 4.5; }
  .arch .spray { width: 50%; left: -19%; bottom: -7%; }
}

/* Entrance: the invitation sets itself line by line. */
.js .hero .rise { transform: translateY(8px); animation: rise 0.4s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 25ms); }
.js .hero .arch { animation: unveil 0.55s var(--ease) both; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes unveil { from { opacity: 0.45; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* The hero flowers sway once as the page opens, and again when you hover the photo. */
.js .hero .arch .spray { transform-origin: 20% 90%; animation: sway 2.6s 0.5s ease-in-out both; }
@media (hover: hover) { .js .hero .arch:hover .spray { animation: sway-again 2.2s ease-in-out both; } }
@keyframes sway { 0%, 100% { rotate: 0deg; } 25% { rotate: 3.5deg; } 55% { rotate: -2deg; } 80% { rotate: 1deg; } }
@keyframes sway-again { 0%, 100% { rotate: 0deg; } 25% { rotate: 3.5deg; } 55% { rotate: -2deg; } 80% { rotate: 1deg; } }

/* The route draws itself from Florence to the Borgo, then the flowers land on the Borgo. */
.js .map .route-draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .map.in-view .route-draw { stroke-dashoffset: 0; transition: stroke-dashoffset 1.5s cubic-bezier(0.45, 0, 0.25, 1); }
.js .map.in-view .route-draw.south { transition-duration: 0.8s; transition-delay: 1.7s; }
.js .map .borgo-pin { transform-box: fill-box; transform-origin: 50% 50%; opacity: 0; scale: 0.4; }
.js .map.in-view .borgo-pin { opacity: 1; scale: 1; transition: opacity 0.35s 1.35s, scale 0.6s 1.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
.js .map .borgo-label { opacity: 0; transition: opacity 0.5s 1.6s; }
.js .map.in-view .borgo-label { opacity: 1; }

/* A wax seal presses onto the letter, under your names. */
.letter-seal { display: block; width: 3.75rem; height: auto; margin: 1rem auto 0; rotate: -8deg; filter: drop-shadow(0 5px 7px rgb(80 20 20 / 0.22)); }
.js .letter-seal { opacity: 0; }
.js .letter-seal.in-view { animation: letter-seal-press 0.7s 0.15s cubic-bezier(0.3, 0, 0.2, 1) both; }
@keyframes letter-seal-press {
  0% { opacity: 0; scale: 1.7; rotate: -20deg; filter: drop-shadow(0 24px 20px rgb(80 20 20 / 0.15)); }
  55% { opacity: 1; scale: 0.9; rotate: -6deg; filter: drop-shadow(0 3px 4px rgb(80 20 20 / 0.3)); }
  75% { scale: 1.04; }
  100% { opacity: 1; scale: 1; rotate: -8deg; filter: drop-shadow(0 5px 7px rgb(80 20 20 / 0.22)); }
}
@media (prefers-reduced-motion: reduce) {
  .js .hero .rise, .js .hero .arch { transform: none; animation: none; }
  .js .hero .arch .spray, .js .hero .arch:hover .spray { animation: none; }
  .js .map .route-draw { stroke-dashoffset: 0; transition: none; }
  .js .map .borgo-pin, .js .map .borgo-label { opacity: 1; scale: 1; transition: none; }
  .js .letter-seal { opacity: 1; animation: none; }
  .button, .nav, a { transition: none; }
}

/* Sections */
section { padding-block: clamp(4.5rem, 10vw, 9rem); }
.sprig { width: clamp(10rem, 22vw, 14rem); margin: 0 auto 1.25rem; }
.head { text-align: center; max-width: 40rem; margin-inline: auto; }
.head p { margin-top: 1rem; color: var(--soft); }

/* The letter */
.letter { text-align: center; padding-top: clamp(3rem, 7vw, 6rem); padding-bottom: clamp(3.5rem, 8vw, 6.5rem); }
.letter .lede { font-family: var(--display); font-weight: 400; font-size: clamp(1.7rem, 3.5vw, 2.7rem); line-height: 1.24; max-width: 23em; margin: 0 auto; }
.letter .dear { font-family: var(--display); font-style: italic; font-size: clamp(1.5rem, 2.6vw, 2rem); color: var(--sage-ink); margin-bottom: 1.25rem; }
.letter .dear[hidden] { display: none; }
.letter .signed { font-family: var(--display); font-style: italic; font-size: 1.5rem; margin-top: 1.5rem; color: var(--soft); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 56rem; margin: clamp(2.5rem, 6vw, 4.5rem) auto 0; border-block: 1px solid var(--rule); }
.facts > div { padding: 1.6rem 1rem; }
.facts > div + div { border-left: 1px solid var(--rule); }
.facts dt { color: var(--sage-ink); margin-bottom: 0.5rem; }
.facts dd { margin: 0; font-family: var(--display); font-size: 1.4rem; line-height: 1.2; }
.facts dd small { display: block; font-family: var(--text); font-size: 0.9rem; color: var(--soft); margin-top: 0.3rem; }
@media (max-width: 40rem) {
  .facts { grid-template-columns: 1fr; }
  .facts > div + div { border-left: 0; border-top: 1px solid var(--rule); }
}

/* A full-width photograph between the letter and the schedule */
.banner { margin: 0; }
.banner img { width: 100%; height: clamp(18rem, 52vw, 40rem); object-fit: cover; object-position: 50% 62%; }

/* Schedule */
.schedule { background: var(--wash) var(--grain); }
.days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: clamp(2.5rem, 6vw, 4.5rem); align-items: start; }
.day { padding: 1.75rem 1.5rem 2rem; border-radius: 1.1rem; border: 1px solid transparent; }
.day header { display: flex; align-items: flex-end; gap: 0.9rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--rule); }
.day .num { font-family: var(--display); font-weight: 400; font-size: 4.4rem; line-height: 0.74; color: var(--coral); font-variant-numeric: lining-nums; }
.day .caps { margin: 0 0 0.3rem; color: var(--soft); }
.day h3 { font-size: 1.9rem; }
.day ul { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.day li { display: grid; grid-template-columns: 1.6rem 1fr; gap: 0.85rem; align-items: start; padding: 0.8rem 0; }
.day li + li { border-top: 1px dashed var(--rule); }
.day li svg { width: 1.5rem; height: 1.5rem; margin-top: 0.1rem; color: var(--leaf); }
.day li small { display: block; font-size: 0.9rem; line-height: 1.45; color: var(--soft); }
.day .wear { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--rule); font-size: 0.9rem; color: var(--soft); }
.day .wear b { display: block; color: var(--ink); margin-bottom: 0.3rem; }
.day.main { background: var(--card); border-color: var(--rule); box-shadow: 0 30px 60px -40px rgb(60 45 20 / 0.45); position: relative; }
.day.main li svg { color: var(--coral); }
@media (max-width: 68rem) { .days { grid-template-columns: 1fr 1fr; } }
@media (max-width: 40rem) {
  .days { grid-template-columns: 1fr; gap: 0.5rem; }
  .day { padding-inline: 0.25rem; }
  .day.main { padding-inline: 1.25rem; margin-inline: -0.25rem; }
}

/* The Borgo */
.place .frame { position: relative; margin: clamp(2.5rem, 6vw, 4.5rem) 0 0; }
.place .frame img { width: 100%; border-radius: 1.1rem; }
.place .frame figcaption { margin-top: 0.6rem; font-size: 0.85rem; color: var(--soft); }
.place .card {
  position: absolute; right: clamp(1rem, 4vw, 3rem); bottom: -3.5rem; width: min(22rem, 80%);
  background: var(--card); border: 1px solid var(--rule); border-radius: 0.9rem; padding: 1.6rem 1.75rem;
  box-shadow: 0 30px 60px -36px rgb(60 45 20 / 0.5);
}
.place .card dl { margin: 0; display: grid; gap: 1rem; }
.place .card dt { color: var(--sage-ink); margin-bottom: 0.25rem; }
.place .card dd { margin: 0; font-family: var(--display); font-size: 1.4rem; line-height: 1.25; }
.place .card dd.addr { font-family: var(--text); font-size: 0.9rem; line-height: 1.5; }
.cols { display: grid; grid-template-columns: 1fr 1fr 15rem; gap: clamp(2rem, 5vw, 5rem); margin-top: clamp(5.5rem, 9vw, 7.5rem); align-items: start; }
.cols h3 { font-size: clamp(1.9rem, 3vw, 2.4rem); margin-bottom: 1rem; }
.map { width: 100%; max-width: 15rem; margin-inline: auto; color: var(--ink); }
.map text { font-family: var(--display); font-size: 16px; fill: var(--ink); }
.map text.it { font-size: 17px; fill: var(--leaf); }
.map text.here { fill: var(--sage-ink); }
.map text.sub { font-family: var(--text); font-size: 11px; opacity: 0.7; }
@media (max-width: 62rem) {
  .cols { grid-template-columns: 1fr 1fr; }
  .cols .map { grid-column: 1 / -1; }
}
@media (max-width: 44rem) {
  .place .card { position: static; width: auto; margin-top: 1rem; box-shadow: none; }
  .cols { grid-template-columns: 1fr; margin-top: 3.5rem; }
}

/* Photographs, laid out like prints on a table */
.prints { padding-block: 0 clamp(2rem, 5vw, 4rem); }
.prints .wrap { position: relative; display: flex; justify-content: center; align-items: flex-start; }
.print { margin: 0; background: #fff; padding: 0.7rem; box-shadow: 0 1px 2px rgb(40 30 20 / 0.1), 0 28px 50px -26px rgb(40 30 20 / 0.45); }
.print img { width: 100%; }
.print.a { width: 34%; rotate: -2.6deg; z-index: 1; }
.print.b { width: 52%; rotate: 1.7deg; margin: 7rem 0 0 -3%; }
.prints .spray { position: absolute; width: clamp(8rem, 17vw, 13rem); right: 6%; top: -3.5rem; rotate: 24deg; pointer-events: none; }
.prints.flip { padding-block: clamp(4.5rem, 10vw, 9rem) 0; }
.prints.flip .wrap { flex-direction: row-reverse; }
.prints.flip .print.a { width: 30%; rotate: 2.2deg; }
.prints.flip .print.b { rotate: -1.6deg; margin: 5rem -3% 0 0; }
@media (max-width: 40rem) {
  .prints .wrap { flex-direction: column; }
  .print { padding: 0.5rem; }
  .print.a { width: 72%; }
  .print.b, .prints.flip .print.b { width: 86%; align-self: flex-end; margin: -2.5rem 0 0; }
  .prints.flip .wrap { flex-direction: column; }
  .prints.flip .print.a { width: 66%; }
  .prints .spray { right: -1rem; top: -2rem; }
}

/* Questions */
.faq { padding-block-end: clamp(2.25rem, 5vw, 4rem); }
.faq .wrap { display: grid; grid-template-columns: 1fr 1.8fr; gap: 2rem clamp(2rem, 6vw, 6rem); align-items: start; }
.faq .side p { margin-top: 1rem; color: var(--soft); max-width: 20rem; }
@media (max-width: 52rem) { .faq .wrap { grid-template-columns: 1fr; } }
.faq .list { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 1.35rem 0;
  font-family: var(--display); font-weight: 400; font-size: clamp(1.4rem, 2.4vw, 1.7rem); line-height: 1.2;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 0.9rem; height: 0.9rem;
  background: linear-gradient(var(--coral), var(--coral)) center / 100% 1px no-repeat, linear-gradient(var(--coral), var(--coral)) center / 1px 100% no-repeat;
  transition: rotate 0.35s var(--ease);
}
.faq details[open] summary::after { rotate: 45deg; }
.faq summary:hover { color: var(--sage-ink); }
.faq details p { margin: -0.35rem 0 1.5rem; color: var(--soft); max-width: var(--measure); }

/* Closing */
.closing { padding-block: clamp(1.1rem, 2vw, 1.75rem) clamp(3.5rem, 7vw, 6rem); }
.closing .wrap {
  display: grid; grid-template-columns: minmax(0, 27rem) minmax(0, 28rem); align-items: center;
  justify-content: center; gap: clamp(2.5rem, 7vw, 6rem);
}
.closing h2 { font-size: clamp(3rem, 6vw, 5.4rem); text-wrap: initial; }
.closing h2 em { display: inline-block; font-style: normal; color: var(--coral); }
.closing .print { width: 100%; max-width: 27rem; margin: 0; rotate: -2deg; }
.closing-photo { display: block; overflow: hidden; }
.closing-photo img { aspect-ratio: 4 / 3; object-fit: cover; transform: scale(1.4); transform-origin: 52% 61%; }
.closing p { margin: 1rem 0 1.5rem; color: var(--soft); max-width: 28rem; }
@media (max-width: 46rem) {
  .closing { text-align: center; }
  .closing .wrap { grid-template-columns: minmax(0, 27rem); gap: 1.9rem; }
  .closing .print { width: calc(100% - 1rem); margin-inline: auto; }
  .closing p { margin-inline: auto; }
}

footer { padding-block: 2.5rem 3rem; font-size: 0.9rem; color: var(--soft); text-align: center; border-top: 1px solid var(--rule); }
footer p { margin: 0.2rem 0; }

.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 0.22em; cursor: pointer; }
.linkish:hover { color: var(--sage-ink); }
footer [hidden] { display: none; }

.contact {
  width: min(100%, 65rem); margin-inline: auto;
  padding: clamp(1.25rem, 5vh, 3rem) clamp(1rem, 4vw, 2.5rem) 2rem;
}
.contact:has(.contact-confirmation:not([hidden])) {
  display: grid; align-content: center; min-height: 100svh; max-width: 36rem;
  padding-block: 1.5rem 3.5rem;
}
.contact-masthead { margin-bottom: clamp(0.875rem, 2.5vw, 1.5rem); }
.contact:has(.contact-confirmation:not([hidden])) .contact-masthead { display: none; }
.contact-back {
  display: inline-flex; align-items: center; vertical-align: top;
  min-height: 2.75rem; color: var(--soft); font: 400 1rem/1.5 var(--text);
  text-decoration: none; transition: none;
}
.contact-back:hover { color: var(--ink); text-decoration: none; }
.contact-back-label {
  text-decoration: underline color-mix(in srgb, currentColor 55%, transparent);
  text-underline-offset: 0.24em;
}
.contact-card {
  --contact-inset: clamp(1.2rem, 4.2vw, 3.25rem);
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  border: 1px solid var(--rule); border-radius: 1rem; background: var(--card);
}
.contact-card[hidden] { display: none; }
.contact-intro {
  position: relative; isolation: isolate; overflow: clip;
  padding: var(--contact-inset); background: #f3eddf var(--grain);
  border-radius: 0.95rem 0 0 0.95rem; border-inline-end: 1px solid var(--rule);
}
.contact-intro h1 {
  font-size: clamp(2.25rem, 4vw, 3rem); line-height: 1.06;
  letter-spacing: -0.018em;
}
.contact-intro p {
  max-width: 28ch; margin: 0.75rem 0 0; color: var(--soft);
  font-size: 1.0625rem; line-height: 1.55; text-wrap: balance;
}
.contact-flowers {
  position: absolute; z-index: -1; inset: auto 0.5rem 0.5rem auto;
  width: clamp(10.5rem, 21vw, 15rem);
}
.contact-compose { min-width: 0; padding: var(--contact-inset); }
.contact-compose fieldset {
  min-inline-size: 0; margin: 0; padding: 0; border: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 1rem;
}
.contact-field { min-width: 0; }
.contact-field label { display: block; margin-bottom: 0.375rem; font: 500 1rem/1.5 var(--text); }
.contact-field input, .contact-field textarea {
  display: block; width: 100%; min-height: 2.875rem; padding: 0.55rem 0.75rem;
  font: 400 1rem/1.5 var(--text); color: var(--ink); background: var(--paper);
  border: 1px solid var(--field-border); border-radius: 0.5rem;
}
.contact-message, .contact-actions { grid-column: 1 / -1; }
.contact-message textarea { resize: vertical; }
.contact-actions { display: grid; justify-items: start; }
.contact-actions .button {
  min-inline-size: 9rem; border-radius: 0.5rem; padding: 0.625rem 1.25rem;
  font: 600 1rem/1.5 var(--text); transition: none;
}
.contact-actions .button:active:not(:disabled) { transform: none; }
#contact-status { margin: 0.85rem 0 0; color: var(--error-ink); }
#contact-status:empty { margin: 0; }
.contact-confirmation { padding: 0; text-align: center; }
.contact-confirmation img { width: clamp(7.5rem, 32vw, 10rem); margin: 0 auto 0.375rem; }
.contact-confirmation h1 { font-size: clamp(2.5rem, 7vw, 3.5rem); letter-spacing: -0.018em; }
.contact-confirmation p { margin: 0.5rem 0 0; color: var(--soft); line-height: 1.5; text-wrap: balance; }
.contact-confirmation-back { margin-top: 1rem; }
@media (min-width: 46.01rem) {
  .contact-intro { min-height: 28rem; }
  .contact-confirmation img { width: 9.5rem; margin-bottom: 0.625rem; }
  .contact-confirmation h1 { font-size: 3rem; }
}
@media (max-width: 46rem) {
  .contact { width: min(100%, 38rem); padding-top: 1.25rem; }
  .contact-card { grid-template-columns: minmax(0, 1fr); }
  .contact-intro { border-radius: 0.95rem 0.95rem 0 0; border-inline-end: 0; border-bottom: 1px solid var(--rule); }
  .contact-intro p { max-width: 23ch; }
  .contact-flowers { inset: 0.35rem 0.35rem auto auto; width: clamp(3.5rem, 16vw, 7rem); }
}
@media (max-width: 30rem) {
  .contact-compose fieldset { grid-template-columns: minmax(0, 1fr); }
  .contact-actions .button { justify-self: stretch; }
}

/* The sign-in card occupies the page until the invitation opens. */
html.locked body > :not(.gate) { display: none; }
.gate {
  --gate-paper: #fffdf7;
  --gate-text-soft: #535c53;
  min-height: 100svh; display: grid; grid-template-rows: minmax(min-content, 1fr) auto;
  place-items: center; padding: 1.25rem 0.875rem 0;
  font: 400 1rem/1.5 var(--text); background: #e9e7e1 var(--grain);
}
.gate-stage { position: relative; display: grid; justify-items: center; width: min(100%, 32.5rem); }
.gate-card-window { display: contents; }
.gate-envelope { display: none; }
.gate-content {
  position: relative; isolation: isolate; width: 100%;
  padding: clamp(5.95rem, 18vw, 7.35rem) clamp(1.45rem, 5vw, 3.65rem) 2.75rem;
  text-align: center; background: var(--gate-paper); border: 1px solid #cfc5b5;
  border-radius: 0.625rem; box-shadow: 0 14px 26px -23px #514537a0;
}
.gate-content::before {
  content: ""; position: absolute; inset: 0.65rem; z-index: -2;
  border: 1px solid #d7c8b4; border-radius: 0.25rem; pointer-events: none;
}
.gate-brand { margin-bottom: 1.65rem; }
.gate-spray {
  position: absolute; top: -0.8rem; right: -0.25rem; z-index: -1;
  width: clamp(5.2rem, 24vw, 6.75rem); pointer-events: none;
}
.gate-wordmark {
  font: 400 clamp(2.15rem, 10.7vw, 3.5rem)/1.1 "Pinyon Script", "Snell Roundhand", cursive;
  text-wrap: wrap;
}
.gate-ampersand { margin-inline: 0.08em; font: 400 0.64em/1 var(--display); }
.gate-when { margin: 0.55rem 0 0; color: var(--gate-text-soft); font: 500 0.95rem/1.35 var(--text); }
.gate-entry { width: min(89%, 19rem); margin-inline: auto; }
.gate form { display: grid; gap: 0.65rem; }
.gate-field { position: relative; text-align: left; min-width: 0; }
.gate label {
  position: absolute; top: 0; left: 0.55rem; transform: translateY(-50%);
  padding-inline: 0.2rem; color: var(--gate-text-soft); background: var(--gate-paper);
  font-size: 0.75rem; opacity: 0; pointer-events: none;
}
.gate input:focus + label, .gate input:not(:placeholder-shown) + label { opacity: 1; }
.gate input {
  display: block; width: 100%; min-height: 2.875rem; padding: 0.56rem 0.7rem;
  font: inherit; color: var(--ink); background: var(--gate-paper); border: 1px solid #858576;
}
.gate input, .gate .button { border-radius: 0.375rem; }
.gate input::placeholder { color: #73766c; opacity: 1; }
.gate input:focus::placeholder { opacity: 0; }
.gate input[aria-invalid="true"] { border-color: var(--error-ink); }
.gate .button {
  min-height: 2.875rem; padding: 0.55rem 0.9rem; color: var(--gate-paper);
  border: 1px solid transparent; font: 600 1rem/1.5 var(--text);
}
.gate-error { margin: 0.4rem 0 0; font-size: 0.95rem; color: var(--error-ink); }
.gate-error:empty { display: none; }
.gate-note { margin: 0; color: var(--gate-text-soft, var(--soft)); overflow-wrap: anywhere; }
.gate-sent { font-size: 2rem; }
.gate-sent:focus { outline: none; }
.gate-footer { padding: 0 0 0.65rem; border: 0; color: var(--gate-text-soft); }
.gate-footer a, .gate-edit { display: inline-flex; align-items: center; min-height: 2.75rem; }
.gate-edit { justify-self: center; }

@media (prefers-reduced-motion: no-preference) {
  .gate-stage.gate-opening {
    --opening-time: 2.30s;
    --envelope-inset: 6%;
    --envelope-overhang: clamp(1.25rem, 7vh, 3.25rem);
    --envelope-descent: cubic-bezier(0.21, 0, 0.1, 1);
    padding-block: 2rem var(--envelope-overhang);
    margin-block: -2rem calc(0px - var(--envelope-overhang));
    mask-image: linear-gradient(to bottom, black calc(100% - var(--envelope-overhang) + 0.3rem), transparent);
    isolation: isolate;
  }
  .gate-stage.gate-opening .gate-card-window {
    display: grid;
    grid-area: 1 / 1;
    width: 100%;
    z-index: 1;
    animation: gate-letterpress-pocket-mask var(--opening-time) var(--envelope-descent) both;
  }
  .gate-stage.gate-opening .gate-content {
    transform-origin: center top;
    animation: gate-letterpress-rise var(--opening-time) ease-in-out both,
               gate-letterpress-grow var(--opening-time) ease-in-out both;
  }
  .gate-stage.gate-opening .gate-spray { visibility: hidden; }
  .contact-flowers, .gate-stage.gate-blooming .gate-spray {
    transform-origin: 14% 86%;
    mask-image: linear-gradient(46deg, black 40%, transparent 59%);
    mask-size: 270% 270%;
    mask-repeat: no-repeat;
    animation: gate-letterpress-bouquet 1.45s cubic-bezier(0.36, 0.12, 0.5, 1) both;
  }
  .gate-stage.gate-opening .gate-envelope {
    display: contents;
    pointer-events: none;
  }
  .gate-envelope-back, .gate-envelope-pocket, .gate-envelope-flap {
    position: absolute;
    grid-area: 1 / 1;
    inset: 38% var(--envelope-inset) 14%;
    transform-origin: center top;
    animation: gate-letterpress-envelope var(--opening-time) var(--envelope-descent) both;
  }
  .gate-envelope-back {
    z-index: 0;
    border-radius: 0.35rem;
    border: 1px solid #b29575;
    background: #c5aa8c;
    box-shadow: 0 20px 28px -19px #5949399c;
  }
  .gate-envelope-pocket {
    border-radius: 0.35rem;
    filter: drop-shadow(0 -1px 1px #694c3333);
    animation: gate-letterpress-envelope var(--opening-time) var(--envelope-descent) both,
               gate-letterpress-pocket-layer var(--opening-time) step-end both;
  }
  .gate-envelope-pocket::before, .gate-envelope-pocket::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
  }
  .gate-envelope-pocket::before {
    clip-path: polygon(0 0, 50% 61%, 100% 0, 100% 100%, 0 100%);
    background: linear-gradient(126deg, #d3b797, #f4e9d8 53%, #cfb091);
    box-shadow: inset 0 0 0 1px #9c76563d;
  }
  .gate-envelope-pocket::after {
    clip-path: polygon(0 100%, 50% 61%, 100% 100%);
    background: linear-gradient(165deg, #c5a381, #eadac3 70%, #e4cfb3);
  }
  .gate-envelope-flap {
    filter: drop-shadow(0 2px 1px #694c333d);
    animation: gate-letterpress-envelope var(--opening-time) var(--envelope-descent) both,
               gate-letterpress-flap var(--opening-time) ease-in-out both;
  }
  .gate-envelope-flap::before {
    content: "";
    position: absolute;
    inset: 0 0 38%;
    border-radius: 0.35rem 0.35rem 0 0;
    clip-path: polygon(0 0, 100% 0, 52% 96%, 48% 96%);
    background: linear-gradient(#e9d8c0, #dcc2a2);
  }
  .gate-envelope-seal {
    position: absolute;
    left: 50%;
    bottom: 38%;
    width: clamp(1.875rem, 8.3vw, 2.5rem);
    aspect-ratio: 1;
    transform: translate(-50%, 10%);
    background: url("art/wax-seal-embossed.png") center / contain no-repeat;
    filter: drop-shadow(0 1px 1px #44201b66);
    animation: gate-letterpress-seal var(--opening-time) linear both;
  }
}
@keyframes gate-letterpress-rise {
  /* The card becomes opaque while it is still tucked behind the pocket. */
  0% { opacity: 0; animation-timing-function: step-end; }
  0%, 21.5% { translate: 0 89%; }
  28.5% { opacity: 1; }
  55% { translate: 0 -4.5%; }
  88%, 100% { opacity: 1; translate: 0 0; }
}
@keyframes gate-letterpress-grow {
  0%, 45% { scale: 0.8; }
  88%, 100% { scale: 1; }
}
@keyframes gate-letterpress-pocket-mask {
  /* The pocket covers this entire edge as the envelope moves downward. */
  0%, 28% {
    clip-path: inset(-2rem -1rem 18%);
    animation-timing-function: var(--envelope-descent);
  }
  88%, 100% { clip-path: inset(-2rem -1rem -41%); }
}
@keyframes gate-letterpress-envelope {
  0%, 28% {
    opacity: 1;
    translate: 0 0;
    rotate: 0deg;
    scale: 1;
    animation-timing-function: var(--envelope-descent);
  }
  70% { opacity: 1; }
  88%, 100% { translate: 0 113%; rotate: -2.5deg; scale: 0.95; }
  100% { opacity: 0; }
}
@keyframes gate-letterpress-pocket-layer {
  0% { z-index: 2; }
  56%, 100% { z-index: 0; }
}
@keyframes gate-letterpress-flap {
  0%, 13% { transform: perspective(650px) rotateX(0); z-index: 3; }
  27% { transform: perspective(650px) rotateX(170deg); z-index: 3; animation-timing-function: step-end; }
  28%, 100% { transform: perspective(650px) rotateX(170deg); z-index: 0; }
}
@keyframes gate-letterpress-seal {
  0%, 18% { opacity: 1; }
  21%, 100% { opacity: 0; }
}
@keyframes gate-letterpress-bouquet {
  /* Sweep through the watercolor from the stem end toward the petals. */
  0% { mask-position: right top; transform: rotate(-3.5deg) scale(0.96); }
  80% { transform: rotate(0.4deg); }
  100% { mask-position: left bottom; transform: none; }
}

@media (orientation: landscape) and (max-height: 31rem) {
  .gate { padding-top: 0.75rem; }
  .gate-stage.gate-opening { --envelope-overhang: 0.9rem; }
  .gate-content { padding-block: 3.25rem 0.5rem; }
  .gate-brand { margin-bottom: 0.75rem; }
  .gate-spray { top: -0.45rem; width: 3.2rem; }
  .gate-wordmark { font-size: 3rem; }
  .gate-footer { padding-bottom: 0; }
}
