/* =========================================================
   cedric.photography — 风景与人像
   极简纸白 / 单一衬线 + 无衬线 / 只保留「图 + 字 + 留白」
   纯静态：HTML + CSS + 原生 JS
   ========================================================= */

/* ---------- 1. 令牌 ---------- */
:root {
  --paper:    #f6f5f2;
  --paper-2:  #efede7;
  --ink:      #14130f;
  --ink-soft: #45433d;
  --muted:    #918d84;
  --rule:     #ddd9d1;

  --serif: "Songti SC", "Source Han Serif SC", "Noto Serif SC",
           "STSong", "SimSun", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
           "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --maxw:   1240px;
  --gutter: clamp(20px, 4.5vw, 56px);
  --ease:   cubic-bezier(.2, .6, .2, 1);
}

/* ---------- 2. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.locked { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--ink); color: var(--paper); }

:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.br-d { display: inline; }

/* 小标签：全站唯一的「辅助字号」 */
.kicker {
  margin: 0;
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- 3. 页头 ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 245, 242, .92);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border-bottom: 1px solid transparent;
  transition: border-color .4s var(--ease);
}
.site-head.is-stuck { border-bottom-color: var(--rule); }

.site-head__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 66px;
}

.logo {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: opacity .3s;
}
.logo span { color: var(--muted); font-weight: 400; }
.logo:hover { opacity: .65; }

.nav { display: flex; gap: clamp(18px, 2.4vw, 32px); }
.nav a {
  position: relative;
  font-size: 12.5px;
  letter-spacing: .12em;
  color: var(--ink-soft);
  padding-block: 4px;
  transition: color .3s;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .45s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after,
.nav a.is-current::after { transform: scaleX(1); transform-origin: left; }

.menu { display: none; width: 30px; height: 30px; position: relative; }
.menu span {
  position: absolute;
  left: 4px; right: 4px;
  height: 1px;
  background: var(--ink);
  transition: transform .35s var(--ease), opacity .25s;
}
.menu span:first-child { top: 11px; }
.menu span:last-child { bottom: 11px; }
.menu[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- 4. 开场 ---------- */
.intro { padding-top: clamp(80px, 11vw, 150px); }

.intro__title {
  margin: clamp(22px, 3vw, 34px) 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.8rem, 8.6vw, 6.6rem);
  line-height: 1.02;
  letter-spacing: .02em;
}

.intro__lede {
  margin: clamp(24px, 3.4vw, 40px) 0 0;
  max-width: 36ch;
  font-size: 14.5px;
  line-height: 2.05;
  color: var(--ink-soft);
}

.lead { margin: clamp(52px, 8vw, 104px) 0 0; }
.lead img { width: 100%; height: auto; background: var(--paper-2); }
.lead figcaption,
.card__cap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 10.5px;
  letter-spacing: .16em;
  color: var(--muted);
}
.lead figcaption span:first-child,
.card__t { color: var(--ink-soft); }

/* ---------- 5. 系列 ---------- */
.series { padding-block: clamp(64px, 9vw, 118px); border-top: 1px solid var(--rule); }
.intro + .series { margin-top: clamp(56px, 8vw, 100px); }

.series__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  margin-bottom: clamp(26px, 3.6vw, 46px);
}

.series__label { display: flex; align-items: baseline; gap: 16px; }
.series__label .no {
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--muted);
}
.series__label h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.5vw, 2.05rem);
  letter-spacing: .06em;
}
.series__label .en {
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
}
.series__note {
  margin: 0;
  max-width: 30ch;
  font-size: 12.5px;
  line-height: 1.95;
  color: var(--muted);
  text-align: right;
}

/* ---------- 6. 网格 ---------- */
.grid { display: grid; gap: clamp(14px, 2.2vw, 30px); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 3vw, 44px); }

.card {
  margin: 0;
  cursor: zoom-in;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.card.is-in { opacity: 1; transform: none; }
.card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--paper-2);
  transition: opacity .5s var(--ease);
}
.grid--portrait .card img { aspect-ratio: 4 / 5; }
.card:hover img { opacity: .84; }

/* ---------- 6.1 城市分组（风景按城市归档） ---------- */
.city { margin-bottom: clamp(36px, 5vw, 64px); }
.city:last-child { margin-bottom: 0; }

.city__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 12px;
  margin-bottom: clamp(16px, 2.4vw, 26px);
  border-bottom: 1px solid var(--rule);
}
.city__name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.15rem, 1.9vw, 1.45rem);
  letter-spacing: .08em;
}
.city__en {
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
}
.city__count {
  margin-left: auto;
  font-size: 10.5px;
  letter-spacing: .16em;
  color: var(--muted);
}

/* 混合横竖比例用瀑布流，保留原图构图不裁切 */
.grid--masonry { display: block; columns: 2; column-gap: clamp(14px, 2.4vw, 32px); }
.grid--masonry .card { break-inside: avoid; margin: 0 0 clamp(14px, 2.4vw, 32px); }
.grid--masonry .card img { aspect-ratio: auto; object-fit: contain; height: auto; }

