@import url("https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;500;600;700&family=Quicksand:wght@500;600;700&display=swap");

:root {
  --paper: #fffdf7;
  --cream: #fff7ec;
  --card: rgba(255, 253, 247, 0.82);
  --ink: #313131;
  --muted: #716a66;
  --red: #b22222;
  --pink: #e85b8d;
  --coral: #f26b4f;
  --orange: #f08b28;
  --yellow: #e3b82d;
  --blue: #2f8edb;
  --teal: #22a6a6;
  --line: rgba(49, 49, 49, 0.22);
  --ring: rgba(178, 34, 34, 0.16);
  --shadow: 0 22px 54px rgba(178, 34, 34, 0.12);
  --shadow-soft: 0 18px 50px rgba(97, 52, 45, 0.09);
  --shadow-lift: 0 28px 70px rgba(97, 52, 45, 0.17);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  font-family: "Comfortaa", "Quicksand", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(232, 91, 141, 0.12), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(34, 166, 166, 0.1), transparent 24rem),
    linear-gradient(180deg, #fffefb 0%, var(--paper) 44%, #fff7ef 100%);
  text-rendering: geometricPrecision;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: calc(var(--scroll-progress, 0) * 100%);
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--pink), var(--orange), var(--blue), var(--teal));
  box-shadow: 0 0 18px rgba(178, 34, 34, 0.22);
  pointer-events: none;
}

.floating-nav {
  position: sticky;
  top: 12px;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  max-width: calc(100% - 24px);
  margin: 10px auto 0;
  border: 1px solid rgba(49, 49, 49, 0.12);
  border-radius: 999px;
  padding: 7px;
  background: rgba(255, 253, 247, 0.76);
  box-shadow: 0 18px 44px rgba(97, 52, 45, 0.12);
  backdrop-filter: blur(18px);
}

.floating-nav a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  transition: color 0.22s var(--ease), background 0.22s var(--ease), transform 0.22s var(--ease);
}

.floating-nav a:hover,
.floating-nav a.is-active {
  color: #fff;
  background: linear-gradient(135deg, #c53333, var(--red));
  transform: translateY(-1px);
}

.heart-pattern {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  opacity: 0.045;
  background-image:
    radial-gradient(circle at 50% 35%, var(--red) 0 5px, transparent 6px),
    radial-gradient(circle at 43% 30%, var(--red) 0 4px, transparent 5px),
    radial-gradient(circle at 57% 30%, var(--red) 0 4px, transparent 5px);
  background-size: 78px 78px;
}

.heart-pattern::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(45deg, transparent 0 47%, var(--red) 47% 53%, transparent 53% 100%);
  background-size: 78px 78px;
  opacity: 0.45;
}

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

.pearls span {
  position: absolute;
  width: clamp(84px, 12vw, 170px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, rgba(255,255,255,0.7), rgba(255,255,255,0.18) 38%, transparent 70%);
  filter: blur(3px);
  animation: pearl-drift 10s var(--ease) infinite alternate;
}

.pearls span:nth-child(1) { left: -28px; top: 140px; }
.pearls span:nth-child(2) { right: -34px; top: 430px; animation-delay: -2s; }
.pearls span:nth-child(3) { left: 5%; bottom: 16%; animation-delay: -4s; }
.pearls span:nth-child(4) { right: 12%; top: 82px; animation-delay: -1s; }
.pearls span:nth-child(5) { right: 2%; bottom: -32px; animation-delay: -5s; }

@keyframes pearl-drift {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.72; }
  to { transform: translate3d(12px, -18px, 0) scale(1.08); opacity: 0.95; }
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.section {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: clamp(42px, 7vw, 86px) 0;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}

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

.top-garland,
.bottom-garland,
.middle-flags {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 7px;
  min-height: 30px;
  padding-top: 8px;
}

.top-garland::before,
.bottom-garland::before,
.middle-flags::before {
  position: absolute;
  width: min(860px, 86vw);
  height: 2px;
  margin-top: 0;
  content: "";
  background: var(--ink);
  transform: translateY(0);
}

.top-garland span,
.bottom-garland span,
.middle-flags span {
  z-index: 1;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 18px solid var(--red);
  transform-origin: 50% 0;
  animation: flag-sway 2.8s var(--ease) infinite alternate;
}

