:root {
  --black: #000;
  --white: #fff;
  --paper: #f4f4f1;
  --muted: #767676;
  --line: rgba(0, 0, 0, 0.14);
  --card-radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

html:has(.project-dialog[open]) {
  background: #000;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: Poppins, Inter, "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body.dialog-open {
  background: #000;
}

body.dialog-open > .site-nav,
body.dialog-open > main,
body.dialog-open > .footer {
  display: none;
}

body.resume-page {
  background: #000;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

a {
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

.site-nav {
  position: fixed;
  z-index: 20;
  left: 0;
  top: 0;
  width: 100%;
  height: 78px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  background: var(--white);
  color: var(--black);
  border-bottom: 1px solid var(--black);
}

.brand {
  padding-left: 22px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

.nav-links {
  display: flex;
  height: 100%;
}

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 118px;
  padding: 0 10px;
  overflow: hidden;
  font-size: 20px;
  line-height: 1;
}

.nav-links a span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 7px;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

.nav-links a[aria-current="page"] span {
  color: #fff;
  background: #171717;
}

.nav-links a[aria-current="page"]::before {
  display: none;
}

.nav-links a::before {
  display: none;
}

.nav-links a:hover::before {
  display: none;
}

.nav-links small {
  color: #b1b1b1;
  font-size: 10px;
}

.nav-toggle {
  display: none;
}

.eyebrow {
  margin: 0 0 12px;
  color: #a9a9a9;
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
}

.hero {
  position: relative;
  min-height: 88vh;
  padding: 78px 20px 0;
  display: grid;
  place-items: center;
  background: var(--white);
  color: var(--black);
  overflow: clip;
}

.hero-contact {
  width: min(980px, calc(100vw - 96px));
  margin: 0;
  display: grid;
  justify-items: center;
  gap: clamp(72px, 7.5vw, 108px);
  transform: translateY(-22px);
}

.hero-qr {
  width: clamp(138px, 11.5vw, 190px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 18px 42px rgba(120, 120, 120, 0.34);
  transition: transform 0.38s var(--ease);
  transform-origin: center;
}

.hero-qr:hover {
  transform: scale(1.16);
}

.hero-info {
  position: relative;
  width: max-content;
  max-width: 100%;
  display: grid;
  grid-template-columns: max-content 1px max-content 1px max-content 1px max-content;
  justify-content: center;
  align-items: center;
  column-gap: clamp(24px, 3.1vw, 48px);
  color: #000;
  font-size: clamp(15px, 1.45vw, 22px);
  font-weight: 500;
  line-height: 1;
  text-align: center;
}

.hero-info span {
  display: inline-block;
  position: relative;
  justify-self: center;
  transform-origin: center;
  transition: transform 0.38s var(--ease);
  will-change: transform;
  white-space: nowrap;
}

.hero-info i {
  display: block;
  width: 1px;
  height: 24px;
  background: #b8b8b8;
  transform: scaleX(0.36);
  transform-origin: center;
  pointer-events: none;
  transition: none;
}

.hero-info span:hover {
  transform: scale(1.18);
}


.hero-project-label {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 19px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--black);
  font-size: 18px;
  line-height: 1;
  color: var(--black);
}

.selected {
  background: var(--white);
  color: var(--black);
  padding: 42px 0 80px;
  overflow-x: clip;
}

.project-grid {
  width: min(1680px, calc(100% - clamp(84px, 12vw, 220px)));
  margin: 0 auto;
  padding-inline: 0;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(42px, 5vw, 78px);
  padding-top: 0;
}

.project-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--card-radius);
  background: var(--white);
  transform-origin: center;
  transition:
    transform 0.46s var(--ease),
    filter 0.46s var(--ease);
  will-change: transform;
}

.thumb {
  position: relative;
  overflow: hidden;
  background: #efefef;
}

.thumb img {
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: filter 0.46s var(--ease), opacity 0.46s var(--ease);
}

.project-card:hover,
.project-card:focus-visible {
  z-index: 3;
  transform: scale(0.975) rotate(1.1deg);
  filter: contrast(1.02);
}

.project-card:nth-child(even):hover,
.project-card:nth-child(even):focus-visible {
  transform: scale(0.975) rotate(1.1deg);
}

.footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  padding: 60px max(20px, calc((100vw - 1004px) / 2));
  background: var(--white);
  color: var(--black);
}

