@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Great+Vibes&display=swap');

:root {
  --ivory: #fbf7f0;
  --blush: #ead6d1;
  --rose: #c8958d;
  --beige: #e8ddcf;
  --sage: #7f9179;
  --deep: #26372f;
  --ink: #3e3531;
  --gold: #b79a66;
  --white: #fffdf9;
  --error: #a65b55;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, .event-title, .signature {
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  line-height: 1.12;
}
h2 { margin: 0.2rem 0 1rem; font-size: clamp(2.9rem, 8vw, 5.2rem); }
p { margin: 0 0 1rem; }

.section { padding: 5.5rem 1.25rem; position: relative; }
.container { width: min(1080px, 100%); margin: auto; text-align: center; }
.narrow { width: min(720px, 100%); margin: auto; text-align: center; }

/* —— Hero —— */
.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  padding: 3rem 1.25rem;
  background: radial-gradient(circle at 50% 30%, #fff 0, #fbf7f0 56%, #f0e7da 100%);
  text-align: center;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: 50vw;
  height: 50vw;
  max-width: 530px;
  max-height: 530px;
  border: 1px solid rgba(183, 154, 102, 0.28);
  border-radius: 50%;
}
.hero::before { left: -33vw; top: -16vw; }
.hero::after { right: -36vw; bottom: -22vw; }
.hero-inner { width: min(760px, 100%); position: relative; z-index: 2; }
.eyebrow, .kicker {
  color: #8d6f68;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 1.3rem 0 0.35rem;
  font-size: clamp(4.7rem, 14vw, 9rem);
  letter-spacing: 0;
  color: var(--deep);
}
.hero h1 em { color: var(--rose); font-size: 0.72em; font-weight: 400; }
.event-title { margin: 0; color: #826d65; font-size: clamp(2.1rem, 6vw, 3rem); }
.hero-copy { max-width: 520px; margin: 1rem auto 1.8rem; font-size: 1.05rem; }

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 570px;
  margin: 0 auto 2rem;
  border-block: 1px solid rgba(183, 154, 102, 0.4);
  padding: 1rem 0;
}
.time:not(:last-child),
.countdown > div:not(:last-child) {
  border-right: 1px solid rgba(183, 154, 102, 0.35);
}
.time strong,
.countdown > div strong {
  display: block;
  font-family: "DM Sans", sans-serif;
  font-weight: 500;
  color: var(--deep);
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  line-height: 1;
}
.time span,
.countdown > div span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #76655e;
}

.button {
  min-height: 46px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.78rem 1.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  transition: 0.25s ease;
}
.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(38, 55, 47, 0.15);
}
.button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(200, 149, 141, 0.55);
  outline-offset: 3px;
}
.primary { background: var(--deep); color: white; }
.secondary { background: transparent; color: var(--deep); border-color: var(--sage); }
.light { background: var(--ivory); color: var(--deep); }
.dark { background: var(--deep); color: white; }

.flower { position: absolute; width: 150px; height: 150px; opacity: 0.34; }
.flower span {
  position: absolute;
  left: 62px;
  top: 18px;
  width: 30px;
  height: 62px;
  background: var(--blush);
  border-radius: 100% 15% 100% 20%;
  transform-origin: 15px 58px;
}
.flower span:nth-child(2) { transform: rotate(72deg); }
.flower span:nth-child(3) { transform: rotate(144deg); }
.flower span:nth-child(4) { transform: rotate(216deg); }
.flower i {
  position: absolute;
  inset: 61px;
  background: var(--gold);
  border-radius: 50%;
}
.flower-a { top: 7%; left: -35px; transform: rotate(-18deg); }
.flower-b { right: -48px; bottom: 9%; transform: rotate(52deg) scale(0.85); }

