:root { color-scheme: light; --paper: #f7f5f0; --ink: #3a3934; --muted: #77756d; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, Helvetica, sans-serif; -webkit-font-smoothing: antialiased; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid #9b8055; outline-offset: 5px; }
[hidden] { display: none !important; }
.page { max-width: 1088px; padding: 0 32px; margin: auto; }
.header { text-align: center; padding: 80px 0 48px; }
h1 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: clamp(34px, 5vw, 56px); letter-spacing: -.035em; line-height: 1.15; margin: 0; text-wrap: balance; }
.gallery, .placeholder-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.photo-tile { position: relative; display: block; padding: 0; border: 0; background: #e8e4db; aspect-ratio: 1; overflow: hidden; border-radius: 2px; }
.photo-tile img { display: block; width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; outline: 1px solid rgba(0, 0, 0, .1); outline-offset: -1px; transition: transform 250ms ease, opacity 180ms ease; }
@media (hover: hover) { .photo-tile:hover img { transform: scale(1.025); } }
.photo-tile:active img { opacity: .85; }
.tile-error { position: absolute; inset: 0; display: grid; place-content: center; padding: 20px; color: var(--muted); font-size: 13px; }
.empty-message { margin: 0 0 24px; text-align: center; font-size: 13px; color: var(--muted); }
.placeholder-grid > div { aspect-ratio: 1; background: #eeebe4; border-radius: 2px; display: grid; place-items: center; }
.placeholder-grid span { color: #a9a397; font: 22px Georgia, serif; }
footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 40px 0; font-size: 12px; color: var(--muted); }
footer a { display: inline-flex; gap: 12px; align-items: center; min-height: 44px; color: inherit; text-decoration: none; }
footer a:hover { color: var(--ink); }
body.viewer-open { position: fixed; top: var(--gallery-scroll-top); left: 0; right: 0; width: 100%; overflow: hidden; }
dialog { position: fixed; inset: 0; max-width: none; max-height: none; width: 100%; height: 100%; height: 100dvh; margin: 0; padding: 0; border: 0; background: #171715; color: #f7f5f0; }
dialog::backdrop { background: #171715; }
.lightbox-shell { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: max(12px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.lightbox-top, .lightbox-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lightbox-top { display: grid; grid-template-columns: 1fr auto 1fr; }
.lightbox-top #close { justify-self: end; }
.gallery-return { justify-self: start; }
#counter { margin: 0; font-size: 14px; color: #c9c6be; font-variant-numeric: tabular-nums; }
.icon-button, .nav-button { border: 0; color: inherit; background: transparent; display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; border-radius: 4px; transition: background-color 150ms ease, transform 150ms ease; }
.icon-button svg, .nav-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-button:hover, .nav-button:hover { background: #ffffff10; }
.icon-button:active, .nav-button:active { transform: scale(.96); }
.nav-button { gap: 8px; padding: 0 12px; font-size: 13px; }
.nav-button:disabled { opacity: .35; cursor: default; }
.photo-stage { touch-action: pan-y pinch-zoom; cursor: grab; position: relative; display: grid; place-items: center; min-height: 0; min-width: 0; margin: 12px 0; overflow: hidden; }
#full-photo { position: absolute; inset: 0; display: block; max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform 180ms ease, opacity 180ms ease; }
#celebration-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
#photo-error { text-align: center; font-size: 14px; color: #c9c6be; }
.viewer-hint { color: #a9a79f; font-size: 12px; }
.photo-stage.dragging { cursor: grabbing; }
.photo-stage.dragging #full-photo { transition: none; }
.viewer-controls { min-width: 0; }
.photo-strip { position: relative; display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 8px 4px 4px; touch-action: pan-x pinch-zoom; }
.photo-strip::-webkit-scrollbar { display: none; }
.strip-photo { flex: 0 0 56px; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 4px; background: #333; opacity: .55; overflow: hidden; transition: opacity 150ms ease; }
.strip-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.strip-photo[aria-pressed="true"] { opacity: 1; box-shadow: 0 0 0 2px #f7f5f0; }
.strip-photo:focus-visible { outline-color: #f7f5f0; outline-offset: 2px; }
.strip-photo:hover { opacity: 1; }
@media (max-width: 600px) {
  .page { padding: 0 14px; }
  .header { padding: 48px 10px 32px; }
  .gallery, .placeholder-grid { gap: 8px; }
  footer { padding: 24px 2px; }
  .lightbox-shell { padding: max(4px, env(safe-area-inset-top)) env(safe-area-inset-right) max(4px, env(safe-area-inset-bottom)) env(safe-area-inset-left); }
  .lightbox-top, .viewer-controls { margin-inline: 10px; }
  .lightbox-top { gap: 4px; }
  .nav-button { min-height: 52px; font-size: 14px; padding: 0 8px; gap: 4px; }
  .lightbox-bottom .nav-button { background: #ffffff0d; border-radius: 8px; min-width: 104px; }
  .viewer-hint { font-size: 11px; text-align: center; }
  .photo-stage { margin: 4px 0; }
  .strip-photo { flex-basis: 48px; width: 48px; height: 48px; }
  .photo-strip { padding-top: 6px; padding-bottom: 2px; gap: 8px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .lightbox-shell { padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: max(4px, env(safe-area-inset-bottom)); }
  .photo-strip { display: none; }
  .photo-stage { margin: 0; }
  .nav-button, .icon-button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
