/* ===================== Design Tokens ===================== */
:root {
  --cream: #f1e2cf;
  --cream-deep: #e7d3b7;
  --ivory: #f8ecd9;
  --ivory-rgb: 248, 236, 217;
  --gold: #ab7d24;
  --gold-light: #caa85a;
  --gold-dark: #855f17;
  --gold-border: rgba(133, 95, 23, 0.72);
  --gold-hairline: rgba(171, 125, 36, 0.42);
  --ink: #3c3226;
  --ink-soft: #6b5f4d;
  --white: #ffffff;
  --error: #a33c3c;

  --font-script: 'Great Vibes', cursive;
  --font-serif: 'Cormorant Garamond', 'Georgia', serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 3rem; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 0.6em 1em;
  background: var(--gold);
  color: var(--white);
}
.skip-link:focus { left: 0; }

/* ===================== Invitation Canvas ===================== */
.invite {
  position: relative;
  width: min(1200px, calc(100vw - 32px));
  margin: 24px auto 0;
  overflow: hidden;
  border: 1px solid var(--gold-border);
  background: var(--ivory);
  container-type: inline-size;
  box-shadow: 0 2px 12px rgba(60, 50, 38, 0.14);
}
.invite::before {
  display: none;
}

/* ===================== Hero ===================== */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 55% 45%;
  height: 66cqw;
  min-height: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--gold-hairline);
}
.hero__photo {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  overflow: hidden;
}
.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 48% 52%;
}
.hero__photo::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to right,
    var(--ivory) 0%,
    rgba(var(--ivory-rgb), 0.92) 13%,
    rgba(var(--ivory-rgb), 0.48) 27%,
    rgba(var(--ivory-rgb), 0) 45%
  );
}
.hero__content {
  position: relative;
  z-index: 2;
  grid-column: 1;
  grid-row: 1;
  box-sizing: border-box;
  width: 88%;
  height: 100%;
  padding: 4.8cqw 0 3.4cqw 7.5cqw;
  text-align: left;
}
.hero-corner {
  display: none;
}

/* ===================== Typography ===================== */
.eyebrow,
.venue-eyebrow {
  margin: 0 0 0.65cqw;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 1.4cqw;
  line-height: 1.1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}
