:root {
  --paper: #f4efe7;
  --paper-deep: #ece3d7;
  --paper-soft: #faf7f2;
  --ink: #29241f;
  --ink-soft: #51483f;
  --muted: #7a6f64;
  --line: rgba(87, 72, 56, .22);
  --line-strong: rgba(72, 58, 43, .38);
  --accent: #755f43;
  --accent-soft: #b9a487;
  --white: #fffdf9;
  --danger: #8b463e;
  --success: #536c52;
  --shadow: 0 24px 70px rgba(55, 43, 31, .10);
  --shadow-soft: 0 12px 38px rgba(55, 43, 31, .07);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --display: "Baskerville", "Baskerville Old Face", "Iowan Old Style", Georgia, serif;
  --script: "Monotype Corsiva", "Segoe Script", "URW Chancery L", cursive;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --radius: 2px;
}

* { box-sizing: border-box; }
html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 4%, rgba(255,255,255,.95), transparent 25rem),
    radial-gradient(circle at 88% 18%, rgba(255,255,255,.5), transparent 28rem),
    linear-gradient(180deg, #fbf8f3 0%, var(--paper) 48%, #efe7dc 100%);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@supports (overflow: clip) {
  html, body { overflow-x: clip; }
}
html { overscroll-behavior-x: none; }
body.menu-open,
body.lightbox-open { overflow: hidden; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: rgba(117,95,67,.18); }

.narrow { width: min(calc(100% - 56px), 1120px); margin-inline: auto; }
main { overflow: clip; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  min-height: 76px;
  border-bottom: 1px solid rgba(91,76,60,.14);
  background: rgba(248,244,238,.88);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.header-inner {
  width: min(calc(100% - 40px), 1240px);
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.brand-monogram {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: .08em;
}
.brand-date {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--muted);
}
.main-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 13px;
}
.main-nav a {
  position: relative;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--ink-soft);
  border-radius: 999px;
  transition: color .2s ease, background .2s ease;
}
.main-nav a:hover { background: rgba(117,95,67,.07); color: var(--ink); }
.main-nav a.active { background: rgba(117,95,67,.10); color: var(--ink); }
.menu-toggle {
  margin-left: auto;
  display: none;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 10px 0 10px 12px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12px;
}
.menu-toggle-lines { width: 26px; display: grid; gap: 6px; }
.menu-toggle-lines i { display: block; height: 1px; background: var(--ink); transition: transform .2s ease; transform-origin: center; }
.menu-toggle[aria-expanded="true"] .menu-toggle-lines i:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-lines i:last-child { transform: translateY(-3.5px) rotate(-45deg); }
.nav-scrim { display: none; }

/* Shared typography */
.eyebrow,
.section-kicker,
.menu-label,
.meta-label {
  margin: 0;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}
.section-kicker { letter-spacing: .18em; }
.lead {
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.65;
}

