@font-face {
  font-family: "FZZDHJW";
  src: url("assets/fonts/FZZDHJW.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Portfolio PingFang";
  src: local("PingFangSC-Regular"), url("assets/fonts/PingFangSC-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Portfolio PingFang";
  src: local("PingFangSC-Medium"), url("assets/fonts/PingFangSC-Medium.otf") format("opentype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Portfolio PingFang";
  src: local("PingFangSC-Semibold"), url("assets/fonts/PingFangSC-Semibold.otf") format("opentype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

/* The sticky scene and its catalog share the document's vertical scroll. */
.portfolio-curtain {
  --gutter: clamp(20px, 4.6vw, 92px);
  padding: clamp(88px, 15svh, 158px) 0 0;
  background: linear-gradient(125deg, #101a26f6, #091018eb 56%, #161b20f2);
  color: #f3f4f2;
}
.catalog-window { height: 100%; overflow: clip; }
.works-catalog { padding-bottom: clamp(24px, 4vw, 68px); }
.project-shelf { padding: clamp(26px, 3.2vw, 62px) var(--gutter); }
.project-shelf + .project-shelf { border-top: 1px solid #c2d2dc30; }
.shelf-head { position: relative; margin: 0 0 clamp(20px, 2.5vw, 46px); }
.shelf-title > span {
  font-family: "FZZDHJW", "Microsoft YaHei", sans-serif;
  font-weight: 400;
  font-synthesis: none;
}
.shelf-meta, .shelf-caption, .work-detail-category, .work-detail-position,
.work-detail-description, .works-close, .work-detail-controls button {
  font-family: "Portfolio PingFang", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}
.shelf-meta, .shelf-caption small {
  color: #b9c4ce;
  line-height: 1.4;
  letter-spacing: .055em;
}
.shelf-meta { font-size: 13px; font-weight: 500; }
.shelf-meta span { color: #ffaf72; padding-inline: .45em; }
.shelf-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px clamp(10px, 1.1vw, 22px); margin-top: 12px; }
.shelf-title h2 { color: #f1f4f6; margin: 0; font: 400 clamp(42px, 5.8vw, 112px)/1 Impact, "Arial Narrow", sans-serif; font-synthesis: none; letter-spacing: -.025em; }
.shelf-title i { font-style: normal; color: #ffae73; }
.shelf-title > span { font-size: 20px; line-height: 1.25; color: #dce3e8; }
.shelf-controls { position: absolute; top: -5px; right: 0; display: flex; gap: 8px; }
.shelf-controls[hidden] { display: none; }
.shelf-controls button {
  width: 32px; height: 32px; display: grid; place-items: center; cursor: var(--cursor-pointer, pointer);
  border-radius: 50%; border: 1px solid #bdc8d55c; background: #17202a;
}
.shelf-controls button:disabled { opacity: .32; cursor: var(--cursor-default, default); }
.shelf-controls img { width: 8px; transform: rotate(90deg); }
.shelf-controls button:last-child img { transform: rotate(-90deg); }
.shelf-row {
  display: flex; align-items: start; gap: clamp(14px, 1.5vw, 30px);
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin;
  scrollbar-color: #57616b #10161c; padding: 4px 3px 10px; user-select: none;
}
.shelf-card {
  flex: 0 0 39%; display: block; min-width: 0; padding: 0; border: 0;
  color: inherit; background: transparent; text-align: left; cursor: var(--cursor-pointer, pointer);
}
.shelf-card img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; display: block; }
.shelf-app .shelf-card { flex-basis: calc((100% - clamp(14px, 1.5vw, 30px)) / 2); }
.shelf-app .shelf-card img { aspect-ratio: 1.735; object-fit: contain; }
.shelf-caption { display: grid; gap: 3px; padding: 11px 0 0; line-height: 1.45; }
.shelf-caption strong { font-size: clamp(15px, 1.16vw, 18px); font-weight: 600; }
.shelf-caption small { font-size: 12px; font-weight: 400; }
.shelf-caption strong { justify-self: start; }
@media (hover: hover) {
  .shelf-card:hover .shelf-caption strong {
    color: #a4a9ad;
  }
  .work-detail-controls button:hover, .works-close:hover {
    background: #414449;
    border-color: #74787e;
  }
  .works-close:hover img { transform: scale(1.15); }
}
.work-detail-controls button:focus-visible, .works-close:focus-visible {
  outline: 2px solid #e1e4e8;
  outline-offset: 2px;
}
.shelf-card:focus-visible, .shelf-controls button:focus-visible { outline: 2px solid #ffb580; outline-offset: 2px; }
:where(.project-shelf:has(.shelf-controls:not([hidden]))) .shelf-row { cursor: var(--cursor-grab, grab); }
.shelf-row.is-dragging, .shelf-row.is-dragging * { cursor: var(--cursor-grabbing, grabbing); }
.works-close, .work-detail-controls button {
  font-size: 14px; font-weight: 500; line-height: 1;
  border: 1px solid #fff5e829; border-radius: 999px; background: #1d1715c4; color: inherit; cursor: var(--cursor-pointer, pointer);
}
.work-detail-media img { display: block; width: 100%; }
.work-detail-category, .work-detail-position { color: #e2cebe; font-size: 12px; line-height: 1.5; font-weight: 500; letter-spacing: .05em; }
body.on-portfolio-works .corner-circular-text {
  visibility: hidden;
}

html:has(.works-dialog[open]) {
  overflow: hidden;
}

.works-dialog {
  position: fixed;
  inset: 0;
  margin: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  padding: clamp(80px, 11svh, 130px) clamp(22px, 4.4vw, 90px) clamp(25px, 7svh, 76px);
  border: 0;
  background: #170f0be6;
  color: #fff5ed;
  overflow: auto;
  overscroll-behavior: contain;
}

.works-dialog[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(205px, 22%);
  align-content: safe center;
  gap: clamp(20px, 3.7vw, 66px);
}

.works-dialog::backdrop {
  background: #100b0970;
  backdrop-filter: blur(9px);
}

.works-close {
  position: absolute;
  top: clamp(17px, 3.6svh, 42px);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  right: clamp(22px, 4.4vw, 90px);
  justify-content: center;
  min-height: 44px;
  padding: 0 15px;
}

.works-close img { display: block; height: 12px; width: auto; }

.work-detail-media {
  align-self: center;
  margin: 0;
  border: 1px solid #e7b69166;
  border-radius: clamp(10px, 1.25vw, 24px);
  overflow: hidden;
  background: #100b09;
  box-shadow: 0 15px 55px #0b070680;
}

.work-detail-media img {
  max-height: 76svh;
  object-fit: contain;
}

.work-detail-info {
  align-self: end;
}

.work-detail-info h2 {
  margin: 11px 0 13px;
  font-family: inherit;
  font-size: clamp(23px, 2.8vw, 54px);
  line-height: 1.12;
  text-wrap: balance;
}

.work-detail-description {
  margin: 0;
  color: #e2d3c7;
  font-size: clamp(15px, 1.12vw, 17px);
  font-weight: 400;
  line-height: 1.75;
}

.work-detail-position { margin: 18px 0; }

.work-detail-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.work-detail-controls button {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 44px;
  white-space: nowrap;
  padding: 0 16px;
}

.work-detail-position { font-variant-numeric: tabular-nums; }


@media (max-width: 700px) {
  .portfolio-curtain { padding-top: clamp(86px, 13svh, 120px); }
  .shelf-card, .shelf-app .shelf-card { flex-basis: 88%; }
  .shelf-title { margin-top: 20px; }
  .shelf-title h2 { font-size: clamp(35px, 8.3vw, 52px); }
  .works-dialog[open] { grid-template-columns: 1fr; align-content: start; }
  .work-detail-media img { max-height: 54svh; }
  .work-detail-position { margin: 12px 0; }
}