.script-hero {
  margin: 0.15cqw 0 0;
  color: var(--gold-dark);
  font-family: var(--font-script);
  font-size: 6.95cqw;
  font-weight: 400;
  line-height: 0.98;
  white-space: nowrap;
}
.script-hero--celebrate {
  margin-top: 0.45cqw;
  margin-bottom: 0.72cqw;
  font-size: 6.7cqw;
}
.hero-subtitle,
.hero-note,
.hero-date-line {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  line-height: 1.05;
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.hero-subtitle {
  margin-bottom: 1.02cqw;
  font-size: 1.68cqw;
  font-weight: 600;
}
.hero-note {
  margin-top: 0.35cqw;
  margin-bottom: 0.92cqw;
  font-size: 1.18cqw;
  letter-spacing: 0.06em;
}
.hero-date-line {
  margin-top: 1.08cqw;
  margin-bottom: 1.7cqw;
  color: var(--ink);
  font-size: 1.58cqw;
  text-transform: uppercase;
}
.caps-hero {
  margin: 0.3cqw 0 0.45cqw;
  color: var(--gold-dark);
  font-family: var(--font-serif);
  font-size: 3.55cqw;
  font-weight: 700;
  letter-spacing: 0.17em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.script-names,
.script-venue {
  margin: 0;
  color: var(--gold-dark);
  font-family: var(--font-script);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}
.script-names { font-size: 4.78cqw; }
.script-venue { font-size: 5.25cqw; }
.muted { color: var(--ink-soft); font-size: 0.94rem; }

.link-gold {
  color: var(--gold-dark);
  font-family: var(--font-serif);
  font-size: 1.22cqw;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
.link-gold:hover { color: var(--gold); }

/* ===================== Ornament Rules ===================== */
.rule-heart {
  display: flex;
  align-items: center;
  gap: 1.15cqw;
  width: 28cqw;
  margin: 1cqw auto 1.2cqw 0;
  color: var(--gold);
}
.rule-heart--sm {
  width: 21cqw;
  margin-top: 0.88cqw;
  margin-bottom: 1.08cqw;
}
.rule-heart span {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}
.heart-icon {
  width: 1.25cqw;
  height: 1.25cqw;
  color: var(--gold);
  flex-shrink: 0;
}
.heart-icon.heart-inline {
  width: 0.5em;
  height: 0.5em;
  margin-left: 0.14em;
  color: var(--gold-dark);
  vertical-align: middle;
}

/* ===================== Date / Schedule / Venue ===================== */
.date-block { margin: 1.2cqw 0 1.35cqw; }
.date-block__day {
  margin: 0 0 0.5cqw;
  width: 31cqw;
  color: var(--ink);
  font-size: 1.45cqw;
  letter-spacing: 0.25em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}
.date-block__row {
  display: grid;
  grid-template-columns: 9.3cqw 5.1cqw 9.3cqw;
  align-items: center;
  gap: 1.2cqw;
}
.date-block__month,
.date-block__year {
  padding-top: 0.55cqw;
  border-top: 1px solid var(--gold);
  color: var(--ink-soft);
  font-size: 1.18cqw;
  letter-spacing: 0.13em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}
.date-block__num {
  padding-top: 0.1cqw;
  border-top: 1px solid var(--gold);
  color: var(--gold-dark);
  font-size: 4.45cqw;
  font-weight: 600;
  line-height: 0.92;
  text-align: center;
}

.schedule {
  display: flex;
  flex-direction: column;
  gap: 0.84cqw;
  width: 35.5cqw;
  margin: 0.75cqw 0 1.1cqw;
}
.schedule__item {
  display: grid;
  grid-template-columns: 4.05cqw 1px 1fr;
  align-items: center;
  gap: 1.35cqw;
  min-height: 4.55cqw;
}
.schedule__icon {
  width: 3.62cqw;
  height: 3.62cqw;
  color: var(--gold-dark);
}
.schedule__divider {
  width: 1px;
  align-self: stretch;
  background: var(--gold-light);
}
.schedule__text { display: flex; flex-direction: column; }
.schedule__label {
  color: var(--ink);
  font-size: 1.47cqw;
  letter-spacing: 0.13em;
  line-height: 1.05;
  text-transform: uppercase;
  white-space: nowrap;
}
.schedule__time {
  margin-top: 0.18cqw;
  color: var(--gold-dark);
  font-size: 1.9cqw;
  font-weight: 600;
  line-height: 1;
}
.schedule__rule {
  width: 100%;
  height: 1px;
  background: var(--gold-light);
}
.venue-address {
  margin: 0.42cqw 0 0.9cqw;
  color: var(--ink);
  font-size: 1.18cqw;
  line-height: 1.25;
}
.hero-links {
  display: flex;
  align-items: center;
  gap: 1.65cqw;
  flex-wrap: wrap;
}

/* ===================== RSVP ===================== */
.rsvp-section {
  padding: 3.1cqw 0 3.15cqw;
  border-bottom: 1px solid var(--gold-hairline);
  text-align: center;
}
.rsvp-card {
  position: relative;
  width: 87%;
  margin: 0 auto;
  padding: 2.6cqw 4.8cqw 2.95cqw;
  border: 1px solid var(--gold-border);
  text-align: center;
}
.rsvp-card > *:not(.rsvp-card__corner) {
  position: relative;
  z-index: 1;
}
.rsvp-card__corner {
  display: none;
}
.rsvp-card__corner--tl { top: 0.55cqw; left: 0.55cqw; }
.rsvp-card__corner--tr { top: 0.55cqw; right: 0.55cqw; transform: scaleX(-1); }
.rsvp-card__corner--bl { bottom: 0.55cqw; left: 0.55cqw; transform: scaleY(-1); }
.rsvp-card__corner--br { bottom: 0.55cqw; right: 0.55cqw; transform: scale(-1, -1); }
.rsvp-card__heart {
  width: 1.5cqw;
  height: 1.5cqw;
  margin-bottom: 0.35cqw;
}
.caps-rsvp {
  margin: 0 0 0.25cqw;
  color: var(--gold-dark);
  font-size: 2.05cqw;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}
.rsvp-deadline {
  margin: 0 0 1.4cqw;
  color: var(--ink-soft);
  font-size: 1.05cqw;
  line-height: 1.1;
}
.rsvp-form {
  max-width: 71cqw;
  margin: 0 auto;
  text-align: left;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 0.76fr;
  gap: 5.4cqw;
  align-items: start;
}
.field { margin-bottom: 1.15cqw; }
.field:last-of-type { margin-bottom: 1.1cqw; }
.field__label {
  display: block;
  margin-bottom: 0.42cqw;
  color: var(--ink);
  font-size: 1.05cqw;
  font-weight: 600;
  line-height: 1.15;
}
.req { color: var(--error); }
textarea,
input[type="password"] {
  width: 100%;
  border: none;
  border-bottom: clamp(1px, 0.11cqw, 1.5px) solid var(--gold-light);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: max(16px, 1.15cqw);
}
textarea {
  min-height: 3.5cqw;
  padding: 0.45cqw 0.15cqw;
  resize: vertical;
}
textarea:focus,
input[type="password"]:focus {
  outline: none;
  border-bottom-color: var(--gold-dark);
}
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.48cqw;
}
.radio-group input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.radio-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 1.45cqw;
  padding-left: 1.7cqw;
  color: var(--ink);
  cursor: pointer;
  font-size: max(13px, 1.03cqw);
  line-height: 1.15;
  user-select: none;
}
.radio-option::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: max(10px, 0.95cqw);
  height: max(10px, 0.95cqw);
  border: clamp(1px, 0.11cqw, 1.5px) solid var(--gold);
  border-radius: 50%;
  background: transparent;
  transform: translateY(-50%);
}
.radio-group input:checked + .radio-option::after {
  content: '';
  position: absolute;
  left: max(3px, 0.25cqw);
  top: 50%;
  width: max(5px, 0.45cqw);
  height: max(5px, 0.45cqw);
  border-radius: 50%;
  background: var(--gold);
  transform: translateY(-50%);
}
.radio-group input:focus-visible + .radio-option::before {
  outline: 2px solid var(--gold-dark);
  outline-offset: 2px;
}
.field__error {
  min-height: 1em;
  margin: 0.32cqw 0 0;
  color: var(--error);
  font-size: max(12px, 0.9cqw);
}
.form-error {
  margin: 0 0 1cqw;
  padding: 0.65em 0.9em;
  border: 1px solid rgba(163, 60, 60, 0.35);
  background: rgba(163, 60, 60, 0.08);
  color: var(--error);
  font-size: max(13px, 0.95cqw);
}
.btn-invite {
  display: block;
  min-width: 13cqw;
  margin: 0.6cqw auto 0;
  padding: 0.72cqw 2.4cqw;
  border: 1px solid var(--gold);
  border-radius: 2px;
  background: var(--gold);
  color: var(--white);
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: max(13px, 1.05cqw);
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}
.btn-invite:hover {
  border-color: var(--gold-dark);
  background: var(--gold-dark);
}
.btn-invite--sm {
  display: inline-block;
  min-width: 0;
  padding: 0.55em 1.1em;
  font-size: 0.82rem;
}
.btn-invite:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.thank-you {
  padding: 1.5cqw 0;
  text-align: center;
}
.thank-you__heart {
  width: 3cqw;
  height: 3cqw;
  margin-bottom: 0.4cqw;
  color: var(--gold);
}
.thank-you p {
  color: var(--ink-soft);
  font-size: max(15px, 1.1cqw);
}

