@charset "UTF-8";
:root {
  color-scheme: light;
  --navy: #102b50;
  --navy-deep: #091a31;
  --blue: #244a75;
  --gold: #c2a064;
  --gold-light: #e7d5ae;
  --paper: #fbfaf7;
  --ink: #25364b;
  --muted: #68778a;
  --line: #e5ded1;
  --serif: "Cormorant Garamond", Georgia, serif;
  --display: "Bodoni Moda", "Cormorant Garamond", Georgia, serif;
  --sans: "DM Sans", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); }
button, input { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, label:focus-visible { outline: 3px solid #d9b967; outline-offset: 3px; }
a { color: inherit; }
.photos-header { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px clamp(20px, 5vw, 72px); background: #fffefa; border-bottom: 1px solid var(--line); }
.photos-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--navy); text-decoration: none; }
.photos-brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; font-family: var(--serif); font-size: 18px; }
.photos-brand > span:last-child { display: grid; gap: 1px; }
.photos-brand strong { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.photos-brand small { color: var(--muted); font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; }
.photos-nav { display: flex; align-items: center; gap: 24px; color: var(--navy); font-size: 12px; }
.photos-nav a { text-decoration-color: var(--gold); text-underline-offset: 4px; }
.photos-nav a[aria-current="page"] { font-weight: 700; text-decoration-thickness: 2px; }
.photos-nav form { margin: 0; }
.admin-badge { padding: 6px 9px; color: #21563d; background: #e9f3ec; border-radius: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.text-button { padding: 7px 0; color: var(--navy); background: none; border: 0; cursor: pointer; font-size: 12px; }
.photos-main { width: min(1320px, calc(100% - 48px)); margin: 0 auto; }
.challenge-links { max-width: 768px; margin: 32px auto 16px; padding-top: 28px; scroll-margin-top: 48px; }
.challenge-links h2 { margin: 0 0 10px; color: var(--navy); font-family: var(--serif); font-size: 24px; font-weight: 500; text-align: center; }
.challenge-links-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.challenge-link { min-height: 42px; padding: 9px 12px; color: var(--navy); background: #fffefa; border: 1px solid var(--gold); border-radius: 4px; cursor: pointer; font: 600 12px/1.35 var(--sans); text-align: center; }
.challenge-link:hover, .challenge-link:focus-visible { color: #fffefa; background: var(--navy); }
.upload-poster { max-width: 768px; margin: 24px auto 0; }
.upload-poster img { display: block; width: 100%; height: auto; }
.photos-intro { padding: 48px 0 32px; }
.section-kicker { margin: 0 0 9px; color: #99723a; font-size: 10px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; }
.photos-intro h1 { margin: 0; color: var(--navy); font-family: var(--display); font-size: 45px; font-weight: 400; line-height: 1.05; }
.photos-intro h1 span { color: #b48c4c; font-style: italic; }
.photos-intro > p:last-child { margin: 9px 0 0; color: var(--muted); font-family: var(--serif); font-size: 18px; }
.share-photos { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: center; gap: 28px; margin: 0 0 24px; padding: 22px 26px; background: #fffefa; border: 1px solid var(--line); border-left: 3px solid var(--gold); }
.share-photos-copy h2 { margin: 0; color: var(--navy); font-family: var(--serif); font-size: 29px; font-weight: 500; line-height: 1.1; }
.upload-poster-return { display: inline-flex; min-height: 38px; align-items: center; margin: 0 0 14px; padding: 0 12px; color: var(--navy); background: #fffefa; border: 1px solid var(--gold); border-radius: 4px; font-size: 11px; font-weight: 700; text-decoration: none; }
.upload-poster-return:hover, .upload-poster-return:focus-visible { color: #fffefa; background: var(--navy); }
.share-photos-copy > p:not(.section-kicker, .upload-status) { max-width: 55ch; margin: 8px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.share-upload-controls { display: flex; flex-wrap: wrap; gap: 10px; }
.share-upload-controls .button-outline { color: var(--navy); background: transparent; }
.share-upload-controls .button-outline:hover { color: var(--navy); background: #f5efe2; }
.share-qr { display: grid; justify-items: center; gap: 7px; padding-left: 20px; border-left: 1px solid var(--line); text-align: center; }
.share-qr #upload-qr { width: 180px; height: 180px; max-width: 100%; }
.share-qr #upload-qr canvas, .share-qr #upload-qr img { width: 100%; height: 100%; image-rendering: pixelated; }
.share-qr .qr-unavailable { display: grid; place-items: center; padding: 12px; color: var(--muted); background: #f5efe2; font-size: 11px; line-height: 1.5; }
.share-qr p, .share-qr a { margin: 0; color: var(--muted); font-size: 10px; }
.share-qr a { color: var(--navy); text-underline-offset: 3px; }
.upload-status { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.upload-status.is-error { color: #842f3a; }
.face-search { position: relative; display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: center; gap: 20px 32px; padding: 23px clamp(20px, 4vw, 42px); color: #f7f3eb; background: linear-gradient(120deg, rgba(9,26,49,.97), rgba(20,54,89,.94)); border: 1px solid rgba(194,160,100,.75); border-radius: 8px; box-shadow: 0 12px 28px rgba(16,43,80,.11); }
.face-search-copy .search-label { margin: 0 0 4px; color: var(--gold-light); font-size: 9px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; }
.face-search-copy h2 { margin: 0; color: #fffaf0; font-family: var(--serif); font-size: 28px; font-weight: 500; line-height: 1.05; }
.face-search-copy > p:last-child { margin: 6px 0 0; color: #d7dce4; font-size: 12px; line-height: 1.5; }
.face-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.button-secondary, .button-outline, .button-upload { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid var(--gold); border-radius: 5px; cursor: pointer; font-size: 11px; font-weight: 700; text-decoration: none; transition: background .18s ease, color .18s ease, transform .18s ease; }
.button-secondary, .button-upload { color: #102b50; background: linear-gradient(110deg, #dfc17d, #f0dba8); }
.button-secondary:hover, .button-upload:hover { background: #f5e6c2; transform: translateY(-1px); }
.button-outline { color: #f6ead1; background: transparent; }
.button-outline:hover { color: white; background: rgba(255,255,255,.1); }
.camera-panel { grid-column: 1 / -1; display: grid; justify-items: center; gap: 12px; padding-top: 4px; }
.camera-panel[hidden] { display: none; }
.camera-panel video { width: min(100%, 420px); max-height: 420px; aspect-ratio: 4 / 3; object-fit: cover; background: #040d18; border: 1px solid var(--gold); border-radius: 7px; transform: scaleX(-1); }
.camera-actions { display: flex; align-items: center; gap: 18px; }
.camera-actions .text-button { color: #f6ead1; }
.face-progress { grid-column: 1 / -1; min-height: 0; color: #f2e4c9; font-size: 12px; }
.face-progress:empty { display: none; }
.clear-search { justify-self: start; width: fit-content; padding: 7px 0; color: #f2e4c9; background: transparent; border: 0; cursor: pointer; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.photo-library { padding: 34px 0 72px; }
.library-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.library-heading .section-kicker { margin-bottom: 4px; }
.library-heading h2 { display: flex; align-items: baseline; gap: 10px; margin: 0; color: var(--navy); font-family: var(--serif); font-size: 35px; font-weight: 500; }
.library-heading h2 span { color: #99723a; font-family: var(--sans); font-size: 11px; font-weight: 600; }
.library-heading > .button-upload { flex: 0 0 auto; text-decoration: none; }
.button-upload { min-height: 40px; }
.gallery-empty { padding: 42px 20px; border: 1px dashed #cfc3ab; border-radius: 6px; text-align: center; }
.gallery-empty[hidden] { display: none; }
.empty-mark { color: var(--gold); font-family: var(--serif); font-size: 28px; }
.gallery-empty h3 { margin: 6px 0 0; color: var(--navy); font-family: var(--serif); font-size: 23px; font-weight: 500; }
.gallery-empty p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 13px; }
.photo-card { position: relative; min-width: 0; overflow: hidden; aspect-ratio: 1; background: #e9e4da; border: 1px solid rgba(194,160,100,.5); border-radius: 5px; box-shadow: 0 3px 12px rgba(16,43,80,.08); }
.photo-open { width: 100%; height: 100%; display: block; padding: 0; background: transparent; border: 0; cursor: zoom-in; }
.photo-open img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .25s ease; }
.photo-open:hover img { transform: scale(1.035); }
.photo-delete { position: absolute; top: 9px; right: 9px; width: 34px; height: 34px; display: grid; place-items: center; color: white; background: rgba(20,25,32,.76); border: 1px solid rgba(255,255,255,.72); border-radius: 50%; cursor: pointer; font-size: 19px; line-height: 1; }
.photo-delete:hover { background: #842f3a; }
.photo-delete[hidden] { display: none; }
.photos-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px clamp(20px, 5vw, 72px); color: #e9dfcf; background: var(--navy-deep); font-size: 11px; }
.photos-footer a { color: #e7d5ae; text-underline-offset: 3px; }
.admin-dialog, .photo-dialog { position: fixed; width: min(520px, calc(100% - 28px)); max-width: 520px; max-height: min(88vh, 900px); margin: auto; padding: 30px; color: var(--ink); background: #fffefa; border: 1px solid var(--gold); border-radius: 8px; box-shadow: 0 20px 80px rgba(3,13,28,.36); }
.admin-dialog::backdrop, .photo-dialog::backdrop { background: rgba(5,17,32,.78); backdrop-filter: blur(3px); }
.challenge-dialog { position: fixed; width: min(760px, calc(100% - 24px)); max-width: 760px; max-height: 92vh; overflow-y: auto; margin: auto; padding: 22px; color: var(--ink); background: #fffefa; border: 1px solid var(--gold); border-radius: 8px; box-shadow: 0 20px 80px rgba(3,13,28,.5); }
.challenge-dialog::backdrop { background: rgba(5,17,32,.82); backdrop-filter: blur(4px); }
.challenge-dialog h2 { margin: 0 42px 12px 0; color: var(--navy); font-family: var(--serif); font-size: 27px; font-weight: 500; }
.challenge-upload-link { display: inline-flex; min-height: 40px; align-items: center; margin-bottom: 14px; padding: 0 15px; color: #fffefa; background: var(--navy); border: 1px solid var(--gold); border-radius: 4px; font-size: 12px; font-weight: 700; text-decoration: none; }
.challenge-upload-link:hover, .challenge-upload-link:focus-visible { background: var(--navy-deep); }
.challenge-dialog > img { width: 100%; max-height: 72vh; display: block; object-fit: contain; }
.admin-dialog h2 { margin: 0; color: var(--navy); font-family: var(--serif); font-size: 32px; font-weight: 500; line-height: 1.05; }
.admin-dialog > p:not(.section-kicker, .auth-error) { margin: 11px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.admin-dialog code { color: var(--navy); font-size: 11px; overflow-wrap: anywhere; }
.dialog-close { position: absolute; top: 9px; right: 12px; width: 32px; height: 32px; display: grid; place-items: center; color: var(--navy); background: transparent; border: 0; cursor: pointer; font-size: 25px; }
.admin-form { display: grid; gap: 8px; margin-top: 22px; }
.admin-form label { margin-top: 5px; color: var(--navy); font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.admin-form input { width: 100%; min-height: 44px; padding: 9px 11px; color: var(--ink); background: white; border: 1px solid #cfc3ab; border-radius: 4px; }
.admin-form .button-upload { justify-self: start; margin-top: 11px; }
.auth-error { margin: 13px 0 0; padding: 10px 12px; color: #7a2c35; background: #f8e9e7; border-left: 3px solid #b55a57; font-size: 12px; line-height: 1.5; }
.photo-dialog { width: min(1000px, calc(100% - 24px)); max-width: 1000px; padding: 18px; background: #071526; }
.photo-dialog img { width: 100%; max-height: 82vh; display: block; object-fit: contain; }
.photo-dialog .dialog-close { z-index: 2; color: white; background: rgba(5,15,28,.74); border-radius: 50%; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body[data-page="gallery"] .share-photos,
body[data-page="upload"] .face-search,
body[data-page="upload"] .photo-library { display: none; }
body[data-upload-focused="true"] .challenge-links,
body[data-upload-focused="true"] .upload-poster,
body[data-upload-focused="true"] .photos-intro { display: none; }
body[data-upload-focused="true"] .photos-main { width: min(100% - 32px, 920px); }
body[data-upload-focused="true"] .share-photos { margin-top: 24px; }
body[data-page="upload"][data-upload-focused="false"] .photos-header { display: none; }
body[data-page="upload"][data-upload-focused="false"] .challenge-links { margin-top: 0; padding-top: 8px; scroll-margin-top: 0; }
@media (max-width: 700px) {
  .photos-header { min-height: 70px; flex-wrap: wrap; padding: 10px 17px; }
  .photos-brand-mark { width: 42px; height: 42px; }
  .photos-nav { width: 100%; flex-wrap: wrap; justify-content: center; gap: 8px 12px; font-size: 11px; }
  .photos-main { width: min(100% - 32px, 560px); }
  .challenge-links { margin-top: 20px; padding-top: 56px; scroll-margin-top: 18px; }
  .challenge-links h2 { font-size: 22px; }
  .challenge-link { min-height: 40px; padding: 8px; font-size: 11px; }
  .upload-poster { margin-top: 20px; }
  .photos-intro { padding: 34px 0 23px; }
  .photos-intro h1 { font-size: 38px; }
  .photos-intro > p:last-child { max-width: 34ch; font-size: 16px; line-height: 1.35; }
  .share-photos { grid-template-columns: minmax(0, 1fr) 126px; gap: 14px; padding: 17px 14px; }
  .share-photos-copy h2 { font-size: 24px; }
  .share-photos-copy > p:not(.section-kicker, .upload-status) { font-size: 11px; }
  .share-upload-controls { display: grid; grid-template-columns: 1fr; }
  .share-upload-controls .button-upload, .share-upload-controls .button-outline { min-height: 38px; padding: 0 9px; font-size: 10px; }
  .share-qr { padding-left: 12px; }
  .share-qr #upload-qr { width: 110px; height: 110px; }
  .share-qr p, .share-qr a { font-size: 9px; }
  .face-search { grid-template-columns: 1fr; gap: 14px; padding: 20px 17px; }
  .face-search-copy h2 { font-size: 25px; }
  .face-actions { justify-content: flex-start; }
  .button-secondary, .button-outline { flex: 1 1 145px; padding: 0 10px; font-size: 10px; }
  .library-heading { align-items: center; }
  .library-heading h2 { font-size: 31px; }
  .button-upload { padding: 0 11px; font-size: 10px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .photo-delete { width: 31px; height: 31px; }
  .admin-dialog { padding: 28px 20px 22px; }
  .challenge-dialog { padding: 18px 14px; }
  .challenge-dialog h2 { font-size: 23px; }
  .photos-footer { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 700px) {
  body[data-page="upload"][data-upload-focused="false"] .challenge-links { width: calc(100% - 12px); margin-top: 0; padding-top: 2px; scroll-margin-top: 0; }
  body[data-page="upload"][data-upload-focused="false"] .challenge-links h2 { margin-bottom: 26px; }
  body[data-page="upload"][data-upload-focused="false"] .challenge-links-list { gap: 12px; }
  body[data-page="upload"][data-upload-focused="false"] .challenge-link { min-height: 62px; padding: 9px 10px; font-size: 16px; }
  body[data-page="upload"][data-upload-focused="false"] .upload-poster { margin-top: 20px; }
}
@media (max-width: 390px) {
  .share-photos { grid-template-columns: 1fr; }
  .share-qr { justify-self: start; grid-template-columns: auto 1fr; justify-items: start; padding: 12px 0 0; border-top: 1px solid var(--line); border-left: 0; text-align: left; }
  .share-qr #upload-qr { grid-row: span 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}