/* Original portfolio case experience, scoped to the Project detail route. */
body[data-view="about"] {
  overflow: hidden;
  color-scheme: dark;
  color: #f4f4f2;
  background: #08080a;
}

body[data-view="about"] .project-header {
  display: none;
}

#project-about {
  position: fixed;
  inset: 0;
  z-index: 40;
  width: 100%;
  max-width: 100vw;
  padding: 0;
  overflow: hidden clip;
  color: #f4f4f2;
  background: #08080a;
}

#project-details,
.project-case {
  width: 100%;
  max-width: 100vw;
  height: 100%;
  height: 100dvh;
}

.project-case {
  --case-green: #8de84f;
  --case-line: rgba(244, 244, 242, .14);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: clip;
  color: #f4f4f2;
  background: #08080a;
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-feature-settings: "tnum" 1, "kern" 1;
  -webkit-font-smoothing: antialiased;
}

.project-case ::selection {
  color: #0a0a0b;
  background: #8de84f;
}

.project-case :focus-visible {
  border-radius: 4px;
  outline: 2px solid #8de84f;
  outline-offset: 3px;
}

.case-back:focus,
.case-back:focus-visible,
.case-close:focus,
.case-close:focus-visible {
  outline: 0;
  box-shadow: none;
}

.case-bar {
  position: relative;
  z-index: 6;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(16px, 3vh, 30px) clamp(24px, 8vw, 180px);
  background: linear-gradient(to bottom, rgba(8, 8, 10, .94), rgba(8, 8, 10, 0));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.case-back,
.case-close {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 32px;
  border: 0;
  color: rgba(244, 244, 242, .68);
  background: none;
  font: 400 13px/20px var(--vi-font-ui);
  letter-spacing: .14em;
  text-transform: uppercase;
  transition: color .3s ease;
}

.case-back:hover,
.case-close:hover {
  color: #fff;
}

.case-close {
  position: absolute;
  right: clamp(18px, 3vw, 44px);
  top: clamp(16px, 3vh, 34px);
  z-index: 5;
  min-height: 0;
  padding: 0;
  color: #fff;
  background: none;
  font-size: clamp(15px, 1.2vw, 20px);
}

.case-close .x {
  position: relative;
  width: clamp(38px, 3.4vw, 54px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  transition: transform .5s cubic-bezier(.19, 1, .22, 1);
}

.case-close .x::before,
.case-close .x::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  height: 1.8px;
  background: #0a0a0b;
  transform: translate(-50%, -50%) rotate(45deg);
}

.case-close .x::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.case-close:hover .x {
  transform: rotate(90deg) scale(.94);
}

.case-progress {
  position: absolute;
  left: clamp(24px, 8vw, 180px);
  right: clamp(24px, 8vw, 180px);
  bottom: 0;
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, .1);
}

.case-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--case-green);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .12s linear;
}

.case-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 clamp(24px, 8vw, 180px) clamp(60px, 10vh, 120px);
  scrollbar-width: none;
}

.case-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.case-hero {
  width: 100%;
  min-width: 0;
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(10px, 4vh, 50px) 0 clamp(24px, 4vh, 44px);
}

.case-hero .label {
  margin: 0;
  color: #a8a8a6;
  font-size: 11px;
  line-height: 18px;
  letter-spacing: .28em;
  text-transform: uppercase;
}

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

.case-title {
  position: relative;
  width: 100%;
  height: clamp(92px, 15vh, 168px);
  margin-top: clamp(12px, 2.2vh, 26px);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.case-title canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.case-year {
  margin: clamp(4px, 1vh, 10px) 0 0;
  color: rgba(244, 244, 242, .55);
  font-size: clamp(16px, 1.6vw, 26px);
  line-height: 1.3;
  letter-spacing: .02em;
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(18px, 3vh, 30px);
}

.case-meta span {
  padding: 8px 14px;
  border: 1px solid var(--case-line);
  border-radius: 999px;
  color: rgba(244, 244, 242, .72);
  font-size: 12px;
  line-height: 18px;
  letter-spacing: .1em;
}

.case-lead {
  max-width: 56em;
  margin: clamp(20px, 3.4vh, 36px) 0 0;
  color: rgba(244, 244, 242, .78);
  font-size: clamp(15px, 1.2vw, 20px);
  line-height: 1.8;
}

.case-pages {
  display: grid;
  gap: clamp(14px, 2vh, 26px);
  max-width: 1500px;
  margin: 0 auto;
}

.case-pages figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(244, 244, 242, .08);
  border-radius: 12px;
  background: #111;
  opacity: 1;
  transform: none;
}