/* Home hero */
.invitation-shell {
  width: min(calc(100% - 36px), 1180px);
  margin: 20px auto 92px;
  padding: 12px;
  border: 1px solid rgba(105,87,66,.22);
  background: rgba(255,255,255,.25);
  box-shadow: var(--shadow);
}
.invitation-card {
  position: relative;
  padding: clamp(64px, 7vw, 96px) clamp(34px, 7vw, 94px) clamp(58px, 7vw, 88px);
  text-align: center;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 50% 5%, rgba(255,255,255,.9), transparent 24rem),
    linear-gradient(180deg, rgba(255,254,251,.94), rgba(247,242,234,.95));
}
.invitation-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(99,79,59,.22);
  pointer-events: none;
}
.corner { position: absolute; width: 70px; height: 70px; z-index: 1; pointer-events: none; opacity: .58; }
.corner::before,
.corner::after { content: ""; position: absolute; background: var(--accent); }
.corner::before { width: 52px; height: 1px; top: 0; }
.corner::after { width: 1px; height: 52px; top: 0; }
.corner-tl { top: 26px; left: 26px; }
.corner-tr { top: 26px; right: 26px; transform: rotate(90deg); }
.corner-bl { bottom: 26px; left: 26px; transform: rotate(-90deg); }
.corner-br { bottom: 26px; right: 26px; transform: rotate(180deg); }
.hero-ornament,
.footer-flourish {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  color: var(--accent);
}
.hero-ornament { font-size: 30px; margin-bottom: 18px; }
.hero-ornament span,
.footer-flourish span { width: 54px; height: 1px; background: currentColor; opacity: .45; }
.hero-script {
  margin: 20px 0 6px;
  font-family: var(--script);
  font-size: clamp(27px, 3.5vw, 45px);
  line-height: 1.15;
  color: var(--ink-soft);
}
.hero h1 {
  max-width: 920px;
  margin: 0 auto 54px;
  font-family: var(--display);
  font-size: clamp(43px, 6vw, 82px);
  font-weight: 400;
  line-height: .98;
  letter-spacing: .01em;
}
.hero h1 em {
  display: inline-block;
  margin: .16em 0 .12em;
  font-family: var(--script);
  font-size: .57em;
  font-weight: 400;
  color: var(--accent);
}
.couple-grid {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
}
.portrait-card { margin: 0; }
.image-button { position: relative; display: block; width: 100%; border: 0; padding: 0; background: transparent; cursor: zoom-in; }
.portrait-wrap {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--paper-deep);
  padding: 9px;
  box-shadow: 0 14px 34px rgba(46,37,27,.08);
}
.portrait-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.9) sepia(.08) contrast(.98);
  transition: transform .55s cubic-bezier(.2,.65,.3,1), filter .3s ease;
}
.portrait-card:hover img { transform: scale(1.025); filter: saturate(.98) sepia(.02); }
.portrait-card figcaption {
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 15px;
  letter-spacing: .04em;
}
.portrait-card figcaption span {
  display: block;
  margin-bottom: 1px;
  font-family: var(--script);
  font-size: clamp(28px, 3vw, 38px);
  color: var(--ink);
  letter-spacing: 0;
}
.couple-mark { font-family: var(--script); font-size: 34px; color: var(--accent); }
.zoom-badge {
  position: absolute;
  right: 17px;
  bottom: 17px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 50%;
  background: rgba(35,30,25,.72);
  color: #fff;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 300;
  line-height: 1;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform .2s ease, background .2s ease;
}
.zoomable:hover .zoom-badge { transform: scale(1.08); background: rgba(35,30,25,.86); }
.wedding-meta {
  margin: 52px auto 18px;
  display: inline-grid;
  grid-template-columns: auto 1px auto;
  align-items: center;
  gap: 28px;
}
.wedding-meta > div { display: grid; gap: 6px; }
.wedding-meta strong {
  font-family: var(--display);
  font-size: clamp(22px, 2.4vw, 31px);
  font-weight: 400;
  letter-spacing: .10em;
}
.meta-divider { width: 1px; height: 52px; background: var(--line-strong); }
.hero-place { max-width: 650px; margin: 10px auto 0; color: var(--muted); font-style: italic; }

/* Intro and home navigation */
.intro-section { max-width: 850px; text-align: center; margin-bottom: 70px; }
.intro-ornament { color: var(--accent-soft); margin-bottom: 16px; font-size: 16px; }
.intro-section h2 {
  margin: 8px auto 18px;
  font-family: var(--display);
  font-size: clamp(34px, 4.6vw, 58px);
  line-height: 1.08;
  font-weight: 400;
}
.intro-section > p:last-child { max-width: 760px; margin: 0 auto; color: var(--muted); font-size: 18px; }
.home-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 1px;
  padding: 1px;
  margin-bottom: 100px;
  background: var(--line);
}
.menu-card {
  min-height: 330px;
  padding: 34px 36px 38px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 42px;
  text-decoration: none;
  background: rgba(250,247,242,.87);
  transition: background .3s ease, transform .25s ease, box-shadow .25s ease;
}
.menu-card:hover { background: var(--white); box-shadow: var(--shadow-soft); transform: translateY(-2px); z-index: 1; }
.menu-card-top { display: flex; justify-content: space-between; align-items: center; }
.menu-number { font-family: var(--sans); font-size: 11px; letter-spacing: .16em; color: var(--muted); }
.menu-arrow { width: 33px; height: 33px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-family: var(--sans); transition: transform .2s ease; }
.menu-card:hover .menu-arrow { transform: translate(2px,-2px); }
.menu-label { margin-bottom: 9px; }
.menu-card h2 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: clamp(28px, 3vw, 39px);
  line-height: 1.08;
  font-weight: 400;
}
.menu-card p:last-child { margin: 0; color: var(--muted); max-width: 470px; }

