:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #080808;
  --muted: #7a7a7a;
  --line: #e2e2e2;
  --soft: #f2f2ef;
  --accent: #5a6f79;
  --header: 64px;
  --ease: cubic-bezier(.76, 0, .24, 1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.35;
}

body[data-page="project"] {
  overflow-x: hidden;
}

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

button {
  font: inherit;
}

img {
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #000;
  color: #fff;
  animation: intro-slide 920ms var(--ease) 720ms forwards;
}

.intro-logo {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  animation: intro-logo 920ms var(--ease) 720ms forwards;
}

.intro-seen .intro {
  display: none;
}

@keyframes intro-slide {
  to {
    transform: translateY(-100%);
  }
}

@keyframes intro-logo {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50vw + 56px), calc(-50vh + 32px)) scale(.72);
    opacity: 0;
  }
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 130px;
  align-items: center;
  min-height: var(--header);
  padding: 0 34px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
}

.brand {
  width: fit-content;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.category-nav {
  display: flex;
  justify-content: center;
  gap: clamp(26px, 6vw, 110px);
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.category-link {
  border: 0;
  padding: 8px 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-transform: uppercase;
}

.category-link:hover,
.category-link:focus-visible,
.category-link[aria-pressed="true"] {
  color: var(--ink);
}

.language-switch {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.language-switch a {
  padding: 8px 0;
}

.language-switch a[aria-current="true"] {
  color: var(--ink);
}

.index-main {
  padding-top: calc(var(--header) + 28px);
}

.project-list {
  display: grid;
  gap: 34px;
  width: min(1620px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 0 0 70px;
}

.index-project {
  transform-origin: center top;
  transition: transform 220ms var(--ease), opacity 180ms ease;
  will-change: transform;
}

body.is-fast-scrolling .index-project {
  opacity: .84;
  transform: scale(var(--scroll-scale, .965));
}

.index-project[hidden] {
  display: none;
}

.index-project .project-summary {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(320px, 1fr);
  gap: 42px;
  align-items: start;
  width: min(960px, 100%);
  margin: 0 auto;
}

.index-project-meta {
  position: sticky;
  top: calc(var(--header) + 26px);
  display: grid;
  justify-items: end;
  gap: 14px;
  min-height: 140px;
  padding-top: 2px;
  text-align: right;
}

.project-icon {
  display: block;
  width: 46px;
  height: 46px;
  color: #000;
}

.project-icon.large {
  width: 58px;
  height: 58px;
}

.project-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.index-project h2 {
  max-width: 260px;
  margin: 8px 0 0;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.12;
}

.index-project p {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  text-transform: uppercase;
}

.index-project figure {
  margin: 0;
  background: var(--soft);
}

.index-project img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.index-project .project-summary:hover img,
.index-project .project-summary:focus-visible img {
  filter: contrast(1.04);
}

.index-project.is-expanded {
  scroll-margin-top: calc(var(--header) + 24px);
}

.expanded-project {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
  gap: 42px;
  align-items: start;
}

.expanded-project-meta {
  position: sticky;
  top: calc(var(--header) + 26px);
  display: grid;
  justify-items: end;
  gap: 14px;
  min-height: min(76vh, 790px);
  padding-top: 2px;
  text-align: right;
}

.expanded-project-meta h2 {
  max-width: 260px;
  margin: 8px 0 0;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.1;
}

.expanded-project-meta > p {
  margin: -6px 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  text-transform: uppercase;
}

.expanded-strip {
  display: flex;
  gap: clamp(42px, 5vw, 86px);
  align-items: flex-start;
  min-width: 0;
  height: min(76vh, 790px);
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  touch-action: pan-x;
}

.expanded-strip:focus {
  outline: 0;
}

.expanded-strip.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  scroll-snap-type: none;
  user-select: none;
}

.expanded-strip::-webkit-scrollbar {
  display: none;
}

.inline-media-panel {
  position: relative;
  flex: 0 0 auto;
  height: 100%;
  max-width: 78vw;
  margin: 0;
  background: var(--soft);
  scroll-snap-align: center;
}

.inline-media-panel img {
  display: block;
  width: auto;
  height: 100%;
  max-width: 78vw;
  object-fit: contain;
}

.inline-media-panel figcaption {
  position: absolute;
  right: 0;
  bottom: -22px;
  color: var(--muted);
  font-size: 11px;
}

.inline-copy-panel,
.inline-source-panel {
  flex: 0 0 320px;
  display: grid;
  align-content: start;
  gap: 18px;
  height: 100%;
  padding-top: 4px;
  scroll-snap-align: center;
}

.inline-copy-panel p,
.inline-source-panel p {
  margin: 0;
  font-size: 16px;
  line-height: 1.24;
}

.inline-source-panel h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
}

.inline-source-panel p {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  margin: 40px 0;
  color: var(--muted);
  text-align: center;
}

.index-footer {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  padding: 58px 34px 72px;
  border-top: 1px solid var(--line);
}

.index-footer h2 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
}

.index-footer p,
.index-footer a {
  margin: 0;
  color: var(--muted);
}

.source-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 20px 0 0;
}