.top-garland span:nth-child(even),
.bottom-garland span:nth-child(even),
.middle-flags span:nth-child(even) {
  animation-delay: -1.2s;
}

@keyframes flag-sway {
  from { transform: rotate(-2deg) translateY(0); }
  to { transform: rotate(3deg) translateY(2px); }
}

.top-garland span:nth-child(2),
.bottom-garland span:nth-child(5),
.middle-flags span:nth-child(2) { border-top-color: var(--pink); }
.top-garland span:nth-child(3),
.bottom-garland span:nth-child(4),
.middle-flags span:nth-child(3) { border-top-color: var(--orange); }
.top-garland span:nth-child(4),
.bottom-garland span:nth-child(3),
.middle-flags span:nth-child(4) { border-top-color: var(--yellow); }
.top-garland span:nth-child(5),
.bottom-garland span:nth-child(2),
.middle-flags span:nth-child(5) { border-top-color: var(--blue); }
.top-garland span:nth-child(6),
.bottom-garland span:nth-child(6) { border-top-color: var(--teal); }

.hero {
  display: grid;
  gap: 24px;
  justify-items: center;
  text-align: center;
}

.hero-card,
.story-card,
.calendar-card,
.day-card,
.questionnaire-card,
.gift-card,
.simple-card,
.gallery,
.map-card,
.gallery-lead,
.photo-viewer {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(49, 49, 49, 0.16);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 250, 241, 0.76)),
    var(--card);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  transition:
    transform 0.35s var(--ease),
    box-shadow 0.35s var(--ease),
    border-color 0.35s var(--ease),
    background 0.35s var(--ease);
}

.hero-card::before,
.story-card::before,
.calendar-card::before,
.day-card::before,
.questionnaire-card::before,
.gift-card::before,
.simple-card::before,
.gallery::before,
.gallery-lead::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at var(--mx, 14%) var(--my, 12%), rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.36) 8rem, transparent 18rem),
    linear-gradient(120deg, rgba(255, 255, 255, 0.38), transparent 42%);
  opacity: 0.68;
  transition: opacity 0.35s var(--ease);
}

.hero-card:hover,
.story-card:hover,
.calendar-card:hover,
.day-card:hover,
.questionnaire-card:hover,
.gift-card:hover,
.simple-card:hover,
.gallery:hover,
.gallery-lead:hover {
  border-color: rgba(178, 34, 34, 0.24);
  box-shadow: var(--shadow-lift);
  transform: translateY(-5px);
}

.hero-card:hover::before,
.story-card:hover::before,
.calendar-card:hover::before,
.day-card:hover::before,
.questionnaire-card:hover::before,
.gift-card:hover::before,
.simple-card:hover::before,
.gallery:hover::before,
.gallery-lead:hover::before {
  opacity: 1;
}

.hero-card > *,
.story-card > *,
.calendar-card > *,
.day-card > *,
.questionnaire-card > *,
.gift-card > *,
.simple-card > *,
.gallery > *,
.gallery-lead > * {
  position: relative;
  z-index: 1;
}

.hero-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(100%, 900px);
  padding: clamp(26px, 5vw, 54px);
  border-radius: 34px;
}

.hero-card::after {
  position: absolute;
  right: clamp(18px, 4vw, 42px);
  bottom: clamp(18px, 4vw, 42px);
  z-index: 0;
  width: 110px;
  aspect-ratio: 1;
  border-radius: 50%;
  content: "";
  background: radial-gradient(circle at 34% 30%, rgba(255,255,255,0.9), rgba(255,255,255,0.18) 46%, transparent 72%);
  filter: blur(1px);
  opacity: 0.85;
}

.day-card::after {
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  height: 5px;
  content: "";
  background: linear-gradient(90deg, var(--red), var(--pink), var(--orange), var(--yellow));
}

.day-card.picnic::after {
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--yellow), var(--orange));
}

.hero-heart {
  color: var(--red);
  font-size: clamp(3rem, 8vw, 5.8rem);
  line-height: 0.8;
  filter: drop-shadow(0 12px 20px rgba(178, 34, 34, 0.18));
  animation: heart-pulse 2.8s var(--ease) infinite;
}

@keyframes heart-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.055); }
}

