/* ==========================================================================
   03-pages.css — home (spiral / list), about, project page
   ========================================================================== */

main { display: block; position: relative; z-index: 1; }

/* the project page is the scroller: on project routes the document stays
   pinned and the page itself scrolls (this is what lets the "next project"
   block stick within the card while the page keeps scrolling) */
html.on-project,
html.on-project body { height: 100vh; overflow: hidden; }
main.project-page { height: 100vh; overflow-y: auto; overflow-x: hidden; -ms-overflow-style: none; scrollbar-width: none; }
main.project-page::-webkit-scrollbar { display: none; }

html.on-project .home-overlay-wrapper.hide { display: none; }

/* =========================================================== home · list */
.list-wrapper {
  align-items: center;
  display: flex;
  flex-direction: column;
  margin: calc(var(--grid-column) * 0 + var(--grid-gutter) * 0 + var(--grid-margin) * 1);
  min-height: 100vh;
  overflow-x: hidden;
  padding-block: calc(20vh - 60rem);
  position: relative;
  text-align: center;
  width: calc(var(--grid-column) * 12 + var(--grid-gutter) * 11);
  z-index: 1;
}

.list-wrapper .project p {
  cursor: pointer;
  font-size: 60rem;
  font-weight: 500;
  margin: 0;
  padding: calc(var(--grid-gutter) / 2) 0;
  pointer-events: auto;
  position: relative;
  transform-origin: top center;
  transition: opacity .3s ease;
  z-index: 10;
}

@media screen and (hover: hover) and (pointer: fine) {
  .list-wrapper .project p:hover { opacity: 1; transition: none; }
}

@media screen and (hover: hover) and (pointer: fine) {
  .list-wrapper:has(.project p:hover) .project p:not(:hover) { opacity: .4; }
}

@media screen and (max-width: 900px) {
  .list-wrapper { height: 100%; min-height: unset; padding-top: 20vh; width: calc(var(--grid-column) * 6 + var(--grid-gutter) * 5); }
  .list-wrapper .project p { font-size: 40rem; }
}

/* cursor image trail */
.cursor-image-trail {
  aspect-ratio: 16 / 9;
  height: 186rem;
  left: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
  transform-origin: center;
  transition: opacity .3s var(--ease-expo-out);
  width: 330rem;
  will-change: transform;
  z-index: 0;
}

.cursor-image-trail.hide { opacity: 0; visibility: hidden; }

.cursor-image-trail .cursor-image {
  aspect-ratio: 16 / 9;
  background-color: var(--color-bg-dark);
  border-radius: 12rem;
  display: block;
  height: 100%;
  left: 0;
  object-fit: cover;
  object-position: center;
  position: absolute;
  top: 0;
  transform-origin: center;
  width: 100%;
  will-change: transform, opacity;
}

/* hovered project pill */
.project-hover-pill {
  bottom: 60rem;
  justify-content: center;
  left: 0;
  position: fixed;
  right: 0;
  z-index: 10;
  align-items: center;
  display: flex;
  pointer-events: none;
  transition: opacity .3s var(--ease-expo-out), visibility .3s var(--ease-expo-out);
}

.project-hover-pill.hide { opacity: 0; visibility: hidden; }

.project-hover-pill .content {
  align-items: center;
  display: flex;
  background: var(--color-white);
  border-radius: 14rem;
  color: var(--color-bg-dark);
  gap: 12rem;
  justify-content: space-between;
  max-width: 90vw;
  padding: 6rem 16rem 6rem 6rem;
}

