:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --surface: #ffffff;
  --ink: #181817;
  --muted: #6f716c;
  --line: #deded8;
  --accent: #9a4e3b;
  --accent-strong: #633526;
  --moss: #596556;
  --shadow: 0 24px 70px rgba(24, 24, 23, 0.14);
  --radius: 6px;
  --max-width: 1380px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 32rem),
    var(--bg);
  color: var(--ink);
  font-family:
    "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

.texture-layer,
.gradual-blur {
  position: fixed;
  pointer-events: none;
}

.texture-layer {
  inset: 0;
  z-index: -1;
  opacity: 0.34;
  background:
    repeating-linear-gradient(90deg, rgba(24, 24, 23, 0.025) 0 1px, transparent 1px 58px),
    repeating-linear-gradient(180deg, rgba(24, 24, 23, 0.018) 0 1px, transparent 1px 54px);
}

.gradual-blur {
  left: 0;
  right: 0;
  z-index: 20;
  height: clamp(4rem, 12vh, 8rem);
  backdrop-filter: blur(16px) saturate(1.04);
}

.gradual-blur-top {
  top: 0;
  background: linear-gradient(180deg, rgba(247, 247, 244, 0.88), rgba(247, 247, 244, 0));
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.92) 34%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.92) 34%, transparent 100%);
}

.gradual-blur-bottom {
  bottom: 0;
  height: clamp(3rem, 9vh, 6rem);
  background: linear-gradient(0deg, rgba(247, 247, 244, 0.78), rgba(247, 247, 244, 0));
  -webkit-mask-image: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.76) 35%, transparent 100%);
  mask-image: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.76) 35%, transparent 100%);
}

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

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 30;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  transform: translateY(-140%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
  padding: 26px 0 18px;
  background: linear-gradient(180deg, rgba(247, 247, 244, 0.92), rgba(247, 247, 244, 0.72));
  backdrop-filter: blur(18px);
}

.brand,
.site-nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.7rem;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  width: 13px;
  height: 13px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 8px 0 0 -3px var(--accent);
  animation: markPulse 5.5s ease-in-out infinite;
}

.site-nav {
  gap: clamp(0.7rem, 2vw, 1.6rem);
  color: var(--muted);
  font-size: 0.92rem;
}

.site-nav a {
  position: relative;
  text-decoration: none;
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: -0.28rem;
  left: 0;
  height: 1px;
  background: currentColor;
  content: "";
  opacity: 0;
  transform: scaleX(0.35);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.site-nav a[aria-current="page"]::after {
  opacity: 1;
  transform: scaleX(1);
}

main {
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: clamp(2rem, 6vw, 7rem);
  align-items: end;
  min-height: 34vh;
  padding: clamp(2.6rem, 9vw, 8rem) 0 clamp(2.4rem, 6vw, 5rem);
  border-top: 1px solid var(--line);
}

.intro-copy {
  transform: translateZ(0);
}

.intro h1 {
  animation: titleSettle 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 10ch;
  margin-bottom: 1rem;
  font-family:
    "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  font-size: clamp(3.8rem, 11vw, 9rem);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 4vw, 3rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: 0;
}

.intro-text {
  max-width: 58ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
}

.intro-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.intro-stats div {
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.35rem);
  background: rgba(255, 255, 255, 0.76);
}

.intro-stats dt {
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  font-weight: 720;
  line-height: 1;
}

.intro-stats dd {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.work-section {
  padding: 1.2rem 0 clamp(3rem, 8vw, 6rem);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}

.result-count {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 1.2rem 0 1.45rem;
}

.filter-button {
  min-height: 2.55rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.filter-button:hover,
.filter-button:focus-visible {
  border-color: rgba(154, 78, 59, 0.42);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(24, 24, 23, 0.06);
}

.filter-button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.works-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.works-grid.is-filtering .work-card {
  animation: filterPulse 260ms ease both;
}

.work-card {
  position: relative;
  display: grid;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: #fff;
  cursor: pointer;
  isolation: isolate;
  aspect-ratio: 4 / 5;
  box-shadow: 0 1px 0 rgba(24, 24, 23, 0.08);
  transform:
    perspective(1000px)
    rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg))
    translateY(var(--lift, 0));
  transform-style: preserve-3d;
  transition:
    box-shadow 240ms ease,
    transform 240ms ease,
    opacity 320ms ease,
    filter 320ms ease;
  will-change: transform;
}

.work-card::before {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(
    circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.32),
    rgba(255, 255, 255, 0.08) 18%,
    rgba(255, 255, 255, 0) 42%
  );
  content: "";
  opacity: 0;
  transition: opacity 180ms ease;
}

.work-card::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.74) 100%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0));
  content: "";
  opacity: 0.82;
  transition: opacity 180ms ease;
}

.work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 420ms ease;
}

.work-card:hover img,
.work-card:focus-visible img {
  transform: scale(1.045);
}

.work-card:hover,
.work-card:focus-visible {
  --lift: -4px;
  box-shadow: 0 22px 54px rgba(24, 24, 23, 0.18);
}

.work-card:hover::before,
.work-card:focus-visible::before {
  opacity: 1;
}

.work-card:hover::after,
.work-card:focus-visible::after {
  opacity: 0.96;
}

.card-content {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  display: grid;
  gap: 0.55rem;
  padding: clamp(1rem, 2vw, 1.35rem);
  text-align: left;
  transform: translateZ(46px);
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
}