/* Inner pages */
.page-hero { padding: 72px 0 52px; text-align: center; }
.compact-hero { padding-bottom: 24px; }
.page-hero-copy { max-width: 920px; margin: 0 auto; }
.page-hero h1 {
  margin: 8px auto 18px;
  font-family: var(--display);
  font-size: clamp(43px, 6.1vw, 76px);
  line-height: 1.02;
  font-weight: 400;
}
.feature-photo-wrap { margin-top: 38px; }
.feature-photo {
  width: min(900px,100%);
  margin: 0 auto;
  padding: 10px;
  border: 1px solid var(--line-strong);
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.feature-photo img {
  display: block;
  width: 100%;
  max-height: 720px;
  object-fit: contain;
  background: var(--paper-deep);
  transition: transform .5s ease;
}
.feature-photo:hover img { transform: scale(1.012); }
.zoom-hint {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 999px;
  background: rgba(39,33,27,.66);
  color: white;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .06em;
  white-space: nowrap;
  opacity: .92;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.content-card {
  background: rgba(255,253,249,.70);
  border: 1px solid var(--line);
  box-shadow: 0 10px 40px rgba(56,44,32,.05);
}
.two-column {
  display: grid;
  grid-template-columns: .82fr 1.18fr;
  gap: clamp(48px, 7vw, 90px);
  padding: clamp(38px, 5vw, 64px);
  margin-bottom: 82px;
}
.form-intro h2,
.article-copy h2,
.section-heading h2,
.quiz-card h2 {
  font-family: var(--display);
  font-weight: 400;
}
.form-intro h2 { margin: 7px 0 15px; font-size: clamp(32px, 4vw, 47px); line-height: 1.08; }
.form-intro p { color: var(--muted); }
.upload-note { display: flex; align-items: center; gap: 14px; margin-top: 28px; color: var(--muted); }
.upload-note span { font-family: var(--display); font-size: 48px; line-height: 1; color: var(--accent); }
.upload-note p { margin: 0; font-family: var(--sans); font-size: 11px; line-height: 1.4; text-transform: uppercase; letter-spacing: .08em; }

/* Forms */
.elegant-form { display: grid; gap: 22px; }
.elegant-form label { display: grid; gap: 8px; }
.elegant-form label > span:first-child:not(.file-drop-icon) { font-size: 15px; }
.elegant-form input:not([type="file"]),
.elegant-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.72);
  padding: 14px 15px;
  outline: none;
  color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.elegant-form input:not([type="file"]):focus,
.elegant-form textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(117,95,67,.08);
}
.elegant-form textarea { resize: vertical; min-height: 160px; }
.elegant-form small { color: var(--muted); font-family: var(--sans); line-height: 1.45; font-size: 10px; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; margin-top: 3px; }
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--white);
  background: var(--ink);
  padding: 12px 20px 12px 22px;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, opacity .2s ease;
}
.button:hover { transform: translateY(-1px); background: #17130f; }
.button:disabled { opacity: .45; cursor: wait; transform: none; }
.button-light { color: var(--ink); background: transparent; }
.button-light:hover { color: var(--white); background: var(--ink); }
.form-status { min-height: 22px; color: var(--muted); font-family: var(--sans); font-size: 12px; }
.form-status.success { color: var(--success); }
.form-status.error { color: var(--danger); }
.file-drop {
  min-height: 220px;
  position: relative;
  place-content: center;
  text-align: center;
  border: 1px dashed var(--line-strong);
  background: linear-gradient(180deg, rgba(255,255,255,.64), rgba(249,245,239,.70));
  padding: 28px !important;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.file-drop:hover { border-color: var(--accent); background: rgba(255,255,255,.88); }
.file-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-drop-icon { width: 48px; height: 48px; margin: 0 auto 14px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; font-family: var(--sans); font-size: 23px; font-weight: 300; }
.file-drop-title { font-family: var(--display); font-size: 27px; line-height: 1.2; }
.file-drop-subtitle { color: var(--muted); font-family: var(--sans); font-size: 11px; }
.selected-files { color: var(--muted); font-family: var(--sans); font-size: 12px; }

/* Section headings */
.wishes-section,
.gallery-section,
.article-section,
.admin-section { padding: 0 0 90px; }
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}
.section-heading h2 { margin: 4px 0 0; font-size: clamp(34px, 4vw, 48px); line-height: 1.08; }
.counter { font-family: var(--sans); font-size: 11px; color: var(--muted); letter-spacing: .12em; }
.gallery-tip { margin: -8px 0 24px; color: var(--muted); font-family: var(--sans); font-size: 11px; }
.empty-card {
  grid-column: 1 / -1;
  padding: 34px;
  border: 1px dashed var(--line-strong);
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,.34);
}

/* Wishes */
.wish-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.wish-card {
  min-height: 220px;
  position: relative;
  padding: 30px;
  border: 1px solid var(--line);
  background: rgba(255,253,249,.68);
  box-shadow: 0 8px 26px rgba(57,45,33,.035);
}
.wish-card::before { content: "❦"; display: block; margin-bottom: 18px; color: var(--accent-soft); font-size: 18px; }
.wish-card h3 { margin: 0 80px 14px 0; font-family: var(--display); font-weight: 400; font-size: 27px; line-height: 1.15; }
.wish-card p { margin: 0; color: var(--ink-soft); }
.wish-time { position: absolute; top: 32px; right: 28px; font-family: var(--sans); color: var(--muted); font-size: 10px; letter-spacing: .08em; }

