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

:root {
  --font-display: "Bodoni Moda", "Didot", Georgia, serif;
  --font-ui: "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 0.5s;
}

[data-theme="dark"] {
  --bg: #050505;
  --surface: #0e0e0e;
  --text: #fafafa;
  --muted: rgba(250, 250, 250, 0.45);
  --line: rgba(250, 250, 250, 0.08);
  --overlay: rgba(0, 0, 0, 0.55);
  --hero-shade: linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.75) 100%);
  --bar-bg: rgba(5, 5, 5, 0.82);
  --lightbox: #000;
  --item-bg: #111;
}

[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f8f8f8;
  --text: #0a0a0a;
  --muted: rgba(10, 10, 10, 0.45);
  --line: rgba(10, 10, 10, 0.08);
  --overlay: rgba(255, 255, 255, 0.15);
  --hero-shade: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 40%, rgba(0,0,0,0.5) 100%);
  --bar-bg: rgba(255, 255, 255, 0.88);
  --lightbox: #0a0a0a;
  --item-bg: #eee;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  transform: scale(1.06);
  transition: transform 8s var(--ease);
}

.hero:hover .hero-media {
  transform: scale(1);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: var(--hero-shade);
  pointer-events: none;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2.5rem;
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease);
}

.topbar.scrolled {
  background: var(--bar-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
}

.topbar.scrolled .brand {
  color: var(--text);
}

.topbar-end {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.topbar-link {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: color 0.3s;
}

.topbar-link:hover {
  color: #fff;
}

.topbar.scrolled .topbar-link {
  color: var(--muted);
}

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

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
}

.topbar.scrolled .theme-toggle {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.hero-body {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 2.5rem 6rem;
  max-width: 900px;
}

.hero-kicker {
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.88;
  margin-bottom: 1.5rem;
}

.hero-title-line {
  display: block;
  font-size: clamp(4rem, 14vw, 9rem);
  color: #fff;
  letter-spacing: -0.02em;
}

.hero-title-accent {
  font-style: italic;
  font-weight: 400;
  padding-left: clamp(1rem, 8vw, 5rem);
}

.hero-lede {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.65);
  max-width: 340px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  transition: border-color 0.3s, gap 0.3s var(--ease);
  width: fit-content;
}

.hero-cta:hover {
  border-color: #fff;
  gap: 1rem;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  right: 2.5rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-scroll-line {
  width: 1px;
  height: 3rem;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
  animation: scrollPulse 2s ease infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.15); }
}

/* ── Filters ── */
.filters-bar {
  position: sticky;
  top: 0;
  z-index: 150;
  background: var(--bar-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.filters-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.85rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.filters-track {
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.filters-track::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.55rem 1rem;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color 0.3s;
}

.filter-btn::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transition: transform 0.35s var(--ease);
}

.filter-btn:hover {
  color: var(--text);
}

.filter-btn.active {
  color: var(--text);
}

.filter-btn.active::after {
  transform: scaleX(1);
}

.filters-count {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Gallery ── */
main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

#gallery {
  columns: 4 260px;
  column-gap: 4px;
}

@media (min-width: 1400px) {
  #gallery {
    columns: 5 240px;
  }
}

#gallery.is-empty {
  columns: 1;
}

.gallery-divider {
  column-span: all;
  break-inside: avoid;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 1.25rem 0 0.5rem;
  margin-bottom: 4px;
}

.gallery-divider:first-child {
  padding-top: 0.25rem;
}

.gallery-divider span {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-style: italic;
  white-space: nowrap;
}

.gallery-divider small {
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.gallery-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  align-self: center;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  break-inside: avoid;
  margin-bottom: 4px;
  line-height: 0;
  background: var(--item-bg);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
  transition: transform 0.9s var(--ease);
}

.gallery-item:hover img,
.gallery-item:hover video {
  transform: scale(1.06);
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  transition: background 0.4s;
  pointer-events: none;
}

.gallery-item:hover .gallery-item-overlay {
  background: rgba(0, 0, 0, 0.25);
}

.gallery-item-label {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s, transform 0.35s var(--ease);
}

.gallery-item:hover .gallery-item-label {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: transform 0.4s var(--ease), border-color 0.3s;
}

.gallery-item:hover .play-icon {
  transform: translate(-50%, -50%) scale(1.1);
  border-color: #fff;
}

.gallery-item .play-icon::after {
  content: "";
  border: 7px solid transparent;
  border-left: 11px solid #fff;
  margin-left: 4px;
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--line);
  padding: 4rem 2.5rem;
}

.footer-inner {
  max-width: 1600px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 400;
  font-style: italic;
  margin-bottom: 0.5rem;
}

.footer-tag {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2rem;
}

.footer-copy {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--lightbox);
  display: grid;
  grid-template-columns: 4rem 1fr 4rem;
  grid-template-rows: auto 1fr;
  padding: 1.5rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-top {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
}

.lightbox-caption {
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.lightbox-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.3s;
}

.lightbox-close:hover {
  color: #fff;
}

.lightbox-content {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: calc(100svh - 8rem);
  object-fit: contain;
}

.lightbox-nav {
  align-self: center;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.lightbox-nav:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

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

.loading,
.error {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.error { color: #b05050; }

@media (max-width: 1024px) {
  #gallery {
    columns: 3 220px;
  }
}

@media (max-width: 640px) {
  .topbar,
  .hero-body,
  .filters-inner,
  main,
  .footer {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .hero-body {
    padding-bottom: 5rem;
  }

  .hero-scroll {
    display: none;
  }

  .filters-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  #gallery {
    columns: 2 140px;
    column-gap: 3px;
  }

  .gallery-item {
    margin-bottom: 3px;
  }

  .lightbox {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .lightbox-nav {
    position: absolute;
    bottom: 1.5rem;
    top: auto;
    width: 2.75rem;
    height: 2.75rem;
  }

  .lightbox-prev { left: 1rem; }
  .lightbox-next { right: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