.footer-profile {
  display: flex;
  align-items: center;
  gap: 22px;
}

.footer-profile img {
  width: 92px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
}

.footer strong {
  font-size: 32px;
  font-weight: 600;
}

.footer p {
  margin: 8px 0 0;
  color: #777;
}

.icp-link {
  display: inline-block;
  margin-top: 10px;
  color: #777;
  font-size: 13px;
  line-height: 1.5;
  text-decoration: none;
  transition: color 0.2s ease;
}

.icp-link:hover,
.icp-link:focus-visible {
  color: var(--black);
}

.icp-footer {
  padding: 24px 20px 32px;
  text-align: center;
}

.icp-footer-dark {
  background: #000;
}

.icp-footer-dark .icp-link:hover,
.icp-footer-dark .icp-link:focus-visible {
  color: var(--white);
}

.footer nav {
  display: flex;
  gap: 28px;
  align-items: center;
}

.resume-main {
  min-height: 100vh;
  padding: 78px 0 0;
  background: #000;
}

.resume-sheet {
  width: min(1920px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 0;
}

.resume-sheet img {
  width: 100%;
  height: auto;
  border-radius: 0;
  box-shadow: none;
}

.project-dialog {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  height: auto;
  max-height: none;
  padding: 0;
  border: 0;
  margin: 0;
  background: #000;
  color: var(--white);
  overflow: visible;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: #9a9a9a #111;
  scrollbar-width: thin;
}

.project-dialog::backdrop {
  background: #000;
}

.project-dialog:modal {
  background: #000;
}

.project-dialog.is-masonry-dialog {
  background: #000;
}

.project-dialog.is-masonry-dialog::backdrop {
  background: #000;
}

.project-dialog::-webkit-scrollbar {
  width: 12px;
}

.project-dialog::-webkit-scrollbar-track {
  background: #111;
}

.project-dialog::-webkit-scrollbar-thumb {
  background: #9a9a9a;
  border: 3px solid #111;
  border-radius: 999px;
}

.dialog-images {
  width: min(1920px, 100%);
  margin: 0 auto;
  display: grid;
  gap: clamp(18px, 2vw, 36px);
  background: #000;
}

.dialog-images.is-masonry {
  width: min(1320px, calc(100% - clamp(210px, 26vw, 480px)));
  display: grid;
  grid-template-columns: repeat(var(--masonry-columns, 2), minmax(0, 1fr));
  align-items: start;
  gap: clamp(42px, 5vw, 86px);
  min-height: 100vh;
  padding: clamp(24px, 3vw, 52px) 0 clamp(42px, 5vw, 86px);
  background: #000;
}

.dialog-images.is-masonry-spacious {
  width: min(1080px, calc(100% - clamp(320px, 34vw, 640px)));
  gap: clamp(72px, 7vw, 132px);
}

.dialog-images.is-masonry-fit {
  width: min(1680px, calc(100% - clamp(90px, 12vw, 240px)));
  gap: clamp(28px, 3.2vw, 54px);
}

.masonry-column {
  display: grid;
  gap: clamp(42px, 5vw, 86px);
}

.masonry-column:nth-of-type(even) {
  padding-top: clamp(86px, 8vw, 150px);
}

.masonry-item {
  display: grid;
  gap: clamp(18px, 2vw, 32px);
}

.dialog-images.is-masonry-fit .masonry-column {
  gap: clamp(28px, 3.2vw, 54px);
}

.dialog-images.is-masonry-spacious .masonry-column {
  gap: clamp(64px, 6.4vw, 120px);
}

.dialog-images.is-masonry-loose .masonry-column {
  gap: clamp(88px, 8vw, 150px);
}

.dialog-images img {
  width: 100%;
  height: auto;
  background: #000;
}

.dialog-images.has-image-groups {
  display: block;
  padding-top: clamp(40px, 4.5vw, 76px);
}

.project-image-group {
  display: grid;
  gap: clamp(24px, 2.4vw, 42px);
}

.project-image-group + .project-image-group {
  margin-top: clamp(84px, 8vw, 148px);
}

.project-year-label {
  min-width: clamp(106px, 8vw, 132px);
  margin: 0 auto;
  padding: clamp(11px, 1vw, 14px) clamp(28px, 2.4vw, 42px);
  border-radius: 999px;
  background: #1b1b1e;
  color: #c9c9ce;
  font-size: clamp(17px, 1.35vw, 22px);
  font-weight: 400;
  line-height: 1.1;
  text-align: center;
}

.project-year-images {
  display: grid;
  gap: clamp(18px, 2vw, 36px);
}

.dialog-images.is-masonry.has-project-note {
  padding-top: clamp(64px, 6vw, 108px);
  row-gap: clamp(46px, 3.8vw, 68px);
}

.project-note {
  grid-column: 1 / -1;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(11px, 1vw, 14px) clamp(24px, 2.6vw, 44px);
  border-radius: 999px;
  background: #1b1b1e;
  color: #c9c9ce;
  font-size: clamp(14px, 1.1vw, 18px);
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
}

.dialog-images.is-fit-screen {
  width: min(1920px, 100%);
  margin: 0 auto;
  gap: clamp(18px, 2vw, 36px);
  background: #000;
}

.dialog-images.is-fit-screen img {
  width: 1920px;
  max-width: 100%;
  height: auto;
  max-height: none;
  margin: 0 auto;
  object-fit: initial;
}

.dialog-images.is-masonry img {
  display: block;
  width: 100%;
  margin: 0;
  background: #000;
  border-radius: 8px;
}

.image-swap-stack {
  position: relative;
  width: 100%;
  aspect-ratio: 1080 / 2100;
  display: block;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  isolation: isolate;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.image-swap-card {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  opacity: 1;
  filter: none;
  transform: translate3d(4%, -4%, 0) scale(0.92) rotate(6deg);
  transform-origin: center;
  transition:
    transform 0.62s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.42s ease,
    filter 0.42s ease,
    box-shadow 0.42s ease;
  will-change: transform;
}

.image-swap-card.is-front {
  z-index: 2;
  opacity: 1;
  filter: none;
  transform: translate3d(0, 0, 0) scale(1) rotate(0);
}

.dialog-images.is-masonry .image-swap-card img {
  width: 100%;
  height: auto;
  border-radius: clamp(12px, 1.2vw, 18px);
  background: transparent;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62);
  pointer-events: none;
  user-select: none;
}

.dialog-images.is-masonry .image-swap-card.is-front img {
  box-shadow:
    0 0 0 4px #000,
    0 24px 70px rgba(0, 0, 0, 0.62);
}

.image-swap-stack:hover .image-swap-card.is-front {
  transform: translate3d(0, 0, 0) scale(1) rotate(0);
}

.image-swap-stack:focus-visible {
  outline: none;
}

.image-swap-stack:focus-visible .image-swap-card.is-front {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.92);
}

