:root {
  --cream: #FFE3C2;
  --cream-deep: #FFD9AE;
  --orange: #F58220;
  --blush: #F8C6D2;
  --hot: #EC1C8F;
  --coral: #F0604D;
  --peach: #EE8A55;
  --rose: #DB9C8D;
  --shadow-pink: #F9B5C6;
  --ink: #E0653F;           /* warm coral for small text (no dark tones) */

  --script: casey, "Lobster", sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
}

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

/* Anything marked hidden stays hidden, even if a class sets display */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;              /* Cormorant is thin at 400; 600 reads better */
  font-size: 1.2rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.script {
  font-family: var(--script);
  font-weight: 700;
  font-style: normal;
  color: var(--coral);
  text-shadow: 0.06em 0.06em 0 var(--shadow-pink);
  line-height: 1.05;
}

/* ---------- Page arch: wraps every section ---------- */
.page {
  display: flex;
  justify-content: center;
  min-height: 100svh;            /* sides always reach the bottom of the screen */
  padding-top: clamp(12px, 2.5vh, 28px);
  /* Cut off the arch's bottom edge. "clip" (not "hidden") so that links,
     focus or scrolling can never scroll the base back into view. */
  overflow: hidden;              /* fallback for old browsers */
  overflow: clip;
}

.arch {
  --aw: min(800px, 94vw);
  --s: clamp(7px, calc(var(--aw) * 0.03), 24px);   /* stripe unit */
  --band: calc(var(--s) * 4.7);                      /* total stripe width */
  --runoff: 200px;                                   /* how far it runs past the page bottom */
  width: var(--aw);
  margin-bottom: calc(var(--runoff) * -1);
  border-radius: 1000px 1000px 0 0;
  background: var(--cream);
  box-shadow:
    inset 0 0 0 var(--s) var(--orange),
    inset 0 0 0 calc(var(--s) * 2) var(--blush),
    inset 0 0 0 calc(var(--s) * 3) var(--hot),
    inset 0 0 0 var(--band) var(--orange);
}

.arch-content {
  text-align: center;
  padding:
    var(--band) calc(var(--band) + 24px)
    var(--runoff);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.disco {
  width: clamp(110px, 26vw, 170px);
  aspect-ratio: 180 / 140;
  margin-top: -2px;
  overflow: visible;
}
#disco .ball, #disco .spark {
  fill: none;
  stroke: var(--rose);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#disco .ball-body, #disco rect { fill: var(--cream); }
#disco .ball {
  transform-box: view-box;
  transform-origin: 60px 0;
  animation: swing 4s ease-in-out infinite;
}
#disco .spark { animation: twinkle 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
#disco .s2 { animation-delay: .8s; }
#disco .s3 { animation-delay: 1.6s; }

@keyframes swing {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}
@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}

.kicker {
  margin-top: 1.2rem;
  color: var(--peach);
  font-size: clamp(1.05rem, 3.4vw, 1.45rem);
  font-style: italic;
}

.names {
  font-size: clamp(2.7rem, 10vw, 5.2rem);
  margin: .3rem 0 1rem;
  text-wrap: balance;
}
.names .amp { font-size: .8em; }