.project-hover-pill .infos { align-items: center; display: flex; gap: 12rem; overflow: hidden; }
.project-hover-pill .infos img { background-color: var(--color-bg-dark); border-radius: 9rem; height: 48rem; object-fit: cover; object-position: center; width: 48rem; }
.project-hover-pill .infos h4 { font-size: 18rem; font-weight: 500; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================================================================ about */
.about-text-wrapper { height: 250vh; width: 100%; position: relative; }

.about-text-wrapper .inner {
  align-items: center;
  display: flex;
  height: 100vh;
  justify-content: center;
  padding: var(--grid-margin);
  position: sticky;
  top: 0;
  width: 100%;
}

.about-text-wrapper .inner .text {
  font-family: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  font-size: 28rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
  max-width: 1200px;
  text-align: center;
  text-wrap: normal;
}

.about-text-wrapper .inner .text .about-line { display: block; }
.about-text-wrapper .inner .text .about-part { display: inline-block; white-space: nowrap; }

.about-text-wrapper .inner .text .about-text-image {
  aspect-ratio: 1 / 1;
  display: inline-block;
  height: auto;
  margin: 0 10rem;
  object-fit: contain;
  transform: translateY(4rem) scale(1.5);
  width: 32rem;
  vertical-align: middle;
}

@media screen and (max-width: 900px) {
  .about-text-wrapper .inner .text { font-size: 28rem; line-height: 1; }
  .about-text-wrapper .inner .text .about-text-image { display: none; }
}

.about-text-wrapper .inner .word { display: inline-block; will-change: opacity; }

@keyframes marqueeScroll {
  0% { translate: 0; }
  to { translate: -100%; }
}

.about-carousel {
  display: flex;
  overflow-x: hidden;
  padding-block: var(--grid-margin);
  position: relative;
  width: 100vw;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.about-carousel::-webkit-scrollbar { display: none; }

.about-carousel .container {
  align-items: flex-end;
  animation: marqueeScroll 40s linear infinite;
  display: flex;
  gap: var(--grid-gutter);
  justify-content: center;
  padding-right: var(--grid-gutter);
}

.about-carousel .container .thumbnail {
  aspect-ratio: 16 / 9;
  border-radius: 12rem;
  cursor: pointer;
  flex: 0 0 auto;
  height: 300rem;
  overflow: hidden;
  position: relative;
  transition: transform .2s ease;
  width: auto;
}

.about-carousel .container .thumbnail img { height: 100%; object-fit: cover; transition: transform .3s ease; width: 100%; }

.about-carousel .container .thumbnail .overlay {
  align-items: center;
  background-color: #00000080;
  display: flex;
  height: 100%;
  justify-content: center;
  left: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  transition: opacity .3s ease;
  width: 100%;
}

.about-carousel .container .thumbnail .overlay span {
  background-color: var(--color-pop-green);
  border-radius: 50rem;
  color: var(--color-black);
  font-size: 18rem;
  font-weight: 500;
  opacity: 0;
  padding: 8rem 16rem;
  transform: scale(.5);
  transition: transform .4s var(--ease-spring), opacity .4s var(--ease-spring);
}

.about-carousel .container .thumbnail.thumbnail-0 { height: 240rem; margin-bottom: 20rem; }
.about-carousel .container .thumbnail.thumbnail-1 { height: 160rem; margin-bottom: 40rem; }
.about-carousel .container .thumbnail.thumbnail-2 { height: 300rem; margin-bottom: 0; }
.about-carousel .container .thumbnail.thumbnail-3 { height: 180rem; margin-bottom: 60rem; }
.about-carousel .container .thumbnail:active { transform: scale(.97); }

@media screen and (hover: hover) and (pointer: fine) {
  .about-carousel .container .thumbnail:hover img { transform: scale(1.05); }
  .about-carousel .container .thumbnail:hover .overlay { opacity: 1; }
  .about-carousel .container .thumbnail:hover .overlay span { opacity: 1; transform: scale(1); }
}

@media screen and (max-width: 900px) {
  .about-carousel .container .thumbnail.thumbnail-0 { height: 160rem; margin-bottom: 20rem; }
  .about-carousel .container .thumbnail.thumbnail-1 { height: 120rem; margin-bottom: 40rem; }
  .about-carousel .container .thumbnail.thumbnail-2 { height: 240rem; margin-bottom: 0; }
  .about-carousel .container .thumbnail.thumbnail-3 { height: 140rem; margin-bottom: 60rem; }
}

.about-socials-wrapper { min-height: 100vh; padding: var(--grid-margin); pointer-events: none; position: relative; }
.about-socials-wrapper, .about-socials-wrapper .socials { align-items: center; display: flex; justify-content: center; position: relative; }

.about-socials-wrapper .socials { flex-direction: column; text-align: center; }

.about-socials-wrapper .socials .social-link {
  color: var(--color-white);
  font-size: 64rem;
  font-weight: 500;
  padding-block: 6rem;
  pointer-events: all;
  text-decoration: none;
  text-transform: lowercase;
  transition: opacity .3s ease;
}

.about-home-link {
  color: var(--color-white);
  cursor: pointer;
  display: block;
  font-size: 16rem;
  font-weight: 400;
  letter-spacing: 0;
  margin: 0 auto 60rem;
  opacity: .7;
  text-align: center;
  text-decoration: none;
  transition: opacity .3s ease;
}
.about-home-link:hover { opacity: 1; }

.about-socials-wrapper .socials .social-link:first-child { padding-top: 0; }
.about-socials-wrapper .socials .social-link:last-child { padding-bottom: 0; }

@media screen and (hover: hover) and (pointer: fine) {
  .about-socials-wrapper .socials .social-link:hover { opacity: 1; transition: none; }
  .about-socials-wrapper .socials:has(.social-link:hover) .social-link:not(:hover) { opacity: .4; }
}

/* ============================================================== project */
.project-page { width: 100%; }

.project-infos { align-items: flex-start; display: flex; gap: var(--grid-gutter); padding: 60rem calc(var(--grid-column) * 1 + var(--grid-gutter) * 1); width: 100%; }

@media screen and (max-width: 900px) {
  .project-infos { flex-direction: column; gap: 30rem; padding: 40rem var(--grid-margin); }
}

.project-infos h2 { font-size: 56rem; font-weight: 500; width: calc(var(--grid-column) * 5 + var(--grid-gutter) * 4); }
@media screen and (max-width: 900px) { .project-infos h2 { font-size: 40rem; width: 100%; } }

.project-infos .left { display: flex; flex-direction: column; gap: 32rem; }
.project-infos .right { display: flex; flex: 1; flex-direction: column; gap: 40rem; padding-top: 8rem; }
.project-infos p { color: rgba(255, 255, 255, 0.72); font-size: 18rem; font-weight: 500; line-height: 1.3; margin: 0; max-width: calc(var(--grid-column) * 3 + var(--grid-gutter) * 2); }
@media screen and (max-width: 900px) { .project-infos p { font-size: 16rem; max-width: 100%; } }
.project-infos .awards { display: flex; flex-direction: column; gap: 10rem; }
.project-infos .award { color: var(--color-white); font-size: 16rem; font-weight: 500; line-height: 1.3; margin: 0; max-width: 100%; text-align: left; }
.project-infos .line { display: block; overflow: hidden; }

.styleframes { display: flex; flex-direction: column; gap: 32rem; justify-content: flex-start; padding: 60rem calc(var(--grid-column) * 1 + var(--grid-gutter) * 1) calc(var(--grid-column) * 1 + var(--grid-gutter) * 1); width: 100%; }
@media screen and (max-width: 900px) { .styleframes { gap: 24rem; padding: 24rem var(--grid-margin); } }

.styleframes .styleframe { border-radius: 14rem; display: flex; opacity: 0; overflow: hidden; position: relative; transform: scale(.5); transform-origin: center center; width: calc(var(--grid-column) * 5 + var(--grid-gutter) * 4); will-change: transform, opacity; }
.styleframes .styleframe img { aspect-ratio: 16 / 9; object-fit: cover; object-position: center; transform: scale(1.5); width: 100%; will-change: transform; }
@media screen and (max-width: 900px) { .styleframes .styleframe { width: 100%; } }
.styleframes .styleframe:nth-child(2n) { align-self: flex-end; }

/* fallback: if the scroll trigger never fires (e.g. restored scroll position),
   keep the frames visible so content is never lost. Kept as a late safety net so
   it does not override the gsap entrance animation while it plays. */
.styleframes .styleframe { animation: styleframeVisible 0s linear 2.5s forwards; }
.styleframes .styleframe img { animation: styleframeImg 0s linear 2.5s forwards; }
@keyframes styleframeVisible { to { opacity: 1; transform: scale(1); } }
@keyframes styleframeImg { to { transform: scale(1); } }

.preview-wrapper { height: auto; aspect-ratio: 16 / 9; max-height: 62vh; overflow: hidden; position: relative; width: 100%; background: var(--color-bg-dark); }
@media screen and (max-width: 900px) { .preview-wrapper { aspect-ratio: auto; height: 42vh; } }
.preview-video { cursor: pointer; display: block; height: 100%; object-fit: cover; object-position: center; width: 100%; }

.project-card {
  align-items: start;
  background-color: rgba(10, 10, 10, 0.42);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16rem;
  color: var(--color-white);
  display: flex;
  flex-direction: column;
  margin: var(--grid-margin);
  overflow: hidden;
  position: relative;
  width: calc(var(--grid-column) * 12 + var(--grid-gutter) * 11);
  z-index: 10;
}

.project-card img { object-fit: cover; object-position: center; width: 100%; }
@media screen and (max-width: 900px) { .project-card { width: calc(var(--grid-column) * 6 + var(--grid-gutter) * 5); } }

.project-card .close { align-items: center; background-color: rgba(10, 10, 10, 0.72); border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 50%; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); color: var(--color-white); cursor: pointer; display: flex; height: 48rem; justify-content: center; pointer-events: auto; position: absolute; right: 10rem; top: 10rem; width: 48rem; z-index: 50; }
.project-card .close svg { transition: transform .2s ease; }

.project-card .close:hover svg { transform: rotate(90deg); }

.next-project .progress-bar-wrapper { align-items: center; bottom: 0; display: flex; height: 100%; position: absolute; right: var(--grid-margin); top: 0; width: 6rem; }
.next-project .progress-bar-wrapper .progress-bar { background-color: var(--color-white20); border-radius: 100rem; overflow: hidden; position: relative; width: 100%; }
.next-project .progress-bar-wrapper .progress-bar .progress-fill { background-color: var(--color-white); border-radius: 100rem; height: 100%; transform: scaleY(0); transform-origin: center center; width: 6rem; }
@media screen and (max-width: 900px) { .next-project .progress-bar-wrapper { display: none; } }

.next-project {
  align-items: center;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-l);
  height: 100vh;
  justify-content: center;
  padding: var(--grid-margin);
  position: sticky;
  width: 100%;
}