/* Guest gallery */
.guest-gallery { columns: 3 260px; column-gap: 14px; }
.guest-gallery.is-empty { columns: auto; }
.guest-gallery.is-empty .empty-card { width: 100%; }
.guest-gallery > .empty-card { column-span: all; break-inside: avoid; }
.guest-photo {
  margin: 0 0 14px;
  break-inside: avoid;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 7px;
  box-shadow: 0 8px 24px rgba(55,43,31,.04);
}
.guest-photo .image-button { overflow: hidden; background: var(--paper-deep); }
.guest-photo img { width: 100%; height: auto; transition: transform .45s ease; }
.guest-photo:hover img { transform: scale(1.02); }
.guest-photo figcaption { padding: 8px 4px 2px; font-family: var(--sans); font-size: 10px; color: var(--muted); letter-spacing: .08em; text-align: right; }

/* History / article */
.article-card {
  margin-bottom: 22px;
  min-height: 270px;
  padding: clamp(32px, 5vw, 58px);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 38px;
  border: 1px solid var(--line);
  background: rgba(255,253,249,.72);
  box-shadow: var(--shadow-soft);
}
.article-copy { max-width: 720px; }
.article-copy h2 { margin: 5px 0 13px; font-size: clamp(38px, 5vw, 58px); line-height: 1; }
.article-copy > p:last-of-type { color: var(--muted); }
.article-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; margin-top: 24px; }
.article-mark {
  width: 130px;
  height: 130px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 62px;
  color: var(--accent);
}
.text-link { color: var(--muted); font-family: var(--sans); font-size: 12px; text-underline-offset: 4px; }
.pdf-frame { overflow: hidden; border: 1px solid var(--line); background: #dfd9d0; transition: min-height .25s ease; }
.pdf-frame.is-collapsed { display: none; }
.pdf-frame iframe { width: 100%; height: min(78vh, 900px); min-height: 680px; display: block; border: 0; }
.history-section { padding-top: 10px; }
.history-gallery { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.history-item { margin: 0; min-width: 0; padding: 7px; border: 1px solid var(--line); background: var(--white); box-shadow: 0 6px 20px rgba(55,43,31,.035); content-visibility: auto; contain-intrinsic-block-size: 450px; }
.history-item .image-button { overflow: hidden; aspect-ratio: 4 / 5; background: var(--paper-deep); }
.history-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, filter .3s ease; }
.history-item:hover img { transform: scale(1.025); }
.history-item figcaption { padding: 8px 2px 1px; text-align: center; font-family: var(--sans); font-size: 9px; color: var(--muted); letter-spacing: .1em; }

/* Quiz */
.quiz-card { max-width: 820px; margin-bottom: 92px; padding: clamp(32px, 5vw, 52px); }
.quiz-card h2 { margin: 6px 0 30px; font-size: clamp(36px, 5vw, 52px); line-height: 1.05; }
.quiz-form fieldset { border: 0; padding: 0; margin: 0 0 28px; display: grid; gap: 10px; }
.quiz-form legend { margin-bottom: 14px; color: var(--muted); }
.quiz-form label {
  min-height: 55px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.48);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.quiz-form label:hover { border-color: var(--accent-soft); background: rgba(255,255,255,.76); }
.quiz-form input { width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.quiz-result { margin-top: 20px; min-height: 34px; font-family: var(--script); font-size: 29px; }
.quiz-result.correct { color: var(--success); }
.quiz-result.wrong { color: var(--danger); }

/* Admin */
.admin-login { max-width: 520px; margin: 34px auto 0; text-align: left; }
.admin-list { display: grid; gap: 12px; }
.admin-item { display: grid; grid-template-columns: 1fr auto; gap: 24px; padding: 22px; border: 1px solid var(--line); background: rgba(255,255,255,.52); }
.admin-item p { margin: 10px 0 0; }
.admin-meta { display: block; margin-top: 4px; font-family: var(--sans); font-size: 10px; color: var(--muted); }
.danger-button { border: 1px solid var(--danger); border-radius: 999px; color: var(--danger); background: transparent; padding: 8px 13px; font-family: var(--sans); font-size: 11px; cursor: pointer; }
.admin-photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.admin-photo { padding: 7px; border: 1px solid var(--line); background: var(--white); }
.admin-photo img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--paper-deep); }
.admin-photo div { padding: 7px 0; font-family: var(--sans); font-size: 9px; color: var(--muted); }
.admin-photo-grid > .empty-card { grid-column: 1 / -1; }

/* Footer */
.site-footer {
  padding: 50px 20px max(58px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
}
.footer-flourish { margin-bottom: 12px; font-size: 18px; color: var(--accent-soft); }
.footer-names { font-family: var(--script); font-size: 27px; color: var(--ink-soft); }
.footer-copy { margin-top: 5px; font-family: var(--sans); font-size: 10px; letter-spacing: .10em; }
.footer-admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-top: 16px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.32);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .055em;
  text-decoration: none;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.footer-admin-link::before { content: "◇"; margin-right: 7px; font-size: 9px; color: var(--accent); }
