:root {
  --cream: #f3ecdf;
  --paper: #fffdf8;
  --field: #f4eee4;
  --ink: #2a2118;
  --muted: #5e5146;
  --line: rgba(42, 33, 24, 0.12);
  --gold: #8a6233;
  --gold-soft: rgba(138, 98, 51, 0.45);
  --sage: #24382c;
  --clay: #5e4638;
  --error: #8d3b32;
  --serif: "Fraunces Variable", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "Outfit Variable", "Avenir Next", "Segoe UI", sans-serif;
  --shadow: 0 28px 70px rgba(72, 48, 22, 0.1);
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

::selection {
  background: #ead7b0;
  color: var(--ink);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.atmosphere-rays {
  position: absolute;
  width: 92vmax;
  height: 92vmax;
  top: -38vmax;
  right: -28vmax;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 8deg,
    rgba(176, 136, 70, 0) 0deg 14deg,
    rgba(176, 136, 70, 0.18) 14deg 15deg
  );
  mask-image: radial-gradient(circle, transparent 0 16%, #000 22% 48%, transparent 70%);
  animation: turn 180s linear infinite;
}

.orb {
  position: absolute;
  border-radius: 50%;
}

.orb-a {
  width: 48vmax;
  height: 48vmax;
  left: -16vmax;
  bottom: -22vmax;
  background: radial-gradient(circle, rgba(228, 200, 187, 0.9), transparent 68%);
}

.orb-b {
  width: 36vmax;
  height: 36vmax;
  right: -12vmax;
  top: -14vmax;
  background: radial-gradient(circle, rgba(232, 210, 160, 0.75), transparent 70%);
}

.mark {
  width: 48px;
  height: 48px;
  display: block;
  margin: 0 auto 12px;
  color: var(--gold);
  animation: turn 96s linear infinite;
}

.page-guest {
  display: grid;
  align-items: start;
  padding:
    max(22px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
}

.sheet,
.sign {
  position: relative;
  width: min(640px, 100%);
  margin: 0 auto;
  background: var(--paper);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.sheet {
  padding: clamp(32px, 6vw, 60px) clamp(20px, 5vw, 52px) 36px;
}

.sheet::before,
.sign::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid var(--gold-soft);
  border-radius: 18px;
  pointer-events: none;
}

.mast,
.sign {
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.74rem;
  font-weight: 560;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow.announce {
  letter-spacing: 0.16em;
  line-height: 1.5;
}

.names {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(3.4rem, 13vw, 6.4rem);
  line-height: 0.84;
  letter-spacing: -0.04em;
  font-variation-settings: "SOFT" 32, "WONK" 1, "opsz" 144, "wght" 560;
}

.names span {
  display: block;
}

.amp {
  font-style: italic;
  font-weight: 460;
  font-size: 0.42em;
  line-height: 1;
  letter-spacing: 0;
  color: var(--gold);
  margin: 0.08em 0;
  font-variation-settings: "SOFT" 60, "WONK" 0, "opsz" 144, "wght" 460;
}

.date {
  margin: 0.95rem 0 0;
  font-size: 0.78rem;
  font-weight: 560;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.question {
  max-width: 16em;
  margin: 0.85rem auto 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 480;
  font-size: clamp(1.35rem, 3.2vw, 1.9rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 55, "WONK" 0, "opsz" 48, "wght" 480;
}

.rule {
  width: 76px;
  height: 1px;
  margin: 22px auto 0;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.rsvp {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

[hidden] {
  display: none !important;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 560;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.optional {
  margin-left: 0.35rem;
  font-style: normal;
  font-weight: 450;
  letter-spacing: 0.08em;
  text-transform: none;
  color: #a89886;
}

.field {
  display: grid;
}

input[type="text"],
input[type="search"],
textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--field);
  padding: 16px;
  font-size: 16px;
  line-height: 1.4;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #b3a394;
}

input[type="text"]:focus,
input[type="search"]:focus,
textarea:focus {
  background: white;
  border-color: var(--gold-soft);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  background: #fbf3f0;
  border-color: rgba(141, 59, 50, 0.45);
}

.reserve-actions {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.submit {
  width: 100%;
}

.thanks-actions {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.quiet {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 44px;
  padding: 0 8px;
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.quiet:hover {
  color: var(--ink);
}

.quiet[data-armed="1"] {
  color: var(--error);
}

.party-grid {
  display: grid;
  gap: 14px;
}

.party {
  padding-top: 2px;
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  background: var(--field);
}

.stepper button {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(42, 33, 24, 0.06);
}

.stepper button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.stepper-value {
  min-width: 2.4ch;
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 540;
  line-height: 1;
  text-align: center;
  font-variation-settings: "SOFT" 30, "opsz" 72, "wght" 540;
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.submit,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 22px;
  border-radius: 999px;
  text-decoration: none;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.86rem;
  font-weight: 540;
}

.submit {
  border: 0;
  background: var(--ink);
  color: #f7f1e6;
}

.submit:hover {
  background: #3d3126;
}

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

.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.form-error {
  margin: 0;
  color: var(--error);
  font-size: 0.98rem;
}

.thanks {
  margin-top: 28px;
  text-align: center;
}

.thanks:not([hidden]) {
  animation: rise 0.4s ease;
}

.thanks h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 520;
  font-size: clamp(2.3rem, 6vw, 3.3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  font-variation-settings: "SOFT" 40, "opsz" 144, "wght" 520;
}

.thanks-body {
  margin: 12px auto 18px;
  max-width: 34rem;
  color: var(--muted);
}

.page-card {
  display: grid;
  place-items: center;
  padding:
    max(20px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

.sign {
  width: min(560px, 100%);
  padding: clamp(32px, 6vw, 58px) clamp(20px, 5vw, 44px) 32px;
}

.scan-line {
  margin: 20px 0 0;
  font-size: 0.76rem;
  font-weight: 560;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}

.qr-frame {
  display: grid;
  place-items: center;
  width: fit-content;
  margin: 18px auto 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.qr-frame img {
  display: block;
  width: min(64vw, 250px);
  height: auto;
  background: var(--paper);
}

.url {
  margin: 6px 0 18px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.url a,
a.url {
  color: inherit;
}

@media (min-width: 720px) {
  .names {
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    gap: 0.22em;
  }

  .amp {
    font-size: 0.48em;
    margin: 0;
  }

  .party-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-height: 760px) {
  .names {
    font-size: 3.15rem;
  }

  .sheet {
    padding-top: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .mark,
  .atmosphere-rays,
  .thanks:not([hidden]) {
    animation: none;
  }
}

@keyframes turn {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media print {
  @page {
    margin: 0.6in;
  }

  body {
    background: white;
    padding: 0;
  }

  .atmosphere,
  .no-print {
    display: none !important;
  }

  .sign,
  .sheet {
    width: 100%;
    max-width: none;
    box-shadow: none;
  }

  .page-card {
    display: block;
    padding: 0;
  }

  .qr-frame img {
    width: 3.15in;
  }
}
