:root {
  --bg: #f7f2ea;
  --bg-deep: #efe6d8;
  --ink: #2c2420;
  --ink-soft: #5c534c;
  --muted: #8a7f74;
  --line: rgba(44, 36, 32, 0.12);
  --card: rgba(255, 252, 247, 0.92);
  --gold: #b08d57;
  --gold-deep: #8f7040;
  --blush: #c9a39a;
  --success: #3d6b4f;
  --success-bg: #e7f0ea;
  --error: #9b3b32;
  --error-bg: #f8eaea;
  --shadow: 0 18px 50px rgba(44, 36, 32, 0.08);
  --radius: 1.25rem;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(176, 141, 87, 0.14), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(201, 163, 154, 0.12), transparent),
    var(--bg);
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--gold-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

button,
input,
label {
  font: inherit;
}

.shell {
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3.5rem;
}

.shell-wide {
  width: min(1100px, calc(100% - 2rem));
}

/* Header */
.site-header {
  text-align: center;
  padding: 1.75rem 0 1.25rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 500;
}

.site-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.amp {
  display: inline-block;
  margin: 0 0.15em;
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}

.subtitle {
  margin: 0.65rem 0 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

.nav-pills {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.nav-pills a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.nav-pills a:hover,
.nav-pills a[aria-current='page'] {
  border-color: rgba(176, 141, 87, 0.45);
  color: var(--ink);
  background: #fff;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.25rem);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.2rem;
  backdrop-filter: blur(8px);
}

.card + .card {
  margin-top: 1rem;
}

.card h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1.15;
}

.card p {
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
}

.card p:last-child {
  margin-bottom: 0;
}

/* Steps */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem;
  border-radius: 1rem;
  background: var(--bg-deep);
}

.step-num {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(145deg, var(--gold), var(--gold-deep));
  flex-shrink: 0;
}

.steps strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.steps span {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* Drop zone */
.dropzone {
  position: relative;
  border: 1.5px dashed rgba(176, 141, 87, 0.55);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(247, 242, 234, 0.4));
  padding: 1.75rem 1rem;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.dropzone:hover,
.dropzone:focus-within,
.dropzone.is-dragover {
  border-color: var(--gold-deep);
  background: #fff;
  transform: translateY(-1px);
}

.dropzone input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0; /* hide "no file chosen" text overflow on some browsers */
}

.drop-icon {
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 0.85rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: rgba(176, 141, 87, 0.12);
}

.dropzone h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 500;
}

.dropzone p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1.1rem;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.12s, background 0.12s;
  touch-action: manipulation;
  min-height: 48px;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(145deg, var(--gold), var(--gold-deep));
  box-shadow: 0 10px 24px rgba(143, 112, 64, 0.28);
}

.btn-secondary {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.btn-ghost {
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
}

/* Queue */
.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.queue-header h2 {
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(176, 141, 87, 0.14);
  color: var(--gold-deep);
}

.queue {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.queue-item {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem;
  border-radius: 1rem;
  background: var(--bg-deep);
  border: 1px solid transparent;
}

.queue-item.is-done {
  border-color: rgba(61, 107, 79, 0.25);
  background: var(--success-bg);
}

.queue-item.is-error {
  border-color: rgba(155, 59, 50, 0.25);
  background: var(--error-bg);
}

.thumb {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.7rem;
  object-fit: cover;
  background: #ddd;
}

.queue-meta {
  min-width: 0;
}

.queue-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-status {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.queue-item.is-done .queue-status {
  color: var(--success);
}

.queue-item.is-error .queue-status {
  color: var(--error);
}

.progress {
  margin-top: 0.45rem;
  height: 0.4rem;
  border-radius: 999px;
  background: rgba(44, 36, 32, 0.08);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  transition: width 0.2s ease;
}

.queue-item.is-done .progress > span {
  background: var(--success);
}

/* Overall status banner */
.status-banner {
  display: none;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.status-banner.is-visible {
  display: block;
}

.status-banner.is-progress {
  background: rgba(176, 141, 87, 0.14);
  color: var(--gold-deep);
}

.status-banner.is-success {
  background: var(--success-bg);
  color: var(--success);
}

.status-banner.is-error {
  background: var(--error-bg);
  color: var(--error);
}

.overall-progress {
  margin-top: 0.65rem;
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(44, 36, 32, 0.08);
  overflow: hidden;
}

.overall-progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  transition: width 0.25s ease;
}

.live-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.live-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(61, 107, 79, 0.45);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(61, 107, 79, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(61, 107, 79, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(61, 107, 79, 0);
  }
}

/* Gallery — CSS grid (not columns) so images never split across rows */
.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.gallery-toolbar h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 720px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
  }
}

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

.gallery-item {
  margin: 0;
  padding: 0;
  border-radius: 0.9rem;
  overflow: hidden;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(44, 36, 32, 0.05);
  cursor: zoom-in;
  aspect-ratio: 1;
  min-width: 0;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--ink-soft);
}

.empty-state h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--ink);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgba(20, 16, 14, 0.88);
  backdrop-filter: blur(6px);
}

.lightbox.is-open {
  display: grid;
}

.lightbox img {
  max-width: min(96vw, 1100px);
  max-height: 88dvh;
  border-radius: 0.75rem;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.footer-note {
  margin-top: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.hidden {
  display: none !important;
}

/* Keep upload controls sticky-friendly on phones */
.sticky-actions {
  position: sticky;
  bottom: 0.75rem;
  z-index: 10;
  margin-top: 1rem;
}

.sticky-actions .card {
  padding: 0.85rem;
  background: rgba(255, 252, 247, 0.96);
}

.sticky-actions .btn {
  width: 100%;
}