/* ===================== Closing Photo Band ===================== */
.closing {
  position: relative;
  display: flex;
  min-height: 22.5cqw;
  padding: 4.1cqw 2cqw 3.4cqw;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
  background-image: url('/assets/hero-photo.jpg');
  background-position: 35% 76%;
  background-size: cover;
}
.closing::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 74% 82% at center, rgba(248, 236, 217, 0.92) 0%, rgba(248, 236, 217, 0.7) 46%, rgba(248, 236, 217, 0.18) 100%),
    linear-gradient(to right, rgba(248, 236, 217, 0.24), rgba(248, 236, 217, 0.04), rgba(248, 236, 217, 0.24));
}
.closing__meta,
.closing__rule {
  position: relative;
  z-index: 1;
}
.closing__meta {
  margin: 1.05cqw 0 0;
  color: var(--ink);
  font-size: 1.02cqw;
  letter-spacing: 0.18em;
  line-height: 1.1;
  text-transform: uppercase;
}
.closing__rule {
  width: 18cqw;
  margin: 1.15cqw auto 0;
}
.closing-corner {
  position: absolute;
  z-index: 1;
  bottom: -1.1cqw;
  width: 12cqw;
  height: 12cqw;
  pointer-events: none;
}
.closing-corner--bl { left: -1.1cqw; }
.closing-corner--br {
  right: -1.1cqw;
  transform: scaleX(-1);
}
.closing-corner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mask-image: radial-gradient(circle at bottom left, black 38%, transparent 84%);
  -webkit-mask-image: radial-gradient(circle at bottom left, black 38%, transparent 84%);
}

