:root {
  --ink: #2d171b;
  --wine: #6f2d39;
  --wine-dark: #3c151d;
  --rose: #b76470;
  --gold: #d9a34d;
  --cream: #fff7e8;
  --paper: #fffdf7;
  --sage: #74845c;
  --muted: #806f70;
  --line: rgba(88, 39, 46, .16);
  --shadow: 0 24px 70px rgba(74, 25, 33, .13);
  --danger: #a62e38;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 5%, rgba(217,163,77,.18), transparent 28rem),
    radial-gradient(circle at 90% 20%, rgba(183,100,112,.16), transparent 30rem),
    linear-gradient(180deg, #fffaf0 0%, #f9ecdc 47%, #fffaf2 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(217,163,77,.55);
  outline-offset: 3px;
}
.page-glow { position: fixed; z-index: -1; width: 340px; height: 340px; border-radius: 50%; filter: blur(12px); opacity: .4; pointer-events: none; }
.page-glow-one { top: 18%; left: -180px; background: rgba(183,100,112,.28); }
.page-glow-two { right: -160px; bottom: 12%; background: rgba(217,163,77,.3); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 12px clamp(18px, 4vw, 62px);
  border-bottom: 1px solid rgba(92,42,49,.12);
  background: rgba(255,250,240,.88);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { width: 46px; height: 46px; border-radius: 50%; box-shadow: 0 8px 22px rgba(70,25,32,.18); }
.brand span { display: grid; min-width: 0; }
.brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; }
.brand small { color: var(--muted); font-size: .72rem; }
nav { display: flex; gap: clamp(10px, 2.6vw, 28px); align-items: center; font-size: .9rem; font-weight: 750; }
nav a { padding: 8px 0; border-bottom: 2px solid transparent; }
nav a:hover { border-color: var(--gold); }
main { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 80px; }
footer { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 28px 18px 42px; color: var(--muted); text-align: center; }
footer img { width: 34px; height: 34px; border-radius: 50%; }
h1, h2, h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; line-height: .98; }
h1 { font-size: clamp(3.2rem, 8vw, 6.7rem); letter-spacing: -.055em; }
h2 { font-size: clamp(2.3rem, 6vw, 4.5rem); letter-spacing: -.045em; }
p { line-height: 1.65; }
.eyebrow { display: inline-block; color: var(--wine); font-size: .76rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  align-items: center;
  gap: clamp(28px, 5vw, 74px);
  min-height: 650px;
  padding: clamp(34px, 6vw, 76px);
  overflow: hidden;
  border: 1px solid rgba(104,45,54,.14);
  border-radius: 42px;
  background: linear-gradient(135deg, rgba(255,253,247,.96), rgba(248,224,198,.84));
  box-shadow: var(--shadow);
}
.hero-copy { position: relative; z-index: 2; }
.hero-copy h1 { margin: 13px 0 22px; color: var(--wine-dark); }
.hero-copy > p { max-width: 680px; margin: 0; color: #684f52; font-size: clamp(1.05rem, 2vw, 1.3rem); }
.event-date-pill { display: inline-flex; margin-top: 20px; padding: 9px 14px; border: 1px solid rgba(111,45,57,.16); border-radius: 999px; background: rgba(255,255,255,.72); color: var(--wine); font-weight: 850; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.primary-button, .secondary-button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  font-weight: 850;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.primary-button { color: #fff8e9; background: linear-gradient(135deg, var(--wine), var(--wine-dark)); box-shadow: 0 12px 25px rgba(86,30,40,.22); }
.secondary-button { color: var(--wine-dark); background: rgba(255,255,255,.76); border: 1px solid rgba(111,45,57,.18); }
.primary-button:hover, .secondary-button:hover, button:hover { transform: translateY(-2px); }
button:disabled { cursor: not-allowed; opacity: .62; transform: none; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-facts span { display: grid; min-width: 135px; padding: 13px 15px; border-left: 3px solid var(--gold); background: rgba(255,255,255,.48); color: var(--muted); font-size: .82rem; }
.hero-facts strong { color: var(--ink); font-size: 1.1rem; }
.hero-art { position: relative; min-height: 510px; }
.hero-family-graphic { width: 100%; height: auto; filter: drop-shadow(0 28px 40px rgba(83,34,40,.16)); }
.qr-card {
  position: absolute;
  right: 4%;
  bottom: 2%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 15px;
  border: 1px solid rgba(101,42,51,.15);
  border-radius: 18px;
  background: rgba(255,253,248,.94);
  box-shadow: 0 18px 45px rgba(70,25,32,.17);
}
.qr { width: 92px; height: 92px; border-radius: 11px; }
.qr-card div { display: grid; gap: 4px; }
.qr-card small { color: var(--muted); }
.upload-card {
  display: grid;
  grid-template-columns: minmax(250px, .75fr) minmax(0, 1.25fr);
  gap: clamp(26px, 5vw, 70px);
  margin: 56px 0;
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid rgba(111,45,57,.14);
  border-radius: 34px;
  background: rgba(255,253,247,.84);
  box-shadow: 0 18px 55px rgba(79,33,40,.09);
}
.section-intro h2 { margin: 10px 0 18px; }
.section-intro p { color: var(--muted); }
form { display: grid; gap: 17px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
label { display: grid; gap: 8px; color: var(--ink); font-size: .9rem; font-weight: 820; }
.required, .optional { width: fit-content; padding: 3px 7px; border-radius: 999px; font-size: .63rem; letter-spacing: .05em; text-transform: uppercase; }
.required { color: #fff; background: var(--wine); }
.optional { color: var(--wine); background: #f6e0d1; }
input, select {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid rgba(94,44,51,.2);
  border-radius: 13px;
  background: rgba(255,255,255,.94);
  color: var(--ink);
}
select { appearance: auto; }
.file-picker {
  min-height: 180px;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 25px;
  border: 2px dashed rgba(111,45,57,.26);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(248,229,207,.65), rgba(255,255,255,.65));
  text-align: center;
}
.file-picker:hover { border-color: var(--wine); }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-picker > span:not(.file-icon) { color: var(--muted); font-size: .82rem; font-weight: 600; }
.file-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 4px; border-radius: 50%; color: #fff; background: var(--wine); font-size: 2rem; line-height: 1; }
.file-summary { color: var(--wine) !important; font-weight: 800 !important; }
.preview-strip { display: flex; gap: 9px; overflow-x: auto; padding: 2px 0 8px; }
.preview-strip img { width: 84px; height: 84px; flex: 0 0 auto; object-fit: cover; border-radius: 14px; box-shadow: 0 8px 20px rgba(70,25,32,.13); }
.progress-wrap { display: grid; gap: 8px; color: var(--muted); font-size: .82rem; }
.progress-track { height: 10px; overflow: hidden; border-radius: 999px; background: #eaded4; }
.progress-bar { width: 0; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--wine), var(--gold)); transition: width .15s linear; }
.full-button { width: 100%; }
.notice { padding: 13px 15px; border-radius: 13px; color: #285029; background: #e8f5df; font-weight: 700; }
.notice.error { color: #7c2028; background: #f9dfe1; }
.privacy-note { margin: 0; color: var(--muted); font-size: .76rem; text-align: center; }
.gallery-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin: 65px 0 22px; }
.gallery-heading h2 { margin: 9px 0 12px; }
.gallery-heading p { margin: 0; color: var(--muted); }
.family-filters { display: flex; gap: 9px; overflow-x: auto; padding: 4px 2px 18px; scrollbar-width: thin; }
.filter-chip { flex: 0 0 auto; min-height: 40px; padding: 9px 13px; border: 1px solid rgba(111,45,57,.15); border-radius: 999px; background: rgba(255,255,255,.72); color: var(--wine-dark); font-size: .84rem; font-weight: 820; }
.filter-chip span { display: inline-grid; place-items: center; min-width: 23px; height: 23px; margin-left: 5px; padding: 0 6px; border-radius: 999px; background: rgba(111,45,57,.1); }
.filter-chip.active { color: #fff8e9; background: var(--wine); border-color: var(--wine); box-shadow: 0 9px 22px rgba(93,35,45,.2); }
.filter-chip.active span { background: rgba(255,255,255,.18); }
.gallery { columns: 4 240px; column-gap: 15px; }
.tile {
  display: block;
  width: 100%;
  margin: 0 0 15px;
  padding: 0;
  overflow: hidden;
  break-inside: avoid;
  border: 1px solid rgba(111,45,57,.13);
  border-radius: 19px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 12px 30px rgba(82,35,42,.08);
}
.tile[hidden] { display: none; }
.tile:hover { box-shadow: 0 18px 40px rgba(82,35,42,.15); }
.tile img { display: block; width: 100%; height: auto; }
.tile-meta { display: grid; gap: 4px; padding: 12px 13px 14px; }
.tile-meta strong { font-size: .92rem; }
.tile-meta small { color: var(--wine); font-weight: 780; }
.tile-meta em { overflow: hidden; color: var(--muted); font-size: .77rem; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { grid-column: 1 / -1; padding: 70px 20px; border: 2px dashed rgba(111,45,57,.22); border-radius: 24px; color: var(--muted); text-align: center; }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { margin-bottom: 7px; color: var(--wine-dark); font-family: Georgia, serif; font-size: 1.7rem; }
.lightbox[hidden] { display: none; }
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 28px; background: rgba(30,9,14,.95); }
.lightbox img { max-width: min(1250px, 94vw); max-height: 84vh; object-fit: contain; border-radius: 15px; box-shadow: 0 30px 90px rgba(0,0,0,.4); }
.lightbox-close { position: fixed; top: 18px; right: 18px; width: 48px; height: 48px; padding: 0; border-radius: 50%; color: white; background: rgba(255,255,255,.12); font-size: 1.9rem; }
.lightbox-caption { position: fixed; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; max-width: min(820px, 90vw); transform: translateX(-50%); padding: 11px 17px; border-radius: 999px; background: rgba(51,16,23,.86); color: #fff8e9; text-align: center; }
.confetti { position: fixed; inset: 0; z-index: 110; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 18px; border-radius: 3px; animation: fall 1.7s ease-in forwards; }
@keyframes fall { to { transform: translate3d(var(--x), 105vh, 0) rotate(720deg); opacity: .3; } }
.slideshow-shell { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: #16080b; }
.slideshow-shell img { width: 100vw; height: 100vh; object-fit: contain; }
.slideshow-controls { position: fixed; z-index: 3; top: 17px; left: 17px; display: flex; gap: 10px; }
.slideshow-exit, .slideshow-controls select { min-height: 42px; padding: 9px 13px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: white; background: rgba(45,14,20,.78); backdrop-filter: blur(10px); }
.slideshow-controls select { width: auto; }
.slideshow-caption { position: fixed; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; max-width: min(1000px, 92vw); transform: translateX(-50%); padding: 11px 17px; border-radius: 999px; background: rgba(45,14,20,.76); color: #fff8e9; text-align: center; }
.slideshow-empty { color: #eacdc7; }
.login-card { max-width: 540px; margin: 45px auto; padding: 42px; border: 1px solid var(--line); border-radius: 30px; background: rgba(255,253,247,.9); box-shadow: var(--shadow); }
.login-logo { width: 82px; height: 82px; margin-bottom: 18px; border-radius: 50%; }
.login-card h1 { margin: 10px 0 20px; font-size: clamp(3.2rem, 9vw, 5.2rem); }
.admin-header { display: flex; justify-content: space-between; align-items: end; gap: 22px; margin-bottom: 24px; }
.admin-header h1 { margin: 8px 0 12px; font-size: clamp(3rem, 8vw, 5.5rem); }
.admin-header p { margin: 0; color: var(--muted); }
.admin-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.admin-header-actions form { display: block; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin: 26px 0; }
.stats-grid article { display: grid; gap: 3px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,253,247,.82); box-shadow: 0 10px 25px rgba(82,35,42,.06); }
.stats-grid strong { color: var(--wine-dark); font-family: Georgia, serif; font-size: 2.2rem; }
.stats-grid span { color: var(--muted); }
.admin-filters { margin-bottom: 18px; }
.admin-grid { display: grid; gap: 17px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.admin-card { overflow: hidden; border: 1px solid var(--line); border-radius: 21px; background: rgba(255,253,247,.9); box-shadow: 0 12px 30px rgba(82,35,42,.08); }
.admin-card.is-hidden { opacity: .52; }
.admin-card > img { width: 100%; height: 225px; object-fit: cover; }
.admin-card > div { display: grid; gap: 7px; padding: 15px; }
.admin-card small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.family-badge, .status-badge { width: fit-content; padding: 5px 9px; border-radius: 999px; font-size: .72rem; font-weight: 850; }
.family-badge { color: var(--wine); background: #f5dfd3; }
.status-badge { color: #fff; background: var(--danger); }
.admin-caption { margin: 0; color: var(--muted); font-size: .86rem; }
.metadata-editor { margin-top: 5px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: rgba(248,232,214,.52); }
.metadata-editor summary { cursor: pointer; color: var(--wine); font-weight: 820; }
.metadata-editor form { margin-top: 12px; }
.metadata-editor input, .metadata-editor select { min-height: 42px; }
.metadata-editor button { color: #fff; background: var(--wine); }
.admin-actions { display: flex; gap: 8px; margin-top: 5px; }
.admin-actions form { flex: 1; }
.admin-actions button { width: 100%; color: var(--ink); background: #f1e5d8; }
button.danger { color: white; background: var(--danger); }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 420px; }
  .hero-family-graphic { max-height: 450px; }
  .upload-card { grid-template-columns: 1fr; }
  .admin-header { align-items: flex-start; flex-direction: column; }
  .admin-header-actions { justify-content: flex-start; }
}
@media (max-width: 680px) {
  .topbar { align-items: center; padding-inline: 14px; }
  .brand small { display: none; }
  nav { gap: 12px; font-size: .78rem; }
  .admin-link { display: none; }
  main { width: min(100% - 20px, 1240px); padding-top: 18px; }
  .hero { min-height: auto; padding: 27px 21px; border-radius: 28px; }
  .hero-copy h1 { font-size: clamp(3.2rem, 17vw, 5rem); }
  .hero-art { min-height: 360px; }
  .qr-card { right: 0; bottom: 0; }
  .qr { width: 72px; height: 72px; }
  .hero-facts span { min-width: 110px; flex: 1; }
  .upload-card { margin: 28px 0; padding: 26px 20px; border-radius: 26px; }
  .form-grid { grid-template-columns: 1fr; }
  .gallery-heading { align-items: flex-start; flex-direction: column; margin-top: 46px; }
  .gallery { columns: 2 140px; column-gap: 10px; }
  .tile { margin-bottom: 10px; border-radius: 14px; }
  .tile-meta { padding: 9px 10px; }
  .tile-meta em { display: none; }
  .stats-grid { gap: 7px; }
  .stats-grid article { padding: 13px; }
  .stats-grid strong { font-size: 1.55rem; }
  .slideshow-controls { right: 15px; flex-wrap: wrap; }
  .slideshow-controls select { max-width: calc(100vw - 110px); }
  footer { font-size: .78rem; }
}
@media (max-width: 430px) {
  .brand strong { max-width: 125px; }
  .brand img { width: 40px; height: 40px; }
  .hero-actions { display: grid; }
  .hero-actions a { width: 100%; }
  .hero-art { min-height: 310px; }
  .qr-card small { display: none; }
  .gallery { columns: 2 120px; }
  .tile-meta small { font-size: .68rem; }
  .lightbox-caption { border-radius: 16px; }
}

/* Custom logo displayed as the main hero graphic */
.hero-family-graphic {
  display: block;
  width: min(100%, 560px);
  max-height: 510px;
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 24px 38px rgba(30, 30, 30, 0.18));
}

@media (max-width: 680px) {
  .hero-family-graphic {
    width: min(100%, 390px);
    max-height: 350px;
  }
}
