/* Color Scheme */
/* Strawberry Cream #F4C3C4 */
/* Marigold #FDAC53 */
/* Pastel Yellow #F2E6B1 */
/* Butterfly #CADEA5 */
/* Spa Blue #D3DEDF */
/* Orchid Petal #BFB4CB */
:root {
  --bg: #F9DCD5;
  --ink: #3D2E33;  /* soft plum-brown instead of pure black */
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', 'Helvetica Neue', Arial, sans-serif;
}

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

body {
  font-family: var(--serif);
  font-size: 1.15rem;
  background: var(--bg);
  color: var(--ink);
}

/* Small spaced capitals used for labels, nav and buttons */
.label,
nav a,
.button,
.question h3,
.choice span {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

header {
  text-align: center;
  padding: 4rem 1rem 1.5rem;
}

header .intro {
  font-style: italic;
  font-size: 1.9rem;
}

header h1 {
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.1;
  margin: 0.4rem 0 0.8rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 2.2rem;
  padding: 1rem;
}

nav a {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

/* Invisible padding around each link so it's easier to tap on a phone,
   without moving the underline or changing the spacing */
nav a::before {
  content: '';
  position: absolute;
  inset: -0.75rem -0.6rem;
}

nav a:hover,
nav a.current {
  border-bottom-color: var(--ink);
}

#home {
  max-width: 1000px;
  margin: 1.5rem auto 4rem;
  padding: 0 1rem;
  /* Soft shadow under the scalloped frame (the mask would clip a box-shadow) */
  filter: drop-shadow(0 8px 20px rgba(61, 46, 51, 0.12));
}

#home img {
  display: block;
  width: 100%;
  height: 70vh;
  object-fit: cover;
  /* White scalloped frame: a white mat whose outer edge is cut into
     half-circles (a row of circles plus a solid inner rectangle).
     --tile-w/--tile-h are set by the page script to sizes that divide the
     frame exactly, so every edge ends on a whole scallop (Safari ignores
     the `round` repeat that would otherwise do this). */
  --scallop: 10px;
  padding: calc(var(--scallop) * 3);
  background: white;
  -webkit-mask:
    linear-gradient(#000 0 0) center / calc(100% - 2 * var(--scallop)) calc(100% - 2 * var(--scallop)) no-repeat,
    radial-gradient(circle closest-side, #000 98%, transparent) 0 0 / var(--tile-w, calc(2 * var(--scallop))) var(--tile-h, calc(2 * var(--scallop))) round;
  mask:
    linear-gradient(#000 0 0) center / calc(100% - 2 * var(--scallop)) calc(100% - 2 * var(--scallop)) no-repeat,
    radial-gradient(circle closest-side, #000 98%, transparent) 0 0 / var(--tile-w, calc(2 * var(--scallop))) var(--tile-h, calc(2 * var(--scallop))) round;
}

/* Scattered doodles (home page) */
.doodles {
  --doodle-size: 160px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

@media (max-width: 600px) {
  .doodles {
    --doodle-size: 90px;
  }
}

.doodles img {
  position: absolute;
  width: var(--doodle-size);
  height: var(--doodle-size);
  transform: rotate(var(--tilt));
  opacity: 0.6;
  animation: dance 3.5s ease-in-out infinite alternate;
}

@keyframes dance {
  from { transform: rotate(calc(var(--tilt) - var(--sway, 5deg))); }
  to   { transform: rotate(calc(var(--tilt) + var(--sway, 5deg))); }
}

/* Small rotations are hard to see on the tiny doodles, so they swing further */
.doodles img.tiny {
  --sway: 15deg;
}

/* Doodles added after the page loads (when content changes size) fade in */
.doodles img.appear {
  animation: dance 3.5s ease-in-out infinite alternate, doodle-appear 0.8s ease-out;
}

@keyframes doodle-appear {
  from { opacity: 0; }
}

/* Keep them still for visitors who've asked their device to reduce motion */
@media (prefers-reduced-motion: reduce) {
  .doodles img,
  .doodles img.appear {
    animation: none;
  }
}

/* Page headings (Registry, FAQ) */
main h2 {
  font-size: 2.2rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

/* Home page: countdown under the date, and the RSVP button under the photo */
header .countdown {
  margin-top: 0.5rem;
}

.home-cta {
  width: fit-content;
  margin: -1rem auto 4rem;
  text-align: center;
}

.home-cta .button {
  margin-top: 0;
}

.home-cta p {
  margin-top: 0.9rem;
  font-style: italic;
}

/* Footer on every page */
footer {
  width: fit-content;
  max-width: calc(100% - 2rem);
  margin: 0 auto 2.5rem;
  text-align: center;
}

footer img {
  display: block;
  width: 34px;
  height: 34px;
  margin: 0 auto 0.6rem;
}

footer .label {
  font-size: 0.72rem;
  line-height: 1.8;
}

/* On phones, put the names and the date/place on their own lines */
@media (max-width: 600px) {
  footer .label span {
    display: block;
  }

  footer .label .dot {
    display: none;
  }
}

/* "Page not found" page */
#not-found {
  max-width: 600px;
  margin: 2rem auto 5rem;
  padding: 0 1rem;
  text-align: center;
}

#not-found h2 {
  margin-bottom: 1.2rem;
}

/* Registry page */
#registry {
  max-width: 600px;
  margin: 2rem auto 5rem;
  padding: 0 1rem;
  text-align: center;
}

#registry h2 {
  margin-bottom: 1.5rem;
}

#registry p {
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

.button {
  display: inline-block;
  margin-top: 1.3rem;
  padding: 1rem 2.4rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.button:hover {
  background: var(--ink);
  color: var(--bg);
}

/* Venmo QR code under the button */
.venmo-qr {
  width: 220px;
  margin: 2.5rem auto 0;
}

.venmo-qr img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
}

/* RSVP page */
#rsvp {
  max-width: 560px;
  margin: 2rem auto 5rem;
  padding: 0 1rem;
}

#rsvp h2 {
  margin-bottom: 0.6rem;
}