/* sticky needs a scroll container; make the next block a containing block so
   it sticks against the project viewport */
.project-page .next-project { position: sticky; top: 0; }

.next-project .back-link { color: var(--color-white); cursor: pointer; font-size: 14rem; font-weight: 400; opacity: .7; position: absolute; top: var(--grid-margin); }
.next-project .back-link:before { background-color: var(--color-white); bottom: -2rem; content: ""; height: .5rem; position: absolute; transform: scaleX(0); transform-origin: right; transition: transform .15s ease-in-out; width: 100%; z-index: -1; }
.next-project .back-link:hover:before { transform: scaleX(1); transform-origin: left; }

.next-project img { aspect-ratio: 16 / 9; border-radius: 12rem; cursor: pointer; object-fit: cover; object-position: center; width: calc(var(--grid-column) * 6 + var(--grid-gutter) * 5); }
.next-project h4 { bottom: -60rem; color: var(--color-white); font-size: 24rem; font-weight: 500; left: 50%; position: absolute; text-align: center; transform: translate(-50%); }
@media screen and (max-width: 900px) { .next-project h4 { bottom: -45rem; font-size: 18rem; width: 100%; } }

.next-project .image-container { position: relative; }
.next-project .image-container .tag { background-color: var(--color-white); border-radius: 50rem; color: var(--color-bg-dark); font-size: 24rem; font-weight: 500; padding: 8rem 16rem; position: absolute; }
.next-project .image-container .tag.green { background-color: var(--color-pop-green); }
.next-project .image-container .tag.top-right { right: -60rem; rotate: -8deg; top: -20rem; }
@media screen and (max-width: 900px) { .next-project .image-container .tag.top-right { display: none; } }
.next-project .image-container .tag.bottom-left { bottom: -20rem; left: -60rem; rotate: 9deg; }
@media screen and (max-width: 900px) {
  .next-project .image-container .tag.bottom-left { background-color: var(--color-pop-green); bottom: unset; font-size: 18rem; left: -5rem; rotate: -8deg; top: -10rem; }
}