.footer-admin-link:hover,
.footer-admin-link:focus-visible { color: var(--ink); border-color: var(--line-strong); background: rgba(255,255,255,.64); }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: 72px minmax(0,1fr) 72px;
  align-items: center;
  padding: 24px;
  background: rgba(17,14,12,.94);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
}
.lightbox.open { opacity: 1; visibility: visible; pointer-events: auto; }
.lightbox.lightbox-single { grid-template-columns: minmax(0, 1fr); }
.lightbox.lightbox-single .lightbox-stage { grid-column: 1; }
.lightbox.lightbox-single .lightbox-nav { display: none; }
.lightbox-stage { min-width: 0; height: calc(100dvh - 48px); display: grid; grid-template-rows: 1fr auto; align-items: center; justify-items: center; position: relative; }
.lightbox-image {
  max-width: 100%;
  max-height: calc(100dvh - 92px);
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transform: scale(.985);
  transition: opacity .2s ease, transform .25s ease;
  touch-action: pinch-zoom;
  user-select: none;
}
.lightbox-image.loaded { opacity: 1; transform: scale(1); }
.lightbox-caption { min-height: 28px; padding-top: 8px; color: rgba(255,255,255,.74); font-family: var(--sans); font-size: 11px; text-align: center; }

/* На широких экранах фотографии №3 и №6 открываются крупно по ширине.
   Вертикальные кадры прокручиваются внутри полноэкранного окна, поэтому
   мелкие детали и текст на фотографии не уменьшаются до узкой колонки. */
