#projects .stack {
  display: flex;
  flex-direction: column;
}

html[lang="zh-CN"] .creator-home .hero-stage h1,
html[lang="zh-CN"] .creator-home .creator-about h2,
html[lang="zh-CN"] .creator-home .creator-services > h2,
html[lang="zh-CN"] .creator-home .creator-projects > h2 {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: .98;
  padding-block: .08em;
  white-space: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

html[lang="zh-CN"] .creator-home .hero-stage h1,
html[lang="zh-CN"] .creator-home .creator-about h2,
html[lang="zh-CN"] .creator-home .creator-projects > h2 {
  background: linear-gradient(180deg, #727985 0%, #c3d0da 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

html[lang="zh-CN"] .creator-home .hero-stage h1 {
  max-width: 94vw;
  font-size: clamp(48px, 8.5vw, 132px);
  line-height: 1.14;
  padding-block: .14em;
}

html[lang="zh-CN"] .creator-home .creator-about h2,
html[lang="zh-CN"] .creator-home .creator-services > h2,
html[lang="zh-CN"] .creator-home .creator-projects > h2 {
  font-size: clamp(52px, 10.2vw, 156px);
}

html[lang="zh-CN"] .creator-home .about-content {
  width: min(92vw, 980px);
  max-width: 980px;
}

html[lang="zh-CN"] .creator-home .about-statement {
  white-space: nowrap;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: clamp(20px, 2.25vw, 34px);
  line-height: 1.32;
  letter-spacing: -.04em;
  overflow: visible;
  padding-block: .03em;
}

html[lang="zh-CN"] .creator-home .about-statement br {
  display: none;
}

html[lang="zh-CN"] .creator-home .about-summary {
  max-width: min(88vw, 880px);
  margin-inline: auto;
}

html[lang="zh-CN"] .creator-home .service-list h3,
html[lang="zh-CN"] .creator-home .creator-nav,
html[lang="zh-CN"] .creator-home .creator-mark {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

html[lang="zh-CN"] .creator-home .service-list h3 {
  font-weight: 700;
  letter-spacing: -.015em;
}

/* Visual order only: the KOI card and its iframe remain in their original DOM position. */
#projects .koi-card {
  order: 1;
}

#projects .qlwalls-card {
  order: 2;
  box-sizing: border-box;
  padding-bottom: 28px;
  margin-bottom: 28px;
  overflow: hidden;
  border-radius: 48px;
  isolation: isolate;
}

#projects .pdf-portfolio-card {
  order: 3;
}

#projects .qlwalls-card .stack-images {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 16px;
  margin-bottom: 0;
  overflow: hidden;
  border-radius: 35px;
}

#projects .qlwalls-card .stack-images img {
  width: 100%;
  height: 100%;
  min-width: 0;
  border-radius: 35px;
  object-position: center;
  background: #010b03;
  overflow: hidden;
}

#projects .qlwalls-card .stack-images img:first-child {
  object-fit: contain;
}

#projects .qlwalls-card .stack-images img:last-child {
  object-fit: cover;
}

#projects .koi-motion-frame--homepage-original-stage {
  position: relative;
  overflow: hidden;
  background: #000;
}

#projects .koi-motion-frame--homepage-original-stage > iframe {
  border: 0;
  background: #000;
}

#projects .koi-motion-preview .koi-motion-frame > video,
.creator-marquee .marquee-tile--koi-system-reveal-video > video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  border: 0;
}

#projects .koi-motion-preview .koi-motion-frame > iframe {
  display: none !important;
}

