/* ============================================================
   孙昊楠 · 摄影 — 极简暗色画册
   ============================================================ */
:root {
  --bg: #0a0a0b;
  --bg-soft: #101012;
  --ink: #ece9e2;
  --dim: #8f8b83;
  --faint: #55524d;
  --line: rgba(236, 233, 226, 0.09);
  --serif: "Cormorant Garamond", "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --pad: clamp(20px, 5vw, 72px);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(236, 233, 226, 0.85); color: #0a0a0b; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #26262a; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #34343a; }

img { display: block; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ---------- 顶部进度条 ---------- */
#progress {
  position: fixed; top: 0; left: 0; z-index: 60;
  width: 0; height: 1px;
  background: rgba(236, 233, 226, 0.55);
  transition: width 0.1s linear;
}

/* ---------- 顶栏 ---------- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s ease, background 0.4s ease;
}
#topbar.scrolled {
  opacity: 1; transform: none; pointer-events: auto;
  background: rgba(10, 10, 11, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
#topbar .brand {
  font-size: 17px; letter-spacing: 0.35em; font-weight: 400;
  color: var(--ink); text-decoration: none;
}
#topbar .brand .en {
  margin-left: 1.1em; font-size: 10px; letter-spacing: 0.45em;
  color: var(--dim); font-weight: 300;
}
#topbar .nav-count {
  font-size: 10px; letter-spacing: 0.4em; color: var(--dim);
}

/* ---------- 封面 ---------- */
#hero {
  position: relative;
  height: 100svh;
  min-height: 540px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; }
.hero-media img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  animation: heroIn 2.2s cubic-bezier(0.2, 0.6, 0.2, 1) both;
}
@keyframes heroIn {
  from { opacity: 0; transform: scale(1.06); }
  to   { opacity: 1; transform: scale(1); }
}
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(10, 10, 11, 0.32) 0%,
    rgba(10, 10, 11, 0.05) 42%,
    rgba(10, 10, 11, 0.44) 82%,
    rgba(10, 10, 11, 0.78) 100%);
}

.hero-copy {
  position: relative; z-index: 2;
  padding: 0 var(--pad) 13vh;
}
.hero-copy .kicker {
  font-family: var(--sans);
  font-size: 10px; letter-spacing: 0.6em;
  color: rgba(236, 233, 226, 0.72);
  margin-bottom: 2.2em;
}
.hero-copy h1 {
  font-size: clamp(36px, 5vw, 80px);
  font-weight: 300; letter-spacing: 0.16em;
  line-height: 1.06;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.45);
}
.hero-copy .sub {
  margin-top: 2.4em;
  font-family: var(--sans);
  font-size: clamp(10px, 1.2vw, 12px);
  letter-spacing: 0.32em;
  color: rgba(236, 233, 226, 0.62);
}

.scroll-cue {
  position: absolute; right: var(--pad); bottom: 6vh; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  font-family: var(--sans); font-size: 9px; letter-spacing: 0.5em;
  color: rgba(236, 233, 226, 0.55);
  text-decoration: none;
  writing-mode: vertical-rl;
}
.scroll-cue span {
  width: 1px; height: 52px;
  background: linear-gradient(180deg, rgba(236,233,226,0.6), transparent);
  animation: cue 2.4s ease-in-out infinite;
}
@keyframes cue {
  0%   { transform: scaleY(0); transform-origin: top; }
  45%  { transform: scaleY(1); transform-origin: top; }
  55%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- 分节标题 ---------- */
.sec-head {
  display: flex; align-items: baseline; gap: 28px;
  padding: 0 var(--pad);
  margin: 16vh 0 7vh;
}
.sec-head h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 400; letter-spacing: 0.22em;
  white-space: nowrap;
}
.sec-head h2 em {
  margin-left: 1.2em;
  font-size: 0.42em; font-style: italic; font-weight: 300;
  letter-spacing: 0.42em; color: var(--dim);
  vertical-align: 0.35em;
}
.sec-head .rule { flex: 1; height: 1px; background: var(--line); }
.sec-head .sec-count {
  font-family: var(--sans);
  font-size: 10px; letter-spacing: 0.35em; color: var(--faint);
  white-space: nowrap;
}

/* ---------- 精选 · 大幅纵列 ---------- */
#featuredList {
  display: flex; flex-direction: column;
  gap: clamp(72px, 12vh, 150px);
  padding: 0 var(--pad) 6vh;
}
#featuredList figure {
  display: flex; flex-direction: column; align-items: center;
}
#featuredList .imgwrap {
  position: relative;
  line-height: 0;
  cursor: zoom-in;
}
#featuredList .imgwrap::before {
  content: ""; position: absolute; inset: 0;
  background: var(--bg-soft);
}
#featuredList img {
  position: relative;
  max-width: 100%;
  max-height: 82vh;
  width: auto; height: auto;
  opacity: 0;
  transition: opacity 1.4s ease, filter 0.9s ease, transform 1.4s cubic-bezier(0.2,0.6,0.2,1);
}
#featuredList img.loaded { opacity: 1; }
#featuredList .imgwrap:hover img { filter: brightness(0.86); }
#featuredList figcaption {
  align-self: flex-start;
  display: flex; align-items: baseline; gap: 18px;
  margin-top: 22px;
  font-family: var(--sans);
}
#featuredList .no {
  font-size: 10px; letter-spacing: 0.3em; color: var(--faint);
}
#featuredList .cap {
  font-family: var(--serif);
  font-size: 15px; letter-spacing: 0.28em; font-weight: 300;
  color: var(--dim);
}

