:root {
  --bg: #ffffff;
  --surface: #f7f6f4;
  --ink: #1b1b1b;
  --muted: #76726d;
  --border: #eae8e4;
  --accent: #1b1b1b;
  --heart: #d94a54;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Montserrat", -apple-system, BlinkMacSystemFont, sans-serif;
  --nav-h: 66px;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* ---------- Hero Cover (Pixieset Classic Style) ---------- */
.hero {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 540px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #141414;
  color: #ffffff;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 35%;
  transform: scale(1.03);
  transition: opacity 0.8s ease, transform 6s ease-out;
  opacity: 0;
}

.hero-bg.loaded {
  opacity: 1;
  transform: scale(1);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.22) 0%,
    rgba(0, 0, 0, 0.38) 55%,
    rgba(0, 0, 0, 0.56) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  max-width: 820px;
}

.hero-subtitle {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.88;
}

.hero-title {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  font-weight: 300;
  letter-spacing: 0.06em;
  line-height: 1.08;
  text-transform: uppercase;
}

.hero-meta {
  margin: 0 0 36px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.85;
}

.hero-cta {
  appearance: none;
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.82);
  padding: 14px 36px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.hero-cta:hover {
  background: #ffffff;
  color: #141414;
  border-color: #ffffff;
}

.hero-chevron {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  padding: 8px;
  transition: transform 0.25s ease, color 0.25s ease;
}

.hero-chevron:hover {
  color: #ffffff;
  transform: translateX(-50%) translateY(3px);
}

/* ---------- Sticky Navigation Bar ---------- */
.gallery-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1640px;
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nav-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-date {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 100%;
}

.nav-tab {
  position: relative;
  height: 100%;
  background: none;
  border: none;
  padding: 0 2px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color 0.2s ease;
}

.nav-tab:hover,
.nav-tab.active {
  color: var(--ink);
}

.nav-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: var(--ink);
}

.tab-count {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink);
  padding: 9px 14px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.icon-text-btn:hover {
  background: var(--surface);
}

.icon-text-btn.primary-action {
  border-color: var(--ink);
}

.icon-text-btn.primary-action:hover {
  background: var(--ink);
  color: #ffffff;
}

/* ---------- Justified Photo Grid ---------- */
.gallery-section {
  max-width: 1640px;
  margin: 0 auto;
  padding: 28px 28px 72px;
  min-height: 60vh;
}

.photo-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.grid-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.photo-tile {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
}

.photo-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.5s ease;
}

.photo-tile img.loaded {
  opacity: 1;
}

.photo-tile:hover img.loaded {
  transform: scale(1.015);
}

.tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.28) 0%,
    rgba(0, 0, 0, 0) 35%,
    rgba(0, 0, 0, 0) 65%,
    rgba(0, 0, 0, 0.34) 100%
  );
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.photo-tile:hover .tile-overlay,
.photo-tile.is-fav .tile-overlay {
  opacity: 1;
}

.photo-tile.is-fav:not(:hover) .tile-overlay {
  background: none;
}

.tile-btn {
  position: absolute;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 20, 0.42);
  backdrop-filter: blur(4px);
  border: none;
  color: #ffffff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.photo-tile:hover .tile-btn {
  opacity: 1;
}

.tile-btn:hover {
  background: rgba(20, 20, 20, 0.72);
  transform: scale(1.05);
}

.tile-fav-btn {
  top: 10px;
  right: 10px;
}

.tile-dl-btn {
  bottom: 10px;
  right: 10px;
}

.photo-tile.is-fav .tile-fav-btn {
  opacity: 1;
  color: var(--heart);
  background: rgba(255, 255, 255, 0.92);
}

.photo-tile.is-fav .tile-fav-btn svg {
  fill: var(--heart);
  stroke: var(--heart);
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 96px 20px;
  color: var(--muted);
}

.empty-state svg {
  margin-bottom: 16px;
  opacity: 0.45;
}

.empty-title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  color: var(--ink);
}

