/* ============================================
   七忻越 · 光影集 — Photography Portfolio
   ============================================ */

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --text: #2c2824;
  --text-secondary: #8a8278;
  --text-muted: #b5ada4;
  --accent: #c17a5a;
  --accent-light: #d4977a;
  --border: #e8e2da;
  --overlay: rgba(44, 40, 36, 0.75);
  --radius: 8px;
  --font-serif: 'Noto Serif SC', 'Songti SC', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1200px;
  --nav-height: 60px;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

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

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

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.nav.scrolled {
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}

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

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.08em;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color 0.3s ease;
  letter-spacing: 0.04em;
}

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

/* ============================================
   Hero
   ============================================ */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #2c2824 0%, #4a4238 50%, #5c5245 100%);
  background-size: cover;
  background-position: center;
  transition: background-image 1.5s ease;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(44, 40, 36, 0.65) 0%,
    rgba(44, 40, 36, 0.4) 50%,
    rgba(44, 40, 36, 0.6) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding: 24px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1s ease 0.3s forwards;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 300;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.8);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s ease 0.6s forwards;
}

.hero-scroll {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  animation: bounce 2s ease-in-out infinite;
  opacity: 0;
  animation: fadeUp 1s ease 1s forwards, bounce 2s ease-in-out 1s infinite;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ============================================
   Section Layout
   ============================================ */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

.gallery-section {
  padding: 80px 0;
}

/* ============================================
   Category Filters
   ============================================ */
.filters {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 32px;
  background: var(--surface);
  padding: 4px;
  border-radius: 40px;
  border: 1px solid var(--border);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.filter-btn {
  padding: 8px 24px;
  border-radius: 32px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  letter-spacing: 0.04em;
}

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

.filter-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ============================================
   Timeline
   ============================================ */
.timeline {
  margin-bottom: 48px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.timeline::-webkit-scrollbar {
  display: none;
}

.timeline-track {
  display: flex;
  gap: 0;
  padding: 8px 0;
  min-width: min-content;
  position: relative;
  justify-content: center;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 24px;
  right: 24px;
  height: 1px;
  background: var(--border);
  top: 50%;
}

.tl-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  flex-shrink: 0;
  min-width: 56px;
}

.tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg);
  transition: all 0.3s ease;
}

.tl-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.3s ease;
  letter-spacing: 0.04em;
}

.tl-item:hover .tl-dot {
  background: var(--accent-light);
  transform: scale(1.2);
}

.tl-item:hover .tl-label {
  color: var(--text);
}

.tl-item.active .tl-dot {
  background: var(--accent);
  transform: scale(1.3);
  box-shadow: 0 0 0 4px rgba(193, 122, 90, 0.2);
}

.tl-item.active .tl-label {
  color: var(--accent);
  font-weight: 500;
}

.tl-item.all-btn .tl-dot {
  width: 8px;
  height: 8px;
  background: transparent;
  border: 2px solid var(--text-muted);
}

.tl-item.all-btn.active .tl-dot {
  border-color: var(--accent);
  background: var(--accent);
}

/* ============================================
   Gallery Grid
   ============================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.gallery-item.hidden {
  opacity: 0;
  transform: scale(0.95);
  position: absolute;
  pointer-events: none;
}

.gallery-item-img {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--border);
}

.gallery-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gallery-item:hover .gallery-item-img img {
  transform: scale(1.08);
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 50%, rgba(44, 40, 36, 0.7));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: #fff;
  font-weight: 600;
  margin-bottom: 4px;
}

.gallery-item-date {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.04em;
}

.gallery-video-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: rgba(44, 40, 36, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-video-badge {
  transform: translate(-50%, -50%) scale(1.1);
}

/* ============================================
   Lightbox
   ============================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.open {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 2.5rem;
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.3s ease;
  z-index: 10;
  line-height: 1;
}

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

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  color: rgba(255, 255, 255, 0.6);
  padding: 16px;
  transition: color 0.3s ease;
}

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

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 85vh;
  gap: 16px;
}

.lightbox-image-wrap {
  max-width: 100%;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image-wrap img,
.lightbox-image-wrap video {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.lightbox-image-wrap video {
  width: 100%;
  background: #000;
}

.lightbox-info {
  text-align: center;
  color: #fff;
  max-width: 600px;
}

.lightbox-info h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.lightbox-date {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.04em;
}

.lightbox-info p {
  margin-top: 8px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
}

.lightbox-counter {
  display: block;
  margin-top: 12px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.08em;
}

/* ============================================
   About Section
   ============================================ */
.about-section {
  padding: 80px 0;
  background: var(--surface);
}

.about-content {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.about-content p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 2;
  margin-bottom: 8px;
}

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

/* ============================================
   Footer
   ============================================ */
.footer {
  padding: 32px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
  }

  .filters {
    gap: 2px;
    padding: 3px;
  }

  .filter-btn {
    padding: 6px 16px;
    font-size: 0.85rem;
  }

  .lightbox {
    padding: 12px;
  }

  .lightbox-prev {
    left: 4px;
  }

  .lightbox-next {
    right: 4px;
  }

  .tl-item {
    padding: 6px 12px;
  }

  .section-header {
    margin-bottom: 32px;
  }

  .gallery-section,
  .about-section {
    padding: 48px 0;
  }
}

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

/* Entry animation */
.gallery-item.entering {
  animation: itemEnter 0.5s ease forwards;
}

@keyframes itemEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