.case-pages figure[data-reveal]:not(.is-visible) {
  opacity: 0;
  transform: translateY(20px);
}

.case-pages figure[data-reveal] {
  transition: opacity .55s cubic-bezier(.22, 1, .36, 1), transform .55s cubic-bezier(.22, 1, .36, 1);
}

.case-image-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: zoom-in;
  text-align: inherit;
}

.case-image-button img {
  display: block;
  width: 100%;
  height: auto;
}

.case-image-action {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  color: #0a0a0b;
  background: #f4f4f2;
  font-size: 12px;
  line-height: 20px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .24s ease, transform .36s cubic-bezier(.19, 1, .22, 1);
}

.case-image-button:is(:hover, :focus-visible) .case-image-action {
  opacity: 1;
  transform: translateY(0);
}

.case-pages figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 2px;
  color: #a8a8a6;
  font-size: 12px;
  line-height: 18px;
  letter-spacing: .06em;
}

.case-pages figcaption > span:first-child {
  color: #f4f4f2;
  font-variant-numeric: tabular-nums;
}

.case-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1500px;
  margin: clamp(40px, 7vh, 80px) auto 0;
  padding-top: clamp(24px, 4vh, 40px);
  border-top: 1px solid rgba(244, 244, 242, .1);
}

.case-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
}

.case-nav a {
  color: rgba(244, 244, 242, .85);
  font-size: clamp(15px, 1.3vw, 22px);
  line-height: 1.35;
  letter-spacing: -.01em;
  transition: color .25s ease;
}

.case-nav a:hover {
  color: var(--case-green);
}

.case-nav small {
  display: block;
  margin-bottom: 6px;
  color: #a8a8a6;
  font-size: 10.5px;
  line-height: 18px;
  letter-spacing: .26em;
  text-transform: uppercase;
}

.case-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 14px 22px;
  border-radius: 999px;
  color: #0a0a0b;
  background: #f1f1ef;
  font-size: 14px;
  line-height: 20px;
  transition: background-color .35s ease, transform .5s cubic-bezier(.19, 1, .22, 1);
}

.case-download:hover {
  background: #8de84f;
  transform: translateY(-2px);
}

.case-zoom {
  width: min(96vw, 1600px);
  max-width: none;
  max-height: 94vh;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: #f4f4f2;
  background: #08080a;
}

.case-zoom::backdrop {
  background: rgba(8, 8, 10, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.case-zoom img {
  display: block;
  max-width: 100%;
  max-height: 86vh;
  margin: 0 auto;
  object-fit: contain;
}

.case-zoom p {
  margin: 0;
  padding: 16px 24px;
  color: #b6b6b4;
  font-size: 14px;
  line-height: 22px;
}

.case-zoom-close {
  position: fixed;
  z-index: 2;
  right: 24px;
  top: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  color: #111;
  background: #fff;
}

.case-zoom-close .x {
  position: relative;
  width: 20px;
  height: 20px;
}

.case-zoom-close .x::before,
.case-zoom-close .x::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 2px;
  background: #111;
  transform: translate(-50%, -50%) rotate(45deg);
}

.case-zoom-close .x::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

@media (hover: hover) and (pointer: fine) {
  .case-image-button:hover img {
    filter: brightness(1.04);
  }
}

@media (max-width: 820px) {
  .case-bar {
    padding: 16px 20px 20px;
  }

  .case-progress {
    left: 20px;
    right: 20px;
  }

  .case-body {
    padding-right: 20px;
    padding-left: 20px;
  }

  .case-title {
    display: none;
  }

  .case-title-sr {
    position: static;
    width: auto;
    height: auto;
    margin: 16px 0 8px;
    overflow: visible;
    clip: auto;
    white-space: normal;
    color: #f4f4f2;
    font-size: 52px;
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -.045em;
    text-wrap: balance;
    overflow-wrap: anywhere;
  }

  .case-image-action {
    right: 12px;
    bottom: 12px;
    opacity: 1;
    transform: none;
  }

  .case-zoom-close {
    right: 16px;
    top: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-pages figure {
    transition: none;
  }

  .case-pages figure[data-reveal] {
    opacity: 1;
    transform: none;
  }
}
