:root {
  --accent: #b51f34;
  --ink: #42121b;
  --muted: rgba(66, 18, 27, 0.72);
  --panel: rgba(255, 250, 248, 0.78);
  --panel-strong: rgba(255, 250, 248, 0.96);
  --line: rgba(181, 31, 52, 0.2);
  --shadow: 0 24px 80px rgba(92, 16, 27, 0.18);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff7f4;
}

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

.app-shell {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 250, 247, 0.2), rgba(255, 242, 239, 0.9)),
    url("assets/red-white-floral-bg.png") center / cover fixed;
  animation: backgroundDrift 24s ease-in-out infinite alternate;
}

.invite {
  min-height: 100vh;
}

.section {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 100svh;
  padding: 72px clamp(20px, 5vw, 80px);
  isolation: isolate;
}

.section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.88), transparent 34%),
    linear-gradient(180deg, rgba(255, 250, 247, 0.4), rgba(255, 242, 239, 0.76));
}

.hero {
  text-align: center;
}

.top-actions {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 60;
}

.chip,
.button,
.icon-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(18px);
  cursor: pointer;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.chip {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(92, 16, 27, 0.12);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 700;
}

.button.primary {
  color: #fff9f7;
  border-color: color-mix(in srgb, var(--accent) 80%, white);
  background: linear-gradient(135deg, #cf4555, var(--accent));
}

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

.hero-content {
  width: min(780px, 100%);
  margin: 0 auto;
  padding: 34px 0;
  animation: heroEnter 1200ms ease both;
  text-shadow: 0 10px 34px rgba(255, 255, 255, 0.68);
}

.eyebrow {
  margin: 0 0 14px;
  color: color-mix(in srgb, var(--accent) 72%, white);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

h1 {
  font-size: clamp(4rem, 15vw, 9.5rem);
  line-height: 0.88;
  color: #8f1326;
}

h2 {
  font-size: clamp(2.2rem, 7vw, 5.8rem);
  line-height: 0.98;
}

.hero-date,
.date-line {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 3vw, 1.55rem);
  font-weight: 700;
}

.intro,
.quote,
.details-section p,
.memory-section h2 + .memory-form {
  width: min(620px, 100%);
}

.intro,
.quote {
  margin: 26px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.24rem);
  line-height: 1.7;
}

.hero-actions,
.editor-actions,
.upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 30px;
}

.upload-actions {
  justify-content: start;
  margin-top: 4px;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 24px;
  translate: -50% 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.countdown-section,
.details-section,
.gallery-section,
.memory-section,
.rsvp-section {
  background: rgba(255, 248, 246, 0.54);
  min-height: auto;
  padding-top: clamp(72px, 9vw, 112px);
  padding-bottom: clamp(72px, 9vw, 112px);
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(82px, 1fr));
  gap: 12px;
  width: min(740px, 100%);
  margin-top: 34px;
}

.countdown div,
.gallery-card,
.memory-form,
.rsvp-form,
.memory-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.countdown div {
  min-height: 112px;
  display: grid;
  place-items: center;
  padding: 16px 8px;
}

.countdown strong {
  display: block;
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 1;
  font-family: Georgia, "Times New Roman", serif;
}

.countdown span {
  color: var(--muted);
  font-size: 0.88rem;
}

.details-section,
.gallery-section,
.memory-section,
.rsvp-section,
.countdown-section {
  align-content: start;
  gap: 22px;
}

.map-frame {
  width: min(900px, 100%);
  height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  filter: saturate(0.8) contrast(1.05);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: min(960px, 100%);
}

.gallery-card {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background-position: center;
  background-size: cover;
  transform: translateY(0) scale(1);
  transition: transform 420ms ease, box-shadow 420ms ease, filter 420ms ease;
}

.gallery-card::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(180deg, transparent 50%, rgba(86, 15, 28, 0.38)),
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.18), transparent 25%);
  opacity: 0.82;
  transition: opacity 420ms ease;
}

.gallery-card:hover {
  transform: translateY(-6px) scale(1.018);
  box-shadow: 0 26px 70px rgba(92, 16, 27, 0.28);
  filter: saturate(1.06);
}

.gallery-card:hover::after {
  opacity: 0.35;
}

.memory-form,
.rsvp-form {
  display: grid;
  gap: 14px;
  width: min(640px, 100%);
  padding: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(181, 31, 52, 0.18);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
}

select option {
  color: #08152b;
}

.memory-list {
  display: grid;
  gap: 10px;
  width: min(640px, 100%);
}

.memory-note {
  padding: 14px 16px;
}

.memory-note strong {
  display: block;
  margin-bottom: 5px;
}

.form-status {
  min-height: 24px;
  color: var(--muted);
}

.hidden-field {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.footer {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 46px 20px 60px;
  color: var(--muted);
  background: rgba(255, 246, 243, 0.88);
}

.footer strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.9rem;
  font-weight: 500;
}

.editor {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 30;
  width: min(420px, 100vw);
  padding: 22px;
  overflow: auto;
  color: var(--ink);
  background: var(--panel-strong);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.38);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(104%);
  transition: transform 220ms ease;
}

.editor.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.editor-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.editor-head h2 {
  font-size: 1.8rem;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-weight: 800;
}

.editor-form {
  display: grid;
  gap: 12px;
}

.editor .editor-actions {
  justify-content: start;
}

@media (max-width: 720px) {
  .section {
    min-height: 100svh;
    padding: 66px 18px;
  }

  h1 {
    font-size: clamp(3.3rem, 24vw, 5.8rem);
  }

  .countdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .map-frame {
    height: 280px;
  }

  .editor {
    width: 100vw;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 760ms ease var(--delay, 0ms),
    transform 760ms ease var(--delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes heroEnter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes backgroundDrift {
  from {
    background-position: center top;
  }

  to {
    background-position: center bottom;
  }
}

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