/* bottom return-to-home button on the last project screen */
.next-project .back-home-bottom {
  align-items: center;
  background: transparent;
  border: 1px solid var(--color-white20);
  border-radius: 100rem;
  color: var(--color-white);
  cursor: pointer;
  display: inline-flex;
  font-size: 15rem;
  font-weight: 500;
  gap: 8rem;
  justify-content: center;
  margin-top: 30rem;
  padding: 12rem 22rem;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.next-project .back-home-bottom:hover {
  background: var(--color-white);
  border-color: var(--color-white);
  color: var(--color-bg-dark);
}
.next-project .back-home-bottom svg { flex: none; }

/* ------------------------------------------------------------- 404 page */
.error-wrapper { align-items: center; display: flex; flex-direction: column; gap: var(--gap-s); height: 100%; justify-content: center; min-height: 100dvh; width: 100%; }
.error-wrapper p { font-weight: 500; pointer-events: none; position: relative; }
.error-wrapper .error-code { display: flex; font-size: 200rem; font-style: italic; font-weight: 600; gap: 118rem; letter-spacing: -.05em; line-height: 1; pointer-events: none; position: relative; transform: translate(-10px); -webkit-user-select: none; user-select: none; }
.error-wrapper .error-code .logo { height: 156rem; left: 50%; margin: 0 var(--gap-s); position: absolute; top: 50%; transform: translate(-50%, -60%); width: 156rem; }
.error-wrapper .overlay { background: radial-gradient(circle at center, var(--color-bg-dark-transparent) 0, var(--color-bg-dark-transparent) 50%, var(--color-bg-dark) 100%); height: 100%; left: 0; pointer-events: none; position: absolute; top: 0; width: 100%; z-index: 50; }

/* ============================================================= resume */
.resume-page { min-height: 100vh; position: relative; z-index: 1; }

.resume-hero {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 40rem;
  justify-content: center;
  min-height: 100vh;
  padding: var(--grid-margin);
}

.resume-orb {
  position: relative;
  width: 120rem;
  height: 120rem;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.resume-face { position: relative; width: 100%; height: 100%; transition: transform .2s ease-out; }
.resume-face .lottie-animation-container { position: absolute; inset: 0; }
.resume-orb:hover .resume-face { transform: scale(1.06); }
.resume-orb:active .resume-face { transform: scale(.92); }

.resume-tip {
  position: absolute;
  left: calc(100% + 18rem);
  top: 50%;
  width: fit-content;
  height: fit-content;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) scale(.5);
  transform-origin: left center;
  transition: opacity .2s ease-out, transform .5s var(--ease-spring);
}
.tip-bubble { display: block; width: 106rem; height: auto; }
.tip-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-bg-dark);
  font-size: 16rem;
  font-weight: 600;
  letter-spacing: 1rem;
  transform: translateX(4rem) translateY(2rem);
}
.tip-star {
  position: absolute;
  right: -12rem;
  top: -12rem;
  width: 32rem;
  height: auto;
  z-index: -1;
}
@media screen and (hover: hover) and (pointer: fine) {
  .resume-orb:hover .resume-tip { opacity: 1; transform: translateY(-50%) translateY(10rem) scale(1) rotate(-5deg); }
}

.resume-content {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: var(--grid-margin);
}

.resume-placeholder {
  align-items: center;
  border: 1px dashed rgba(255, 255, 255, .2);
  border-radius: 24rem;
  display: flex;
  flex-direction: column;
  gap: 16rem;
  justify-content: center;
  min-height: 60vh;
  max-width: 900rem;
  width: 100%;
}
.resume-placeholder-title { color: var(--color-white); font-size: 24rem; font-weight: 500; margin: 0; }
.resume-placeholder-note { color: var(--color-grey); font-size: 15rem; margin: 0; opacity: .6; }