:root {
  --paper: #f3e4c8;
  --paper-shadow: #e8d4ae;
  --ink: #121514;
  --terracotta: #c94f25;
  --blue: #315b9e;
  --line: rgba(18, 21, 20, 0.24);
  --art-scale: 160%;
  --art-position-y: 0%;
  --grain-image: none;
  --serif: Baskerville, "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: Avenir, "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::after {
  content: "";
  position: fixed;
  z-index: 10;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain-image);
  background-repeat: repeat;
  background-size: 96px 96px;
  opacity: 0.055;
}

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

.invitation {
  width: min(1280px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 26px clamp(24px, 5vw, 76px) 20px;
  overflow: hidden;
}

.masthead,
.invitation-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.6px;
  line-height: 1.35;
  text-transform: uppercase;
}

.masthead {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ink);
}

.masthead p,
.invitation-footer { margin: 0; }

.masthead .masthead-dot { margin: 0 6px; color: var(--terracotta); }

.masthead .wordmark,
.footer-wordmark {
  color: var(--ink);
  font-family: "Kohinoor Devanagari", "Noto Serif Devanagari", "Noto Sans Devanagari", serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 0;
  text-transform: none;
}

.masthead .wordmark-divider {
  margin: 0 7px;
  color: var(--ink);
}

.opening {
  display: grid;
  grid-template-columns: minmax(280px, 0.84fr) minmax(430px, 1.16fr);
  align-items: end;
  gap: clamp(42px, 8vw, 132px);
  padding: clamp(38px, 6vw, 82px) 0 clamp(36px, 5vw, 66px);
}

.art-fragment {
  position: relative;
  min-height: clamp(320px, 37vw, 460px);
  margin: 0;
  overflow: hidden;
  background: var(--paper-shadow);
  background-image: url("invite-poster.png");
  background-position: 50% var(--art-position-y);
  background-repeat: no-repeat;
  background-size: var(--art-scale) auto;
  animation: enter-left 800ms 100ms both cubic-bezier(.2, .75, .28, 1);
}

.art-fragment img {
  display: none;
}

.art-fragment::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(18, 21, 20, 0.09);
}

.art-fragment::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: -18%;
  pointer-events: none;
  background: radial-gradient(circle at 65% 61%, rgba(201, 79, 37, 0.34) 0, rgba(201, 79, 37, 0.13) 24%, rgba(201, 79, 37, 0) 58%);
  mix-blend-mode: screen;
  opacity: 0.38;
  animation: sun-breathe 18s ease-in-out infinite alternate;
}

.opening-copy {
  max-width: 650px;
  padding-bottom: 12px;
  animation: enter-right 820ms 180ms both cubic-bezier(.2, .75, .28, 1);
}

.kicker,
.section-number,
.host-note p,
.field-hint,
.success-footnote {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.7px;
  line-height: 1.5;
  text-transform: uppercase;
}

.kicker {
  margin: 0 0 18px;
  color: var(--terracotta);
}

h1,
h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0;
}

h1 {
  max-width: 630px;
  font-size: clamp(50px, 5.65vw, 82px);
  line-height: 0.94;
}

.opening-note {
  max-width: 430px;
  margin: 22px 0 0;
  font-family: var(--serif);
  font-size: clamp(19px, 1.7vw, 24px);
  font-style: italic;
  line-height: 1.35;
}

.rsvp-section {
  display: grid;
  grid-template-columns: minmax(230px, 0.7fr) minmax(500px, 1.3fr);
  gap: clamp(38px, 8vw, 126px);
  padding: clamp(32px, 4vw, 54px) 0 clamp(42px, 5vw, 66px);
  border-top: 1px solid var(--ink);
}

.rsvp-introduction { padding-top: 3px; }

.section-number {
  margin: 0 0 20px;
  color: var(--terracotta);
}

.rsvp-introduction h2 {
  max-width: 280px;
  font-size: clamp(28px, 2.5vw, 38px);
  line-height: 1.01;
}

.rsvp-introduction > p:last-child {
  max-width: 250px;
  margin: 20px 0 0;
  color: rgba(18, 21, 20, 0.65);
  font-family: var(--serif);
  font-size: 17px;
  font-style: italic;
  line-height: 1.35;
}

.response-area { min-width: 0; }

.rsvp-form {
  max-width: 650px;
  animation: rise 760ms 280ms both cubic-bezier(.2, .75, .28, 1);
}

.name-field label,
.guest-count legend {
  display: block;
  margin-bottom: 11px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
  line-height: 1.35;
  text-transform: uppercase;
}

input[type="text"] {
  width: 100%;
  min-height: 64px;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: var(--serif);
  font-size: clamp(26px, 2.5vw, 36px);
  line-height: 1;
  transition: border-color 180ms ease;
}

input[type="text"]::placeholder {
  color: rgba(18, 21, 20, 0.32);
  font-style: italic;
}

input[type="text"]:focus { border-bottom-color: var(--terracotta); }

.field-error {
  min-height: 16px;
  margin: 7px 0 0;
  color: var(--terracotta);
  font-size: 12px;
}

