:root {
  --bg: #0d0d0f;
  --panel: rgba(255, 255, 255, 0.065);
  --panel-strong: rgba(255, 255, 255, 0.11);
  --text: #f4f1ed;
  --muted: #aaa49b;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #f1dfc0;
  --accent-text: #15120f;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
  --radius: 26px;
}

body.light {
  --bg: #f6f3ee;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: #ffffff;
  --text: #181614;
  --muted: #6d655d;
  --line: rgba(20, 20, 20, 0.12);
  --accent: #191715;
  --accent-text: #fff8ee;
  --shadow: 0 24px 70px rgba(54, 45, 35, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(241, 223, 192, 0.16), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.08), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
  cursor: pointer;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.app-shell {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 72px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 6rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.muted {
  color: var(--muted);
  line-height: 1.55;
}

.ghost-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 18px;
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.ghost-btn:hover {
  transform: translateY(-1px);
  background: var(--panel-strong);
  border-color: var(--accent);
}

.stats {
  color: var(--muted);
  font-weight: 850;
  margin: 0 0 34px;
}

.stats span {
  color: var(--text);
}

.gallery {
  margin-top: 10px;
}

.masonry {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.masonry-column {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.photo-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(18, 18, 20, 0.45);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
  isolation: isolate;
}

body.light .photo-card {
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.045), rgba(0, 0, 0, 0.015)),
    rgba(255, 255, 255, 0.72);
}

.photo-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  backface-visibility: hidden;
  transition: opacity 0.22s ease, transform 0.35s ease;
}

.photo-card.is-loaded img {
  opacity: 1;
}

.photo-card:hover img {
  transform: scale(1.018);
}

.photo-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 42px 14px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.64));
  color: white;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.24s ease, transform 0.24s ease;
  pointer-events: none;
}

.photo-card:hover .photo-caption {
  opacity: 1;
  transform: translateY(0);
}

.photo-caption strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}

.empty-state {
  text-align: center;
  max-width: 760px;
  margin: 36px auto;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.hidden {
  display: none !important;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox figure {
  margin: 0;
  width: min(1320px, 92vw);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.lightbox img {
  display: block;
  max-width: min(1320px, 92vw);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}

.lightbox figcaption {
  display: none;
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  box-shadow: none;
  backdrop-filter: none;
  appearance: none;
  font-size: 0;
  line-height: 1;
  transition: color 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
}

.lightbox-close {
  top: 22px;
  right: 24px;
  width: 44px;
  height: 44px;
  opacity: 0.78;
  z-index: 140;
}

.lightbox-close::before {
  content: "×";
  font-family: Arial, Helvetica, sans-serif;
  font-size: 36px;
  font-weight: 200;
  line-height: 1;
  transform: translateY(-2px);
  pointer-events: none;
}

.lightbox-close:hover {
  opacity: 1;
  color: #fff;
  transform: scale(1.04);
}

.lightbox-nav {
  top: 0;
  bottom: 0;
  width: 22vw;
  height: 100vh;
  opacity: 0.42;
  z-index: 115;
}

.lightbox-nav::before {
  position: absolute;
  top: 50%;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(3.2rem, 6vw, 5.4rem);
  font-weight: 200;
  line-height: 1;
  transform: translateY(-52%);
  pointer-events: none;
}

.lightbox-prev {
  left: 0;
}

.lightbox-prev::before {
  content: "‹";
  left: clamp(18px, 3vw, 48px);
}

.lightbox-next {
  right: 0;
}

.lightbox-next::before {
  content: "›";
  right: clamp(18px, 3vw, 48px);
}

.lightbox-nav:hover {
  opacity: 1;
  color: #fff;
}

.lightbox-nav:focus-visible,
.lightbox-close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 4px;
}

@media (max-width: 1100px) {
  .masonry {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 800px) {
  .app-shell {
    width: min(100% - 28px, 1480px);
    padding-top: 18px;
  }

  .masonry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lightbox-nav {
    width: 26vw;
  }
}

@media (max-width: 520px) {
  .masonry {
    grid-template-columns: 1fr;
  }
}
