:root {
  --bg: #0b0b0c;
  --bg-elevated: #141416;
  --surface: #1a1a1d;
  --text: #f4f1ea;
  --muted: #9a958c;
  --border: rgba(255, 255, 255, 0.1);
  --accent: #f4f1ea;
  --accent-text: #111111;
  --gold: #c4a574;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button, a.btn, input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.home-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(196, 165, 116, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(80, 90, 110, 0.2), transparent 50%),
    radial-gradient(ellipse 50% 35% at 0% 80%, rgba(60, 50, 40, 0.35), transparent 45%),
    linear-gradient(180deg, #101012 0%, #0b0b0c 40%, #080809 100%);
}

.home-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.home-page {
  min-height: 100vh;
  padding-bottom: calc(28px + var(--safe-bottom));
}

.home-hero {
  padding: 52px 22px 32px;
  text-align: center;
  max-width: 40rem;
  margin: 0 auto;
  animation: homeFade 0.9s ease both;
}

.home-kicker {
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}

.home-brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 10vw, 4.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 0.95;
}

.home-rule {
  width: 48px;
  height: 1px;
  margin: 20px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.85;
}

.home-tagline {
  margin: 16px auto 0;
  color: var(--muted);
  line-height: 1.55;
  font-weight: 400;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  max-width: 28rem;
}

.event-list {
  animation: homeFade 1.05s ease 0.12s both;
}