.card-title {
  margin: 0;
  font-size: clamp(1.18rem, 2vw, 1.55rem);
  font-weight: 700;
  line-height: 1.18;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  list-style: none;
}

.media-badge {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 4;
  min-width: 3.25rem;
  padding: 0.28rem 0.48rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius);
  background: rgba(20, 20, 18, 0.56);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  backdrop-filter: blur(12px);
  transform: translateZ(60px);
}

.journal-preview {
  display: grid;
  gap: 0.6rem;
  max-width: 740px;
  padding: clamp(2.4rem, 6vw, 4.5rem) 0 clamp(3.2rem, 8vw, 7rem);
  border-top: 1px solid var(--line);
}

.journal-preview p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
  padding: 1.6rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin-bottom: 0;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: clamp(0.8rem, 3vw, 2rem);
  background: rgba(10, 10, 9, 0.82);
  backdrop-filter: blur(18px);
  animation: lightboxFade 220ms ease both;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  width: min(100%, 1180px);
  max-height: min(760px, calc(100vh - 4rem));
  overflow: hidden;
  border-radius: var(--radius);
  background: #10100f;
  box-shadow: var(--shadow);
  animation: lightboxPanel 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.lightbox-media {
  position: relative;
  display: grid;
  min-height: 360px;
  background: #050505;
}

.lightbox-media img,
.lightbox-media video {
  width: 100%;
  height: 100%;
  max-height: min(760px, calc(100vh - 4rem));
  object-fit: contain;
}

.video-placeholder {
  position: relative;
  display: grid;
}

.video-placeholder img {
  filter: saturate(0.82) brightness(0.75);
}

.video-placeholder span {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  min-width: min(82%, 18rem);
  padding: 0.8rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: rgba(10, 10, 9, 0.72);
  color: #fff;
  font-weight: 700;
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(14px);
}

.lightbox-details {
  display: flex;
  flex-direction: column;
  justify-content: end;
  min-width: 0;
  padding: clamp(1.3rem, 3vw, 2rem);
  background: #f5f4ef;
  color: var(--ink);
}

.lightbox-meta {
  margin-bottom: 0.75rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.lightbox-details h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.7rem, 4vw, 2.8rem);
}

.lightbox-details p {
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--moss);
  font-size: 0.78rem;
  font-weight: 700;
}

.icon-button {
  position: absolute;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  line-height: 1;
  backdrop-filter: blur(14px);
  transition:
    background-color 160ms ease,
    transform 160ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.lightbox-close {
  top: clamp(0.8rem, 3vw, 2rem);
  right: clamp(0.8rem, 3vw, 2rem);
  font-size: 1.5rem;
}

.lightbox-nav {
  top: 50%;
  font-size: 2rem;
  transform: translateY(-50%);
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  transform: translateY(calc(-50% - 1px));
}

.lightbox-prev {
  left: clamp(0.8rem, 3vw, 2rem);
}

.lightbox-next {
  right: clamp(0.8rem, 3vw, 2rem);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

body.animations-ready .reveal {
  opacity: 0;
  filter: blur(14px);
  transform: translateY(26px);
  transition:
    opacity 700ms ease,
    filter 700ms ease,
    transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.animations-ready .reveal.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.work-card.is-visible {
  animation: cardReveal 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--order, 0) * 55ms);
}

@keyframes markPulse {
  0%,
  100% {
    box-shadow: 8px 0 0 -3px var(--accent);
  }

  50% {
    box-shadow: 8px 0 0 -2px var(--accent), 0 0 0 7px rgba(154, 78, 59, 0.08);
  }
}

@keyframes titleSettle {
  from {
    opacity: 0;
    filter: blur(12px);
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes cardReveal {
  from {
    opacity: 0;
    filter: blur(12px);
  }

  to {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes filterPulse {
  from {
    opacity: 0;
    filter: blur(10px);
  }

  to {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes lightboxFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes lightboxPanel {
  from {
    opacity: 0;
    filter: blur(16px);
    transform: translateY(18px) scale(0.985);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 720px) {
  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  .works-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1320px) {
  .works-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .intro {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .intro-stats {
    max-width: 100%;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-count {
    white-space: normal;
  }

  .lightbox-panel {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 5rem);
    overflow: auto;
  }

  .lightbox-media {
    min-height: 280px;
    max-height: 55vh;
  }

  .lightbox-media img,
  .lightbox-media video {
    max-height: 55vh;
  }

  .lightbox-details {
    justify-content: start;
  }

  .lightbox-nav {
    top: auto;
    bottom: 1rem;
    transform: none;
  }

  .lightbox-nav:hover,
  .lightbox-nav:focus-visible {
    transform: translateY(-1px);
  }
}

@media (max-width: 540px) {
  .site-header {
    gap: 1rem;
    padding-top: 18px;
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
  }

  .intro {
    padding-top: 2rem;
  }

  h1 {
    font-size: clamp(3.15rem, 19vw, 4.6rem);
  }

  .intro-stats {
    grid-template-columns: 1fr;
  }

  .intro-stats dd {
    white-space: normal;
  }

  .filter-button {
    flex: 1 1 calc(50% - 0.55rem);
  }

  .card-title {
    font-size: 1.25rem;
  }

  .lightbox {
    padding: 0.7rem;
  }

  .lightbox-close {
    top: 0.7rem;
    right: 0.7rem;
  }

  .icon-button {
    width: 2.45rem;
    height: 2.45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