@media (min-width: 981px) {
  .lightbox.lightbox-detail {
    padding: 18px;
    background: #171411;
  }
  .lightbox.lightbox-detail .lightbox-stage {
    height: calc(100dvh - 36px);
    display: block;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    text-align: center;
    padding: 0;
  }
  .lightbox.lightbox-detail .lightbox-image {
    display: block;
    width: min(1180px, calc(100vw - 190px));
    max-width: none;
    max-height: none;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
  }
  .lightbox.lightbox-detail.lightbox-single .lightbox-image {
    width: min(1280px, calc(100vw - 72px));
  }
  .lightbox.lightbox-detail .lightbox-caption { display: none; }
  .lightbox.lightbox-detail .lightbox-loader { position: fixed; }
}
.lightbox-close,
.lightbox-nav {
  border: 0;
  color: white;
  background: transparent;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 200;
}
.lightbox-close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 18px; z-index: 3; width: 48px; height: 48px; font-size: 38px; line-height: 1; }
.lightbox-nav { width: 52px; height: 52px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; font-size: 40px; line-height: .8; justify-self: center; }
.lightbox-nav[hidden] { visibility: hidden; }
.lightbox-loader { position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 1px solid rgba(255,255,255,.22); border-top-color: rgba(255,255,255,.9); border-radius: 50%; animation: spin .8s linear infinite; }
.lightbox-image.loaded + .lightbox-caption ~ .lightbox-loader { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

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

@media (max-width: 980px) {
  .site-header { min-height: 68px; }
  .header-inner { min-height: 68px; width: min(calc(100% - 32px), 1240px); }
  .menu-toggle { display: inline-flex; }
  .main-nav {
    position: fixed;
    top: 68px;
    left: 16px;
    right: 16px;
    z-index: 90;
    margin: 0;
    padding: 12px;
    display: grid;
    gap: 2px;
    border: 1px solid var(--line);
    background: rgba(250,247,242,.98);
    box-shadow: 0 24px 70px rgba(29,23,18,.20);
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  }
  .main-nav.open { opacity: 1; transform: translateY(0); visibility: visible; pointer-events: auto; }
  .main-nav a { min-height: 48px; display: flex; align-items: center; padding: 10px 14px; border-radius: 0; border-bottom: 1px solid rgba(91,76,60,.10); }
  .main-nav a:last-child { border-bottom: 0; }
  .nav-scrim {
    position: fixed;
    inset: 68px 0 0;
    z-index: 60;
    display: block;
    background: rgba(33,27,22,.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
  }
  body.menu-open .nav-scrim { opacity: 1; visibility: visible; pointer-events: auto; }
  .two-column { grid-template-columns: 1fr; gap: 36px; }
  .history-gallery { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .admin-photo-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 720px) {
  body { font-size: 16px; line-height: 1.58; }
  .narrow { width: min(calc(100% - 28px), 1120px); }
  .brand-date { display: none; }
  .brand-monogram { font-size: 20px; }
  .menu-toggle-text { display: none; }

  .invitation-shell { width: calc(100% - 16px); margin: 8px auto 58px; padding: 6px; box-shadow: 0 16px 42px rgba(55,43,31,.09); }
  .invitation-card { padding: 48px 18px 44px; }
  .invitation-card::before { inset: 8px; }
  .corner { display: none; }
  .hero-ornament { margin-bottom: 12px; font-size: 23px; }
  .hero-ornament span { width: 34px; }
  .hero-script { margin-top: 14px; font-size: 28px; }
  .hero h1 { font-size: clamp(36px, 11vw, 54px); line-height: 1.01; margin-bottom: 34px; }
  .hero h1 em { margin: .10em 0 .05em; }

  .couple-grid { grid-template-columns: 1fr; gap: 22px; max-width: 340px; }
  .couple-mark { margin: -5px 0 -8px; font-size: 30px; }
  .portrait-wrap { padding: 7px; }
  .portrait-card figcaption { margin-top: 12px; }
  .portrait-card figcaption span { font-size: 31px; }
  .wedding-meta { width: 100%; margin-top: 38px; grid-template-columns: 1fr 1px 1fr; gap: 16px; }
  .wedding-meta strong { font-size: 20px; letter-spacing: .06em; }
  .meta-divider { height: 44px; }
  .hero-place { padding: 0 5px; font-size: 15px; }

  .intro-section { margin-bottom: 48px; }
  .intro-section h2 { font-size: 36px; }
  .intro-section > p:last-child { font-size: 16px; }
  .home-menu { grid-template-columns: 1fr; margin-bottom: 64px; }
  .menu-card { min-height: 250px; padding: 26px 24px 28px; gap: 32px; }
  .menu-card h2 { font-size: 31px; }

  .page-hero { padding: 46px 0 36px; }
  .page-hero h1 { font-size: clamp(38px, 10.5vw, 54px); }
  .lead { font-size: 16px; }
  .feature-photo-wrap { margin-top: 28px; }
  .feature-photo { padding: 6px; }
  .feature-photo img { max-height: 560px; }
  .zoom-hint { bottom: 16px; font-size: 9px; }

  .two-column { width: calc(100% - 20px); padding: 30px 22px; margin-bottom: 58px; gap: 30px; }
  .form-intro h2 { font-size: 34px; }
  .file-drop { min-height: 190px; padding: 22px !important; }
  .form-actions { align-items: stretch; }
  .button { width: 100%; min-height: 50px; justify-content: space-between; }
  .form-status { width: 100%; }

  .wishes-section, .gallery-section, .article-section, .admin-section { padding-bottom: 64px; }
  .section-heading { align-items: center; }
  .section-heading h2 { font-size: 36px; }
  .wish-list { grid-template-columns: 1fr; }
  .wish-card { min-height: auto; padding: 24px; }
  .wish-card h3 { font-size: 25px; margin-right: 68px; }
  .wish-time { top: 27px; right: 22px; }

  .guest-gallery { columns: 2 145px; column-gap: 9px; }
  .guest-photo { margin-bottom: 9px; padding: 5px; }
  .guest-photo figcaption { font-size: 9px; }

  .article-card { grid-template-columns: 1fr; gap: 24px; padding: 28px 24px; }
  .article-mark { width: 82px; height: 82px; font-size: 40px; order: -1; }
  .article-actions { align-items: stretch; }
  .article-actions .button { width: auto; }
  .pdf-frame iframe { min-height: 520px; height: 68vh; }
  .history-section .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .history-section .counter {
    max-width: 100%;
    white-space: normal;
    line-height: 1.35;
    letter-spacing: .08em;
  }
  .history-gallery { gap: 8px; }
  .history-item { padding: 4px; contain-intrinsic-block-size: 220px; }
  .history-item figcaption { padding-top: 5px; }
  .history-item .zoom-badge { width: 28px; height: 28px; right: 10px; bottom: 10px; font-size: 15px; }

  .quiz-card { width: calc(100% - 20px); padding: 28px 22px; margin-bottom: 66px; }
  .quiz-card h2 { font-size: 37px; }
  .quiz-form label { min-height: 58px; padding: 12px; }

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

  .lightbox { grid-template-columns: 1fr; padding: 14px; }
  .lightbox-stage { height: calc(100dvh - 28px); padding: 40px 0 60px; }
  .lightbox-image { max-height: calc(100dvh - 130px); }
  .lightbox-nav {
    position: absolute;
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 4;
    width: 44px;
    height: 44px;
    font-size: 32px;
    background: rgba(0,0,0,.18);
  }
  .lightbox-prev { left: calc(50% - 58px); }
  .lightbox-next { right: calc(50% - 58px); }
  .lightbox-close { top: max(8px, env(safe-area-inset-top)); right: 8px; }
  .lightbox-caption { padding: 8px 54px 0; }
}

@media (max-width: 420px) {
  .header-inner { width: calc(100% - 24px); }
  .invitation-card { padding-inline: 14px; }
  .hero h1 { font-size: 36px; }
  .couple-grid { max-width: 305px; }
  .wedding-meta strong { font-size: 18px; }
  .menu-card h2 { font-size: 29px; }
  .page-hero h1 { font-size: 39px; }
  .history-gallery { grid-template-columns: 1fr 1fr; }
  .guest-gallery { columns: 2 130px; }
}

/* Home media: photo + video + wide photo */
.hero-media-grid {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: clamp(22px, 4vw, 48px);
}
.hero-media-card { min-width: 0; }
.video-wrap {
  position: relative;
  display: block;
  background: #1f1c19;
}
.video-wrap video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #1f1c19;
}
.hero-wide-photo {
  max-width: 860px;
  margin: clamp(34px, 4.5vw, 52px) auto 0;
}
.hero-wide-photo-wrap {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 7;
  border: 1px solid var(--line-strong);
  background: var(--paper-deep);
  padding: 9px;
  box-shadow: 0 14px 34px rgba(46,37,27,.08);
}
.hero-wide-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.92) sepia(.05) contrast(.99);
  transition: transform .55s cubic-bezier(.2,.65,.3,1), filter .3s ease;
}
.hero-wide-photo:hover img {
  transform: scale(1.018);
  filter: saturate(1) sepia(0);
}

