:root {
  color-scheme: light;
  --paper: #fbf7f2;
  --ink: #392027;
  --wine: #651e33;
  --muted: #72575b;
  --line: #e9dcd6;
  --serif: 'Baskerville', 'Palatino Linotype', Georgia, serif;
  --sans: 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); }
body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid #9a4260; outline-offset: 4px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.shell { width: min(1120px, calc(100% - 36px)); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; min-height: 69px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--wine); font: 600 19px var(--serif); }
.monogram { width: 38px; height: 38px; border: 1px solid #dcbfc4; border-radius: 50%; display: grid; place-content: center; display: inline-flex; align-items: center; justify-content: center; font: 600 13px var(--serif); }
.monogram span { font-size: 9px; font-style: italic; margin-inline: 1px; }
.nav-link { font-size: 14px; font-weight: 600; padding-block: 12px; }
.nav-link:hover { color: var(--wine); text-decoration: underline; text-underline-offset: 5px; }
.hero { margin-top: 23px; display: grid; overflow: hidden; border: 1px solid #ebd9d6; border-radius: 20px; background: #f4e7e5; }
.hero-copy { padding: clamp(26px, 6vw, 68px); position: relative; isolation: isolate; }
.hero-copy::before { content: ''; position: absolute; z-index: -1; inset: 0; background: radial-gradient(ellipse at top left, #faefeb, transparent 80%); }
.eyebrow { margin: 0; color: var(--wine); text-transform: uppercase; font-size: 13px; font-weight: 700; letter-spacing: .15em; display: flex; align-items: center; gap: 10px; }
.eyebrow span { height: 1px; width: 22px; background: #a87580; }
h1, h2, h3 { margin: 0; color: var(--wine); font-family: var(--serif); font-weight: 500; line-height: 1; }
h1 { font-size: clamp(70px, 11vw, 140px); line-height: .78; letter-spacing: -.065em; margin: 25px 0 24px; }
h1 em { font-weight: 400; font-size: .64em; color: #9b4f61; }
.intro { max-width: 28ch; margin: 0 0 24px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 9px; position: relative; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 48px; border-radius: 8px; padding: 10px 15px; border: 1px solid transparent; font-size: 14px; font-weight: 650; line-height: 1.2; cursor: pointer; transition: background-color .16s ease; }
.primary { background: var(--wine); color: #fff8f4; }
.primary:hover { background: #4d1526; }
.secondary { color: var(--wine); border-color: #c8a4ab; background: transparent; }
.secondary:hover { background: #efdbdd; }
.file-input { position: absolute; bottom: 0; left: 0; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.actions:has(#gallery-input:focus-visible) label[for=gallery-input],
.actions:has(#camera-input:focus-visible) label[for=camera-input] { outline: 2px solid #9a4260; outline-offset: 4px; }
.hero-visual { min-height: clamp(156px, 43vw, 264px); background: #532031 url('/wedding-flowers.webp') center 53% / cover no-repeat; position: relative; }
.hero-frame { position: absolute; inset: 12px; border: 1px solid #fff3e279; border-radius: 8px; pointer-events: none; }
.gallery { margin-top: clamp(34px, 6vw, 72px); scroll-margin-top: 24px; }
.gallery-header { display: flex; gap: 12px; justify-content: space-between; align-items: end; margin-bottom: 22px; }
.gallery h2 { font-size: clamp(44px, 7vw, 74px); letter-spacing: -.05em; margin-top: 8px; }
.photo-count { color: var(--muted); margin: 0 0 6px; white-space: nowrap; font-size: 14px; }
.empty { min-height: 208px; border: 1px dashed #dec3c3; border-radius: 14px; text-align: center; display: grid; justify-items: center; align-content: center; gap: 12px; padding: 26px 18px; background: #fffaf6; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--wine); background: #f4e7e5; }
.empty h3 { font-size: 27px; }
.empty p { color: var(--muted); margin: 0; }
.empty p:empty { display: none; }
.photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { position: relative; overflow: hidden; aspect-ratio: 1; border-radius: 10px; background: #efdfdb; margin: 0; }
.tile-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; }
.tile-open:focus-visible { outline-offset: -4px; }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.tile-open:hover img { transform: scale(1.045); }
.tile-save { position: absolute; right: 7px; bottom: 7px; background: #fff9f3; color: var(--wine); }
.icon-button { display: inline-grid; width: 44px; height: 44px; padding: 0; place-items: center; border-radius: 50%; border: 0; color: var(--wine); background: #f6e8e7; flex: none; }
.icon-button:hover { background: #eed7d9; }
.more { display: flex; margin: 22px auto 0; }
.notice { margin: 16px 0 -10px; border: 1px solid #e0c1c8; background: #f5e6e8; border-radius: 8px; padding: 10px 14px; }
.footer { margin-top: 42px; padding: 24px 4px max(24px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--wine); display: flex; align-items: center; justify-content: center; gap: 8px; font: italic 18px var(--serif); }
.footer svg { width: 16px; height: 16px; }
dialog { border: 0; padding: 0; }
dialog::backdrop { background: #211216ac; }
.upload-dialog { width: min(490px, calc(100% - 26px)); border-radius: 16px; background: var(--paper); color: var(--ink); max-height: min(90dvh, 700px); }
.upload-form { display: grid; gap: 10px; padding: clamp(18px, 5vw, 30px); }
.dialog-heading { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.dialog-heading h2 { font-size: clamp(31px, 7vw, 43px); letter-spacing: -.035em; }
.upload-form label { font-weight: 650; font-size: 14px; }
.upload-form label span { color: var(--muted); font-weight: 400; margin-left: 4px; }
.upload-form input { min-width: 0; width: 100%; border: 1px solid #ceafb3; background: #fffaf6; color: var(--ink); border-radius: 7px; padding: 10px 12px; }
.upload-hint, .upload-status { margin: 0; font-size: 14px; color: var(--muted); }
progress { width: 100%; accent-color: var(--wine); }
.queue { margin: 3px 0; padding: 0; list-style: none; max-height: 145px; overflow: auto; }
.queue li { display: flex; align-items: center; gap: 9px; padding: 3px 0; }
.queue img, .queue-icon { width: 36px; height: 36px; object-fit: cover; flex: none; border-radius: 5px; background: #eedadb; }
.queue-icon { display: grid; place-items: center; color: var(--wine); }
.queue-copy { overflow: hidden; }
.queue-copy span, .queue-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.queue-copy small { color: var(--muted); }
.remove { margin-left: auto; }
.viewer { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; background: #24151a; color: #fff9f2; }
.viewer-layout { height: 100%; display: grid; grid-template-rows: 48px minmax(0, 1fr) auto; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); gap: 6px; }
.viewer-close { justify-self: end; }
.viewer-stage { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 4px; min-height: 0; }
.viewer-stage img { display: block; height: 100%; width: 100%; object-fit: contain; }
.viewer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.viewer-footer p { margin: 0; overflow-wrap: anywhere; }
#viewer-credit { color: #e2c7cc; font-size: 14px; }
.viewer-download { background: #fff5ee; color: var(--wine); margin-left: auto; }
.viewer-download:hover { background: #eed7d9; }

@media (min-width: 710px) {
  .shell { width: min(1120px, calc(100% - 76px)); }
  .masthead-inner { min-height: 76px; }
  .hero { margin-top: 32px; grid-template-columns: 1.02fr 1fr; }
  .hero-visual { min-height: 100%; }
  .hero-frame { inset: 17px; }
  .photos { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
  .viewer-layout { padding-inline: 24px; }
}

@media (min-width: 1030px) {
  .photos { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