/* —— Welcome / featured / details —— */
.welcome { background: var(--white); }
.welcome p:not(.script-mark):not(.signature) { font-size: 1.1rem; }
.welcome strong { color: #8d625d; font-weight: 600; }
.script-mark { color: var(--gold); letter-spacing: 0.22em; font-size: 0.75rem; }
.signature { margin: 2rem 0 0; font-size: 2rem; color: var(--sage); }

.featured {
  padding-block: 4rem;
  background: linear-gradient(90deg, #ead6d1 0 9%, #fbf7f0 9% 91%, #e6dfd3 91%);
}
.photo-frame {
  width: min(610px, 82vw);
  margin: auto;
  padding: 10px;
  border: 1px solid rgba(183, 154, 102, 0.6);
  border-radius: 220px 220px 18px 18px;
  background: #fff;
  box-shadow: 0 30px 70px rgba(47, 37, 30, 0.14);
}
.photo-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 900px;
  object-fit: contain;
  border-radius: 210px 210px 12px 12px;
}

.details { background: #f1e7dc; }
.details-grid { display: grid; gap: 1rem; margin: 2.5rem 0; }
.details-grid article {
  background: rgba(255, 253, 249, 0.76);
  padding: 1.8rem 1.2rem;
  border-radius: 22px;
  border: 1px solid rgba(183, 154, 102, 0.2);
}
.details-grid small,
.gift-data small {
  display: block;
  color: #8d6f68;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
}
.details-grid p { margin: 0.35rem 0 0; }
.icon-badge {
  display: grid;
  place-items: center;
  margin: 0 auto 0.8rem;
  width: 52px;
  height: 52px;
  color: var(--white);
  background: var(--sage);
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(65, 84, 60, 0.18);
}
.icon-badge svg { width: 26px; height: 26px; }

.dress { background: var(--ivory); }
.split-card {
  width: min(950px, 100%);
  margin: auto;
  padding: 2.4rem;
  border-radius: 30px;
  background: var(--white);
  box-shadow: 0 20px 60px rgba(80, 58, 48, 0.08);
  text-align: center;
}
.swatches { display: flex; justify-content: center; gap: 0.7rem; margin-top: 2rem; }
.swatches i {
  width: 52px;
  height: 72px;
  border-radius: 30px;
  border: 5px solid white;
  box-shadow: 0 5px 16px #0001;
}
.swatches i:nth-child(1) { background: #c78d7e; }
.swatches i:nth-child(2) { background: #d4ad8d; }
.swatches i:nth-child(3) { background: #ab8c72; }
.swatches i:nth-child(4) { background: #7d8770; }

/* —— Gifts —— */
.gifts { background: #e3ddd0; }
.gift-icon { background: var(--gold); }
.gift-data {
  margin: 2rem auto 0;
  border-radius: 22px;
  overflow: hidden;
  background: var(--white);
  text-align: left;
}
.gift-data > div {
  padding: 1rem 1.2rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.35rem 0.75rem;
  border-bottom: 1px solid var(--beige);
}
.gift-data > div:last-child { border-bottom: 0; }
.gift-data small:first-child { grid-column: 1 / -1; }
.gift-data strong { overflow-wrap: anywhere; }
.gift-data [data-copied-for] {
  grid-column: 1 / -1;
  color: var(--sage);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
}
.copy {
  border: 0;
  border-radius: 99px;
  background: #e9eee6;
  color: var(--deep);
  min-height: 40px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  font-weight: 600;
}

/* —— RSVP —— */
.rsvp { background: linear-gradient(155deg, #f3e5e1, #fbf7f0); }
.form-card {
  width: min(650px, 100%);
  margin: auto;
  padding: 2.2rem 1.3rem;
  text-align: center;
  border: 1px solid rgba(183, 154, 102, 0.4);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.65);
}
.form-card form {
  margin: 2rem auto 0;
  width: min(460px, 100%);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.form-card label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.form-card input,
.form-card textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid #b9a9a0;
  background: white;
  border-radius: 13px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--ink);
}
.form-card textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.form-card form .button { width: 100%; margin-top: 0.5rem; }
.rsvp-details { display: flex; flex-direction: column; gap: 0.9rem; }
.rsvp-details[hidden] { display: none !important; }
.rsvp-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.rsvp-fieldset legend {
  padding: 0;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.rsvp-choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 13px;
  border: 1px solid rgba(183, 154, 102, 0.35);
  background: rgba(255, 253, 249, 0.85);
  font-weight: 400;
  cursor: pointer;
  margin: 0;
}
.rsvp-choice input {
  width: auto;
  min-height: 0;
  margin: 0;
  accent-color: var(--sage);
  flex-shrink: 0;
}
.rsvp-choice:has(input:focus-visible) {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.rsvp-choice:has(input:checked) {
  border-color: var(--sage);
  background: #edf3ea;
}
.success {
  color: #52684f;
  font-weight: 600;
  padding: 1.25rem;
  border-radius: 16px;
  background: #edf3ea;
  margin-top: 1.5rem;
  display: grid;
  gap: 0.4rem;
}
.success strong {
  font-family: "Great Vibes", cursive;
  font-size: 2rem;
  font-weight: 400;
  color: var(--deep);
}
.form-error { font-size: 0.85rem; color: var(--error); margin: 0.5rem 0 0; }

/* —— Gallery CTA (homepage) —— */
.gallery { background: var(--white); }
.gallery-layout {
  display: grid;
  gap: 2rem;
  align-items: center;
}
.gallery-copy { text-align: center; }
.qr-card {
  width: 210px;
  margin: auto;
  background: #f4eee5;
  border-radius: 28px;
  padding: 1.3rem;
  box-shadow: 0 18px 45px #3e353116;
}
.qr-card p { margin: 0.8rem 0 0; font-weight: 600; }
.qr-image {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  background: white;
  border-radius: 12px;
}

/* —— Photographer —— */
.photographer { background: var(--deep); color: white; }
.photographer-inner {
  width: min(980px, 100%);
  margin: auto;
  display: grid;
  gap: 2rem;
  justify-items: center;
  text-align: center;
  align-items: center;
}
.photographer img { width: min(390px, 86vw); height: auto; }
.photo-meta h2 { font-size: 3rem; margin: 0 0 0.2rem; color: white; }
.photo-meta p { margin: 0.25rem 0; color: #e6dfd3; }
.contact-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}
.contact-line svg { width: 20px; height: 20px; stroke-width: 2.4; flex-shrink: 0; }

footer {
  padding: 2.3rem 1.25rem;
  background: #19231f;
  color: #e7dfd4;
  text-align: center;
  display: grid;
  gap: 1rem;
}
footer p { margin: 0; }
.privacy {
  max-width: 600px;
  margin: auto;
  font-size: 0.78rem;
  color: #bcb5ac;
}
footer small { color: #bfb8ae; }
footer small a {
  color: #d5b97e;
  text-underline-offset: 4px;
}

/* —— Upload / gallery pages —— */
.upload-page,
.gallery-page {
  min-height: 100svh;
  padding: 25px 18px 70px;
  background: radial-gradient(circle at top, #f3e5e1, var(--ivory) 55%, #e8dfd3);
}
.back-link {
  color: var(--deep);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.7rem;
  display: inline-block;
  margin-bottom: 25px;
}
.upload-card,
.gallery-shell {
  max-width: 680px;
  margin: auto;
  background: var(--white);
  color: var(--ink);
  border: 1px solid rgba(183, 154, 102, 0.35);
  border-radius: 28px;
  padding: 38px 22px;
  box-shadow: 0 20px 50px rgba(62, 53, 49, 0.08);
}
.gallery-main { width: min(100%, 960px); margin: 0 auto; }
.gallery-shell { max-width: none; text-align: center; }
.upload-card h1,
.gallery-title {
  font-family: "Great Vibes", cursive;
  font-size: clamp(2.8rem, 10vw, 4.5rem);
  line-height: 1.05;
  font-weight: 400;
  margin: 8px 0 16px;
  color: var(--deep);
}
.upload-card h1 em,
.gallery-title em {
  color: var(--rose);
  font-style: normal;
  display: block;
}
.upload-card > p,
.gallery-lead {
  line-height: 1.7;
  color: #6b5d56;
}
.file-picker {
  display: grid;
  place-items: center;
  min-height: 150px;
  border: 2px dashed rgba(127, 145, 121, 0.65);
  border-radius: 20px;
  background: #edf3ea;
  color: var(--deep);
  font-weight: 600;
  text-align: center;
  padding: 25px;
  cursor: pointer;
  margin-top: 20px;
}
.file-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.upload-card ul {
  margin: 16px 0;
  padding-left: 20px;
  font-size: 0.85rem;
}
.upload-gallery-link { margin-top: 28px; text-align: center; }
.upload-gallery-link .button { width: 100%; max-width: 320px; }
.upload-card .countdown {
  color: var(--ink);
  margin: 20px auto 0;
  max-width: 360px;
  grid-template-columns: repeat(3, 1fr);
}

.gallery-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.gallery-tab {
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 22px;
  border: 1px solid var(--sage);
  border-radius: 999px;
  background: transparent;
  color: var(--deep);
  cursor: pointer;
}
.gallery-tab.is-active {
  background: var(--deep);
  border-color: var(--deep);
  color: white;
}
.gallery-panel { min-height: 120px; margin-bottom: 28px; }
.gallery-view[hidden] { display: none !important; }
.gallery-loading,
.gallery-empty,
.gallery-error,
.gallery-loading-more {
  font-size: 1rem;
  color: #8d6f68;
  padding: 2rem 1rem;
}
.gallery-error { color: var(--error); }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  text-align: left;
}
.gallery-item {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  overflow: hidden;
  cursor: pointer;
  background: #e8dfd3;
  border-radius: 12px;
  transition: 0.15s transform;
}
.gallery-item:hover,
.gallery-item:focus { transform: scale(1.02); outline: none; }
.gallery-item:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-item--video { background: #26372f; }
.gallery-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.gallery-sentinel { width: 100%; height: 1px; }
.gallery-upload-link { margin-top: 8px; }
.gallery-upload-link .button { min-width: 240px; }

.gallery-modal-open { overflow: hidden; }
.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.gallery-modal[hidden] { display: none; }
.gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 35, 31, 0.9);
}
.gallery-modal-dialog {
  position: relative;
  z-index: 1;
  max-width: min(960px, 96vw);
  max-height: 90vh;
  width: 100%;
}
.gallery-modal-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.gallery-modal-content img {
  display: block;
  max-width: 100%;
  max-height: 85vh;
  margin: 0 auto;
  background: #000;
  border-radius: 8px;
}
.gallery-video-embed {
  position: relative;
  width: min(960px, 96vw);
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  background: #000;
  overflow: hidden;
  border-radius: 8px;
}
.gallery-video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (min-width: 760px) {
  .section { padding: 7rem 2rem; }
  .details-grid { grid-template-columns: 1fr 1fr 1.25fr; }
  .split-card {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    align-items: center;
    text-align: left;
    padding: 3.2rem;
  }
  .gallery-layout {
    grid-template-columns: 1.5fr 0.7fr;
  }
  .gallery-copy { text-align: left; }
  .photographer-inner {
    grid-template-columns: 1.15fr 0.8fr auto;
    text-align: left;
    justify-items: start;
  }
  .photographer img { width: 330px; }
  .contact-line { justify-content: flex-start; }
  footer {
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    text-align: left;
  }
  footer > small:last-child { text-align: right; }
}

@media (max-width: 440px) {
  .hero { padding-inline: 0.9rem; }
  .hero h1 { font-size: 3.65rem; }
  .countdown { gap: 0; }
  .time strong,
  .countdown > div strong { font-size: 1.7rem; }
  .time span,
  .countdown > div span { font-size: 0.62rem; letter-spacing: 0.04em; }
  .section { padding: 4.5rem 1rem; }
  .photo-frame { width: 94vw; padding: 6px; }
  .gift-data strong { font-size: 0.92rem; }
  .copy { font-size: 0.82rem; }
  .photographer img { width: 90vw; }
  .gallery-tabs { gap: 0.5rem; }
  .gallery-tab {
    flex: 1 1 0;
    max-width: 11rem;
    padding: 0.75rem 0.5rem;
    font-size: 0.65rem;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .gallery-modal-close {
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.5rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    animation: rise 0.8s both ease-out;
    animation-timeline: view();
    animation-range: entry 5% cover 28%;
  }
  @keyframes rise {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
  }
}