.date {
  color: var(--peach);
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.15;
}
.time {
  color: var(--peach);
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  font-weight: 600;
  line-height: 1.15;
}
.place {
  margin-top: 1rem;
  font-size: clamp(1.05rem, 3.4vw, 1.35rem);
  color: var(--ink);
}
.countdown {
  margin-top: 1.1rem;
  font-family: var(--script);
  font-weight: 700;
  font-style: normal;
  color: var(--hot);
  font-size: clamp(1.15rem, 4vw, 1.6rem);
  min-height: 1.4em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .7rem;
  margin-top: 1.4rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--script);
  font-weight: 700;
  font-style: normal;
  font-size: 1.3rem;
  line-height: 1;
  padding: .75em 1.6em;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  border: 3px solid var(--orange);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary {
  background: var(--hot);
  color: #fff;
  border-color: var(--hot);
  box-shadow: 4px 4px 0 var(--orange);
}
.btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--orange); }
.btn-primary:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--orange); }
.btn-ghost { background: transparent; color: var(--orange); }
.btn-ghost:hover { background: var(--orange); color: var(--cream); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .text-link:focus-visible {
  outline: 3px solid var(--hot);
  outline-offset: 3px;
}

/* ---------- Sections ---------- */
.section {
  padding-top: clamp(64px, 10vw, 100px);
}
.section-title { font-size: clamp(3rem, 10vw, 4.6rem); }
.section-lede {
  max-width: 34rem;
  margin: 1rem auto 0;
  font-size: 1.3rem;
}

.wave-divider {
  height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='22' viewBox='0 0 64 22'%3E%3Cpath d='M0 11 Q16 -1 32 11 T64 11' fill='none' stroke='%23F58220' stroke-width='6'/%3E%3C/svg%3E") repeat-x center;
}

/* ---------- Details ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr));
  gap: clamp(40px, 6vw, 64px);
  margin-top: 2.5rem;
}
.card-kicker {
  font-family: var(--script);
  font-weight: 700;
  font-style: normal;
  color: var(--coral);
  text-shadow: 0.06em 0.06em 0 var(--shadow-pink);
  font-size: clamp(2.3rem, 8vw, 3rem);
}
.card-time {
  color: var(--peach);
  font-size: clamp(1.8rem, 6vw, 2.2rem);
  font-weight: 600;
  margin: .3rem 0 .9rem;
}
address {
  font-style: normal;
  font-size: clamp(1.3rem, 4.4vw, 1.55rem);
  line-height: 1.45;
}
.text-link {
  display: inline-block;
  margin-top: 1.1rem;
  font-size: 1.3rem;
  color: var(--hot);
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* ---------- RSVP ---------- */
.rsvp-card {
  max-width: 600px;
  margin: 2.6rem auto 0;
  padding: clamp(44px, 7vw, 64px) clamp(30px, 7vw, 64px);
  text-align: left;
  border: 6px solid var(--orange);
  border-radius: 36px;
  box-shadow: 8px 8px 0 var(--blush);
}

.field {
  margin: 0 0 1.4rem;
  padding: 0;
  border: 0;
  min-width: 0;
}
label, legend {
  display: block;
  font-family: var(--script);
  font-weight: 700;
  font-style: normal;
  color: var(--coral);
  font-size: 1.35rem;
  margin-bottom: .4rem;
  padding: 0;
}
.optional {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--peach);
}

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 1.15rem;
  color: var(--ink);
  background: #FFF3E3;
  border: 2.5px solid var(--blush);
  border-radius: 16px;
  padding: .65rem .9rem;
  transition: border-color .15s ease, background .15s ease;
}
input::placeholder, textarea::placeholder { color: #D9A48C; font-style: italic; }
input:hover, select:hover, textarea:hover { border-color: var(--orange); }
input:focus, select:focus, textarea:focus { border-color: var(--hot); background: #FFF8EF; outline: none; }
textarea { resize: vertical; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'%3E%3Cpath d='M1 1l6 7 6-7' fill='none' stroke='%23F58220' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.choice-row { display: flex; flex-wrap: wrap; gap: .7rem; }
.choice {
  position: relative;
  flex: 1 1 200px;
  margin: 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  cursor: pointer;
}
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: block;
  text-align: center;
  padding: .7rem 1rem;
  border: 2.5px solid var(--orange);
  border-radius: 999px;
  color: var(--orange);
  font-weight: 700;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.choice:hover span { background: #FFEBD4; }
.choice input:checked + span {
  background: var(--hot);
  border-color: var(--hot);
  color: #fff;
  box-shadow: 3px 3px 0 var(--orange);
}
.choice input:focus-visible + span { outline: 3px solid var(--hot); outline-offset: 3px; }

.error {
  display: none;
  margin-top: .35rem;
  color: var(--hot);
  font-size: 1rem;
  font-style: italic;
}
.field.invalid .error { display: block; }
.field.invalid input, .field.invalid textarea { border-color: #E04B5F; }

.code-input {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .3em;
  font-size: 1.5rem !important;
}
.code-input::placeholder { letter-spacing: .05em; text-transform: none; }
.hint { margin-top: 1rem; text-align: center; font-size: 1.05rem; color: var(--peach); }

.greeting { text-align: center; margin-bottom: 1.6rem; }
.hello { color: var(--peach); font-style: italic; font-size: 1.3rem; }
.party-name { font-size: clamp(2rem, 7vw, 2.8rem); margin: .2rem 0 .5rem; overflow-wrap: anywhere; }
.already {
  text-align: center;
  background: #FFEFE0;
  border: 2px dashed var(--blush);
  border-radius: 16px;
  padding: .6rem 1rem;
  margin-bottom: 1.4rem;
}
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 1.05rem;
  color: var(--hot);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:focus-visible { outline: 3px solid var(--hot); outline-offset: 3px; }
.thanks .link-btn { margin-top: 1.2rem; }

.btn-submit { width: 100%; font-size: 1.6rem; margin-top: .4rem; }
.btn-submit[disabled] { opacity: .6; cursor: progress; transform: none; }

.form-status { margin-top: 1rem; text-align: center; font-style: italic; min-height: 1.5em; }
.form-status.is-error { color: var(--hot); }

.thanks { text-align: center; padding: 1rem 0; }
.thanks:focus { outline: none; }
.disco-sm { width: 120px; }
.thanks-title { font-size: clamp(2.6rem, 9vw, 3.6rem); margin: .6rem 0 .8rem; }
.thanks p { font-size: 1.3rem; }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 48px 20px 64px;
  color: var(--peach);
}
.footer-names { font-size: 2.4rem; margin-bottom: .3rem; }

/* ---------- Small screens ---------- */
@media (max-width: 520px) {
  body { font-size: 1.1rem; }
  .arch { --aw: 96vw; }
  .arch-content { padding-left: calc(var(--band) + 10px); padding-right: calc(var(--band) + 10px); }
  .rsvp-card { padding-left: 22px; padding-right: 22px; }
  .btn { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #disco .ball, #disco .spark { animation: none; }
  .btn { transition: none; }
}
