:root {
  --cream: #fff8ec;
  --cream-deep: #f3e6cf;
  --gold: #d3a13f;
  --gold-dark: #9b6b18;
  --tan: #c7a987;
  --charcoal: #2f2a24;
  --muted: #675b4e;
  --white: #fffdf8;
  --danger: #9b1c1c;
  --success: #21623a;
  --shadow: 0 18px 50px rgba(61, 42, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--cream);
  color: var(--charcoal);
  font-size: 18px;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Lora, Georgia, serif;
  line-height: 1.55;
  background:
    linear-gradient(180deg, rgba(255, 248, 236, 0.94), rgba(255, 248, 236, 0.99)),
    radial-gradient(circle at 15% 10%, rgba(211, 161, 63, 0.16), transparent 30%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
select,
input,
textarea {
  border-radius: 8px;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 4px solid rgba(211, 161, 63, 0.48);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: "Playfair Display", Georgia, serif;
  line-height: 1.05;
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 8vw, 4.3rem);
}

h2 {
  font-size: clamp(2rem, 6vw, 3.2rem);
}

h3 {
  font-size: 1.7rem;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

.gate-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.75fr);
  gap: 0;
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow);
}

.hero-photo {
  min-height: 620px;
  background: var(--cream-deep);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gate-panel,
.screen-panel {
  background: rgba(255, 253, 248, 0.92);
}

.gate-panel {
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.language-toggle,
.header-actions,
.queue-actions,
.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.language-toggle {
  margin-bottom: 48px;
}

.eyebrow {
  margin: 0 0 12px;
  font-family: Montserrat, Arial, sans-serif;
  font-weight: 700;
  color: var(--gold-dark);
  text-transform: uppercase;
  letter-spacing: 0;
}

.lead {
  color: var(--muted);
  font-size: 1.08rem;
}

.simple-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

label,
.gallery-head span {
  font-family: Montserrat, Arial, sans-serif;
  font-weight: 700;
  font-size: 1rem;
}

input,
textarea,
select {
  width: 100%;
  min-height: 56px;
  border: 2px solid #d8c4a8;
  background: #fff;
  color: var(--charcoal);
  padding: 14px 16px;
}

textarea {
  resize: vertical;
}

.primary-button,
.secondary-button,
.text-button,
.action-button,
.language-toggle button {
  min-height: 52px;
  border: 0;
  padding: 14px 22px;
  cursor: pointer;
  font-family: Montserrat, Arial, sans-serif;
  font-weight: 700;
}

.primary-button,
.action-button {
  color: #261d10;
  background: var(--gold);
  box-shadow: 0 8px 22px rgba(155, 107, 24, 0.2);
}

.primary-button:hover,
.action-button:hover {
  background: #e0b04d;
}

.secondary-button,
.language-toggle button,
.text-button {
  color: var(--charcoal);
  background: #f7ead7;
}

.text-button {
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.success-text,
.success-panel {
  color: var(--success);
  font-weight: 700;
}

.app-header {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px clamp(16px, 4vw, 48px);
  background: var(--white);
  border-bottom: 1px solid #ead7b7;
}

.app-header img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
}

.app-header h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
}

.app-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 32px auto 64px;
}

.screen-panel {
  padding: clamp(22px, 5vw, 48px);
  box-shadow: var(--shadow);
  border: 1px solid #ead7b7;
}

.welcome-row,
.gallery-head,
.progress-text {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.action-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.action-button {
  min-height: 116px;
  font-size: 1.2rem;
}

.flow-screen h2 {
  margin: 16px 0 24px;
}

.big-picker {
  width: 100%;
  min-height: 72px;
  font-size: 1.15rem;
}

.drop-zone {
  margin-top: 18px;
  padding: 28px;
  border: 2px dashed #d8c4a8;
  color: var(--muted);
  text-align: center;
}

.drop-zone.is-over {
  background: #fff2d4;
  border-color: var(--gold-dark);
}

.progress-wrap {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 24px 0;
  padding: 18px;
  background: #fffaf0;
  border: 2px solid #ead7b7;
}

.progress-bar {
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: #ead7b7;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold-dark);
  transition: width 0.2s ease;
}

.progress-bar.small {
  height: 10px;
}

.reassurance {
  margin: 12px 0;
  font-weight: 700;
  color: var(--gold-dark);
}

.queue-list {
  display: grid;
  gap: 14px;
}

.queue-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
  padding: 14px;
  background: #fff;
  border: 1px solid #ead7b7;
}

.queue-preview {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  background: #f7ead7;
  font-size: 1.8rem;
  color: var(--gold-dark);
  overflow: hidden;
}

.queue-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.queue-body {
  display: grid;
  gap: 10px;
}

.status-label {
  color: var(--muted);
  font-weight: 700;
}

.queue-error {
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.queue-item-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.success-panel {
  margin-top: 24px;
  padding: 24px;
  background: #f2fbf4;
  border: 2px solid #c6e7cf;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.gallery-tile {
  border: 0;
  padding: 0;
  background: #fff;
  color: var(--charcoal);
  text-align: left;
  box-shadow: 0 5px 20px rgba(61, 42, 20, 0.08);
  overflow: hidden;
}

.gallery-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.gallery-tile span {
  display: block;
  padding: 12px;
  font-size: 0.95rem;
}

.wide {
  width: 100%;
  margin-top: 24px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 12px;
  padding: 24px;
  background: rgba(33, 27, 19, 0.88);
}

.lightbox-stage {
  min-width: 0;
  display: grid;
  gap: 12px;
  justify-items: center;
}

.lightbox-content {
  width: min(96vw, 1200px);
  height: min(76vh, 820px);
  display: grid;
  place-items: center;
  overflow: auto;
  overscroll-behavior: contain;
}

.lightbox img,
.lightbox video {
  max-width: 100%;
  max-height: 100%;
  background: #000;
}

.lightbox img {
  transform-origin: center center;
  transition: transform 0.15s ease;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  font-size: 2rem;
}

.lightbox-nav {
  width: 64px;
  height: 96px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  color: var(--charcoal);
  font-size: 4rem;
  line-height: 1;
}

.lightbox-nav:disabled {
  opacity: 0.45;
}

.lightbox-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.lightbox-caption,
.lightbox-counter {
  max-width: min(92vw, 860px);
  margin: 0;
  color: #fff;
  text-align: center;
  font-weight: 700;
}

.lightbox-counter {
  font-family: Montserrat, Arial, sans-serif;
  font-size: 0.95rem;
}

@media (max-width: 820px) {
  .gate-shell {
    grid-template-columns: 1fr;
  }

  .hero-photo {
    min-height: 44vh;
  }

  .app-header {
    grid-template-columns: 84px 1fr;
  }

  .app-header img {
    width: 84px;
    height: 84px;
  }

  .header-actions {
    grid-column: 1 / -1;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }

  .queue-item {
    grid-template-columns: 72px 1fr;
  }

  .queue-preview {
    width: 72px;
    height: 72px;
  }

  .lightbox {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
    padding: 76px 12px 18px;
  }

  .lightbox-stage {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .lightbox-content {
    height: 62vh;
  }

  .lightbox-nav {
    width: 100%;
    height: 60px;
    font-size: 2.6rem;
  }

  .lightbox-prev {
    grid-column: 1;
    grid-row: 2;
  }

  .lightbox-next {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 480px) {
  .gate-page {
    padding: 0;
  }

  .gate-shell,
  .screen-panel {
    box-shadow: none;
    border-left: 0;
    border-right: 0;
  }

  .app-shell {
    width: 100%;
    margin-top: 0;
  }
}
