:root {
  color-scheme: light;
  --ink: #2a1520;
  --wine: #3b1024;
  --wine-soft: #67223e;
  --rose: #9e4466;
  --gold: #d7a866;
  --cream: #fffaf3;
  --paper: #fffdf9;
  --line: #eadbd4;
  --muted: #765f68;
  --danger: #b42318;
  --shadow: 0 22px 70px rgba(59,16,36,.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--cream); color: var(--ink); font-size: 1rem; line-height: 1.55; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #2d73d5; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 1000; padding: .75rem 1rem; background: white; color: var(--ink); border-radius: .5rem; }
.skip-link:focus { top: 1rem; }
.gate { min-height: 100svh; display: grid; place-items: center; padding: max(2rem, env(safe-area-inset-top)) 1rem max(6rem, env(safe-area-inset-bottom)); background: radial-gradient(circle at 15% 12%, rgba(215,168,102,.22), transparent 28rem), radial-gradient(circle at 85% 82%, rgba(158,68,102,.2), transparent 28rem), var(--wine); position: relative; overflow: hidden; }
.gate::before, .gate::after { content: ""; position: absolute; width: 18rem; height: 18rem; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.gate::before { left: -10rem; top: -8rem; }
.gate::after { right: -10rem; bottom: -8rem; }
.gate-card { width: min(100%, 34rem); padding: clamp(2rem, 7vw, 4.5rem); background: var(--paper); border-radius: 2rem; text-align: center; box-shadow: var(--shadow); position: relative; z-index: 1; }
.monogram { width: 6rem; height: 6rem; margin: 0 auto 1.5rem; display: flex; align-items: center; justify-content: center; gap: .18rem; border: 1px solid var(--gold); border-radius: 50%; color: var(--wine); font: 600 1.6rem Georgia, serif; }
.monogram i { font-size: 1rem; color: var(--rose); }
.eyebrow { margin: 0 0 .55rem; color: var(--rose); font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.gate h1, .welcome h1, .section-heading h2, .dialog h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.03em; }
.gate h1 { margin: 0; font-size: clamp(2.6rem, 10vw, 4.3rem); line-height: .98; color: var(--wine); }
.gate h1 span { color: var(--gold); font-style: italic; font-size: .8em; }
.gate-copy { margin: 1.35rem auto 2rem; max-width: 26rem; color: var(--muted); }
.gate-form { text-align: left; }
.gate-form label, .dialog label { display: block; margin-bottom: .5rem; font-weight: 750; font-size: .9rem; }
.pin-row { display: grid; grid-template-columns: 1fr auto; gap: .6rem; }
.pin-row input, .text-input { width: 100%; min-height: 3.25rem; padding: 0 1rem; border: 1px solid #cdbdc3; border-radius: .8rem; background: white; color: var(--ink); }
.pin-row input { font-size: 1.25rem; letter-spacing: .25em; }
.pin-row button { min-height: 3.25rem; border: 0; border-radius: .8rem; padding: 0 1.25rem; background: var(--wine); color: white; font-weight: 800; }
.hint, .form-error { min-height: 1.2rem; margin: .5rem 0 0; font-size: .84rem; }
.hint { color: var(--muted); }
.form-error { color: var(--danger); font-weight: 650; }
.gate-admin { margin-top: 1.35rem; padding-top: 1.15rem; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .35rem .55rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }
.gate-admin button { padding: .3rem; border: 0; background: transparent; color: var(--wine); font-weight: 800; text-decoration: underline; text-underline-offset: .2rem; }
.gate-footer { position: absolute; left: 1rem; right: 1rem; bottom: max(.75rem, env(safe-area-inset-bottom)); z-index: 1; color: rgba(255,255,255,.72); font-size: .72rem; text-align: center; }
.gate-footer p { margin: .15rem 0; }
.gate-footer a { color: white; font-weight: 750; }
.app { min-height: 100svh; }
.site-header { height: 5.25rem; padding: .75rem clamp(1rem, 4vw, 3rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); background: rgba(255,250,243,.92); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none; }
.brand-mark { width: 2.7rem; height: 2.7rem; display: grid; place-items: center; background: var(--wine); color: white; border-radius: 50%; font: 600 1rem Georgia, serif; }
.brand-mark span { color: var(--gold); font-size: .7em; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 1.04rem; }
.brand small { color: var(--muted); font-size: .75rem; }
.header-actions { display: flex; align-items: center; gap: .65rem; }
.admin-badge { padding: .3rem .65rem; background: #efe3c9; color: #68400f; border-radius: 99px; font-size: .75rem; font-weight: 800; }
.drive-button { min-height: 2.35rem; padding: .5rem .8rem; border: 1px solid #cdbdc3; background: white; color: var(--wine); font-size: .78rem; }
.drive-button[data-connected="true"] { border-color: #9ac5a5; background: #edf8ef; color: #245c32; }
.button { min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; border: 0; border-radius: .8rem; padding: .7rem 1rem; text-decoration: none; font-weight: 800; transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
.button:hover { transform: translateY(-1px); }
.button svg, .floating-upload svg, .drop-zone svg { width: 1.35rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { background: var(--wine); color: white; box-shadow: 0 8px 22px rgba(59,16,36,.2); }
.button-primary:hover { background: #531832; }
.button-secondary { background: #f0e2d6; color: var(--wine); }
.button-quiet { background: transparent; color: var(--wine); }
.button-light { background: white; color: var(--wine); }
.button-approve { background: #e1f3e6; color: #185c2f; }
.button-danger { background: #fff0ee; color: var(--danger); }
.welcome { width: min(100% - 2rem, 76rem); margin: clamp(2rem, 7vw, 5rem) auto 0; padding: clamp(1.5rem, 6vw, 4rem); display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2rem; border-radius: 2rem; color: white; background: linear-gradient(120deg, rgba(59,16,36,.96), rgba(103,34,62,.91)), radial-gradient(circle, #9e4466, #3b1024); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.welcome::after { content: "♡"; position: absolute; right: 12%; top: -3.5rem; color: rgba(255,255,255,.07); font: 14rem Georgia, serif; transform: rotate(-10deg); pointer-events: none; }
.welcome > * { position: relative; z-index: 1; }
.welcome .eyebrow { color: #efc98f; }
.welcome h1 { margin: 0; max-width: 42rem; font-size: clamp(2.3rem, 6vw, 4.8rem); line-height: .98; }
.welcome p:not(.eyebrow) { max-width: 41rem; margin: 1rem 0 0; color: rgba(255,255,255,.78); font-size: 1.05rem; }
.welcome .button-primary { background: white; color: var(--wine); white-space: nowrap; }
.gallery-section { width: min(100% - 2rem, 76rem); margin: 0 auto; padding: clamp(2.7rem, 7vw, 5rem) 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-heading h2 { margin: 0; font-size: clamp(2rem, 5vw, 3.3rem); color: var(--wine); }
.photo-count { margin: 0 0 .35rem; color: var(--muted); font-weight: 700; }
.album-tabs { display: flex; gap: .55rem; margin: -.35rem 0 1.5rem; padding: .2rem 0 .45rem; overflow-x: auto; scrollbar-width: thin; }
.album-tab { flex: 0 0 auto; padding: .65rem .9rem; border: 1px solid #d9c4cc; border-radius: 99px; background: rgba(255,255,255,.62); color: var(--wine); font: inherit; font-size: .9rem; font-weight: 750; }
.album-tab span { display: inline-grid; min-width: 1.45rem; height: 1.45rem; margin-left: .25rem; padding: 0 .3rem; place-items: center; border-radius: 99px; background: #eadfd9; color: var(--muted); font-size: .72rem; }
.album-tab:hover { border-color: var(--rose); }
.album-tab.active { border-color: var(--wine); background: var(--wine); color: white; box-shadow: 0 6px 18px rgba(59,16,36,.16); }
.album-tab.active span { background: rgba(255,255,255,.18); color: white; }
.gallery { columns: 4 16rem; column-gap: 1rem; }
.photo-card { width: 100%; margin: 0 0 1rem; padding: 0; display: block; break-inside: avoid; border: 0; border-radius: 1rem; overflow: hidden; background: #eadfd9; position: relative; box-shadow: 0 6px 24px rgba(59,16,36,.08); }
.photo-card img { width: 100%; height: auto; display: block; transition: transform .35s ease; }
.photo-card:hover img { transform: scale(1.025); }
.photo-card::after { content: "View"; position: absolute; right: .65rem; bottom: .65rem; padding: .35rem .65rem; border-radius: 99px; background: rgba(27,10,18,.78); color: white; font-size: .75rem; font-weight: 750; opacity: 0; transform: translateY(.25rem); transition: .2s ease; }
.photo-card.video-card::after { content: "Play"; }
.photo-card:hover::after, .photo-card:focus-visible::after { opacity: 1; transform: none; }
.photo-card.pending-card { outline: 3px solid #d69b38; outline-offset: -3px; }
.pending-badge { position: absolute; left: .65rem; top: .65rem; z-index: 2; padding: .38rem .65rem; border-radius: 99px; background: #fff3d8; color: #704700; font-size: .72rem; font-weight: 800; box-shadow: 0 4px 14px rgba(59,16,36,.14); }
.play-badge { position: absolute; left: 50%; top: 50%; width: 3.2rem; height: 3.2rem; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; background: rgba(27,10,18,.72); color: white; font-size: 1rem; transform: translate(-50%,-50%); box-shadow: 0 8px 25px rgba(0,0,0,.25); }
.processing-card { min-height: 14rem; padding: 1.5rem; display: grid; place-items: center; align-content: center; gap: .45rem; color: var(--wine); text-align: center; }
.processing-card i, .viewer-processing i { width: 2rem; height: 2rem; border: 3px solid rgba(158,68,102,.22); border-top-color: var(--rose); border-radius: 50%; animation: spin 1s linear infinite; }
.processing-card small { color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { min-height: 13rem; display: flex; justify-content: center; align-items: center; gap: .4rem; }
.loading span { width: .55rem; height: .55rem; border-radius: 50%; background: var(--rose); animation: pulse 1s infinite ease-in-out; }
.loading span:nth-child(2) { animation-delay: .15s; }
.loading span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%,100% { opacity: .25; transform: scale(.75); } 50% { opacity: 1; transform: scale(1); } }
.empty-state { min-height: 20rem; display: grid; place-items: center; align-content: center; padding: 2rem; text-align: center; border: 1px dashed #ceb9c2; border-radius: 1.5rem; background: rgba(255,255,255,.48); }
.empty-icon { font: 3.4rem Georgia, serif; color: var(--rose); }
.empty-state h3 { margin: .6rem 0 .2rem; font: 500 1.7rem Georgia, serif; color: var(--wine); }
.empty-state p { margin: 0 0 1.3rem; color: var(--muted); }
.floating-upload { position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 8; width: 3.6rem; height: 3.6rem; display: none; place-items: center; border: 0; border-radius: 50%; background: var(--wine); color: white; box-shadow: 0 12px 32px rgba(59,16,36,.35); }
.site-footer { padding: 2rem 1rem 6rem; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .4rem 1rem; color: var(--muted); font-size: .82rem; text-align: center; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--wine); font-weight: 750; text-underline-offset: .2rem; }
.dialog, .viewer { border: 0; padding: 0; }
.dialog::backdrop, .viewer::backdrop { background: rgba(29,9,18,.72); backdrop-filter: blur(5px); }
.dialog { width: min(calc(100% - 1.5rem), 38rem); max-height: calc(100svh - 1.5rem); border-radius: 1.25rem; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.dialog-shell { padding: clamp(1.2rem, 5vw, 2rem); }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.dialog h2 { margin: 0; color: var(--wine); font-size: 2rem; }
.icon-button { width: 2.7rem; height: 2.7rem; flex: 0 0 auto; border: 0; border-radius: 50%; background: #f3e9e4; color: var(--wine); font-size: 1.65rem; line-height: 1; }
.album-picker { margin-top: 1.35rem; display: grid; grid-template-columns: auto minmax(10rem, 1fr); align-items: center; gap: .8rem; }
.album-picker label { color: var(--wine); font-weight: 750; }
.album-picker select { width: 100%; padding: .75rem 2.3rem .75rem .85rem; border: 1px solid #c9adb9; border-radius: .75rem; background: white; color: var(--ink); font: inherit; }
.album-picker select:focus { outline: 3px solid rgba(158,68,102,.18); border-color: var(--rose); }
.drop-zone { margin-top: 1rem; min-height: 13rem; display: grid !important; place-items: center; align-content: center; gap: .35rem; border: 2px dashed #c9adb9; border-radius: 1rem; background: #fff9f4; color: var(--wine); text-align: center; transition: .2s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--rose); background: #f9edef; }
.drop-zone svg { width: 2.2rem; margin-bottom: .5rem; }
.drop-zone strong { font-size: 1.1rem; }
.drop-zone span, .drop-zone small { color: var(--muted); }
.selection { margin-top: 1rem; color: var(--muted); font-size: .9rem; }
.progress-wrap { margin-top: 1.2rem; }
.progress-label { display: flex; justify-content: space-between; font-size: .85rem; }
.progress { height: .6rem; margin-top: .55rem; overflow: hidden; background: #eadfd9; border-radius: 99px; }
.progress span { width: 0; height: 100%; display: block; border-radius: inherit; background: var(--rose); transition: width .15s linear; }
.dialog-actions { margin-top: 1.35rem; display: flex; justify-content: flex-end; gap: .5rem; }
.small-dialog { max-width: 30rem; }
.small-dialog .text-input { margin-top: .2rem; }
.small-dialog label:not(:first-of-type) { display: block; margin-top: .9rem; }
.viewer { width: 100vw; max-width: none; height: 100svh; max-height: none; background: rgba(15,6,10,.97); color: white; }
.viewer figure { width: 100%; height: 100%; margin: 0; padding: 4rem clamp(1rem, 7vw, 7rem) 1rem; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 1rem; }
.viewer img, .viewer video { width: 100%; height: 100%; object-fit: contain; min-height: 0; background: #080307; }
.viewer-processing { width: min(100%, 34rem); min-height: 18rem; place-self: center; padding: 2rem; display: grid; place-items: center; align-content: center; gap: .8rem; border: 1px solid rgba(255,255,255,.12); border-radius: 1rem; color: white; text-align: center; }
.viewer-processing i { border-color: rgba(255,255,255,.2); border-top-color: white; }
.viewer-processing span { color: rgba(255,255,255,.68); }
.viewer figcaption { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: rgba(255,255,255,.72); }
.viewer figcaption div { display: flex; gap: .6rem; }
.viewer-close { position: fixed; top: 1rem; right: 1rem; z-index: 2; width: 3rem; height: 3rem; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; background: rgba(255,255,255,.1); color: white; font-size: 1.8rem; }
.viewer-nav { position: fixed; top: 50%; z-index: 2; width: 3rem; height: 4rem; border: 0; background: rgba(255,255,255,.1); color: white; font-size: 2.2rem; transform: translateY(-50%); }
.viewer-prev { left: .75rem; }
.viewer-next { right: .75rem; }
.toast { position: fixed; left: 50%; bottom: max(1.25rem, env(safe-area-inset-bottom)); z-index: 100; min-width: min(22rem, calc(100% - 2rem)); padding: .85rem 1.1rem; border-radius: .8rem; background: var(--ink); color: white; text-align: center; font-weight: 700; box-shadow: var(--shadow); transform: translateX(-50%); }
@media (max-width: 720px) {
  .site-header { height: 4.5rem; }
  .brand small { display: none; }
  #logout-button { min-height: 2.35rem; padding: .5rem .7rem; border: 1px solid #d8c6cc; background: rgba(255,255,255,.72); font-size: .78rem; white-space: nowrap; }
  .drive-button { max-width: 7.5rem; line-height: 1.15; }
  .welcome { grid-template-columns: 1fr; border-radius: 1.4rem; }
  .welcome .upload-trigger { width: 100%; }
  .floating-upload { display: grid; }
  .gallery { columns: 2 9rem; column-gap: .7rem; }
  .photo-card { margin-bottom: .7rem; border-radius: .75rem; }
  .viewer figure { padding: 4.5rem .5rem 5rem; }
  .viewer figcaption { padding: 0 .5rem; }
  .viewer figcaption time { display: none; }
  .viewer figcaption div { width: 100%; }
  .viewer figcaption .button { flex: 1; }
  .viewer-nav { top: auto; bottom: .7rem; transform: none; }
}
@media (max-width: 480px) {
  .site-header { gap: .65rem; padding-inline: .75rem; }
  .brand > span:last-child { display: none; }
  .header-actions { gap: .4rem; }
  .gate { align-items: start; padding-top: max(1rem, env(safe-area-inset-top)); }
  .gate-card { padding: 2rem 1.2rem; border-radius: 1.5rem; }
  .pin-row { grid-template-columns: 1fr; }
  .pin-row button { width: 100%; }
  .welcome, .gallery-section { width: min(100% - 1rem, 76rem); }
  .section-heading { align-items: start; }
  .photo-count { margin-top: .55rem; white-space: nowrap; }
  .album-picker { grid-template-columns: 1fr; gap: .4rem; }
  .dialog { width: calc(100% - .7rem); max-height: calc(100svh - .7rem); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
