/* Palette and type follow the couple's invitation suite (Classink Designs, concept one A). */
:root {
  --page: #F1EAE0;   /* envelope */
  --card: #FDFDF8;   /* cream invitation */
  --text: #231F20;   /* letterpress black */
  --muted: #5F5952;
  --line: #E4DED3;
  --field: #8A8378;
  --error: #9E2B1E;
  --accent: #E2CBAA; /* set per wedding in config.js */
  --accent-soft: color-mix(in srgb, var(--accent) 35%, var(--card));
  --serif: "Cormorant Garamond", Georgia, serif;
  --display: "Italiana", "Cormorant Garamond", Georgia, serif;
  --script: "Pinyon Script", "Cormorant Garamond", cursive;
  --sans: "Jost", system-ui, sans-serif;
  --w: min(100vw - 2rem, 32rem);
  --radius: 2px;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--sans);
  font-variant-numeric: lining-nums; /* Cormorant defaults to old-style figures; the invitation uses lining */
}

main { display: grid; justify-items: center; gap: 1.5rem; padding: 2rem 0 1rem; }
@media (min-width: 40em) { main { gap: 2.5rem; padding-top: 4rem; } }

h1, h2, h3, h4 { margin: 0; font-weight: 400; }
em { font-style: italic; }
.caps { text-transform: uppercase; }

.card {
  width: var(--w);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(35, 31, 32, 0.06), 0 18px 40px -24px rgba(35, 31, 32, 0.28);
}