@media (max-width: 720px) {
  .hero-media-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    max-width: 340px;
  }
  .hero-wide-photo {
    max-width: 340px;
    margin-top: 34px;
  }
  .hero-wide-photo-wrap {
    padding: 7px;
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 420px) {
  .hero-media-grid,
  .hero-wide-photo { max-width: 305px; }
}

/* Header & navigation UX refinement */
.site-header {
  z-index: 110;
  min-height: 78px;
  border-bottom: 1px solid rgba(91,76,60,.13);
  background: rgba(250,247,242,.92);
  box-shadow: 0 5px 24px rgba(55,43,31,.035);
}
.header-inner {
  min-height: 78px;
  gap: 26px;
}
.brand {
  align-items: center;
  gap: 12px;
}
.brand-monogram {
  display: grid;
  place-items: center;
  min-width: 48px;
  height: 42px;
  padding: 0 7px;
  border: 1px solid rgba(87,72,56,.25);
  background: rgba(255,253,249,.55);
  font-size: 20px;
  line-height: 1;
}
.brand-meta {
  display: grid;
  gap: 2px;
  line-height: 1.1;
}
.brand-label {
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: .025em;
  color: var(--ink);
}
.brand-date {
  font-size: 9px;
  letter-spacing: .16em;
}
.main-nav {
  position: static;
  margin-left: auto;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  transform: none;
  visibility: visible;
  pointer-events: auto;
}
.main-nav-links {
  display: flex;
  align-items: center;
  gap: 5px;
}
.main-nav-links a {
  display: block;
  min-height: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 999px;
}
.main-nav-links a.active {
  background: rgba(117,95,67,.11);
  box-shadow: inset 0 0 0 1px rgba(117,95,67,.06);
}
.nav-title { display: block; }
.nav-index,
.nav-description,
.nav-arrow,
.mobile-nav-head,
.mobile-nav-intro,
.mobile-nav-footer { display: none; }
.menu-toggle {
  min-height: 44px;
  border-radius: 999px;
}
.nav-scrim { z-index: 100; }

