/* perspective by will — portfolio */

:root {
  --bg: #0a0a0a;
  --bg-elev: #141414;
  --fg: #ededed;
  --fg-muted: #8a8a8a;
  --fg-dim: #555;
  --line: #1d1d1d;
  --accent: #f5f1ea;
  --pill-bg: transparent;
  --pill-border: #2a2a2a;
  --pill-hover: #1f1f1f;
  --pill-active-bg: #ededed;
  --pill-active-fg: #0a0a0a;
  --radius: 999px;
  --maxw: 1600px;
  --gutter: clamp(16px, 3vw, 36px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-weight: 300;
  font-size: 20px;
  letter-spacing: 0.01em;
  color: var(--accent);
}

.brand em {
  font-style: italic;
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 28px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--fg-muted);
}

.nav-links a {
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--fg);
}

/* ---------- Filter pills ---------- */
.filters {
  position: sticky;
  top: 61px;
  z-index: 40;
  background: rgba(10, 10, 10, 0.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.filters-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.pill {
  appearance: none;
  border: 1px solid var(--pill-border);
  background: var(--pill-bg);
  color: var(--fg-muted);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 12px;
  font-family: inherit;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.pill:hover {
  background: var(--pill-hover);
  color: var(--fg);
}

.pill.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-fg);
  border-color: var(--pill-active-bg);
}

.pill .count {
  opacity: 0.55;
  margin-left: 6px;
  font-feature-settings: 'tnum';
}

.pill.active .count {
  opacity: 0.6;
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) var(--gutter) clamp(24px, 4vw, 48px);
}

.hero h1 {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-weight: 300;
  font-size: clamp(32px, 6vw, 64px);
  line-height: 1.05;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.hero h1 em {
  font-style: italic;
  color: var(--fg);
}

.hero p {
  color: var(--fg-muted);
  font-size: 15px;
  max-width: 56ch;
  margin: 0;
}

.hero p a {
  color: var(--fg);
  border-bottom: 1px solid var(--fg-dim);
  transition: border-color 0.2s ease;
}

.hero p a:hover {
  border-color: var(--fg);
}

/* ---------- Gallery ---------- */
.gallery {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(48px, 8vw, 96px);
}

.section {
  margin-top: clamp(36px, 6vw, 72px);
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.section-title {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-weight: 300;
  font-size: clamp(22px, 3.4vw, 32px);
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.section-count {
  color: var(--fg-dim);
  font-size: 12px;
  font-family: 'Inter', monospace;
  font-feature-settings: 'tnum';
  letter-spacing: 0.08em;
}

/* Masonry via CSS columns */
.masonry {
  column-count: 4;
  column-gap: 14px;
}

@media (max-width: 1200px) { .masonry { column-count: 3; } }
@media (max-width: 800px)  { .masonry { column-count: 2; column-gap: 10px; } }
@media (max-width: 500px)  { .masonry { column-count: 1; } }

.tile {
  break-inside: avoid;
  margin: 0 0 14px;
  position: relative;
  overflow: hidden;
  background: var(--bg-elev);
  cursor: zoom-in;
  border-radius: 2px;
}

@media (max-width: 800px) { .tile { margin-bottom: 10px; } }

.tile img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.4s ease;
  opacity: 0;
}

.tile img.loaded {
  opacity: 1;
}

.tile:hover img {
  transform: scale(1.025);
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.25), transparent 40%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.tile:hover::after {
  opacity: 1;
}

.section.hidden {
  display: none;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 56px);
  cursor: zoom-out;
}

.lightbox.open {
  display: flex;
  animation: fadein 0.18s ease;
}

@keyframes fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}

.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--pill-border);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  font-family: inherit;
}

.lightbox-btn:hover {
  color: var(--fg);
  border-color: var(--fg-muted);
  background: rgba(255,255,255,0.04);
}

.lightbox-prev { left: clamp(12px, 2vw, 28px); }
.lightbox-next { right: clamp(12px, 2vw, 28px); }

.lightbox-close {
  top: clamp(12px, 2vw, 28px);
  right: clamp(12px, 2vw, 28px);
  left: auto;
  transform: none;
}

.lightbox-meta {
  position: absolute;
  left: 50%;
  bottom: clamp(12px, 2vw, 24px);
  transform: translateX(-50%);
  color: var(--fg-dim);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  font-feature-settings: 'tnum';
}

@media (max-width: 600px) {
  .lightbox-prev, .lightbox-next {
    bottom: 12px;
    top: auto;
    transform: none;
  }
  .lightbox-prev { left: 12px; }
  .lightbox-next { right: 12px; }
}

/* ---------- About / Contact ---------- */
.info {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) var(--gutter);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 5vw, 64px);
  border-top: 1px solid var(--line);
}

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

.info h2 {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-weight: 300;
  font-size: clamp(22px, 3vw, 28px);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.info p {
  color: var(--fg-muted);
  max-width: 52ch;
  margin: 0 0 10px;
}

.info a {
  color: var(--fg);
  border-bottom: 1px solid var(--fg-dim);
  transition: border-color 0.2s ease;
}

.info a:hover {
  border-color: var(--fg);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 32px var(--gutter);
  text-align: center;
  color: var(--fg-dim);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.footer a {
  color: var(--fg-muted);
}

.footer a:hover {
  color: var(--fg);
}