.source-stats div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.source-stats dt {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.source-stats dd {
  margin: 2px 0 0;
  font-size: 28px;
}

.detail-main {
  height: 100vh;
  padding-top: var(--header);
  overflow: hidden;
}

.project-strip {
  display: flex;
  gap: clamp(42px, 5vw, 86px);
  align-items: flex-start;
  height: calc(100vh - var(--header));
  overflow-x: auto;
  overflow-y: hidden;
  padding: 64px 8vw 74px 18vw;
  cursor: grab;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  touch-action: pan-x;
  -ms-overflow-style: none;
}

.project-strip:focus {
  outline: 0;
}

.project-strip.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  scroll-snap-type: none;
  user-select: none;
}

.project-strip::-webkit-scrollbar {
  display: none;
}

.project-info-panel {
  flex: 0 0 260px;
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 16px;
  min-height: min(76vh, 800px);
  padding-top: 2px;
  text-align: right;
  scroll-snap-align: start;
}

.project-info-panel h1 {
  max-width: 260px;
  margin: 10px 0 0;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.08;
}

.project-info-panel > p {
  margin: -6px 0 22px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.project-meta-list {
  display: grid;
  gap: 16px;
  width: 100%;
  margin: 0;
}

.project-meta-list div {
  display: grid;
  gap: 3px;
}

.project-meta-list dt {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.project-meta-list dd {
  margin: 0;
  font-size: 14px;
}

.project-sibling-nav {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.project-sibling-nav a:hover,
.project-sibling-nav a:focus-visible {
  color: var(--ink);
}

.media-panel {
  position: relative;
  flex: 0 0 auto;
  height: min(76vh, 800px);
  max-width: 90vw;
  margin: 0;
  background: var(--soft);
  scroll-snap-align: center;
}

.media-panel img {
  display: block;
  width: auto;
  height: 100%;
  max-width: 90vw;
  object-fit: contain;
}

.media-panel figcaption {
  position: absolute;
  right: 0;
  bottom: -22px;
  color: var(--muted);
  font-size: 11px;
}

.copy-panel,
.source-panel {
  flex: 0 0 320px;
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: min(76vh, 800px);
  padding-top: 4px;
  scroll-snap-align: center;
}

.copy-panel p,
.source-panel p {
  margin: 0;
  font-size: 17px;
  line-height: 1.24;
}

.source-panel h2 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
}

.source-panel p {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

.strip-controls {
  position: fixed;
  right: 34px;
  bottom: 22px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.strip-controls button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.strip-controls a:hover,
.strip-controls button:hover {
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .intro {
    animation-duration: 1ms;
    animation-delay: 1ms;
  }

  .intro-logo {
    animation-duration: 1ms;
    animation-delay: 1ms;
  }

  .project-strip {
    scroll-behavior: auto;
  }

  .expanded-strip {
    scroll-behavior: auto;
  }

  body.is-fast-scrolling .index-project {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 980px) {
  :root {
    --header: 86px;
  }

  .site-header {
    grid-template-columns: auto auto;
    gap: 10px;
    padding: 0 18px;
  }

  .category-nav {
    grid-column: 1 / -1;
    order: 3;
    justify-content: flex-start;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .language-switch {
    justify-self: end;
  }

  .project-list {
    width: min(720px, calc(100vw - 36px));
  }

  .index-project .project-summary,
  .expanded-project {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .index-project-meta,
  .expanded-project-meta {
    position: static;
    grid-template-columns: 42px minmax(0, 1fr);
    justify-items: start;
    min-height: 0;
    text-align: left;
  }

  .index-project-meta h2,
  .index-project-meta p,
  .expanded-project-meta h2,
  .expanded-project-meta > p {
    grid-column: 2;
  }

  .index-project-meta .project-icon,
  .expanded-project-meta .project-icon {
    grid-row: 1 / span 2;
  }

  .expanded-strip {
    height: min(62vh, 620px);
  }

  .index-footer {
    grid-template-columns: 1fr 1fr;
    padding-right: 18px;
    padding-left: 18px;
  }

  .detail-main {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  body[data-page="project"] {
    overflow: auto;
  }

  .project-strip {
    height: auto;
    min-height: calc(100vh - var(--header));
    padding: 30px 18px 86px;
  }

  .project-info-panel,
  .media-panel,
  .copy-panel,
  .source-panel {
    min-height: 0;
  }

  .project-info-panel {
    flex-basis: 230px;
  }

  .media-panel {
    height: min(62vh, 620px);
  }
}

@media (max-width: 640px) {
  .brand {
    font-size: 24px;
  }

  .category-nav {
    font-size: 12px;
  }

  .project-list {
    gap: 28px;
  }

  .index-footer,
  .source-stats {
    grid-template-columns: 1fr;
  }

  .project-strip {
    gap: 24px;
    overflow-x: auto;
  }

  .expanded-strip {
    gap: 24px;
    height: 58vh;
  }

  .project-info-panel,
  .copy-panel,
  .source-panel,
  .inline-copy-panel,
  .inline-source-panel {
    flex-basis: 78vw;
  }

  .media-panel,
  .inline-media-panel {
    height: 58vh;
    max-width: 86vw;
  }

  .media-panel img,
  .inline-media-panel img {
    max-width: 86vw;
  }

  .strip-controls {
    right: 18px;
    bottom: 16px;
  }
}
