/* Moments Revived upload portal. Colors and type follow momentsrevived.com. */
:root {
  --bg: #F9F5EF;
  --paper: #FFFAF3;
  --card: #FFFCF7;
  --ink: #2A1F16;
  --text: #5E4C3D;
  --muted: #8A7A66;
  --gold: #996B30;
  --gold-deep: #8D5E22;
  --gold-soft: #D6B67F;
  --gold-light: #D5AB69;
  --line: #E5D6BF;
  --line-soft: #EFE5D6;
  --footer: #261E13;
  --ok: #4F6B3E;
  --ok-bg: #EEF1E4;
  --err: #9A3D2A;
  --err-bg: #F8E9E2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(74, 55, 40, .06), 0 8px 24px rgba(74, 55, 40, .07);
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; outline: none; }
img { max-width: 100%; height: auto; }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold-deep); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.wrap { width: 100%; max-width: 920px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 12px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header {
  background: linear-gradient(100deg, #F8F2E8, #FFFAF3 46%, #F7EEE1);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; max-width: 1180px; }
.brand img { display: block; width: 280px; height: auto; }
.header-nav { display: flex; gap: 22px; }
.header-nav a { font: 600 16px/1.3 var(--serif); color: #30291F; text-decoration: none; }
.header-nav a:hover { color: var(--gold); }

/* Hero */
.hero { text-align: center; padding-top: 64px; padding-bottom: 8px; }
.eyebrow { margin: 0 0 14px; font: 500 14px/1.5 var(--sans); letter-spacing: 2.2px; text-transform: uppercase; color: var(--gold); }
h1 { margin: 0 0 22px; font: 500 clamp(36px, 6vw, 56px)/1.12 var(--serif); color: var(--ink); letter-spacing: -.5px; }
h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--ink); }
.lead { max-width: 720px; margin: 0 auto 16px; font-size: 17px; color: var(--text); }
.lead.small { font-size: 16px; }

/* Panels */
#app { padding-top: 26px; padding-bottom: 8px; }
.notice {
  margin: 12px auto 0; max-width: 880px; padding: 26px 28px;
  background: #F6F0E4; border: 1px solid var(--gold-soft); border-radius: var(--radius);
  font-size: 14px; color: #5B4A3A;
}
.notice p { margin: 0; }
.notice.error { background: var(--err-bg); border-color: #E3BFB2; color: var(--err); }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px 28px; margin: 0 auto 22px; max-width: 880px;
}
.panel h2 { margin: 0 0 6px; font-size: 26px; line-height: 1.25; }
.panel > p { margin: 0 0 12px; }

/* Progress */
.progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.progress-count { font: 500 22px/1.3 var(--serif); color: var(--ink); }
.progress-count strong { font-weight: 600; }
.progress-meta { font-size: 14px; color: var(--muted); }
.bar { position: relative; height: 12px; margin: 14px 0 8px; border-radius: 999px; background: #EFE4D2; overflow: hidden; border: 1px solid #E6D7BF; }
.bar > span {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #B98A46, #996827 60%, #8D5E22);
  transition: width .5s ease;
}
.bar.complete > span { background: linear-gradient(90deg, #7D9466, #5E7A49); }
.progress-note { margin: 0; font-size: 14px; color: var(--muted); }

/* Drop zone */
.dropzone {
  position: relative; display: grid; place-items: center; text-align: center; gap: 10px;
  margin-top: 4px; padding: 38px 20px; border: 2px dashed var(--gold-soft); border-radius: 12px;
  background: repeating-linear-gradient(135deg, rgba(214, 182, 127, .06) 0 12px, transparent 12px 24px), var(--paper);
  transition: border-color .15s, background-color .15s;
}
.dropzone.drag { border-color: var(--gold); background-color: #FBF2E2; }
.dropzone .icon { width: 46px; height: 46px; opacity: .9; }
.dropzone h3 { margin: 0; font-size: 22px; }
.dropzone p { margin: 0; font-size: 14px; color: var(--muted); }
.dropzone.disabled { opacity: .6; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 11px 26px; border-radius: 6px; border: 1px solid var(--gold-soft);
  background: linear-gradient(#996827, #8D5E22); color: #FFFAF3;
  font: 600 16px/1.2 var(--serif); letter-spacing: .1px; cursor: pointer; text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15), 0 2px 5px rgba(104, 71, 33, .1);
  transition: background .18s, box-shadow .18s, transform .05s;
}
.btn:hover { background: linear-gradient(#A6742F, #93622A); color: #FFFAF3; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--gold-deep); border-color: var(--gold-soft); box-shadow: none; }
.btn.secondary:hover { background: #F6EBD8; }
.btn.small { min-height: 36px; padding: 7px 14px; font-size: 14px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Upload queue */
.queue { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.queue:empty { display: none; }
.q-item {
  display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 8px; background: #fff;
}
.q-thumb { width: 52px; height: 52px; border-radius: 6px; object-fit: cover; background: #F1E8DA; display: grid; place-items: center; font: 700 11px var(--sans); color: var(--muted); text-transform: uppercase; overflow: hidden; }
.q-name { font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-status { font-size: 13px; color: var(--muted); }
.q-item.ok .q-status { color: var(--ok); }
.q-item.err .q-status { color: var(--err); }
.q-item .mini-bar { height: 4px; margin-top: 6px; border-radius: 99px; background: #F0E6D6; overflow: hidden; }
.q-item .mini-bar > span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.q-item.ok .mini-bar, .q-item.err .mini-bar { display: none; }
.q-main { min-width: 0; }

/* Gallery */
.gallery-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.gallery { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.tile { position: relative; border-radius: 8px; overflow: hidden; background: #F1E8DA; border: 1px solid var(--line-soft); aspect-ratio: 1; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 10px; font: 700 12px/1.3 var(--sans); color: var(--muted); }
.tile .placeholder small { display: block; font-weight: 400; margin-top: 4px; word-break: break-all; }
.tile .caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 11px; line-height: 1.3; color: #fff;
  background: linear-gradient(transparent, rgba(30, 22, 14, .72)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile .remove {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: rgba(255, 250, 243, .92); color: var(--ink); font-size: 18px; line-height: 30px; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
.tile .remove:hover { background: #fff; color: var(--err); }
.tile .badge { position: absolute; top: 6px; left: 6px; padding: 2px 8px; border-radius: 99px; font-size: 11px; background: rgba(238, 241, 228, .95); color: var(--ok); }
.empty { margin: 14px 0 0; font-size: 14px; color: var(--muted); }

/* Finish */
.finish label { display: block; margin: 0 0 6px; font-weight: 500; color: var(--ink); }
.finish textarea {
  width: 100%; min-height: 96px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; resize: vertical;
  font: 400 15px/1.5 var(--sans); color: var(--ink); background: #fff;
}
.finish textarea:focus { outline: 2px solid var(--gold-soft); border-color: var(--gold); }
.finish .row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.thanks { border-color: #CFD8BE; background: #F7F8F0; }
.thanks h2 { color: #3F5631; }

/* Tips */
.tips { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); margin-top: 6px; }
.tip { padding: 16px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--paper); }
.tip h3 { margin: 0 0 4px; font-size: 18px; }
.tip p { margin: 0; font-size: 14px; }

.help { text-align: center; padding-top: 18px; padding-bottom: 56px; font-size: 16px; }
.help p { margin: 0 0 10px; }
.help .muted { font-size: 15px; }

/* Footer */
.site-footer { background: var(--footer); color: #CDBFAB; }
.footer-inner { display: flex; gap: 48px; padding-top: 40px; padding-bottom: 26px; align-items: center; justify-content: center; flex-wrap: wrap; max-width: 1080px; }
.footer-brand img { display: block; width: 220px; }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-cols h2 { margin: 0 0 12px; font: 700 16px/1.4 var(--sans); letter-spacing: 1.3px; text-transform: uppercase; color: var(--gold-light); }
.footer-cols a { display: block; margin: 0 0 8px; color: #F4EEE4; text-decoration: none; font-size: 15px; }
.footer-cols a:hover { color: var(--gold-light); }
.footer-base { text-align: center; padding-bottom: 22px; max-width: 1080px; }
.footer-base .flourish { display: block; height: 1px; background: linear-gradient(90deg, transparent, #8A6A3A 15%, #8A6A3A 85%, transparent); margin-bottom: 14px; }
.footer-base p { margin: 0; font-size: 12px; color: #CDBFAB; }

@media (max-width: 720px) {
  .header-inner { min-height: 64px; }
  .brand img { width: 196px; }
  .header-nav { gap: 14px; }
  .header-nav a { font-size: 14px; }
  .hero { padding-top: 40px; }
  .lead { font-size: 16px; }
  .panel { padding: 20px 18px; }
  .tips { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .footer-inner { gap: 28px; }
  .footer-cols { gap: 40px; }
}
@media (max-width: 420px) {
  .header-nav a:first-child { display: none; }
  .wrap { padding: 0 16px; }
  .dropzone { padding: 28px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
