/* Nature Photography Portfolio — diagonal archive */
html, body, #root { min-height: 100%; }
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f7f9fc;
  --ink: #161616;
  --gray: #a8a8a2;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── STAGE ── */
.stage {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1;
  filter: drop-shadow(4px 7px 6px rgba(36,49,66,.035)) drop-shadow(16px 22px 20px rgba(36,49,66,.075));
  touch-action: none;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}
.stage.is-dragging { cursor: grabbing; }
.photo {
  position: absolute;
  width: 17%;
  cursor: pointer;
  transform: translate(-50%,-50%) skewY(-28deg);
  transform-origin: center center;
  transition: transform .55s var(--ease-out), box-shadow .55s var(--ease-out), opacity .55s var(--ease-out);
  will-change: transform;
  opacity: 0;
}
.photo.shown { opacity: 1; }
.photo img {
  pointer-events: none;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  filter: saturate(.92);
  transition: transform .65s cubic-bezier(.22,1,.36,1), filter .65s ease, opacity .35s ease;
}
.photo.featured { z-index: 100; }
.photo.featured img {
  transition: transform .85s cubic-bezier(.22,1,.36,1), filter .85s ease, opacity .35s ease;
}
.stage:not(.is-entering):not(.is-browsing) .photo.featured:hover img {
  transform: skewY(28deg) scale(1.86);
  filter: saturate(1) drop-shadow(0 18px 22px rgba(0,0,0,.1));
}
.photo.picked:not(.featured) img {
  transform: translateY(var(--pick-lift, -110%));
  filter: saturate(1) drop-shadow(0 12px 10px rgba(0,0,0,.12));
}
.photo.picked:not(.featured):after {
  content: "";
  position: absolute;
  inset: var(--pick-lift, -110%) 0 0;
}
.stage.is-browsing .photo, .stage.is-entering .photo { pointer-events: none; }
.stage.is-browsing .photo img { transition: opacity .35s ease; transform: none; }
.stage.has-pick .photo:not(.picked) { background: var(--bg); }
.stage.has-pick .photo:not(.picked) img { opacity: .25; }
.stage.has-pick .photo.picked img { opacity: 1; }
@media (hover:hover) and (min-width:861px), (hover:hover) and (min-width:601px) and (orientation:landscape) {
  .stage:not(.is-entering):not(.is-browsing):not(.detail-active):has(.photo.featured:hover) .photo:not(.featured) { background: var(--bg); }
  .stage:not(.is-entering):not(.is-browsing):not(.detail-active):has(.photo.featured:hover) .photo:not(.featured) img { opacity: .25; }
}

/* floor reflection */
@media (min-width:861px), (min-width:601px) and (orientation:landscape) {
  .photo:before {
    content: "";
    position: absolute;
    top: calc(100% + 16px);
    left: 0;
    width: 100%;
    height: 38%;
    background: var(--reflection-image) center / 100% 100% no-repeat;
    transform: scaleY(-1);
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.8), transparent 85%);
    mask-image: linear-gradient(to top, rgba(0,0,0,.8), transparent 85%);
    filter: blur(2px) saturate(.65);
    opacity: .11;
    pointer-events: none;
    transition: opacity .45s ease;
  }
  .stage.has-pick .photo:not(.picked):before { opacity: 0; }
}