/* Only the lightweight gradient KOI motion is retained in the homepage carousel. */
.creator-marquee .marquee-tile:has(iframe),
.creator-marquee .marquee-tile:has(video[src*="/original/koi/"]) { display: none; }
.creator-marquee .marquee-tile--koi-gradient-motion { display: block !important; background: #030305; }
.creator-marquee .marquee-tile--koi-gradient-motion .koi-motion-frame,
.creator-marquee .marquee-tile--koi-gradient-motion iframe { display: block; width: 100%; height: 100%; border: 0; background: #030305; }
/* Each KOI motion retains its own square stage: card height is the limiting size,
   while the stage stays centred and is never stretched to the card width. */
.creator-marquee .marquee-tile--koi-gradient-motion { display: grid !important; place-items: center; }
.creator-marquee .marquee-tile--koi-gradient-motion .koi-motion-frame--marquee-square {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0 auto;
  overflow: hidden;
}
.creator-marquee .marquee-tile--koi-gradient-motion .koi-motion-frame--marquee-square iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 900px !important;
  height: 900px !important;
  max-width: none;
  transform: translate(-50%, -50%) scale(var(--koi-motion-scale, .22));
  transform-origin: center;
}
.creator-marquee .marquee-tile[data-marquee-motion-poster="true"] .marquee-motion-poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #030305;
}
.creator-marquee .marquee-tile--flaget img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.creator-marquee .marquee-tile--koi-construction img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.creator-marquee .marquee-tile--qlwalls-title img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.creator-marquee .marquee-tile--paige-applications img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.creator-marquee .marquee-tile--he-xiangjian-cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.creator-marquee .marquee-tile--flaget-h5-map img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }

/* Homepage project covers always crop to the card rather than letterbox. */
.creator-marquee .marquee-tile { overflow: hidden; border-radius: 24px; }
.creator-marquee .marquee-tile > img { display: block; width: 100%; max-width: none; height: 100%; object-fit: cover; object-position: center; }
/* One duplicate run is enough for an exact, natural loop. The distance is
   measured from the first original tile to its first repeat at runtime. */
.creator-marquee .row-one[data-seamless-loop="true"] { animation: marquee-loop-right 34s linear infinite; }
.creator-marquee .row-two[data-seamless-loop="true"] { animation: marquee-loop-left 38s linear infinite; }
@keyframes marquee-loop-right {
  from { transform: translate3d(var(--marquee-loop-distance), 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}
@keyframes marquee-loop-left {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(var(--marquee-loop-distance), 0, 0); }
}
.brand-identity-board { overflow: hidden; background: #0b1537; }
.brand-identity-board img { object-fit: cover; object-position: center; }

@media (max-width: 700px) {
  #projects .qlwalls-card {
    padding-bottom: 18px;
    margin-bottom: 28px;
    border-radius: 30px;
  }

  #projects .qlwalls-card .stack-images {
    gap: 8px;
    border-radius: 22px;
  }

  #projects .qlwalls-card .stack-images img {
    border-radius: 22px;
  }
}

/* Brand studies: one quiet gallery frame, two distinct identity worlds. */
#projects .brand-identity-card {
  color: #edf3ff !important;
  background: #111622 !important;
  overflow: hidden;
  isolation: isolate;
}

#projects .brand-identity-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 88% 0%, rgba(65, 118, 255, .24), transparent 35%), linear-gradient(115deg, rgba(28, 56, 137, .18), transparent 48%);
}

.brand-identity-card > * { position: relative; }

