/* ============================================
   Tom Vilot Photography — editorial portfolio
   ============================================ */

:root {
  --bg: #0c0c0d;
  --bg-raised: #151516;
  --ink: #f5f3ef;
  --stone: #8a8580;
  --stone-dim: #5d5a56;
  --brass: #c9a876;
  --brass-dim: #9c8862;
  --line: #232323;
  --max: 1400px;
  --gap: 3px;
}

* { box-sizing: border-box; }

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  margin: 0;
}

::selection { background: var(--brass); color: #0c0c0d; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 28px clamp(20px, 5vw, 56px) 22px;
  background: linear-gradient(to bottom, rgba(12,12,13,0.96) 60%, rgba(12,12,13,0));
  backdrop-filter: blur(6px);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
}

.brand-name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.brand-sub {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass-dim);
}

.site-nav {
  display: flex;
  gap: clamp(18px, 3vw, 34px);
  align-items: baseline;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
  padding-bottom: 6px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--ink);
  border-bottom-color: var(--brass);
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(40px, 10vh, 110px) clamp(20px, 5vw, 56px) clamp(36px, 6vh, 64px);
  max-width: var(--max);
  margin: 0 auto;
}

.hero-kicker {
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 18px;
  display: block;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 1.6rem);
  line-height: 1.04;
  max-width: 14ch;
}

.hero p {
  margin-top: 22px;
  max-width: 46ch;
  color: var(--stone);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.65;
}

/* ---------- Filter bar ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 clamp(20px, 5vw, 56px) 28px;
  max-width: var(--max);
  margin: 0 auto;
}

.filter-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  transition: all 0.25s;
}

.filter-btn:hover {
  border-color: var(--brass-dim);
  color: var(--ink);
}

.filter-btn.active {
  background: var(--brass);
  border-color: var(--brass);
  color: #161311;
}

.filter-count {
  padding: 0 clamp(20px, 5vw, 56px) 8px;
  max-width: var(--max);
  margin: 0 auto;
  font-size: 0.78rem;
  color: var(--stone-dim);
  letter-spacing: 0.04em;
}

/* ---------- Grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 1fr;
  gap: var(--gap);
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gap) 80px;
  background: var(--bg);
}

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 800px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--bg-raised);
  line-height: 0;
  font-size: 0;
}

.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(.2,.7,.2,1), filter 0.4s, opacity 0.4s;
  opacity: 0;
}

.tile img.loaded { opacity: 1; }

.tile::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(201,168,118,0);
  transition: border-color 0.3s;
  pointer-events: none;
}

.grid.has-hover .tile img { filter: grayscale(0.5) brightness(0.7); }
.grid.has-hover .tile:hover img,
.grid.has-hover .tile:focus-within img { filter: none; transform: scale(1.06); }
.tile:hover::after, .tile:focus-within::after { border-color: rgba(201,168,118,0.9); }

.tile-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 12px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.78), rgba(0,0,0,0));
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: var(--ink);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.tile:hover .tile-caption,
.tile:focus-within .tile-caption {
  opacity: 1;
  transform: translateY(0);
}

.tile button.tile-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: zoom-in;
  z-index: 2;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8,8,9,0.97);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.lightbox.open { display: flex; }

.lightbox-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 70px 80px;
}

.lightbox img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.35s, transform 0.35s;
}

.lightbox img.shown { opacity: 1; transform: scale(1); }

.lightbox-caption {
  margin-top: 20px;
  text-align: center;
  color: var(--stone);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.lightbox-caption strong {
  color: var(--ink);
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.05rem;
  display: block;
  margin-bottom: 4px;
}

.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: transparent;
  border: none;
  color: var(--stone);
  cursor: pointer;
  transition: color 0.2s, opacity 0.2s;
}

.lb-close {
  top: 22px;
  right: clamp(20px, 4vw, 50px);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lb-prev, .lb-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.4rem;
  line-height: 1;
  padding: 10px 16px;
}

.lb-prev { left: clamp(4px, 2vw, 30px); }
.lb-next { right: clamp(4px, 2vw, 30px); }

.lb-close:hover, .lb-prev:hover, .lb-next:hover { color: var(--brass); }

.lb-counter {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--stone-dim);
}

@media (max-width: 700px) {
  .lightbox-stage { padding: 60px 16px; }
  .lb-prev, .lb-next { font-size: 1.8rem; padding: 8px 10px; }
  .lb-close { top: 16px; right: 16px; }
}

/* ---------- Simple pages (about/contact) ---------- */

.page-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 90px) clamp(20px, 5vw, 56px) 100px;
}

.page-kicker {
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--brass);
  display: block;
  margin-bottom: 16px;
}

.page-wrap h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 30px;
}

.page-wrap p {
  color: var(--stone);
  font-size: 1.08rem;
  line-height: 1.85;
  margin: 0 0 24px;
}

.page-wrap p em {
  color: var(--ink);
  font-style: italic;
}

.contact-row {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.contact-label {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone-dim);
  display: block;
  margin-bottom: 8px;
}

.contact-row a {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--brass-dim);
  transition: color 0.2s, border-color 0.2s;
}

.contact-row a:hover { color: var(--brass); border-color: var(--brass); }

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: 30px 20px 50px;
  color: var(--stone-dim);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}