@media (max-width: 980px) {
  .site-header {
    min-height: 72px;
    /* backdrop-filter создаёт containing block для position: fixed в части
       мобильных браузеров. Без него боковая навигация привязана именно
       к viewport, а не к ширине sticky-шапки. */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(250,247,242,.985);
    box-shadow: 0 7px 24px rgba(55,43,31,.08);
  }
  .header-inner {
    width: min(calc(100% - 28px), 1240px);
    min-height: 72px;
    gap: 14px;
  }
  .brand { gap: 9px; min-width: 0; }
  .brand-monogram {
    min-width: 44px;
    height: 40px;
    font-size: 18px;
  }
  .brand-meta { min-width: 0; }
  .brand-label {
    max-width: 116px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
  }
  .brand-date { display: block; font-size: 8px; }

  .menu-toggle {
    position: relative;
    z-index: 112;
    display: inline-flex;
    min-height: 46px;
    margin-left: auto;
    padding: 0 15px;
    gap: 10px;
    border: 1px solid var(--ink);
    border-radius: 999px;
    background: var(--ink);
    color: var(--white);
    box-shadow: 0 7px 18px rgba(41,36,31,.16);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .10em;
    text-transform: uppercase;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .menu-toggle:active { transform: scale(.97); }
  .menu-toggle-text { display: inline; }
  .menu-toggle-lines { width: 20px; gap: 5px; }
  .menu-toggle-lines i { height: 1px; background: currentColor; }
  .menu-toggle[aria-expanded="true"] {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: none;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    z-index: 120;
    width: min(90vw, 410px);
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 0;
    border-left: 1px solid rgba(91,76,60,.16);
    border-radius: 0;
    background:
      radial-gradient(circle at 86% 6%, rgba(185,164,135,.18), transparent 18rem),
      linear-gradient(180deg, #fcfaf6 0%, #f4eee5 100%);
    box-shadow: -28px 0 80px rgba(29,23,18,.24);
    opacity: 1;
    transform: translateX(104%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .28s cubic-bezier(.2,.72,.28,1), visibility .28s ease;
  }
  .main-nav.open {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  .mobile-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 62px;
    padding: 0 2px 14px;
    border-bottom: 1px solid rgba(91,76,60,.14);
  }
  .mobile-nav-head > div { display: grid; gap: 3px; }
  .mobile-nav-kicker {
    font-family: var(--sans);
    font-size: 9px;
    font-weight: 650;
    letter-spacing: .20em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .mobile-nav-head strong {
    font-family: var(--display);
    font-size: 27px;
    line-height: 1;
    font-weight: 400;
  }
  .mobile-nav-close {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    padding: 0 0 3px;
    border: 1px solid rgba(91,76,60,.22);
    border-radius: 50%;
    background: rgba(255,253,249,.78);
    color: var(--ink);
    cursor: pointer;
    font-family: var(--sans);
    font-size: 30px;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav-intro {
    display: block;
    padding: 15px 2px 11px;
    font-family: var(--sans);
    font-size: 11px;
    color: var(--muted);
  }
  .main-nav-links {
    display: grid;
    align-content: start;
    gap: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 2px 10px;
    scrollbar-width: thin;
  }
  .main-nav-links a {
    min-height: 72px;
    padding: 11px 12px;
    display: grid;
    grid-template-columns: 30px minmax(0,1fr) 28px;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(91,76,60,.13);
    border-radius: 16px;
    background: rgba(255,253,249,.66);
    color: var(--ink);
    box-shadow: 0 5px 14px rgba(55,43,31,.025);
    transition: transform .16s ease, background .16s ease, border-color .16s ease;
  }
  .main-nav-links a:active { transform: scale(.985); }
  .main-nav-links a.active {
    border-color: rgba(117,95,67,.34);
    background: rgba(117,95,67,.105);
    box-shadow: inset 3px 0 0 var(--accent);
  }
  .nav-index {
    display: block;
    align-self: start;
    padding-top: 3px;
    font-family: var(--sans);
    font-size: 9px;
    font-weight: 650;
    letter-spacing: .12em;
    color: var(--muted);
  }
  .nav-copy { min-width: 0; display: grid; gap: 3px; }
  .nav-title {
    font-family: var(--display);
    font-size: 19px;
    line-height: 1.08;
  }
  .nav-description {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--sans);
    font-size: 10px;
    line-height: 1.3;
    color: var(--muted);
  }
  .nav-arrow {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(91,76,60,.16);
    border-radius: 50%;
    font-family: var(--sans);
    font-size: 13px;
    color: var(--accent);
  }
  .main-nav-links a.active .nav-arrow {
    border-color: rgba(117,95,67,.28);
    background: rgba(255,253,249,.54);
  }
  .mobile-nav-footer {
    display: block;
    margin-top: auto;
    padding: 13px 2px 0;
    border-top: 1px solid rgba(91,76,60,.14);
    font-family: var(--sans);
    font-size: 9px;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .nav-scrim {
    position: fixed;
    inset: 0;
    /* Ниже stacking-context шапки (z-index: 110), чтобы панель меню
       всегда оставалась поверх затемнения и принимала нажатия. */
    z-index: 105;
    display: block;
    background: rgba(33,27,22,.43);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .24s ease, visibility .24s ease;
  }
  body.menu-open .nav-scrim {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

@media (max-width: 720px) {
  .header-inner { width: calc(100% - 24px); }
  .brand-date { display: block; }
  .brand-monogram { font-size: 17px; }
  .menu-toggle-text { display: inline; }
  .menu-toggle { min-height: 44px; padding-inline: 14px; }
}

@media (max-width: 380px) {
  .header-inner { width: calc(100% - 20px); gap: 9px; }
  .brand { gap: 7px; }
  .brand-monogram { min-width: 40px; height: 38px; padding-inline: 5px; font-size: 16px; }
  .brand-label { max-width: 88px; font-size: 12px; }
  .brand-date { font-size: 7px; letter-spacing: .12em; }
  .menu-toggle { min-height: 42px; padding-inline: 12px; gap: 8px; font-size: 10px; }
  .menu-toggle-lines { width: 18px; }
  .main-nav { width: min(94vw, 410px); padding-inline: 14px; }
  .main-nav-links a { min-height: 68px; }
}