/* ── WORK LIST (sidebar) ── */
.work-list {
  position: fixed; left: 34px; bottom: 30px; z-index: 10;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 10.5px; letter-spacing: .05em; line-height: 1.5;
  max-height: 46vh; overflow-y: auto; scrollbar-width: none;
  padding-right: 12px;
  mask-image: linear-gradient(to bottom, transparent, #000 24px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 24px);
}
.work-list::-webkit-scrollbar { display: none; }
.work-list .series-label {
  color: #c4c4bd; margin-top: 8px;
  font-size: 9.5px; letter-spacing: .14em;
  display: flex; flex-direction: column; gap: 3px;
}
.work-list .series-label:after { content: ""; width: 22px; height: 1px; background: #d4d4cd; }
.work-list .series-label:first-child { margin-top: 0; }
.work-list .work-item {
  color: var(--gray); cursor: pointer;
  transition: color .3s ease, transform .3s ease;
  font-weight: 400; background: none; border: none;
  text-align: left; font: inherit; padding: 0;
}
.work-list .work-item:hover { color: #55554f; }
.work-list .work-item.hover { color: var(--ink); }
.work-list .work-item.current { color: var(--ink); font-weight: 700; }

/* ── LIGHTBOX ── */
.lightbox {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100;
  background: #f7f9fcf7;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .5s ease, visibility 0s linear .5s;
}
.lightbox.open { opacity: 1; visibility: visible; transition: opacity .5s ease; }
.lightbox-inner {
  display: flex; align-items: center; justify-content: center;
  width: min(1280px, 92vw);
  perspective: 1800px;
}
.lightbox-figure {
  width: 58%;
  background: transparent;
  padding: 0;
  box-shadow: 12px 22px 45px #2431421a;
  transform-origin: center center;
  transform: none;
  opacity: 1;
  transition: transform .5s var(--ease-out), opacity .3s ease;
}
.lightbox.is-morphing .lightbox-figure { visibility: hidden; }
.photo-flight {
  position: fixed; z-index: 102;
  object-fit: cover; pointer-events: none;
  transform-origin: center;
}
.stage.detail-active, .stage.detail-active .photo { pointer-events: none; }
.lightbox-figure img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.lightbox-gap { width: 9%; flex-shrink: 0; }
.lightbox-meta {
  width: 24%;
  display: flex; flex-direction: column; gap: 10px;
  opacity: 0; transform: translateY(18px);
  transition: opacity .6s ease .25s, transform .7s var(--ease-out) .25s;
}
.lightbox.open .lightbox-meta { opacity: 1; transform: translateY(0); }
.lb-series { font-size: 10px; letter-spacing: .22em; color: var(--gray); text-transform: uppercase; }
.lb-title { font-size: 22px; font-weight: 700; letter-spacing: .04em; }
.lb-en { font-size: 11px; color: var(--gray); letter-spacing: .1em; }
.lb-desc { font-size: 11px; line-height: 1.8; color: #6d6d66; margin-top: 6px; }
.lb-index { font-size: 10px; color: var(--gray); letter-spacing: .16em; margin-top: 14px; }
.lightbox-figure.swap-out {
  transform: rotateY(-32deg) scale(.9) !important;
  opacity: 0;
  transition: transform .28s ease-in, opacity .28s ease-in;
}
.lightbox-close {
  position: fixed; top: 18px; right: 20px;
  background: none; border: none;
  font-size: 26px; color: var(--gray); cursor: pointer; line-height: 1;
  transition: color .3s ease, transform .3s ease;
}
.lightbox-close:hover { color: var(--ink); transform: rotate(90deg); }
.lb-side {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: none; border: none;
  font-size: 30px; line-height: 1; color: var(--gray);
  cursor: pointer; padding: 30px 14px;
  transition: color .3s ease, transform .3s ease;
}
.lb-side:hover { color: var(--ink); }
.lb-side-prev { left: 10px; }
.lb-side-next { right: 10px; }
.lb-side-prev:hover { transform: translateY(-50%) translate(-4px); }
.lb-side-next:hover { transform: translateY(-50%) translate(4px); }

/* ── FOOTER ── */
.site-footer {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%);
  z-index: 10;
  display: flex; align-items: center; gap: 16px;
  white-space: nowrap;
}
.footer-line { width: 56px; height: 1px; background: #d4d4cd; }
.footer-text { font-size: 10px; letter-spacing: .14em; color: var(--gray); }

/* ── MOBILE: vertical list ── */
@media (max-width:600px), (max-width:860px) and (orientation:portrait) {
  body { overflow: auto; }
  .stage {
    position: relative; inset: auto;
    perspective: none; touch-action: pan-y;
    display: flex; flex-direction: column; align-items: center;
    gap: 26px; padding: 110px 20px 12px 104px;
  }
  .photo, .photo.featured {
    position: relative; left: auto !important; top: auto !important;
    width: 100% !important; transform: none;
  }
  .photo:hover, .photo.featured:hover { transform: none; }
  .stage:not(.is-entering):not(.is-browsing) .photo.featured:hover img { transform: scale(1.03); }
  .work-list {
    position: fixed; left: 0; width: 88px;
    padding-left: 16px; padding-right: 0;
    max-height: calc(46vh * 2 / 3);
  }
  .work-list .work-item { overflow-wrap: anywhere; }
  .lightbox-inner { flex-direction: column; gap: 22px; }
  .lightbox-figure { width: 88%; }
  .lightbox-gap { display: none; }
  .lightbox-meta { width: 88%; }
  .site-footer {
    position: relative; bottom: auto; left: auto; transform: none;
    justify-content: center; margin: 6px auto 70px; padding: 0 20px;
    white-space: normal; text-align: center;
  }
  .footer-line { width: 34px; flex-shrink: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .photo, .photo img { transition: none; }
}

/* ── MSL brand + contacts ── */
.brand{position:fixed;top:20px;left:34px;z-index:10;display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink);background:rgba(247,249,252,.82);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);border:1px solid #e2e5ea;border-radius:999px;padding:7px 16px 7px 10px}
.brand img{height:26px;width:auto}
.brand span{font-size:12px;font-weight:700;letter-spacing:.18em}
.footer-text a{color:var(--ink);text-decoration:underline;text-underline-offset:3px}
.lb-url{font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink);font-weight:700}
.lb-cta{display:flex;gap:10px;margin-top:6px}
.lb-cta a{flex:1;text-align:center;font-size:11px;letter-spacing:.1em;text-transform:uppercase;text-decoration:none;border:1px solid var(--ink);color:var(--ink);padding:10px 0;transition:background .25s,color .25s}
.lb-cta a:hover{background:var(--ink);color:var(--bg)}
.lb-cta #lb-wa{background:var(--ink);color:var(--bg);font-weight:700}
.lb-cta #lb-wa:hover{background:#000;transform:translateY(-1px)}
@media(max-width:600px),(max-width:860px) and (orientation:portrait){.brand{left:16px;top:14px}}