/* ===================== Footer / Modal ===================== */
.footer {
  padding: 18px 24px 28px;
  background: var(--cream);
  text-align: center;
}
.footer__planner-link {
  padding: 0.5em;
  border: none;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  opacity: 0.55;
  text-decoration: underline;
}
.footer__planner-link:hover {
  color: var(--gold-dark);
  opacity: 0.9;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(60, 50, 38, 0.55);
}
.modal__panel {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 36px 28px;
  border: 1.5px solid var(--gold);
  background: var(--ivory);
}
.modal__close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
}
.modal__close:hover { color: var(--gold-dark); }
#planner-login-form { max-width: 320px; }
#planner-login-form .field__label {
  margin-top: 1em;
  font-size: 1rem;
}
#planner-login-form .btn-invite {
  width: 100%;
  margin-top: 1.2em;
}
.planner-summary {
  display: flex;
  gap: 24px;
  margin: 0.8em 0 1.2em;
  flex-wrap: wrap;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.planner-summary strong { color: var(--gold-dark); }
.planner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 1.2em;
}
.planner-table-wrap { overflow-x: auto; }
.planner-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.planner-table th,
.planner-table td {
  padding: 8px 10px;
  border: 1px solid var(--gold-light);
  text-align: left;
  vertical-align: top;
}
.planner-table th {
  background: var(--cream-deep);
  color: var(--ink-soft);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.planner-table tbody tr:nth-child(even) { background: rgba(178, 138, 76, 0.05); }

@media (max-width: 520px) {
  .invite {
    width: calc(100vw - 10px);
    margin-top: 10px;
  }
}

/* Small usability adjustments only: the artwork composition remains unchanged. */
@container (max-width: 520px) {
  .hero { height: 104cqw; }
  .hero__content {
    width: 94%;
    padding-top: 6.2cqw;
    padding-left: 6.6cqw;
    padding-bottom: 5.4cqw;
  }
  .eyebrow,
  .venue-eyebrow { font-size: max(10px, 2.05cqw); }
  .script-hero { font-size: 9.55cqw; }
  .script-hero--celebrate {
    margin-top: 0.65cqw;
    margin-bottom: 1.18cqw;
    font-size: 8.35cqw;
  }
  .hero-subtitle {
    margin-bottom: 1.58cqw;
    font-size: max(11px, 2.05cqw);
    letter-spacing: 0.055em;
  }
  .hero-note {
    margin-top: 0.55cqw;
    margin-bottom: 1.18cqw;
    font-size: max(8.5px, 1.46cqw);
    letter-spacing: 0.025em;
  }
  .hero-date-line {
    margin-top: 1.4cqw;
    margin-bottom: 2.05cqw;
    font-size: max(10.5px, 1.86cqw);
    letter-spacing: 0.055em;
  }
  .caps-hero { font-size: 4.72cqw; }
  .script-names { font-size: 7.05cqw; }
  .script-venue { font-size: 7.35cqw; }
  .rule-heart {
    width: 30cqw;
    margin-top: 0.82cqw;
    margin-bottom: 1.05cqw;
  }
  .rule-heart--sm {
    width: 27cqw;
    margin-top: 1.18cqw;
    margin-bottom: 1.35cqw;
  }
  .heart-icon {
    width: max(6px, 1.35cqw);
    height: max(6px, 1.35cqw);
  }
  .date-block { margin-top: 1.05cqw; margin-bottom: 1.05cqw; }
  .date-block__day {
    width: 34cqw;
    font-size: max(8px, 1.75cqw);
  }
  .date-block__row {
    grid-template-columns: 10.4cqw 5.7cqw 10.4cqw;
    gap: 1.35cqw;
  }
  .date-block__month,
  .date-block__year { font-size: max(7px, 1.42cqw); }
  .date-block__num { font-size: 6.05cqw; }
  .schedule {
    width: 44cqw;
    gap: 1.08cqw;
    margin-bottom: 1.36cqw;
  }
  .schedule__item {
    grid-template-columns: 5.2cqw 1px 1fr;
    gap: 1.72cqw;
    min-height: 6.35cqw;
  }
  .schedule__icon {
    width: 4.72cqw;
    height: 4.72cqw;
  }
  .schedule__label { font-size: max(10px, 2.12cqw); }
  .schedule__time { font-size: max(12px, 2.78cqw); }
  .venue-address {
    font-size: max(9.5px, 1.68cqw);
    margin-bottom: 1.05cqw;
  }
  .link-gold { font-size: max(9px, 1.42cqw); }

  .rsvp-section { padding-top: 3cqw; padding-bottom: 3.2cqw; }
  .rsvp-card {
    width: 92.5%;
    padding: 3.55cqw 4.7cqw 4cqw;
  }
  .rsvp-card__heart {
    width: 2.2cqw;
    height: 2.2cqw;
    margin-bottom: 0.45cqw;
  }
  .rsvp-form { max-width: 80cqw; }
  .field-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
    gap: 4cqw;
  }
  .caps-rsvp { font-size: max(14px, 2.2cqw); }
  .rsvp-deadline {
    margin-bottom: 2.35cqw;
    font-size: max(10.5px, 1.2cqw);
  }
  .field { margin-bottom: 2.05cqw; }
  .field__label { font-size: max(13px, 1.24cqw); }
  .radio-option {
    min-height: 20px;
    padding-left: 22px;
    font-size: max(13px, 1.14cqw);
  }
  .radio-option::before {
    width: 14px;
    height: 14px;
  }
  .radio-group input:checked + .radio-option::after {
    left: 4px;
    width: 6px;
    height: 6px;
  }
  .radio-group { gap: 0.65cqw; }
  textarea {
    min-height: 38px;
    font-size: 16px;
  }
  .btn-invite {
    min-width: 30cqw;
    padding: 1.45cqw 2.8cqw;
    font-size: max(13px, 1.24cqw);
  }
  .closing { min-height: 26cqw; }
  .closing__meta { font-size: max(7.5px, 1.02cqw); }
}