.empty-sub {
  margin: 0 0 26px;
  font-size: 13px;
  font-weight: 300;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.btn-outline-dark {
  appearance: none;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 12px 28px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-outline-dark:hover {
  background: var(--ink);
  color: #ffffff;
}

/* ---------- Footer ---------- */
.gallery-footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px 56px;
  text-align: center;
}

.footer-credit {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.footer-sub {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Full-Screen Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #0c0c0c;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  user-select: none;
}

.lb-topbar {
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 3;
}

.lb-counter {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.lb-filename {
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
}

.lb-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lb-btn {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.82);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.lb-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.lb-btn.is-fav {
  color: var(--heart);
}

.lb-btn.is-fav svg {
  fill: var(--heart);
  stroke: var(--heart);
}

.lb-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 68px 28px;
  overflow: hidden;
}

.lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 0.2s ease;
}

.lb-img.loading {
  opacity: 0.35;
}

.lb-spinner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.lb-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 52px;
  height: 72px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.lb-arrow:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.lb-prev { left: 8px; }
.lb-next { right: 8px; }

/* ---------- Modals & Password Gate ---------- */
.modal-backdrop,
.password-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(16, 16, 16, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.password-gate {
  background: #ffffff;
  z-index: 200;
}

.modal-card,
.password-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  padding: 40px 36px 36px;
  text-align: center;
  border: 1px solid var(--border);
}

.password-card {
  border: none;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
}

.modal-close:hover {
  color: var(--ink);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.serif-title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.modal-desc,
.gate-hint {
  margin: 0 0 26px;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--muted);
}

.dl-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dl-option-btn {
  width: 100%;
  padding: 16px 20px;
  background: #ffffff;
  border: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dl-option-btn:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--surface);
}

.dl-option-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dl-option-title {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.dl-option-meta {
  font-size: 11px;
  color: var(--muted);
}

.dl-progress-wrap {
  margin-top: 22px;
}

.dl-progress-bar {
  width: 100%;
  height: 3px;
  background: var(--border);
  overflow: hidden;
}

.dl-progress-fill {
  width: 0%;
  height: 100%;
  background: var(--ink);
  transition: width 0.15s ease;
}

.dl-progress-text {
  margin: 10px 0 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.password-form {
  display: flex;
  gap: 10px;
}

.password-form input {
  flex: 1;
  border: 1px solid var(--border);
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
}

.password-form input:focus {
  border-color: var(--ink);
}

.password-error {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--heart);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--ink);
  color: #ffffff;
  padding: 11px 22px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-inner {
    padding: 0 14px;
    height: 58px;
  }

  .nav-brand {
    display: none;
  }

  .nav-tabs {
    gap: 16px;
  }

  .icon-text-btn span {
    display: none;
  }

  .icon-text-btn {
    padding: 8px 10px;
  }

  .gallery-section {
    padding: 12px 10px 56px;
  }

  .photo-grid,
  .grid-row {
    gap: 5px;
  }

  .lb-stage {
    padding: 8px 10px 24px;
  }

  .lb-arrow {
    width: 40px;
    height: 56px;
  }

  .lb-filename {
    display: none;
  }
}

@media (hover: none) {
  .tile-btn {
    opacity: 0.85;
  }
}

/* ---------- Curate Mode (Local Only: ?curate=1) ---------- */
.curate-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: #141414;
  color: #ffffff;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.curate-bar-inner {
  max-width: 1640px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.curate-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.curate-pill {
  background: #ffffff;
  color: #141414;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.curate-cover-label {
  color: rgba(255, 255, 255, 0.65);
}

.curate-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.curate-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.85);
}

.curate-save-btn {
  background: #ffffff;
  color: #141414;
  border: 1px solid #ffffff;
  padding: 8px 18px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.curate-save-btn:hover {
  opacity: 0.85;
}

body.curate-mode .gallery-footer {
  padding-bottom: 96px;
}

.photo-tile.is-excluded img {
  opacity: 0.22 !important;
  filter: grayscale(100%);
}

.photo-tile.is-cover {
  outline: 3px solid #1b1b1b;
  outline-offset: -3px;
}

.tile-curate-check {
  top: 10px;
  left: 10px;
  width: auto !important;
  padding: 0 10px;
  opacity: 1 !important;
  background: rgba(255, 255, 255, 0.94);
  color: #141414;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.photo-tile.is-family .tile-curate-check {
  background: #b08a4f;
  color: #ffffff;
}

.photo-tile.is-excluded .tile-curate-check {
  background: rgba(20, 20, 20, 0.85);
  color: #ffffff;
}

.footer-link-btn {
  margin-top: 14px;
  background: none;
  border: none;
  padding: 4px 8px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.footer-link-btn:hover {
  color: var(--ink);
}

.tile-curate-cover {
  bottom: 10px;
  left: 10px;
  width: auto !important;
  padding: 0 10px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.photo-tile.is-cover .tile-curate-cover {
  opacity: 1 !important;
  background: #141414;
  color: #ffffff;
}

.tile-excluded-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  background: rgba(20, 20, 20, 0.82);
  color: #ffffff;
  padding: 5px 12px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  pointer-events: none;
}

.lb-curate-btn {
  height: 32px;
  padding: 0 12px;
  margin-right: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.lb-curate-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.lb-curate-btn.active {
  background: #ffffff;
  color: #141414;
  border-color: #ffffff;
}
