:root {
  --bg: #0a0a0a;
  --fg: #f2f2f0;
  --muted: #8a8a86;
  --accent: #f2f2f0;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
  position: sticky;
  top: 0;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(6px);
  z-index: 10;
}
.logo { font-weight: 700; letter-spacing: 0.05em; }
.site-header nav a { margin-left: 24px; color: var(--muted); font-size: 14px; }
.site-header nav a:hover { color: var(--fg); }

/* Hero */
.hero {
  min-height: 70vh;
  display: flex;
  align-items: center;
  padding: 0 40px;
  position: relative;
  overflow: hidden;
}

/* soft backlight sweep, plays once behind the text on load */
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: -30%;
  width: 60%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255,255,255,0.18), rgba(255,255,255,0) 70%);
  filter: blur(20px);
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0;
  animation: heroSweep 1.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

@keyframes heroSweep {
  0%   { transform: translateX(-20%); opacity: 0; }
  15%  { opacity: 1; }
  60%  { opacity: 0.7; }
  100% { transform: translateX(220%); opacity: 0; }
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 900px;
  position: relative;
  z-index: 1;
}
.hero-line {
  display: block;
  opacity: 0;
  filter: blur(14px);
  transform: translateY(24px) scale(1.03);
  animation: heroReveal 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-line:nth-of-type(2) { animation-delay: 0.18s; }

@keyframes heroReveal {
  to { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
}

/* Filter bar */
.work { padding: 40px; }
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 32px;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  border: 1px solid #333;
  color: var(--muted);
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tag-chip:hover { border-color: var(--fg); color: var(--fg); }
.tag-chip.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }

#searchBox {
  margin-left: auto;
  background: transparent;
  border: 1px solid #333;
  color: var(--fg);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  min-width: 200px;
}
#searchBox:focus { outline: none; border-color: var(--fg); }

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  grid-auto-rows: 200px;
  grid-auto-flow: dense;
  gap: 16px;
}
.tile {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: #111;
  grid-column: span 1;
  grid-row: span 1;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.4s ease;
}
.tile:hover img { transform: scale(1.04); filter: brightness(1.08); }
.tile .tile-title {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.tile:hover .tile-title { opacity: 1; }
.tile.hidden { display: none; }

/* size variants — set via photos.js "size" field */
.tile.wide { grid-column: span 2; }
.tile.tall { grid-row: span 2; }
.tile.big  { grid-column: span 2; grid-row: span 2; }

/* View all link */
.view-all-wrap {
  text-align: center;
  margin-top: 48px;
}
.view-all-link {
  display: inline-block;
  border: 1px solid #333;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 14px;
  transition: all 0.2s ease;
}
.view-all-link:hover {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
}

/* Gallery page header */
.page-header {
  padding: 60px 40px 20px;
}
.page-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-header .back-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}
.page-header .back-link:hover { color: var(--fg); }

/* About / Contact */
.about, .contact {
  padding: 80px 40px;
  max-width: 700px;
}
.about h2, .contact h2 {
  font-size: 1.8rem;
  margin-bottom: 16px;
}
.about p, .contact p { color: var(--muted); }

footer {
  padding: 24px 40px;
  color: var(--muted);
  font-size: 13px;
}

/* Mobile */
@media (max-width: 640px) {
  .site-header, .hero, .work, .about, .contact, footer { padding-left: 20px; padding-right: 20px; }
  .tile.wide, .tile.big { grid-column: span 1; }
  .tile.tall, .tile.big { grid-row: span 1; }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .site-header nav a { margin-left: 0; margin-right: 20px; }

  .filter-bar { flex-direction: column; align-items: stretch; }
  #searchBox { margin-left: 0; min-width: 0; width: 100%; }

  .hero { min-height: 50vh; }

  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
  .lb-close { top: 12px; right: 16px; }
  .lb-nav { font-size: 1.6rem; padding: 8px; }
  .lightbox img { max-width: 94vw; max-height: 70vh; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .hero-line { animation: none; opacity: 1; transform: none; }
  .lightbox, .lightbox img { transition: none; }
}

/* GLightbox dark theme override */
.goverlay { background: rgba(10,10,10,0.97); }

.glightbox-clean .gclose, .glightbox-clean .gnext, .glightbox-clean .gprev {
  background: rgba(10,10,10,0.6);
  border-radius: 50%;
}
.gnext svg, .gprev svg, .gclose svg { filter: none; }

/* Description panel below the image */
.gslide-description {
  background: var(--bg);
}
.gslide-title {
  color: var(--fg) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 700;
}
.gslide-desc {
  color: var(--muted) !important;
}
.gdesc-inner {
  background: var(--bg);
}