/* ---------- 影集 · 齐行网格 ---------- */
#grid {
  display: flex; flex-direction: column;
  gap: 14px;
  padding: 0 var(--pad) 14vh;
}
#grid .row {
  display: flex; gap: 14px;
}
#grid .item {
  position: relative;
  overflow: hidden;
  flex-basis: 0;
  min-width: 0;
  cursor: zoom-in;
  background: var(--bg-soft);
  border-radius: 2px;
}
#grid .item::before {
  content: ""; position: absolute; inset: -6%;
  background: var(--ph) center / cover no-repeat;
  filter: blur(22px) brightness(0.7);
}
#grid .item img {
  position: relative;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.9s ease, filter 0.7s ease, transform 1.2s cubic-bezier(0.2,0.6,0.2,1);
}
#grid .item img.loaded { opacity: 1; }
@media (hover: hover) {
  #grid .item:hover img { filter: brightness(0.82); transform: scale(1.025); }
}

/* ---------- 页脚 ---------- */
footer {
  padding: 10vh var(--pad) 12vh;
  border-top: 1px solid var(--line);
  text-align: center;
}
footer .ft-name {
  font-size: 20px; letter-spacing: 0.4em; font-weight: 300;
  margin-bottom: 1.6em;
}
footer .ft-note {
  font-family: var(--sans);
  font-size: 10px; letter-spacing: 0.3em;
  color: var(--faint);
}

/* ---------- 入场动画 ---------- */
.reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity 1.1s cubic-bezier(0.2, 0.6, 0.2, 1),
              transform 1.1s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- 灯箱 ---------- */
.lb {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
.lb[hidden] { display: none; }
.lb.open { opacity: 1; pointer-events: auto; }
.lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(7, 7, 8, 0.96);
}
.lb-stage {
  position: relative;
  max-width: 94vw; max-height: 84vh;
  margin: 0;
  line-height: 0;
}
.lb-stage::before {
  content: ""; position: absolute; inset: -4%;
  background: var(--ph) center / cover no-repeat;
  filter: blur(26px) brightness(0.55);
  opacity: 0.9;
}
#lbImg {
  position: relative;
  max-width: 94vw; max-height: 84vh;
  width: auto; height: auto;
  opacity: 0;
  transition: opacity 0.55s ease;
  line-height: 0;
}
#lbImg.on { opacity: 1; }

.lb-meta {
  position: absolute; left: 0; right: 0; bottom: 3.4vh;
  display: flex; align-items: baseline; justify-content: center;
  gap: 26px;
  padding: 0 var(--pad);
  font-family: var(--sans);
  pointer-events: none;
}
.lb-cap {
  font-family: var(--serif);
  font-size: 14px; letter-spacing: 0.32em; font-weight: 300;
  color: var(--ink);
}
.lb-ex {
  font-size: 10px; letter-spacing: 0.18em;
  color: var(--dim);
}
.lb-counter {
  font-size: 10px; letter-spacing: 0.3em;
  color: var(--faint);
}

.lb-btn {
  position: absolute; z-index: 2;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 22px; font-weight: 300;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.lb-btn:hover {
  color: var(--ink);
  border-color: rgba(236, 233, 226, 0.35);
  background: rgba(236, 233, 226, 0.05);
}
.lb-prev { left: clamp(10px, 3vw, 40px); top: 50%; transform: translateY(-50%); }
.lb-next { right: clamp(10px, 3vw, 40px); top: 50%; transform: translateY(-50%); }
.lb-close { top: clamp(14px, 3vh, 32px); right: clamp(10px, 3vw, 40px); font-size: 15px; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  #topbar .brand { letter-spacing: 0.25em; font-size: 15px; }
  #topbar .brand .en { display: none; }
  .hero-copy { padding-bottom: 16vh; }
  .hero-copy h1 { letter-spacing: 0.18em; }
  .scroll-cue { display: none; }
  .sec-head { flex-wrap: wrap; gap: 14px; }
  .lb-meta { flex-direction: column; gap: 8px; align-items: center; bottom: 2.6vh; }
  .lb-btn { width: 44px; height: 44px; }
}

/* ---------- 减弱动态 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01s !important;
    transition-duration: 0.01s !important;
  }
  .reveal { opacity: 1; transform: none; }
}
