:root {
  --bg: #faf9f7;
  --surface: #f2f0ec;
  --text: #161616;
  --text-muted: #76746e;
  --border: #e7e4de;
  --accent: #161616;
  --lightbox-bg: rgba(12, 12, 12, 0.96);
  --font-serif: 'Iowan Old Style', 'Palatino Linotype', 'Songti SC', 'Noto Serif SC', Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Helvetica Neue', sans-serif;
  --radius: 2px;
  --max-width: 1360px;
}

[data-theme='dark'] {
  --bg: #0e0e0e;
  --surface: #181818;
  --text: #f0efeb;
  --text-muted: #8b8982;
  --border: #242424;
  --accent: #f0efeb;
  --lightbox-bg: rgba(6, 6, 6, 0.98);
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px clamp(20px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  position: relative;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--text);
}

.theme-toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.icon-sun { display: none; }
.icon-moon { display: inline; }
[data-theme='dark'] .icon-sun { display: inline; }
[data-theme='dark'] .icon-moon { display: none; }

/* Main */
.main-container {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 56px) clamp(20px, 4vw, 48px) 80px;
}

/* Category Filter Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-bottom: 36px;
}

.filter-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 6px 0;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

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

.filter-btn.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--text);
}

/* Gallery Grid (Editorial Masonry preserving natural aspect ratio) */
.gallery-grid {
  column-count: 3;
  column-gap: 28px;
}

@media (max-width: 1080px) {
  .gallery-grid {
    column-count: 2;
    column-gap: 22px;
  }
}

@media (max-width: 640px) {
  .gallery-grid {
    column-count: 1;
    column-gap: 0;
  }
  .brand-sub {
    display: none;
  }
  .site-nav {
    gap: 18px;
  }
}

.photo-card {
  break-inside: avoid;
  margin-bottom: 32px;
  cursor: zoom-in;
}

.photo-frame {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius);
}

.photo-frame img {
  width: 100%;
  height: auto;
  opacity: 0;
  transform: scale(1.005);
  transition: opacity 0.45s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.photo-frame img.loaded {
  opacity: 1;
  transform: scale(1);
}

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

.photo-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.photo-title {
  color: var(--text);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-year {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
}

/* Loading & Empty State */
.status-block {
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.2; transform: scale(0.85); }
  50% { opacity: 0.9; transform: scale(1.1); }
}

.empty-state {
  min-height: 52vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 580px;
  margin: 0 auto;
}

.empty-eyebrow,
.about-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 18px;
}

.empty-title {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  font-weight: 400;
  line-height: 1.3;
  margin: 0 0 18px;
}

.empty-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* About View */
.about-layout {
  display: grid;
  grid-template-columns: minmax(260px, 400px) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
  max-width: 1040px;
  margin: 24px auto 0;
}

.about-layout.no-portrait {
  grid-template-columns: 1fr;
  max-width: 680px;
}

@media (max-width: 820px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.about-portrait-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.about-portrait {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.about-headline {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  font-weight: 400;
  line-height: 1.3;
  margin: 0 0 28px;
}

.about-bio {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 32px;
}

.about-bio p {
  margin: 0 0 18px;
}

.about-bio p:last-child {
  margin-bottom: 0;
}

.about-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  margin-bottom: 24px;
  font-size: 0.88rem;
}

.meta-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.74rem;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  padding-top: 8px;
}

.contact-link {
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 3px;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.contact-link:hover {
  border-color: var(--text);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px clamp(20px, 4vw, 48px);
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-inner p {
  margin: 0;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--lightbox-bg);
  color: #f2f1ed;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px clamp(16px, 4vw, 48px) 24px;
}

.lightbox[hidden] {
  display: none;
}

.lb-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 40px 16px;
}

@media (max-width: 640px) {
  .lb-stage {
    padding: 40px 4px 12px;
  }
}

.lb-image {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.lb-close {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 210;
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 2rem;
  line-height: 1;
  width: 44px;
  height: 44px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.lb-close:hover {
  color: #ffffff;
}

.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 210;
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 2.6rem;
  line-height: 1;
  width: 52px;
  height: 72px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.lb-nav:hover {
  color: #ffffff;
}

.lb-prev { left: 8px; }
.lb-next { right: 8px; }

@media (max-width: 640px) {
  .lb-nav {
    display: none;
  }
}

.lb-caption {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 14px;
}

.lb-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  color: #ffffff;
}

.lb-desc {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  max-width: 600px;
}

.lb-caption-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.62);
  letter-spacing: 0.04em;
}

.lb-counter {
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.45);
}