.guest-count {
  margin: 28px 0 0;
  padding: 0;
  border: 0;
}

.field-hint {
  max-width: 570px;
  margin: -1px 0 17px;
  color: rgba(18, 21, 20, 0.62);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.55px;
  line-height: 1.55;
  text-transform: none;
}

.choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 24px;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1;
}

.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.choice-mark {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 18px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.choice input:checked + .choice-mark {
  border: 5px solid var(--terracotta);
  background: var(--paper);
  transform: rotate(-8deg) scale(1.08);
}

.choice input:focus-visible + .choice-mark {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.host-note {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 24px;
  max-width: 590px;
  margin-top: 30px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.host-note p {
  margin: 0;
  color: var(--terracotta);
  white-space: nowrap;
}

.host-note span {
  max-width: 390px;
  color: rgba(18, 21, 20, 0.76);
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  line-height: 1.34;
}

.form-footer { margin-top: 31px; }

.primary-button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 0 17px 0 20px;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--paper);
  background: var(--ink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms cubic-bezier(.2, .75, .28, 1);
}

.primary-button:hover {
  color: var(--ink);
  background: var(--paper);
  transform: translateY(-3px);
}

.primary-button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.button-arrow {
  position: relative;
  width: 15px;
  height: 15px;
  display: inline-block;
  flex: 0 0 15px;
  font-size: 0;
}

.button-arrow::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 15px;
  height: 1.5px;
  background: currentColor;
  transform: rotate(-45deg);
  transform-origin: center;
}

.button-arrow::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 7px;
  height: 7px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
}

.form-status {
  min-height: 18px;
  margin: 11px 0 0;
  color: var(--terracotta);
  font-size: 12px;
}

.rsvp-form.is-submitting .primary-button {
  pointer-events: none;
  opacity: 0.58;
}

.invitation.is-confirmed .opening,
.invitation.is-confirmed .rsvp-introduction {
  display: none;
}

.invitation.is-confirmed .rsvp-section {
  display: flex;
  align-items: center;
  min-height: calc(100svh - 112px);
  padding-top: clamp(56px, 10svh, 132px);
  padding-bottom: clamp(56px, 10svh, 132px);
  border-top: 0;
}

.invitation.is-confirmed .response-area {
  width: 100%;
  max-width: 570px;
  margin: 0 auto;
}

.success-view {
  max-width: 570px;
  padding: 9px 0 2px;
  animation: reveal 300ms cubic-bezier(.2, .75, .28, 1) both;
}

.success-stamp {
  position: relative;
  width: 112px;
  min-height: 70px;
  display: grid;
  place-items: center;
  margin: 0 0 31px;
  border: 3px solid var(--terracotta);
  color: var(--terracotta);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 3px;
  line-height: 1.15;
  text-align: center;
  opacity: 0;
  transform: rotate(-5deg);
}

.seal-wax {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  border: 2px solid rgba(18, 21, 20, 0.16);
  border-radius: 48% 52% 51% 49%;
  background: var(--terracotta);
  box-shadow: inset 0 0 0 3px rgba(243, 228, 200, 0.18);
  transform: translate(-50%, -50%) rotate(-8deg);
}

.seal-wax::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(243, 228, 200, 0.58);
  border-radius: 50%;
}

.success-view h2 {
  max-width: 520px;
  font-size: clamp(44px, 5vw, 72px);
  line-height: 0.95;
}

.guest-name-wrap {
  position: relative;
  display: inline-block;
  isolation: isolate;
  white-space: nowrap;
}

.guest-name-wrap #guest-name {
  position: relative;
  z-index: 1;
}

.name-flourish {
  position: absolute;
  z-index: 0;
  bottom: -0.08em;
  left: -0.06em;
  width: 112%;
  height: 0.48em;
  overflow: visible;
}

.name-flourish path {
  fill: none;
  stroke: var(--terracotta);
  stroke-linecap: round;
  stroke-width: 3.5;
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
}

.success-copy {
  margin: 20px 0 29px;
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
}

.success-view .kicker,
.success-view h2,
.success-view .success-copy,
.success-view .success-footnote {
  opacity: 0;
}

.map-button {
  min-width: 190px;
  opacity: 0;
  transform: translateY(10px);
}

.calendar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 10px;
  opacity: 0;
  transform: translateY(8px);
}

.calendar-action {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid rgba(18, 21, 20, 0.72);
  color: var(--ink);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  line-height: 1.1;
  text-decoration: none;
  text-transform: uppercase;
}

.calendar-action:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
}

.calendar-action:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
}

.success-view.is-unlocking .success-stamp {
  animation: stamp-arrive 280ms both cubic-bezier(.2, .75, .28, 1);
}

.success-view.is-unlocking .seal-wax {
  animation: seal-break 380ms 120ms both cubic-bezier(.2, .75, .28, 1);
}

.success-view.is-unlocking .kicker {
  animation: copy-arrive 230ms 370ms both cubic-bezier(.2, .75, .28, 1);
}