/* Invitation: arch-topped card */
.invite {
  border-radius: calc(var(--w) / 2) calc(var(--w) / 2) 0 0;
  padding: calc(var(--w) * 0.22) 1.25rem 3rem;
  text-align: center;
  font-family: var(--serif);
}
.monogram {
  margin: 0 0 1.75rem;
  font-family: var(--script);
  font-size: clamp(4rem, 21vw, 6rem);
  line-height: 1;
  letter-spacing: -0.3em;
  padding-right: 0.3em;
  color: #E3E0D8;
  text-shadow: 0 1px 0 #fff, 0 -1px 0 rgba(35, 31, 32, 0.14);
}
.invite-lines { display: grid; gap: 0.1rem; margin: 0 0 2.25rem; font-size: 0.95rem; letter-spacing: 0.3em; }
.invite-lines .caps { font-size: 0.8rem; font-weight: 500; letter-spacing: 0.34em; }
.names {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: 0.14em;
  margin: 0 0 2.25rem;
  font-family: var(--display);
  font-size: clamp(2rem, 9.5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.amp { font-family: var(--script); font-size: 1.3em; text-transform: none; transform: translateY(0.1em); }
.date {
  margin: 0 0 1.5rem;
  padding-left: 0.42em; /* balances the trailing letter-spacing */
  font-size: 1rem; font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
}
.venue { display: grid; gap: 0.15rem; margin: 0; font-size: 0.95rem; letter-spacing: 0.18em; text-wrap: balance; }
.venue .caps { font-size: 0.78rem; font-weight: 500; letter-spacing: 0.26em; }
.follow { margin: 1rem 0; font-size: 0.95rem; letter-spacing: 0.22em; }

/* Details card */
.details { padding: 2.5rem 1.5rem 1.5rem; }
.illustration { margin: 0 auto 1.25rem; max-width: 22rem; }
.illustration img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; }
.caps-title {
  margin: 0 0 2.25rem;
  padding-left: 0.45em;
  text-align: center;
  font-family: var(--serif); font-size: 1rem; font-weight: 500;
  letter-spacing: 0.45em;
  text-transform: uppercase;
}
.script { font-family: var(--script); font-size: 2rem; line-height: 1.2; }
.detail { margin-bottom: 1.75rem; }
.detail p { margin: 0.25rem 0 0; font-family: var(--serif); font-size: 1.0625rem; letter-spacing: 0.08em; line-height: 1.7; }

/* Reply card */
.respond { padding: 2.25rem 1rem 2rem; }
@media (min-width: 40em) { .respond { padding: 2.75rem 2.25rem 2.5rem; } }
.respond-title { text-align: center; font-size: 2.75rem; }
.reply-by { margin: 0.25rem 0 0.5rem; text-align: center; font-family: var(--serif); font-size: 1.0625rem; letter-spacing: 0.08em; text-wrap: balance; }

.step { padding-top: 2rem; margin-top: 2rem; border-top: 1px solid var(--line); }
.step-title {
  margin-bottom: 1.25rem;
  font-family: var(--serif); font-size: 0.9rem; font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.field { margin-bottom: 1.5rem; }
label, .label { display: block; margin-bottom: 0.375rem; font-weight: 500; }
.optional { font-weight: 400; color: var(--muted); }
.hint { margin: 0 0 1rem; color: var(--muted); font-size: 0.9375rem; }

input[type="text"], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.625rem 0.875rem;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid var(--field);
  border-radius: var(--radius);
}
textarea { min-height: 7.5rem; resize: vertical; }
select { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23231F20' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 0.875rem center; padding-right: 2.5rem; }

:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
[aria-invalid="true"] { border: 2px solid var(--error); }

.error { margin: 0.375rem 0 0; color: var(--error); font-size: 0.9375rem; font-weight: 500; }
.error:empty { display: none; }
#attending-group-error, #accommodation-group-error { margin: 0 0 0.5rem; }

fieldset.plain { border: 0; margin: 0 0 1.5rem; padding: 0; min-width: 0; }
fieldset.plain legend { padding: 0; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 21em) { .choices { grid-template-columns: 1fr; } }
.choice { display: flex; margin: 0; position: relative; font-weight: 400; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  min-height: 4.25rem; padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid var(--field);
  border-radius: var(--radius);
  font-family: var(--serif); font-size: 1.2rem; font-weight: 500; line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}
.compact .choice span { min-height: 48px; font-size: 1.1rem; }
.choice input:checked + span { background: var(--accent-soft); border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.choice input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }

.guest {
  margin-bottom: 1rem;
  padding: 1rem 0.875rem 0.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.guest-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-bottom: 0.75rem; }
.guest-title { font-family: var(--serif); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; }
.remove {
  min-width: 44px; min-height: 44px; margin-right: -0.5rem;
  border: 0; border-radius: var(--radius);
  background: none; color: var(--muted);
  font-size: 1.75rem; line-height: 1;
  cursor: pointer;
}

.diet { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); column-gap: 0.5rem; }
.check { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; margin: 0; font-size: 0.9375rem; font-weight: 400; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; margin: 0; flex: none; accent-color: var(--text); }
.other-wrap { margin: 0.5rem 0 0.75rem; }
.serious { font-weight: 500; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.75rem 1.25rem;
  font: inherit; font-size: 0.85rem; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--text);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 160ms ease, transform 120ms ease;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn-secondary { margin-bottom: 2rem; }
.btn-primary { width: 100%; min-height: 54px; margin-top: 0.5rem; color: var(--card); background: var(--text); }
.btn:disabled { opacity: 0.6; cursor: progress; }
@media (hover: hover) {
  .btn-primary:hover:not(:disabled) { background: #3D3739; }
  .btn-secondary:hover, .remove:hover, .choice span:hover { background: var(--accent-soft); }
}

.form-error { margin: 2rem 0 0; color: var(--error); font-weight: 500; }
.form-error:empty { display: none; }

.thanks { padding: 2rem 0 1rem; text-align: center; font-family: var(--serif); }
.thanks h3 { font-size: 1.75rem; font-weight: 500; line-height: 1.3; text-wrap: balance; }
.thanks h3:focus { outline: none; }
.thanks p { margin: 1rem 0 0; font-size: 1.2rem; font-style: italic; letter-spacing: 0.04em; }

.notice { text-align: center; font-weight: 500; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.site-footer {
  max-width: 32rem; margin: 1.5rem auto 0; padding: 1.5rem 1rem 3rem;
  text-align: center; color: var(--muted); font-size: 0.875rem;
}
.site-footer p { margin: 0 0 0.375rem; }
.site-footer .brand {
  font-family: var(--serif); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--text);
}

/* Cards rise in gently on load; nothing moves for people who ask for less motion. */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.reveal { animation: rise 700ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.reveal:nth-child(2) { animation-delay: 120ms; }
.reveal:nth-child(3) { animation-delay: 240ms; }
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
  .choice span, .btn { transition: none; }
}