/* ---------- 7. 关于 ---------- */
.about { padding-block: clamp(70px, 9vw, 120px); border-top: 1px solid var(--rule); }

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, .52fr) minmax(0, 1fr);
  gap: clamp(34px, 7vw, 110px);
  align-items: start;
}

.about__portrait { margin: 0; max-width: 380px; }
.about__portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.about__portrait figcaption {
  margin-top: 10px;
  font-size: 10.5px;
  letter-spacing: .16em;
  color: var(--muted);
}

.about__title {
  margin: 20px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  line-height: 1.35;
  letter-spacing: .03em;
}

.about__text { margin-top: clamp(24px, 3vw, 36px); max-width: 46ch; }
.about__text p { margin: 0 0 18px; font-size: 14.5px; line-height: 2.05; color: var(--ink-soft); }
.about__text p:last-child { margin-bottom: 0; }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 5vw, 64px);
  margin: clamp(34px, 4vw, 48px) 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}
.facts div { display: flex; flex-direction: column; gap: 6px; }
.facts dt { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-size: 13px; letter-spacing: .04em; }

/* ---------- 8. 器材 ---------- */
.gear { padding-block: clamp(64px, 8vw, 110px); border-top: 1px solid var(--rule); }

.gear__grid {
  display: grid;
  grid-template-columns: minmax(0, .52fr) minmax(0, 1fr);
  gap: clamp(30px, 6vw, 90px);
  align-items: start;
}
.gear__title {
  margin: 20px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  letter-spacing: .04em;
}

.gear__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.gear__list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--rule);
}
.gear__list span { font-size: 14px; letter-spacing: .02em; }
.gear__list em {
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: .16em;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- 9. 联系 ---------- */
.contact { padding-block: clamp(80px, 11vw, 150px); border-top: 1px solid var(--rule); }

.contact__mail {
  display: inline-block;
  margin-top: 22px;
  padding-bottom: 6px;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4.4vw, 3rem);
  letter-spacing: .01em;
  border-bottom: 1px solid var(--ink);
  transition: opacity .35s var(--ease);
}
.contact__mail:hover { opacity: .55; }

.contact__note { margin: 22px 0 0; font-size: 13px; color: var(--muted); }

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 30px;
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
}
.socials a {
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color .3s;
}
.socials a:hover { color: var(--muted); }

/* ---------- 10. 页脚 ---------- */
.foot { border-top: 1px solid var(--rule); }
.foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 24px;
  font-size: 10.5px;
  letter-spacing: .14em;
  color: var(--muted);
}
.foot__inner a { transition: color .3s; }
.foot__inner a:hover { color: var(--ink); }

/* ---------- 11. 灯箱 ---------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(48px, 6vw, 76px) clamp(14px, 5vw, 72px);
  background: rgba(246, 245, 242, .985);
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s;
}
.lb.is-open { opacity: 1; visibility: visible; }

.lb__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  max-height: 100%;
}
.lb__figure img {
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity .45s var(--ease);
}
.lb.is-ready .lb__figure img { opacity: 1; }

.lb__figure figcaption {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 16px;
  font-size: 10.5px;
  letter-spacing: .16em;
  color: var(--muted);
}
.lb__figure figcaption span:first-child { color: var(--ink-soft); }

.lb__close, .lb__nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  color: var(--ink-soft);
  transition: color .3s, opacity .3s;
}
.lb__close:hover, .lb__nav:hover { color: var(--ink); }
.lb__close { top: 16px; right: 16px; }
.lb__prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb__next { right: 8px; top: 50%; transform: translateY(-50%); }

.lb__count {
  position: absolute;
  left: 50%; bottom: 18px;
  transform: translateX(-50%);
  margin: 0;
  font-size: 10px;
  letter-spacing: .26em;
  color: var(--muted);
}

/* ---------- 12. 入场 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- 13. 响应式 ---------- */
@media (max-width: 960px) {
  .about__grid, .gear__grid { grid-template-columns: 1fr; }
  .about__portrait { max-width: 300px; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .series__note { text-align: left; }
}

@media (max-width: 720px) {
  .br-d { display: none; }

  /* backdrop-filter 会让 fixed 子元素以页头为参照，移动端必须关掉 */
  .site-head { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--paper); }

  .site-head__inner { height: 58px; }

  .nav {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 26px;
    background: var(--paper);
    opacity: 0;
    visibility: hidden;
    transition: opacity .4s var(--ease), visibility .4s;
  }
  .nav.is-open { opacity: 1; visibility: visible; }
  .nav a { font-size: 20px; font-family: var(--serif); letter-spacing: .14em; }
  .nav a::after { display: none; }

  .menu { display: block; z-index: 60; }
  .site-head__inner { position: relative; z-index: 60; }

  .intro__lede { max-width: 100%; }
  .lead figcaption, .card__cap { font-size: 10px; letter-spacing: .1em; }

  .grid--2 { grid-template-columns: 1fr; }
  .about__portrait { max-width: 240px; }
}

@media (max-width: 520px) {
  .grid--3 { grid-template-columns: 1fr; }
  .grid--masonry { columns: 1; }
  .series__head { flex-direction: column; gap: 14px; }
  .lb__prev { left: 0; }
  .lb__next { right: 0; }
  .foot__inner { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ---------- 14. 可访问性 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}