.success-view.is-unlocking h2 {
  animation: copy-arrive 300ms 440ms both cubic-bezier(.2, .75, .28, 1);
}

.success-view.is-unlocking .success-copy {
  animation: copy-arrive 240ms 630ms both cubic-bezier(.2, .75, .28, 1);
}

.success-view.is-unlocking .name-flourish path {
  animation: draw-ink 520ms 740ms cubic-bezier(.2, .75, .28, 1) forwards;
}

.success-view.is-unlocking .map-button {
  animation: map-unlock 330ms both cubic-bezier(.2, .75, .28, 1);
}

.success-view.is-unlocking .calendar-actions {
  animation: map-unlock 300ms both cubic-bezier(.2, .75, .28, 1);
}

.success-view.is-unlocking .success-footnote {
  animation: copy-arrive 240ms 1.5s both cubic-bezier(.2, .75, .28, 1);
}

.success-footnote {
  margin: 18px 0 0;
  color: rgba(18, 21, 20, 0.62);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: none;
}

.invitation-footer {
  padding-top: 15px;
  border-top: 1px solid var(--ink);
  font-size: 9px;
}

.invitation-footer i {
  width: 4px;
  height: 4px;
  display: inline-block;
  margin: 0 8px 2px;
  border-radius: 50%;
  background: var(--terracotta);
}

[hidden] { display: none !important; }

@keyframes enter-left {
  from { opacity: 0; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes enter-right {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sun-breathe {
  from { opacity: 0.28; transform: scale(0.96) translate3d(-1%, 1%, 0); }
  to { opacity: 0.48; transform: scale(1.06) translate3d(1%, -1%, 0); }
}

@keyframes stamp-arrive {
  from { opacity: 0; transform: rotate(-8deg) scale(0.78); }
  to { opacity: 1; transform: rotate(-5deg) scale(1); }
}

@keyframes seal-break {
  0%, 42% { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(1); }
  72% { opacity: 0.74; transform: translate(-50%, -50%) rotate(9deg) scale(1.13); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(18deg) scale(1.34); }
}

@keyframes copy-arrive {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes draw-ink {
  to { stroke-dashoffset: 0; }
}

@keyframes map-unlock {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .invitation { padding: 19px 20px 17px; }

  .masthead {
    align-items: flex-start;
    gap: 11px;
    padding-bottom: 14px;
    font-size: 8px;
    line-height: 1.5;
  }

  .masthead p:last-child { max-width: 140px; text-align: right; }
  .masthead .masthead-dot { margin: 0 3px; }

  .opening {
    grid-template-columns: 1fr;
    gap: 29px;
    padding: 22px 0 38px;
  }

  .art-fragment {
    min-height: 265px;
    max-height: 39svh;
  }

  .opening-copy { padding-bottom: 0; }
  .kicker { margin-bottom: 14px; font-size: 9px; }
  h1 { font-size: clamp(46px, 13vw, 68px); line-height: 0.93; }
  .opening-note { margin-top: 18px; font-size: 20px; }

  .rsvp-section {
    grid-template-columns: 1fr;
    gap: 29px;
    padding: 29px 0 38px;
  }

  .invitation.is-confirmed .rsvp-section {
    min-height: calc(100svh - 78px);
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .rsvp-introduction { display: grid; grid-template-columns: 46px 1fr; column-gap: 12px; }
  .section-number { grid-column: 1; margin: 3px 0 0; }
  .rsvp-introduction h2 { grid-column: 2; max-width: 320px; font-size: 31px; }
  .rsvp-introduction > p:last-child { grid-column: 2; max-width: 260px; margin-top: 13px; font-size: 16px; }
  .rsvp-form { max-width: none; }
  input[type="text"] { min-height: 60px; }
  .guest-count { margin-top: 25px; }
  .choice-list { gap: 9px 18px; }
  .choice { font-size: 19px; }
  .host-note { grid-template-columns: max-content minmax(0, 1fr); gap: 16px; margin-top: 27px; }
  .host-note span { font-size: 16px; }
  .primary-button { width: 100%; }
  .invitation-footer { gap: 12px; font-size: 8px; }
}

@media (max-width: 380px) {
  .invitation { padding-right: 16px; padding-left: 16px; }
  h1 { font-size: 44px; }
  .choice-list { gap: 9px 13px; }
  .choice { font-size: 18px; }
  .masthead { gap: 7px; }
  .masthead .wordmark { font-size: 15px; }
  .masthead .wordmark-divider,
  .masthead .guest-list-title { display: none; }
  .masthead p:first-child { white-space: nowrap; }
  .masthead p:last-child { max-width: 132px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }

  .art-fragment {
    --art-scale: 160%;
    --art-position-y: 0%;
  }

  .art-fragment::before { animation: none; }
  .success-view .seal-wax { display: none; }
  .success-view .kicker,
  .success-view h2,
  .success-view .success-copy,
  .success-view .success-footnote,
  .map-button,
  .calendar-actions {
    opacity: 1;
    transform: none;
  }

  .name-flourish path { stroke-dashoffset: 0; }
}