.rainbow-title,
.rainbow-date {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 0.28em;
  row-gap: 0.06em;
  color: var(--red);
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  line-height: 1.15;
}

.rainbow-word {
  display: inline-flex;
  white-space: nowrap;
}

.rainbow-title {
  max-width: 920px;
  font-size: clamp(2.2rem, 6vw, 5.8rem);
}

.rainbow-date {
  font-size: clamp(2rem, 5.5vw, 4.4rem);
}

.rainbow-char {
  position: relative;
  display: inline-block;
  transform: rotate(var(--tilt));
  transition: transform 0.28s var(--ease), filter 0.28s var(--ease);
}

.rainbow-word:hover .rainbow-char {
  filter: drop-shadow(0 8px 12px rgba(178, 34, 34, 0.12));
  transform: translateY(-4px) rotate(var(--tilt));
}

.rainbow-char.flagged::after {
  position: absolute;
  left: 50%;
  top: -0.38em;
  width: 0;
  height: 0;
  border-left: 0.16em solid transparent;
  border-right: 0.16em solid transparent;
  border-top: 0.28em solid currentColor;
  content: "";
  transform: translateX(-50%);
  transition: transform 0.28s var(--ease);
}

.rainbow-char.flagged:hover::after,
.rainbow-word:hover .rainbow-char.flagged::after {
  transform: translateX(-50%) translateY(-3px) rotate(6deg);
}

.hero-subtitle {
  max-width: 720px;
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.65;
}

.invitation-photo {
  width: min(100%, 700px);
  margin: 0;
  perspective: 1200px;
}

.invitation-photo img {
  width: 100%;
  border: 1px solid rgba(49, 49, 49, 0.18);
  border-radius: 26px;
  background: #fde7df;
  box-shadow: 0 26px 70px rgba(94, 43, 39, 0.18);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), filter 0.45s var(--ease);
}

.invitation-photo:hover img {
  box-shadow: 0 34px 86px rgba(94, 43, 39, 0.24);
  filter: saturate(1.03) contrast(1.01);
  transform: rotateX(1.4deg) rotateY(-1.4deg) translateY(-6px);
}

.button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(49, 49, 49, 0.42);
  border-radius: 999px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(49, 49, 49, 0.06);
  transition:
    transform 0.22s var(--ease),
    box-shadow 0.22s var(--ease),
    border-color 0.22s var(--ease),
    background 0.22s var(--ease);
}

.button::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(110deg, transparent 0 32%, rgba(255,255,255,0.5) 45%, transparent 58% 100%);
  transform: translateX(-120%);
  transition: transform 0.65s var(--ease);
}

.button:hover {
  border-color: rgba(178, 34, 34, 0.46);
  box-shadow: 0 16px 34px rgba(178, 34, 34, 0.16);
  transform: translateY(-3px);
}

.button:hover::before {
  transform: translateX(120%);
}

.button:active {
  transform: translateY(-1px) scale(0.99);
}

