@font-face { font-family: "Permanent Marker"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/permanent-marker-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jost-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/jost-latin-500-normal.woff2") format("woff2"); }

:root {
  --ground: #232120;
  --paper: #F3ECDF;
  --ink: #1F1D1B;
  --white: #FFFFFF;
  --soft: #E7E0D2;
  --muted: #D8D1C4;
  --dim: #A29B91;               /* helper text: quieter than field titles, still 5:1 on the ground */
  --line: rgba(243, 236, 223, 0.4);
  --pink: #FF5BA7;
  --pink-hover: #FF7DBA;
  --pink-line: rgba(255, 91, 167, 0.55);
  --error: #F4A99A;
  --marker: "Permanent Marker", "Marker Felt", "Comic Sans MS", cursive;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.07'/></svg>");
}

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

html { background: var(--ground); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--white);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  background:
    var(--grain),
    radial-gradient(ellipse 85% 60% at 50% 22%, #3A3633 0%, #2A2826 55%, var(--ground) 100%) top center / 100% 1500px no-repeat,
    var(--ground);
}

p, h1, h2, figure { margin: 0; }

[hidden] { display: none !important; }

/* Bunting and confetti spill past the column; clip here so the page never scrolls sideways */
.page { display: block; width: 100%; overflow-x: hidden; }
@supports (overflow: clip) { .page { overflow-x: clip; } }

.sheet {
  container-type: inline-size;
  max-width: 600px;
  margin: 0 auto;
  padding: clamp(14px, 4vw, 32px) clamp(20px, 6vw, 40px) clamp(56px, 12vw, 96px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ---------- Photo hung from the bunting (proportions match the printed invite) ----------
   The decor layers use the invite's own coordinates (card is 540 wide at x 330, y 88);
   the box runs from x -400 to 1600 so the bunting carries on across wide screens. */
.photo-wrap {
  position: relative;
  width: 82%;
  margin-top: 13.4%;            /* room for the bunting line and pegs above the card */
}

.decor {
  position: absolute;
  left: -135.19%;              /* -(400 + 330) / 540 */
  top: 0;
  margin-top: -16.3%;          /* -88 / 540 */
  width: 370.37%;              /* 2000 / 540 */
  height: auto;
  overflow: visible;           /* the bunting string runs on up past the top edge */
  pointer-events: none;
  z-index: 0;
}
.decor-front { z-index: 2; }

.snapshot {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 6.3% 6.3% 0;
  background: var(--paper);
  transform: rotate(-2deg);
  container-type: inline-size;
  box-shadow:
    0 22px 44px rgba(0, 0, 0, 0.55),
    0 3px 6px rgba(0, 0, 0, 0.35),
    inset 0 0 50px rgba(166, 132, 78, 0.28);
}

.snapshot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.snapshot figcaption {
  padding: 3.7cqw 0 7cqw;
  font-family: var(--marker);
  font-size: 8.15cqw;           /* 44px on the 540px-wide printed card */
  line-height: 1;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--ink);
  transform: rotate(-3deg);
}

/* ---------- Headline lock-up ---------- */
.intro { margin-top: 7.6cqw; }

.eyebrow {
  font-weight: 500;
  font-size: clamp(11px, 3.04cqw, 16px);
  letter-spacing: 0.28em;
  padding-left: 0.28em;
  text-transform: uppercase;
  color: var(--soft);
}

.title {
  margin-top: 2.7cqw;
  font-family: var(--marker);
  font-weight: 400;
  font-size: 16.4cqw;           /* "Stuart's" is 108px on the invite */
  line-height: 0.9;
  text-transform: uppercase;
  color: var(--white);
}
.title .line { display: block; }
.title .name { transform: translateX(-0.046em); }
.title .bday { margin-top: -0.056em; transform: translateX(-0.037em); }

.title .forty {
  font-size: 2.5em;             /* 270px "40" against 108px words */
  line-height: 0.9;
  margin-top: -0.037em;
}
.title .num {
  position: relative;
  display: inline-block;
  color: var(--pink);
  text-shadow: 0.0185em 0.022em 0 rgba(0, 0, 0, 0.35);
  transform: translateX(-0.096em) rotate(-3deg);
}
.title .ord {
  position: absolute;
  left: 100%;
  top: 0.517em;
  margin-left: -0.517em;
  font-size: 0.215em;           /* 58px "th" */
  line-height: 1;
}

/* ---------- When / Where ---------- */
.details {
  width: 100%;
  margin-top: 6.5cqw;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 3cqw;
}
.detail + .detail { border-left: 2px solid var(--pink-line); }

.icon { width: clamp(24px, 5.2cqw, 34px); height: auto; color: var(--pink); margin-bottom: 4px; }

.detail .main { font-weight: 500; font-size: clamp(15px, 4.1cqw, 22px); line-height: 1.25; color: var(--white); text-wrap: balance; }
.detail .sub { font-size: clamp(13px, 3.2cqw, 17px); line-height: 1.35; color: var(--muted); text-wrap: balance; }

.map-link {
  display: inline-block;
  margin-top: 2px;
  padding: 10px 4px;
  font-weight: 500;
  font-size: clamp(11px, 2.6cqw, 13px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pink);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-color: var(--pink-line);
}
.map-link:hover { color: var(--pink-hover); text-decoration-color: var(--pink-hover); }

/* ---------- Dress code & drinks ---------- */
.extras { margin-top: 6cqw; display: flex; flex-direction: column; align-items: center; }

.dress-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; }

.dress-label {
  font-weight: 500;
  font-size: clamp(11px, 2.3cqw, 14px);
  letter-spacing: 0.26em;
  padding-left: 0.26em;
  text-transform: uppercase;
  color: var(--pink);
}

.dress {
  padding: 0.28em 0.7em 0.22em;
  background: var(--pink);
  transform: rotate(-1.5deg);
  clip-path: polygon(1% 14%, 4% 4%, 30% 9%, 60% 2%, 96% 7%, 99% 22%, 98% 60%, 100% 88%, 70% 96%, 35% 92%, 5% 98%, 0% 80%, 2% 45%);
  font-family: var(--marker);
  font-size: clamp(19px, 4.9cqw, 30px);
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink);
}

