:root {
  --bg: #f7f1e8;
  --bg-deep: #ebe2d4;
  --ink: #2c2825;
  --ink-soft: #5c534c;
  --gold: #9a7b4f;
  --gold-soft: #c4a574;
  --line: rgba(44, 40, 37, 0.12);
  --white: #fffdf9;
  --shadow: 0 18px 50px rgba(44, 40, 37, 0.12);
  --radius: 18px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-ui: "Outfit", system-ui, sans-serif;
  --header-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(88px + var(--safe-bottom));
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(196, 165, 116, 0.28), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(235, 226, 212, 0.9), transparent 50%),
    linear-gradient(180deg, #faf6f0 0%, var(--bg) 40%, #f3ebe0 100%);
}

.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 0.75rem 1.25rem;
  backdrop-filter: blur(14px);
  background: rgba(247, 241, 232, 0.82);
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  color: var(--gold);
}

.site-nav {
  display: flex;
  gap: 0.35rem;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  color: var(--ink-soft);
  transition: background 0.25s ease, color 0.25s ease;
}

.site-nav a.is-active,
.site-nav a:hover {
  background: rgba(154, 123, 79, 0.12);
  color: var(--ink);
}

main {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  min-height: calc(100svh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2.5rem 0 3rem;
  animation: rise 0.9s ease both;
}

.hero-kicker {
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--gold);
}

.hero-title {
  margin: 0;
  display: grid;
  gap: 0.15rem;
}

.hero-line {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 4.8rem);
  font-weight: 500;
  line-height: 0.95;
}

.hero-names {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.8rem, 10vw, 5.6rem);
  line-height: 1;
  color: var(--ink);
}

.hero-line-soft {
  color: var(--ink-soft);
  font-size: clamp(1.8rem, 5vw, 3rem);
}

.hero-date {
  margin: 1.4rem 0 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.18em;
  color: var(--gold);
}

.hero-lead {
  max-width: 28rem;
  margin: 1.1rem auto 0;
  color: var(--ink-soft);
  font-weight: 300;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.95rem 1.45rem;
  font: inherit;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--ink);
  color: var(--white);
}

.btn-primary:hover {
  background: #1f1c1a;
}

