@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-display: swap; src: url("../fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-weight: 400; font-display: swap; src: url("../fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-weight: 500; font-display: swap; src: url("../fonts/eb-garamond-latin-500-normal.woff2") format("woff2"); }

:root {
  --paper: #f1ebe4;
  --olive: #66583d;
  --brown: #4a2f1d;
  --emboss-face: #f6f0e9;
  --emboss-shade: rgb(138 102 66 / .66);
  --emboss-light: #fffdf9;
  --display: "Cormorant Garamond", Garamond, serif;
  --body: "EB Garamond", Garamond, serif;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--paper) url("../art/paper.webp") repeat;
  background-size: 400px 400px;
  color: var(--olive);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.5;
  text-align: center;
  -webkit-text-size-adjust: 100%;
}

.defs { position: absolute; }

.card {
  position: relative;
  width: min(100%, 680px);
  margin-inline: auto;
  container-type: inline-size;
}

/* ---- Raised arch ---- */
.frame { position: absolute; inset: 0; display: flex; flex-direction: column; pointer-events: none; }
.frame svg { display: block; width: 100%; overflow: hidden; }
.frame-top, .frame-bottom { height: auto; flex: none; }
.frame-top { aspect-ratio: 1024 / 440; }
.frame-bottom { aspect-ratio: 1024 / 200; }
.frame-sides { flex: 1; min-height: 0; margin-block: -.5px; }

.frame g.shade, .frame g.face, .frame g.light { fill: none; stroke-linecap: butt; }
.frame g.shade { stroke: var(--emboss-shade); stroke-width: 5; transform: translate(1.4px, 1.6px); }
.frame g.face  { stroke: var(--emboss-face);  stroke-width: 4.2; }
.frame g.light { stroke: var(--emboss-light); stroke-width: 1.6; transform: translate(-1px, -1px); }