.brand-identity-head { grid-template-columns: 60px 1fr auto; }
.brand-identity-head .brand-identity-label { grid-column: 2; grid-row: 1; }
.brand-identity-head .brand-identity-kicker { grid-column: 2; grid-row: 2; color: #a9c0ff; letter-spacing: .12em; font: 10px DM Mono, monospace; }
.brand-identity-view-all { grid-column: 3; grid-row: 1 / span 2; align-self: center; justify-self: end; border-color: #7e8dff; text-decoration: none; }
.brand-identity-view-all:focus-visible { outline: 2px solid #f6ec64; outline-offset: 3px; }

.brand-identity-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: end;
  margin: 42px 0 28px;
}

.brand-identity-title { margin: 0; font-size: clamp(34px, 5.1vw, 72px); line-height: .86; letter-spacing: -.07em; }
.brand-identity-type { color: #a9c0ff; margin: 14px 0 0; font: 10px DM Mono, monospace; letter-spacing: .1em; text-transform: uppercase; }
.brand-identity-copy { max-width: 510px; margin: 0; font-size: 15px; line-height: 1.65; color: #c8d2e3; }

.brand-identity-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.brand-identity-tabs button {
  appearance: none;
  color: #b9c7dc;
  border: 1px solid rgba(208, 223, 247, .24);
  border-radius: 999px;
  background: rgba(7, 11, 20, .5);
  padding: 10px 16px;
  font: 500 11px DM Mono, monospace;
  letter-spacing: .06em;
  cursor: pointer;
  transition: color .22s ease, border-color .22s ease, background .22s ease, transform .22s ease;
}
.brand-identity-tabs button:hover { color: #fff; border-color: rgba(255,255,255,.72); transform: translateY(-2px); }
.brand-identity-tabs button.is-active { color: #07111f; border-color: #eef6ff; background: #eef6ff; }
.brand-identity-tabs button:focus-visible { outline: 2px solid #f6ec64; outline-offset: 3px; }

.brand-identity-board {
  height: 650px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(225, 236, 255, .14);
  border-radius: 34px;
  background: #0a0d13;
}
.brand-identity-board::after { content: ""; position: absolute; inset: auto 0 0; height: 28%; pointer-events: none; background: linear-gradient(transparent, rgba(7, 11, 20, .72)); }
.brand-identity-board img { width: 100%; height: 100%; object-fit: cover; object-position: center; border-radius: 0; display: block; animation: brand-board-in .42s cubic-bezier(.2,.8,.2,1); }
.brand-identity-board span { position: absolute; z-index: 1; right: 18px; bottom: 16px; color: #f2f6ff; letter-spacing: .12em; font: 9px DM Mono, monospace; }

.brand-identity-card[data-active-project="paige"] .brand-identity-board { background: #164bf2; }
.brand-identity-card[data-active-project="flaget"] .brand-identity-board { background: #ffe970; }
.brand-identity-card[data-active-project="heXiangjian"] .brand-identity-board { background: #05070b; }
.brand-identity-card[data-active-project="flagetH5"] .brand-identity-board { background: #0c83f2; }
.brand-identity-card[data-active-project="koiK1"] .brand-identity-board { background: #08090c; }

/* Keep Flaget flush with the board: no artificial inset or pale frame. */
.brand-identity-card[data-active-project="flaget"] .brand-identity-board img {
  width: 100%;
  margin-left: 0;
  object-position: center;
  transform: none;
}
@keyframes brand-board-in { from { opacity: .15; transform: scale(1.025); } to { opacity: 1; transform: scale(1); } }

html[lang="zh-CN"] .brand-identity-title,
html[lang="zh-CN"] .brand-identity-copy,
html[lang="zh-CN"] .brand-identity-tabs button { font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif; }

@media (max-width: 700px) {
  .brand-identity-head { grid-template-columns: 40px 1fr; }
  .brand-identity-head .brand-identity-kicker { grid-column: 2; font-size: 8px; }
  .brand-identity-view-all { grid-column: 1 / -1; grid-row: 3; justify-self: start; }
  .brand-identity-intro { display: block; margin: 30px 0 22px; }
  .brand-identity-title { font-size: clamp(36px, 11vw, 54px); }
  .brand-identity-type { margin: 11px 0 20px; font-size: 8px; }
  .brand-identity-copy { font-size: 13px; }
  .brand-identity-tabs { gap: 6px; margin-bottom: 12px; }
  .brand-identity-tabs button { padding: 9px 12px; font-size: 9px; }
  .brand-identity-board { height: 440px; border-radius: 22px; }
  .brand-identity-card[data-active-project="flaget"] .brand-identity-board img { width: 100%; margin-left: 0; transform: none; }
  .brand-identity-board span { right: 12px; bottom: 11px; font-size: 8px; }
}