.drinks {
  margin-top: 14px;
  font-size: clamp(13px, 2.9cqw, 17px);
  line-height: 1.45;
  color: var(--muted);
}
.drinks span { display: block; }

/* ---------- RSVP form ---------- */
.rsvp {
  width: 100%;
  max-width: 460px;
  margin-top: clamp(36px, 9cqw, 52px);
  padding-top: clamp(30px, 7cqw, 42px);
  border-top: 1px solid var(--line);
}

.rsvp-title {
  font-family: var(--marker);
  font-weight: 400;
  font-size: clamp(38px, 10cqw, 54px);
  line-height: 1;
  text-transform: uppercase;
  color: var(--pink);
}

.rsvp-intro { margin: 10px 0 28px; font-size: clamp(15px, 3.6cqw, 18px); color: var(--muted); }

form { display: flex; flex-direction: column; gap: 24px; text-align: left; }

.field { display: flex; flex-direction: column; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }

.field > label,
.field > legend {
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--soft);
  padding: 0;
}
.field > legend { margin-bottom: 12px; }

.optional { color: var(--dim); letter-spacing: 0.06em; text-transform: none; font-weight: 400; }

input[type="text"],
textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.4;
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
textarea { resize: vertical; min-height: 5em; }
input[type="text"]:focus,
textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 1px var(--pink); }

.hint { font-size: 14px; color: var(--dim); }

.guest-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.guest-count { width: 100%; font-size: 13px; color: var(--dim); }
.guest-chip {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 91, 167, 0.16);
  border: 1px solid var(--pink-line);
  font-size: 15px;
  line-height: 1.2;
  color: var(--white);
}

.options { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.options input {
  position: absolute;
  top: 0; left: 0;
  opacity: 0;
  width: 1px; height: 1px;
  margin: 0;
  pointer-events: none;
}

.options label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
  color: var(--white);
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.options label:hover { border-color: var(--pink); }
.options input:checked + label { background: var(--pink); border-color: var(--pink); color: var(--ink); }
.options input:focus-visible + label { outline: 2px solid var(--white); outline-offset: 3px; }

.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.error { font-size: 15px; line-height: 1.5; color: var(--error); }

/* Matches the RSVP pill on the invite */
.submit {
  align-self: stretch;
  min-height: 62px;
  margin-top: 6px;
  padding: 14px 28px;
  background: var(--pink);
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(255, 91, 167, 0.22), 0 14px 28px rgba(0, 0, 0, 0.45);
  font-family: var(--marker);
  font-size: 26px;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .2s;
}
.submit:hover:not(:disabled) { background: var(--pink-hover); }
.submit:focus-visible { outline: 2px solid var(--white); outline-offset: 8px; }
.submit:disabled { opacity: .6; cursor: progress; }

.thanks { display: flex; flex-direction: column; align-items: center; gap: 12px; outline: none; }
.thanks-title { font-family: var(--marker); font-size: clamp(30px, 8cqw, 42px); line-height: 1.1; text-transform: uppercase; color: var(--pink); }
.thanks-body { text-wrap: balance; font-size: 18px; line-height: 1.5; color: var(--soft); max-width: 32ch; }

/* Add to calendar (shown after a "yes") */
.add-cal { width: 100%; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.cal-title { font-weight: 500; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--soft); }
.cal-buttons { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
.cal-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  padding: 10px 18px;
  border: 1.5px solid var(--pink);
  border-radius: 999px;
  font-weight: 500;
  font-size: 17px;
  line-height: 1.2;
  color: var(--white);
  text-decoration: none;
  transition: background-color .2s, color .2s;
}
.cal-btn span { font-weight: 400; font-size: 13px; color: var(--dim); }
.cal-btn:hover { background: var(--pink); color: var(--ink); }
.cal-btn:hover span { color: var(--ink); }
.cal-btn:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }
.cal-note { margin-top: 12px; font-size: 14px; color: var(--dim); }

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