.dialog-images.is-masonry-fit img {
  width: auto;
  max-width: 100%;
  max-height: none;
  margin: 0 auto;
  object-fit: initial;
}

.project-link-wrap {
  display: flex;
  justify-content: center;
  padding: clamp(36px, 5vw, 80px) clamp(20px, 5vw, 80px);
  background: #000;
}

.masonry-item .project-link-wrap {
  padding: 0;
}

.project-buy-link {
  max-width: min(420px, 100%);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.035)),
    #101010;
  transition: transform 0.28s var(--ease), border-color 0.28s var(--ease), background 0.28s var(--ease);
}

.project-buy-link:hover,
.project-buy-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.055)),
    #111;
}

.jd-logo {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 5px;
  background: #e1251b;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.project-buy-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
  text-align: left;
}

.project-buy-copy strong {
  font-size: 16px;
  line-height: 1.1;
  font-weight: 600;
}

.project-buy-copy span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  line-height: 1;
}

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.project-card.reveal {
  transition:
    opacity 0.7s var(--ease),
    transform 0.46s var(--ease),
    filter 0.46s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card.reveal.is-visible:hover,
.project-card.reveal.is-visible:focus-visible {
  z-index: 3;
  transform: scale(0.975) rotate(1.1deg);
  filter: contrast(1.02);
}

.project-card.reveal.is-visible:nth-child(even):hover,
.project-card.reveal.is-visible:nth-child(even):focus-visible {
  transform: scale(0.975) rotate(1.1deg);
}

@media (prefers-reduced-motion: reduce) {
  .project-card,
  .thumb img,
  .image-swap-card {
    transition: none;
  }

  .project-card:hover,
  .project-card:focus-visible,
  .project-card:nth-child(even):hover,
  .project-card:nth-child(even):focus-visible {
    transform: none;
  }
}

@media (min-width: 521px) {
  .nav-toggle {
    display: none;
  }

  .nav-links,
  .nav-links.is-open {
    position: static;
    height: 100%;
    display: flex;
    background: transparent;
    border-bottom: 0;
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    height: 100%;
    border-top: 0;
  }
}

@media (max-width: 520px) {
  .site-nav {
    height: 58px;
  }

  .nav-toggle {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
  }

  .nav-toggle span {
    width: 18px;
    height: 1px;
    background: currentColor;
    transition: transform 0.25s var(--ease);
  }

  .nav-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(5px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-5px) rotate(-45deg);
  }

  .nav-links {
    position: absolute;
    left: 0;
    right: 0;
    top: 58px;
    height: auto;
    display: grid;
    background: var(--white);
    border-bottom: 1px solid var(--black);
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.24s var(--ease), opacity 0.24s var(--ease);
  }

  .nav-links.is-open {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    height: 56px;
    border-top: 1px solid var(--line);
  }

  .hero {
    min-height: 100vh;
    padding-top: 58px;
  }

  .brand {
    font-size: 18px;
    padding-left: 18px;
  }

  .hero-contact {
    width: min(900px, calc(100vw - 44px));
    gap: 64px;
  }

  .hero-info {
    width: max-content;
    max-width: 100%;
    column-gap: clamp(18px, 2.4vw, 32px);
    font-size: clamp(13px, 1.8vw, 18px);
  }

  .hero-project-label {
    left: 14px;
    right: 14px;
    font-size: 15px;
  }

  .footer {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 560px) {
  .hero {
    min-height: 100vh;
  }

  .hero-contact {
    width: min(360px, 92vw);
    gap: 40px;
    transform: translateY(-18px);
  }

  .hero-qr {
    width: 112px;
  }

  .hero-info {
    width: min(360px, 92vw);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 13px;
    line-height: 1.5;
    gap: 12px 30px;
  }

  .hero-info i {
    height: 18px;
  }

  .thumb {
    min-height: 0;
  }

  .project-grid {
    width: calc(100% - 36px);
    padding-inline: 0;
    gap: 26px;
  }

  .project-grid {
    padding-top: 0;
  }

  .dialog-images.is-masonry {
    width: calc(100% - 36px);
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 18px 0;
  }

  .masonry-column {
    gap: 26px;
  }

  .masonry-column:nth-of-type(even) {
    padding-top: 0;
  }

  .footer nav {
    align-items: start;
    flex-direction: column;
    gap: 14px;
  }

  .footer-profile {
    align-items: flex-start;
    flex-direction: column;
  }
}
