:root {
  --ink: #28231d;
  --muted: #72685c;
  --gold: #9b7127;
  --gold-dark: #664918;
  --paper: #fffdf8;
  --background: #f3eee3;
  --line: rgba(117, 94, 53, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--background);
  color: var(--ink);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--background);
  font-family: Georgia, "Times New Roman", serif;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.memorial-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 56px 20px 42px;
  background:
    radial-gradient(circle at 50% -5%, rgba(255, 255, 255, 0.96), transparent 38%),
    linear-gradient(145deg, #eee6d8 0%, #faf7f0 45%, #e8dfcf 100%);
}

.ambient {
  position: fixed;
  border: 1px solid rgba(166, 123, 45, 0.2);
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.42;
}

.ambient-one {
  top: -180px;
  right: -150px;
  width: 460px;
  height: 460px;
}

.ambient-two {
  bottom: -250px;
  left: -190px;
  width: 580px;
  height: 580px;
}

.memorial-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 690px);
  margin: 0 auto;
  text-align: center;
}

.memorial-header {
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-weight: 400;
  letter-spacing: -0.035em;
}

h1 {
  font-size: clamp(2.35rem, 9vw, 4.7rem);
  line-height: 0.98;
}

h2 {
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.05;
}

.subtitle {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 3vw, 1.22rem);
  font-style: italic;
}

.invitation-frame {
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(117, 94, 53, 0.2);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow:
    0 30px 70px rgba(62, 51, 35, 0.16),
    0 5px 14px rgba(62, 51, 35, 0.1);
}

.invitation-crop {
  position: relative;
  overflow: hidden;
  aspect-ratio: 710 / 1220;
  border-radius: 2px;
  background: white;
}

.invitation-crop img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

.event-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 30px auto 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.48);
  text-align: left;
}

.event-summary > div {
  display: flex;
  min-height: 120px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 20px 24px;
}

.event-summary > div + div {
  border-left: 1px solid var(--line);
}

.summary-label {
  margin-bottom: 3px;
  color: var(--gold);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.event-summary strong,
.event-summary span:not(.summary-label) {
  line-height: 1.35;
}

.event-summary strong {
  font-size: 0.98rem;
}

.event-summary span:not(.summary-label) {
  color: var(--muted);
  font-size: 0.88rem;
}

.flower-note {
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.primary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  border: 1px solid rgba(99, 72, 24, 0.38);
  border-radius: 999px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(166, 123, 45, 0.35);
  outline-offset: 3px;
}

.button-primary {
  border-color: var(--gold-dark);
  background: var(--gold-dark);
  color: #fffdf8;
}

.button-primary:hover {
  background: #4f3710;
}

.button-secondary {
  background: rgba(255, 253, 248, 0.78);
  color: var(--gold-dark);
}

.button-secondary:hover {
  background: var(--paper);
}

.rsvp-card {
  margin-top: 46px;
  padding: 42px 46px;
  scroll-margin-top: 18px;
  border: 1px solid rgba(117, 94, 53, 0.22);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.84);
  box-shadow: 0 22px 60px rgba(62, 51, 35, 0.11);
  text-align: left;
}

.rsvp-card > .eyebrow,
.rsvp-card h2,
.rsvp-intro,
.text-fallback,
.noscript-note {
  text-align: center;
}

.rsvp-intro {
  max-width: 560px;
  margin: 14px auto 30px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

fieldset {
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

legend,
label > span {
  display: block;
  margin-bottom: 8px;
  color: #4f473e;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

label em {
  color: var(--muted);
  font-weight: 400;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice-card {
  position: relative;
  cursor: pointer;
}

.choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-card span {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid rgba(117, 94, 53, 0.3);
  border-radius: 6px;
  background: #fffdf9;
  color: var(--ink);
}

.choice-card input:checked + span {
  border-color: var(--gold-dark);
  background: #f0e5ce;
  box-shadow: inset 0 0 0 1px var(--gold-dark);
}

.choice-card input:focus-visible + span {
  outline: 3px solid rgba(166, 123, 45, 0.35);
  outline-offset: 3px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 16px;
}

.form-span {
  grid-column: 1 / -1;
}

input[type="text"],
input[type="number"],
textarea {
  display: block;
  width: 100%;
  border: 1px solid rgba(117, 94, 53, 0.32);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
}

input[type="text"],
input[type="number"] {
  min-height: 48px;
  padding: 10px 12px;
}

textarea {
  min-height: 110px;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

input:disabled {
  background: #eee9df;
  color: var(--muted);
  cursor: not-allowed;
}

.form-error {
  min-height: 1.4em;
  margin: 18px 0 0;
  color: #9d2525;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

.send-rsvp {
  width: 100%;
  margin-top: 4px;
}

.text-fallback,
.noscript-note {
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.text-fallback a {
  color: var(--gold-dark);
  font-weight: 700;
}

footer {
  max-width: 560px;
  margin: 36px auto 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.6;
}

@media (max-width: 620px) {
  .memorial-page {
    padding: 38px 12px 30px;
  }

  .memorial-header {
    margin-bottom: 24px;
  }

  .invitation-frame {
    padding: 6px;
  }

  .event-summary {
    grid-template-columns: 1fr;
  }

  .event-summary > div {
    min-height: auto;
    padding: 18px 20px;
    text-align: center;
  }

  .event-summary > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .primary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .rsvp-card {
    margin-top: 38px;
    padding: 32px 20px;
  }

  .form-grid,
  .choice-grid {
    grid-template-columns: 1fr;
  }

  .form-span {
    grid-column: auto;
  }
}

@media (max-width: 410px) {
  .primary-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