.btn-ghost {
  background: transparent;
  border-color: rgba(44, 40, 37, 0.22);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.section {
  padding: 0 0 3rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
}

.section-head a,
.site-footer a {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.95rem;
}

.preview-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(140px, 38vw);
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.preview-tile,
.gallery-item {
  position: relative;
  border: 0;
  padding: 0;
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  background: var(--bg-deep);
  aspect-ratio: 4 / 5;
  scroll-snap-align: start;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.preview-tile img,
.preview-tile video,
.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.preview-tile:hover img,
.preview-tile:hover video,
.gallery-item:hover img,
.gallery-item:hover video {
  transform: scale(1.04);
}

.badge-play {
  position: absolute;
  inset: auto auto 0.75rem 0.75rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(44, 40, 37, 0.72);
  color: var(--white);
  font-size: 0.75rem;
  padding-left: 2px;
}

.guest-chip {
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  bottom: 0.6rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: rgba(247, 241, 232, 0.88);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-intro {
  padding: 2rem 0 1.25rem;
  text-align: center;
  animation: rise 0.7s ease both;
}

.page-intro h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 500;
}

.page-intro p {
  margin: 0.6rem 0 0;
  color: var(--ink-soft);
}

.gallery-grid {
  columns: 2;
  column-gap: 0.75rem;
  padding-bottom: 2rem;
}

.gallery-item {
  width: 100%;
  break-inside: avoid;
  margin: 0 0 0.75rem;
  aspect-ratio: auto;
  min-height: 140px;
}

.gallery-item img,
.gallery-item video {
  min-height: 140px;
}

.empty-state,
.empty-hint {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-soft);
}

.upload-form {
  width: min(560px, 100%);
  margin: 0 auto 2rem;
  display: grid;
  gap: 1rem;
  animation: rise 0.7s ease both;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field span {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.field em {
  font-style: normal;
  opacity: 0.7;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  font: inherit;
  color: var(--ink);
  min-height: 52px;
}

.field input:focus {
  outline: 2px solid rgba(154, 123, 79, 0.35);
  border-color: var(--gold-soft);
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0.35rem;
  min-height: 180px;
  padding: 1.5rem;
  border: 1.5px dashed rgba(154, 123, 79, 0.55);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.7);
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.dropzone.is-dragover {
  background: rgba(196, 165, 116, 0.16);
  border-color: var(--gold);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
}

.dropzone-hint {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(255, 253, 249, 0.8);
  border: 1px solid var(--line);
  font-size: 0.92rem;
}

.file-list .meta {
  color: var(--ink-soft);
  white-space: nowrap;
}

.progress {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(44, 40, 37, 0.08);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  transition: width 0.15s ease;
}

.progress-text {
  margin: 0.45rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.form-status {
  min-height: 1.4em;
  margin: 0;
  text-align: center;
  color: var(--ink-soft);
}

.form-status.is-error {
  color: #8a2f2f;
}

.form-status.is-ok {
  color: #2f6a45;
}

.qr-page {
  text-align: center;
  padding: 2rem 0 3rem;
  animation: rise 0.7s ease both;
}

.qr-page h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 500;
}

.qr-lead {
  color: var(--ink-soft);
  margin: 0.75rem auto 1.5rem;
  max-width: 26rem;
}

.qr-frame {
  margin: 0 auto;
  width: min(320px, 80vw);
  padding: 1.25rem;
  background: var(--white);
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.qr-frame img {
  width: 100%;
  height: auto;
}

.qr-url {
  margin: 1.25rem 0 0;
  word-break: break-all;
  font-size: 0.95rem;
}

.qr-url a {
  color: var(--gold);
}

.site-footer {
  width: min(1100px, calc(100% - 2rem));
  margin: 1rem auto 0;
  padding: 1.5rem 0 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

.mobile-fab {
  position: fixed;
  right: 1.1rem;
  bottom: calc(1.1rem + var(--safe-bottom));
  z-index: 50;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--white);
  font-size: 1.8rem;
  line-height: 1;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.mobile-fab:active {
  transform: scale(0.96);
}

body:has(.upload-form) .mobile-fab {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  background: rgba(28, 25, 23, 0.92);
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.lightbox.is-open {
  opacity: 1;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-stage {
  width: min(1100px, 100%);
  height: min(78vh, 100%);
  display: grid;
  place-items: center;
}

.lightbox-stage img,
.lightbox-stage video {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  background: #111;
}

.lightbox-close,
.lightbox-nav {
  appearance: none;
  border: 0;
  background: rgba(255, 253, 249, 0.12);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  font-size: 1.6rem;
  cursor: pointer;
}

.lightbox-close {
  justify-self: end;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-nav.prev {
  left: 0.75rem;
}

.lightbox-nav.next {
  right: 0.75rem;
}

.lightbox-caption {
  margin: 0.75rem 0 0;
  color: rgba(255, 253, 249, 0.85);
  font-size: 0.95rem;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: rise 0.7s ease forwards;
  animation-delay: var(--d, 0ms);
}

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

@media (min-width: 720px) {
  body {
    padding-bottom: 0;
  }

  .mobile-fab {
    display: none;
  }

  .gallery-grid {
    columns: 3;
    column-gap: 1rem;
  }

  .preview-strip {
    grid-auto-flow: dense;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-columns: unset;
    overflow: visible;
  }

  .preview-tile:nth-child(n + 5) {
    display: none;
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    columns: 4;
  }

  .site-header,
  main,
  .site-footer {
    width: min(1180px, calc(100% - 3rem));
  }

  .site-header {
    width: min(1180px, calc(100% - 3rem));
    margin: 0.75rem auto 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding-inline: 1.5rem;
  }
}

@media print {
  .site-header,
  .site-footer,
  .mobile-fab,
  .hero-actions .btn-ghost {
    display: none !important;
  }

  body {
    background: white;
    padding: 0;
  }

  .page-bg {
    display: none;
  }

  .qr-page {
    padding-top: 2rem;
  }
}