@keyframes homeFade {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.event-list {
  display: grid;
  gap: 16px;
  padding: 8px 16px 0;
}

@media (min-width: 720px) {
  .event-list {
    grid-template-columns: repeat(3, 1fr);
    padding-left: 28px;
    padding-right: 28px;
    gap: 20px;
  }
}

.event-card {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  transition: transform 0.35s ease, border-color 0.35s ease;
}

.event-card:hover {
  transform: translateY(-4px);
  border-color: rgba(196, 165, 116, 0.35);
}

.event-card-image,
.event-card-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.event-card:hover .event-card-image {
  transform: scale(1.04);
}

.event-card-placeholder {
  background:
    radial-gradient(circle at 30% 20%, #3a3a3a 0%, transparent 45%),
    linear-gradient(160deg, #2a2a2a, #111);
}

.event-card-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 22px 18px 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
}

.event-card-overlay h2 {
  margin: 4px 0 4px;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.event-card-overlay p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 300;
}

.event-card-overlay .eyebrow {
  color: var(--gold);
}

.cover {
  position: relative;
  min-height: 78vh;
  overflow: hidden;
  background: #111;
}

.cover-image {
  width: 100%;
  height: 78vh;
  object-fit: cover;
  object-position: center 42%;
  display: block;
}

.cover-image-square {
  height: auto;
  aspect-ratio: 1 / 1;
  max-height: 78vh;
  margin: 0 auto;
  object-fit: cover;
}

.video-card {
  margin: 8px 16px 16px;
}

.video-card video {
  width: 100%;
  max-height: 70vh;
  border-radius: 12px;
  background: #111;
  display: block;
}

.video-actions {
  margin-top: 10px;
}

.cover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 20px calc(28px + var(--safe-bottom));
  background: linear-gradient(transparent 40%, rgba(0, 0, 0, 0.7));
  color: #fff;
}

.cover-back {
  position: absolute;
  top: 16px;
  left: 16px;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 500;
  backdrop-filter: blur(8px);
}

.cover-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.cover-meta {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 300;
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 11, 12, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 16px 16px 12px;
}

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.header-titles {
  min-width: 0;
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: var(--gold);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}

.home-link:hover {
  color: var(--text);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.btn-home {
  background: rgba(196, 165, 116, 0.12);
  color: var(--gold);
  border: 1px solid rgba(196, 165, 116, 0.35);
}

.btn-home:hover {
  background: rgba(196, 165, 116, 0.2);
  color: var(--text);
}

/* Phone: save via press-and-hold; downloads are desktop-only */
@media (max-width: 719px) {
  .desktop-only {
    display: none !important;
  }
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.tab {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 12px;
}

.tab.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.photo-count {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  padding: 12px 16px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-link {
  border: none;
  background: none;
  color: var(--gold);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.save-hint {
  margin: 12px 16px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.save-hint-content {
  padding: 14px 16px;
}

.save-hint p {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.save-guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  animation: homeFade 0.35s ease both;
}

.save-guide-card {
  width: min(440px, 100%);
  max-height: min(88vh, 720px);
  overflow-y: auto;
  background: rgba(20, 20, 22, 0.96);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 32px 26px 26px;
  box-shadow: var(--shadow);
  text-align: center;
  -webkit-overflow-scrolling: touch;
}

.save-guide-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.save-guide-lead {
  margin: 0 0 22px;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.5;
}

.save-guide-section {
  text-align: left;
  margin-bottom: 22px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.save-guide-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.save-guide-heading {
  margin: 16px 0 12px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.save-guide-section:first-of-type .save-guide-heading {
  margin-top: 0;
}

.save-guide-subheading {
  margin: 14px 0 10px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}

.save-guide-steps {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
  text-align: left;
  display: grid;
  gap: 12px;
}

.save-guide-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.45;
  font-weight: 300;
}

.save-guide-num {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(196, 165, 116, 0.18);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.save-guide-done {
  width: 100%;
  margin-top: 4px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 8px calc(24px + var(--safe-bottom));
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-left: 16px;
    padding-right: 16px;
  }
}

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

.grid-item {
  border: none;
  padding: 0;
  background: transparent;
  width: 100%;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
}

.grid-item img {
  display: block;
  width: 100%;
  height: auto;
  background: #222;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  color: #fff;
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  z-index: 3;
}

.lightbox-nav-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-shrink: 0;
  padding: 10px 16px 4px;
}

.lightbox-home {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 8px 12px;
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.icon-btn {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 24px;
  cursor: pointer;
  flex-shrink: 0;
}

.lightbox-counter {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  min-width: 4.5em;
  text-align: center;
}

.lightbox-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  touch-action: pan-y pinch-zoom;
}

#lightboxImage {
  max-width: 100%;
  max-height: calc(100vh - 260px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

/* Below the photo: prev / counter / next */
.nav-btn {
  position: static;
  transform: none;
  z-index: 2;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.14);
  opacity: 0.95;
  flex-shrink: 0;
}

.nav-btn:hover,
.nav-btn:focus-visible {
  opacity: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.nav-btn:disabled,
.nav-btn.is-disabled {
  opacity: 0.2;
  pointer-events: none;
}

/* Desktop: also keep side arrows over the photo area */
@media (min-width: 720px) {
  .lightbox-nav-top {
    gap: 20px;
    padding-top: 8px;
  }
}

.lightbox-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
}

.lightbox-actions .btn {
  flex: 1 1 calc(50% - 8px);
  min-width: 140px;
}

.lightbox-hint {
  margin: 0;
  padding: 0 16px calc(16px + var(--safe-bottom));
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-bottom));
  transform: translateX(-50%);
  background: rgba(17, 17, 17, 0.92);
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 200;
  max-width: calc(100vw - 32px);
  text-align: center;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
}

.login-card {
  width: min(420px, 100%);
  background: rgba(20, 20, 22, 0.88);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 36px 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  text-align: center;
}

.login-brand {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.login-subtitle {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 300;
}

.login-card label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
}

.login-card input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font: inherit;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
}

.login-card input:focus {
  outline: 1px solid rgba(196, 165, 116, 0.55);
  border-color: rgba(196, 165, 116, 0.55);
}

.login-card .btn {
  width: 100%;
}

.login-error {
  margin: 14px 0 0;
  color: #ff8e8e;
  font-size: 14px;
}

@media (max-width: 480px) {
  .header-top {
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn {
    flex: 1;
  }

  #downloadAllBtn {
    width: auto;
  }

  .home-hero {
    padding-top: 36px;
  }
}