.rsvp-deadline {
  text-align: center;
  font-style: italic;
  margin-bottom: 2.5rem;
}

.field {
  margin-bottom: 1.8rem;
  border: 0;  /* fieldsets have a border by default */
}

/* The accepting-only questions are a fieldset too; drop its default box */
.if-attending {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.field > .label {
  display: block;
  margin-bottom: 0.6rem;
}

.field .optional {
  text-transform: none;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  display: block;
  width: 100%;
  padding: 0.7rem 0.9rem;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(61, 46, 51, 0.3);
  border-radius: 3px;
  transition: border-color 0.2s, background 0.2s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
}

.field textarea {
  resize: vertical;
}

.hint {
  margin-top: 0.4rem;
  font-size: 1rem;
  font-style: italic;
  opacity: 0.8;
}

/* Accept / decline: radio buttons drawn as two pill buttons */
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.choice {
  flex: 1 1 200px;
  position: relative;
  display: flex;  /* lets the button fill the label, so both stay the same height */
}

.choice input {
  position: absolute;
  opacity: 0;
}

.choice span {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1rem;
  text-align: center;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.choice input:checked + span {
  background: var(--ink);
  color: var(--bg);
}

.choice input:focus-visible + span {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.form-actions {
  text-align: center;
  margin-top: 2.5rem;
}

button.button {
  background: none;
  cursor: pointer;
  margin-top: 0;
}

button.button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.form-status {
  margin-top: 1rem;
  min-height: 1.5em;
}

.form-status.error {
  color: #9B2C2C;
}

.thanks {
  text-align: center;
  padding: 2rem 0;
}

.thanks h3 {
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 0.6rem;
}

/* Invitation search: name box with the Find button beside it */
.search-row {
  display: flex;
  gap: 0.6rem;
}

.search-row input {
  flex: 1;
  min-width: 0;
}

.search-row .button {
  flex: none;
  padding: 0 1.6rem;
}

#find-form .form-status {
  min-height: 0;
  margin-top: 0;
  text-align: center;
}

.results .label {
  margin: 1.5rem 0 0.8rem;
}

.result-list {
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.result {
  display: block;
  width: 100%;
  padding: 0.9rem 1.1rem;
  font: inherit;
  font-size: 1.25rem;
  letter-spacing: 0.08em;  /* names are shown in capitals */
  text-align: left;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(61, 46, 51, 0.3);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.result:hover,
.result:focus-visible {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
}

.result-plus {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.04em;
  font-style: italic;
  opacity: 0.8;
}

/* The chosen invitation, at the top of step 2 */
.invitation-card {
  text-align: center;
  padding: 1.6rem 1rem;
  margin-bottom: 2.2rem;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(61, 46, 51, 0.15);
  border-radius: 3px;
}

.invitation-name {
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: 0.08em;  /* names are shown in capitals */
  line-height: 1.2;
  margin: 0.4rem 0 0.5rem;
}

.already-responded {
  margin-top: 0.6rem;
  font-style: italic;
}

.link-button {
  margin-top: 0.8rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Spam trap field, kept off-screen */
.honeypot {
  position: absolute;
  left: -9999px;
}

/* FAQ page */
#faq {
  max-width: 700px;
  margin: 2rem auto 5rem;
  padding: 0 1rem;
}

#faq h2 {
  margin-bottom: 2.5rem;
}

/* Little emblem between the heading and the first question */
#faq .faq-mark {
  display: block;
  width: 340px;
  max-width: 75%;
  height: auto;
  margin: -3.5rem auto 1.5rem;  /* the image has empty space above the drawing */
}

.question {
  padding: 1.6rem 0;
  border-top: 1px solid rgba(61, 46, 51, 0.15);
}

.question h3 {
  margin-bottom: 0.6rem;
}

.question p {
  line-height: 1.7;
}

/* Space between paragraphs, lists and labels within an answer */
.question > :not(h3) + * {
  margin-top: 0.9rem;
}

/* A small label sits close to the text it introduces */
.question > .label + * {
  margin-top: 0.3rem;
}

.question a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.question .dress-code {
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.3;
}

/* Venue and hotel list: name over a tappable map link */
.places {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));  /* auto-fit lets a lone item use the full width */
  gap: 1rem 2rem;
}

.places li {
  line-height: 1.5;
}

.place-name {
  display: block;
  font-weight: 500;
}