.button.primary {
  color: #fff;
  border-color: rgba(178, 34, 34, 0.72);
  background: linear-gradient(135deg, #c53333, var(--red));
  box-shadow: 0 12px 28px rgba(178, 34, 34, 0.24), 0 0 0 8px rgba(255,255,255,0.72);
}

.button.light {
  background: #fff8ef;
}

.button.route {
  color: var(--red);
  background: rgba(255,255,255,0.88);
}

.section-heading {
  display: grid;
  gap: 8px;
  justify-items: center;
  margin-bottom: 24px;
  text-align: center;
}

.section-heading.split {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
}

.section-kicker,
dt,
.questionnaire-card span,
legend,
.day-tag {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.section-kicker::before,
.section-kicker::after {
  width: 22px;
  height: 1px;
  content: "";
  background: rgba(178, 34, 34, 0.32);
}

.story-card,
.simple-card,
.gift-card {
  padding: clamp(20px, 4vw, 34px);
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  line-height: 1.65;
}

.story-card p,
.simple-card p,
.gift-card p {
  max-width: 850px;
  margin-inline: auto;
}

.calendar-card {
  width: min(100%, 620px);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 26px);
  border-radius: 30px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-grid b,
.calendar-grid span,
.calendar-grid i {
  display: grid;
  min-height: 52px;
  place-items: center;
  border-radius: 16px;
  font-style: normal;
  font-weight: 700;
}

.calendar-grid b {
  color: var(--red);
}

.calendar-grid span {
  border: 1px solid rgba(49, 49, 49, 0.11);
  background: rgba(255, 255, 255, 0.74);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease);
}

.calendar-grid span:hover {
  border-color: rgba(178, 34, 34, 0.2);
  box-shadow: 0 12px 26px rgba(178, 34, 34, 0.1);
  transform: translateY(-3px);
}

.wedding-day {
  position: relative;
  border-color: var(--red) !important;
  color: #fff;
  background: linear-gradient(135deg, #d03939, var(--red)) !important;
  box-shadow: 0 14px 30px rgba(178, 34, 34, 0.2);
  animation: wedding-glow 2.6s var(--ease) infinite;
}

.wedding-day::after {
  position: absolute;
  inset: -10px;
  display: grid;
  place-items: start end;
  color: var(--red);
  content: "♥";
  font-size: 1.35rem;
}

.calendar-card::after {
  position: absolute;
  right: 20px;
  bottom: 18px;
  z-index: 0;
  color: rgba(178, 34, 34, 0.08);
  content: "26";
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 700;
  line-height: 0.8;
}

@keyframes wedding-glow {
  0%, 100% { box-shadow: 0 14px 30px rgba(178, 34, 34, 0.18); }
  50% { box-shadow: 0 18px 42px rgba(178, 34, 34, 0.32); }
}

.days-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.day-card {
  padding: clamp(18px, 3vw, 30px);
}

.day-card h3,
.gift-card h3,
.map-card h3 {
  margin-top: 10px;
  color: var(--red);
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.08;
}

.day-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(178, 34, 34, 0.16);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.52);
}

.picnic .day-tag {
  color: var(--teal);
  border-color: rgba(34, 166, 166, 0.22);
}

dl {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

dl div {
  display: grid;
  gap: 4px;
  border-radius: 16px;
  padding: 9px 10px;
  transition: background 0.22s var(--ease), transform 0.22s var(--ease);
}

dl div:hover {
  background: rgba(255, 255, 255, 0.52);
  transform: translateX(3px);
}

dd {
  margin: 0;
  line-height: 1.5;
}

.program {
  display: grid;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.program li {
  display: flex;
  gap: 10px;
  align-items: center;
  border-bottom: 2px dotted rgba(49, 49, 49, 0.2);
  padding-bottom: 7px;
  transition: color 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease);
}

.program li:hover {
  border-color: rgba(178, 34, 34, 0.35);
  color: var(--red);
  transform: translateX(4px);
}

.program time {
  color: var(--red);
  font-weight: 700;
}

.middle-flags {
  position: relative;
  flex-direction: column;
  align-items: center;
  min-height: 260px;
}

.middle-flags::before {
  width: 2px;
  height: 250px;
}

.middle-flags span {
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 18px solid var(--red);
  border-right: 0;
}

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

  .section {
    opacity: 1;
    transform: none;
  }
}

.questionnaire-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.questionnaire-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 18px;
}

.questionnaire-card.full,
.full {
  grid-column: 1 / -1;
}

.questionnaire-card label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 14px;
  line-height: 1.45;
}

fieldset.questionnaire-card label,
.food-card label,
.drinks-card label {
  min-height: 40px;
  border: 1px solid rgba(49, 49, 49, 0.1);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: 0 8px 18px rgba(49, 49, 49, 0.04);
}

fieldset.questionnaire-card label:has(input:checked),
.food-card label:has(input:checked),
.drinks-card label:has(input:checked) {
  border-color: rgba(178, 34, 34, 0.3);
  color: #fff;
  background: linear-gradient(135deg, #c53333, var(--red));
  box-shadow: 0 14px 28px rgba(178, 34, 34, 0.18);
}

fieldset.questionnaire-card label:has(input:checked) input,
.food-card label:has(input:checked) input,
.drinks-card label:has(input:checked) input {
  accent-color: #fff;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(49, 49, 49, 0.18);
  border-radius: 16px;
  outline: none;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(178, 34, 34, 0.48);
  background: #fff;
  box-shadow: 0 0 0 5px rgba(178, 34, 34, 0.1);
}

input,
select {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  min-height: 118px;
  padding: 12px;
  resize: vertical;
  line-height: 1.5;
}

input[type="radio"],
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
  flex: 0 0 auto;
}