/* The shapes inside <use> take these through the symbol. */
.fleuron { filter: drop-shadow(-.6px -.6px .3px #fffdf9) drop-shadow(1.2px 1.8px 1.1px rgb(116 82 48 / .62)); }
.relief { fill: url(#relief-fill); stroke: rgb(146 110 74 / .7); stroke-width: 4.5; }
.groove { fill: none; stroke: rgb(168 132 94 / .5); stroke-width: 11; stroke-linecap: round; }

/* ---- Text ---- */
.content {
  position: relative;
  padding: 17cqw 11.5cqw 17cqw;
}

.bismillah { display: block; width: 32cqw; height: auto; margin: 0 auto 5.5cqw; }

.invite {
  color: var(--brown);
  font-weight: 500;
  font-size: clamp(.75rem, 2.35cqw, 1rem);
  letter-spacing: .13em;
  line-height: 1.75;
  text-transform: uppercase;
}
.invite span { display: block; text-wrap: balance; }

.name {
  margin: 7cqw 0 0;
  font-family: var(--display);
  font-weight: 500;
  font-kerning: none; /* the card sets its names without kerning */
  font-size: 14.2cqw;
  line-height: 1;
  letter-spacing: .13em;
  text-indent: .13em; /* balances the trailing letter space so the name sits centred */
  text-transform: uppercase;
}

.parents { margin-top: 2.6cqw; color: var(--brown); font-weight: 500; text-transform: uppercase; letter-spacing: .09em; line-height: 1.5; }
.relation { display: block; font-size: clamp(.78rem, 2.4cqw, 1.02rem); }
.parent-names { display: block; font-size: clamp(.92rem, 2.8cqw, 1.19rem); text-wrap: balance; }

.grand-relation { margin-top: 3.2cqw; font-size: clamp(.75rem, 1.95cqw, .85rem); text-transform: uppercase; letter-spacing: .02em; }
.grandparents { list-style: none; margin-top: .25rem; font-size: clamp(.94rem, 2.65cqw, 1.125rem); line-height: 1.42; }
.grandparents li + li { margin-top: .35rem; }
.grandparents span { display: inline-block; }

.and { display: block; width: 44cqw; height: auto; margin: 7cqw auto 0; }
.and + .person .name { margin-top: 4cqw; }

.reception { margin-top: 11cqw; }
/* A short run of the arch's double rule separates the families from the reception. */
.reception::before {
  content: "";
  display: block;
  width: 42%;
  height: 7px;
  margin: 0 auto 2rem;
  background: linear-gradient(var(--emboss-light) 0 1px, rgb(143 108 72 / .5) 1px 2px, transparent 2px 5px, var(--emboss-light) 5px 6px, rgb(143 108 72 / .5) 6px 7px);
  mask-image: linear-gradient(90deg, transparent, #000 25% 75%, transparent);
}
.reception h2 { color: var(--brown); font-size: 1.125rem; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.reception p { margin-top: 1rem; font-size: 1.125rem; text-wrap: balance; }
.venue { font-weight: 500; font-size: 1.25rem; color: var(--brown); }

.button {
  display: inline-block;
  margin-top: 1.5rem;
  padding: .8rem 1.6rem;
  border: 1px solid var(--olive);
  border-radius: 999px;
  color: var(--paper);
  background: var(--olive);
  font-weight: 500;
  text-decoration: none;
}
.button:hover { background: var(--brown); border-color: var(--brown); }
.button:focus-visible { outline: 2px solid var(--brown); outline-offset: 3px; }

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 1.5rem; }
.actions .button { margin: 0; }
.button.button-outline { color: var(--brown); background: transparent; }
.button.button-outline:hover { color: var(--paper); }
.reception .alt-calendar { margin-top: .5rem; font-size: 1rem; }

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

@media (min-width: 720px) {
  body { padding-block: 1.5rem 2.5rem; }
}

/* ---- RSVP ---- */
.section-title { color: var(--brown); font-size: 1.125rem; font-weight: 500; letter-spacing: .13em; }
.rsvp { margin-top: 4rem; scroll-margin-top: 1rem; }
.rsvp p { margin-top: .75rem; text-wrap: balance; }
.deadline { font-size: 1.2rem; color: var(--brown); }
.hint { font-size: 1rem; }

.rsvp form { max-width: 24rem; margin: 1.5rem auto 0; text-align: left; }
.field { margin-top: 1.4rem; border: 0; min-width: 0; }
.field > label, .field legend { display: block; margin-bottom: .45rem; color: var(--brown); font-weight: 500; font-size: 1.125rem; }

/* 16px or more stops iPhones zooming in when a field is tapped. */
input[type="text"], select {
  width: 100%;
  min-height: 3rem;
  padding: .6rem 1.2rem;
  border: 1px solid #8d7a5c;
  border-radius: 999px;
  background-color: #fffcf8;
  color: var(--brown);
  font: inherit;
  font-size: 1.125rem;
}

/* iPhones ignore rounded corners on a native dropdown, so draw it ourselves, arrow included. */
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 3rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5l6 6 6-6' fill='none' stroke='%234a2f1d' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.2rem center;
}
.label-note { display: block; color: var(--olive); font-weight: 400; font-size: 1rem; }

.choices { display: grid; gap: .6rem; }
.choice { display: flex; align-items: center; gap: .7rem; min-height: 3rem; padding: .6rem 1.2rem; border: 1px solid #8d7a5c; border-radius: 999px; cursor: pointer; }
.choice input { width: 1.15rem; height: 1.15rem; flex: none; accent-color: var(--olive); }
.choice:has(input:checked) { background: #fffcf8; border-color: var(--brown); box-shadow: inset 0 0 0 1px var(--brown); }

/* Guests who decline are not asked for a number. Works without JavaScript. */
form:has(input[name="attending"][value="no"]:checked) :is(.guests, .guest-names) { display: none; }

.guest-name { margin-top: .85rem; }
.guest-name label { display: block; margin: 0 0 .3rem; }

.rsvp form .button { display: block; width: 100%; margin-top: 1.75rem; }
button.button { font: inherit; font-weight: 500; font-size: 1.125rem; cursor: pointer; }
button.button:disabled { opacity: .65; cursor: progress; }

input:focus-visible, select:focus-visible, .text-link:focus-visible { outline: 2px solid var(--brown); outline-offset: 2px; }
[aria-invalid="true"] { border-color: #8f2d1d !important; box-shadow: 0 0 0 1px #8f2d1d; }
.rsvp .error { margin-top: .4rem; color: #8f2d1d; text-wrap: pretty; }
.alert { margin-top: 1.25rem; padding: .75rem 1rem; border: 1px solid #8f2d1d; border-radius: 1.25rem; background: #fffaf6; color: #732417; }
.text-link { display: inline-block; padding: .4rem 0; color: var(--brown); text-underline-offset: .2em; }

.answered { margin-top: 1.5rem; padding: 1.5rem 1.25rem; border: 1px solid #8d7a5c; border-radius: 1.5rem; background: #fffcf8; overflow-wrap: anywhere; }
.answered h3 { color: var(--brown); font-size: 1.35rem; font-weight: 500; line-height: 1.3; text-wrap: balance; }
.answered .button { margin-top: .5rem; }

/* ---- Keepsake and short messages ---- */
.keepsake { padding-top: 3cqw; }
.keepsake p { margin-top: 1rem; text-wrap: balance; }
.monogram { font-family: var(--display); font-weight: 500; font-size: clamp(2rem, 9cqw, 3.4rem); letter-spacing: .08em; }
.keepsake h1 { margin-top: 1.5rem; color: var(--brown); font-weight: 500; font-size: clamp(1.35rem, 4.6cqw, 1.9rem); line-height: 1.3; text-wrap: balance; }
.keepsake .guest-name { margin-top: 1.5rem; font-family: var(--display); font-weight: 500; font-size: clamp(2rem, 8.5cqw, 3.2rem); line-height: 1.15; overflow-wrap: anywhere; }
.party { font-size: 1.25rem; color: var(--brown); }
.party-count { font-size: 1.6em; }
.party-list { list-style: none; margin-top: .5rem; font-size: 1.125rem; line-height: 1.7; overflow-wrap: anywhere; }
.keepsake .reception { margin-top: 2.5rem; }
.keepsake .hint { margin-top: 2.5rem; }
