/* Palette and type follow the couple's invitation suite (Classink Designs, concept three). */
:root {
  --page: #E9E4DA;
  --card: #FDFDF7;   /* ivory invitation */
  --ink: #231F20;    /* black letterpress, and the details card */
  --on-ink: #FDFDF7; /* white ink */
  --on-ink-muted: #CFC9C0;
  --muted: #5F5952;
  --line: #E2DDD3;
  --field: #8A8378;
  --error: #9E2B1E;
  --accent: #E2CBAA; /* set per wedding in config.js */
  --accent-soft: color-mix(in srgb, var(--accent) 35%, var(--card));
  --roman: "Bodoni Moda", Didot, Georgia, serif;
  --script: "Pinyon Script", cursive;
  --sans: "Archivo", system-ui, sans-serif;
  --w: min(100vw - 2rem, 32rem);
  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(--ink);
  font: 400 1rem/1.6 var(--sans);
}

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; }

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

/* Invitation: oversized initials bleed off opposite corners */
.invite {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1.4fr auto 1fr auto;
  min-height: calc(var(--w) * 1.6);
  padding: calc(var(--w) * 0.08) 1.25rem 1.75rem;
}
.initial {
  position: absolute;
  z-index: 0;
  font-family: var(--roman);
  font-optical-sizing: auto;
  font-size: calc(var(--w) * 0.75);
  line-height: 0.8;
  user-select: none;
}
.initial-a { top: calc(var(--w) * -0.04); left: calc(var(--w) * -0.04); }
.initial-b { right: calc(var(--w) * -0.01); bottom: calc(var(--w) * -0.03); }
.invite > :not(.initial) { position: relative; z-index: 1; }

.invite-lines {
  grid-row: 1;
  display: grid; justify-items: end;
  margin: 0;
  font-size: 0.75rem; font-stretch: 125%;
  letter-spacing: 0.1em;
  line-height: 1.7;
}
.centre { grid-row: 3; text-align: center; }
.names {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; column-gap: 0.5em;
  margin: 0 0 0.6rem;
  padding-left: 0.32em; /* balances the trailing letter-spacing */
  font-family: var(--roman);
  font-size: clamp(1.6rem, 7.5vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.amp { letter-spacing: 0; }
.date {
  margin: 0;
  padding-left: 0.3em;
  font-family: var(--roman);
  font-size: clamp(0.9rem, 4vw, 1.15rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-variant-numeric: lining-nums;
}
.where { grid-row: 5; max-width: 72%; }
.venue, .follow { margin: 0; font-size: 0.72rem; font-stretch: 115%; letter-spacing: 0.06em; line-height: 1.7; }
.venue { display: grid; }
/* Phones: time on its own line beside the J. Wider: "Venue | time" as on the card. */
.venue .pipe { display: none; }
.venue .time { display: block; }
@media (min-width: 30em) {
  .venue, .follow { font-size: 0.75rem; font-stretch: 125%; letter-spacing: 0.08em; }
  .venue .pipe { display: inline; }
  .venue .time { display: inline; }
}
.follow { margin: 0.6rem 0; }

/* Details card: white ink on black */
.details { padding: 3rem 1.5rem 2rem; background: var(--ink); color: var(--on-ink); }
@media (min-width: 40em) { .details { padding: 3.5rem 2.5rem 2.5rem; } }
.vows { display: grid; justify-items: center; gap: 0.1rem; margin: 0 0 2.75rem; }
.vow { display: flex; align-items: baseline; gap: 0.35em; }
.roman { font-family: var(--roman); font-size: 1.75rem; letter-spacing: 0.22em; text-transform: uppercase; }
.script { font-family: var(--script); font-size: 2.6rem; line-height: 1; }
.detail { margin-bottom: 1.75rem; }
.detail .label {
  margin-bottom: 0.35rem;
  color: var(--on-ink-muted);
  font-size: 0.7rem; font-weight: 500; font-stretch: 125%;
  letter-spacing: 0.22em; text-transform: uppercase;
}
.detail p { margin: 0; font-size: 0.875rem; font-stretch: 125%; letter-spacing: 0.04em; line-height: 1.8; }

/* Reply card */
.respond { padding: 2.5rem 1rem 2rem; }
@media (min-width: 40em) { .respond { padding: 3rem 2.25rem 2.5rem; } }
.respond-title {
  padding-left: 0.4em;
  text-align: center;
  font-family: var(--roman); font-size: 1.75rem;
  letter-spacing: 0.4em;
}
.reply-by { margin: 0.5rem 0 0.5rem; text-align: center; font-size: 0.8rem; font-stretch: 125%; 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-size: 0.75rem; font-weight: 600; font-stretch: 125%;
  letter-spacing: 0.22em;
  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; font-size: 1rem;
  color: inherit;
  background: #fff;
  border: 1px solid var(--field);
  border-radius: 0;
}
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(--ink); 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);
  font-family: var(--roman); font-size: 1.1rem; line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.compact .choice span { min-height: 48px; }
.choice input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.choice input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.guest {
  margin-bottom: 1rem;
  padding: 1rem 0.875rem 0.25rem;
  background: #fff;
  border: 1px solid var(--line);
}
.guest-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-bottom: 0.75rem; }
.guest-title { font-size: 0.7rem; font-weight: 600; font-stretch: 125%; letter-spacing: 0.22em; text-transform: uppercase; }
.remove {
  min-width: 44px; min-height: 44px; margin-right: -0.5rem;
  border: 0;
  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(--ink); }
.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.75rem; font-weight: 500; font-stretch: 125%;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
  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(--on-ink); background: var(--ink); }
.btn:disabled { opacity: 0.6; cursor: progress; }
@media (hover: hover) {
  .btn-primary:hover:not(:disabled) { background: #3D3739; }
  .btn-secondary:hover, .remove:hover, .choice input:not(:checked) + 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; }
.thanks h3 { font-family: var(--roman); font-size: 1.5rem; line-height: 1.35; text-wrap: balance; }
.thanks h3:focus { outline: none; }
.thanks p { margin: 1rem 0 0; font-family: var(--script); font-size: 1.9rem; line-height: 1.2; }

.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-size: 0.7rem; font-weight: 600; font-stretch: 125%;
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink);
}

/* 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; }
}