.food-card,
.drinks-card {
  display: block;
}

.food-card legend,
.drinks-card legend {
  margin-bottom: 12px;
}

.food-card label,
.drinks-card label,
.questionnaire-card label {
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}

.food-card label:hover,
.drinks-card label:hover,
.questionnaire-card label:hover {
  color: var(--red);
  transform: translateY(-1px);
}

.form-actions,
.gallery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.questionnaire-status {
  min-height: 28px;
  color: var(--red);
  font-weight: 700;
  text-align: center;
}

.questionnaire-status.pop::after {
  display: inline-block;
  margin-left: 8px;
  color: var(--red);
  content: "♥";
  animation: heart-pop 0.7s ease both;
}

@keyframes heart-pop {
  0% { opacity: 0; transform: translateY(8px) scale(0.5); }
  60% { opacity: 1; transform: translateY(-8px) scale(1.3); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.questionnaire-summary {
  overflow: auto;
  margin: 0;
  border: 1px dashed rgba(178, 34, 34, 0.55);
  border-radius: 18px;
  padding: 14px;
  background: #fff6f3;
  white-space: pre-wrap;
}

.gift-options,
.map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.gift-options {
  grid-template-columns: 1fr;
}

.gift-options article,
.map-card {
  border: 1px dashed rgba(49, 49, 49, 0.18);
  border-radius: 20px;
  padding: 18px;
  background: rgba(255,255,255,0.62);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.gift-options article:hover,
.map-card:hover {
  border-color: rgba(178, 34, 34, 0.28);
  box-shadow: 0 14px 30px rgba(178, 34, 34, 0.1);
  transform: translateY(-3px);
}

.gallery-lead {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
}

.gallery-lead img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid rgba(49, 49, 49, 0.2);
  border-radius: 18px;
  transition: transform 0.32s var(--ease), box-shadow 0.32s var(--ease);
}

.gallery-lead:hover img {
  box-shadow: 0 16px 38px rgba(178, 34, 34, 0.12);
  transform: rotate(-1deg) scale(1.03);
}

#photo-upload {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-height: 230px;
  padding: 12px;
  border-radius: 30px;
}

.gallery-empty {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  color: var(--muted);
  text-align: center;
}

.gallery-item {
  display: grid;
  gap: 7px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid rgba(49, 49, 49, 0.18);
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(49, 49, 49, 0.08);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), filter 0.3s var(--ease);
}

.gallery-item:hover img {
  box-shadow: 0 18px 42px rgba(178, 34, 34, 0.16);
  filter: saturate(1.04);
  transform: translateY(-4px) scale(1.015);
}

.gallery-item span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-card span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 700;
}

.photo-viewer {
  width: min(920px, calc(100% - 24px));
  padding: 14px;
}

.photo-viewer::backdrop {
  background: rgba(49, 49, 49, 0.68);
}

.photo-viewer img {
  width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 18px;
}

.viewer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(49, 49, 49, 0.32);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  font-size: 1.4rem;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}

.viewer-close:hover {
  background: var(--red);
  color: #fff;
  transform: rotate(8deg) scale(1.04);
}

@media (max-width: 860px) {
  .days-layout,
  .questionnaire-form,
  .gift-options,
  .map-grid,
  .gallery-lead {
    grid-template-columns: 1fr;
  }

  .middle-flags {
    flex-direction: row;
    min-height: 32px;
  }

  .middle-flags::before {
    width: min(420px, 80vw);
    height: 2px;
  }

  .middle-flags span {
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 18px solid var(--red);
    border-bottom: 0;
  }

  .section-heading.split {
    display: grid;
    justify-items: center;
    text-align: center;
  }

  .gallery-actions,
  .gallery-actions .button {
    width: 100%;
  }

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

@media (max-width: 520px) {
  .section {
    width: min(100% - 20px, 500px);
    padding: 38px 0;
  }

  .rainbow-title {
    font-size: clamp(2rem, 11vw, 3.3rem);
  }

  .calendar-grid {
    gap: 5px;
  }

  .calendar-grid b,
  .calendar-grid span,
  .calendar-grid i {
    min-height: 39px;
    border-radius: 12px;
    font-size: 0.86rem;
  }

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