/* ============================================================
   Home effects: full-screen project backdrop, lifted hovered strip,
   custom logo support. All state lives in CSS variables so the hot
   path is compositor-only (no per-frame layout, no animated blur).
   ============================================================ */

/* ---------- legacy counter (superseded by LUMIDOT opening below) ---------- */
body:not(:has(#nav)) #load:not(:empty){
  z-index: 10001;
  position: fixed;
  top: 50%;
  left: 50%;
  min-width: 132px;
  padding: 27px 20px 15px 17px;
  box-sizing: border-box;
  border-left: 1px solid currentColor;
  border-top: 1px solid currentColor;
  background:
    linear-gradient(currentColor,currentColor) 100% 0 / 28px 1px no-repeat,
    linear-gradient(currentColor,currentColor) 0 100% / 28px 1px no-repeat,
    linear-gradient(135deg, rgba(20,20,20,.32), rgba(20,20,20,.08));
  font-size: 58px;
  line-height: 48px;
  letter-spacing: -.035em;
  text-shadow: 0 5px 18px rgba(0,0,0,.24);
  isolation: isolate;
  transform: translate(-50%,-50%);
}
body:not(:has(#nav)) #load:not(:empty)::before{
  content: "LOADING  /  LUMIDOT";
  position: absolute;
  top: 8px;
  left: 17px;
  font-family: "jws", sans-serif;
  font-size: 7px;
  line-height: 9px;
  letter-spacing: .16em;
  white-space: nowrap;
  opacity: .76;
}
body:not(:has(#nav)) #load:not(:empty)::after{
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: fx-load-pulse 1.15s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes fx-load-pulse{
  0%,100%{ opacity: .28; transform: scale(.7); }
  50%{ opacity: 1; transform: scale(1); }
}
/* The navigation is created when the site enters its rendered view. */
body:has(#nav) #load{ display: none !important; }

/* Hallmark · component: opening · theme: existing LUMIDOT
 * pre-emit critique: P4 H5 E4 S5 R5 V4 */
:root{
  --lumi-paper: #141414;
  --lumi-ink: #bac4b8;
  --lumi-muted: #899187;
  --lumi-font: "jws", sans-serif;
  --lumi-logo-font: "TNY", sans-serif;
  --lumi-red: #d7867c;
  --lumi-orange: #dca36e;
  --lumi-gold: #d6c382;
  --lumi-green: #a5be94;
  --lumi-cyan: #83b9b5;
  --lumi-blue: #899fc9;
  --lumi-violet: #b39ac7;
  --lumi-ease: cubic-bezier(.16,1,.3,1);
}
#load, #fxload{ display:none !important; }
#lumi-opening{
  position:fixed; inset:0; z-index:2147483000;
  background:var(--lumi-paper); color:var(--lumi-ink);
  font-family:var(--lumi-font); overflow:clip;
  transition:transform .85s cubic-bezier(.76,0,.24,1);
}
.lumi-stage{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.lumi-aperture{ width:min(44vw,280px); height:100px; display:flex; align-items:center; justify-content:center; gap:7px; margin-bottom:32px; }
.lumi-aperture i{ display:block; width:2px; height:72px; background:currentColor; transform:scaleY(.04); opacity:0; animation:lumi-focus 1.3s var(--lumi-ease) var(--lumi-enter, .1s) both, lumi-wave 1.8s cubic-bezier(.45,0,.55,1) calc(1.3s + var(--lumi-enter, .1s)) infinite; }
.lumi-aperture i:nth-child(1),.lumi-aperture i:nth-child(7){ height:24px; }
.lumi-aperture i:nth-child(2),.lumi-aperture i:nth-child(6){ height:48px; }
.lumi-aperture i:nth-child(3),.lumi-aperture i:nth-child(5){ height:80px; }
.lumi-aperture i:nth-child(1){ --lumi-enter:.1s; }
.lumi-aperture i:nth-child(2){ --lumi-enter:.18s; }
.lumi-aperture i:nth-child(3){ --lumi-enter:.26s; }
.lumi-aperture i:nth-child(4){ height:100px; --lumi-enter:.34s; }
.lumi-aperture i:nth-child(5){ --lumi-enter:.42s; }
.lumi-aperture i:nth-child(6){ --lumi-enter:.5s; }
.lumi-aperture i:nth-child(7){ --lumi-enter:.58s; }
.lumi-word{ font-family:var(--lumi-logo-font); font-size:clamp(88px,16vw,160px); letter-spacing:-.02em; line-height:.95; animation:lumi-type .9s .35s var(--lumi-ease) both; }
.lumi-aperture i:nth-child(1){ color:var(--lumi-red); }
.lumi-aperture i:nth-child(2){ color:var(--lumi-orange); }
.lumi-aperture i:nth-child(3){ color:var(--lumi-gold); }
.lumi-aperture i:nth-child(4){ color:var(--lumi-green); }
.lumi-aperture i:nth-child(5){ color:var(--lumi-cyan); }
.lumi-aperture i:nth-child(6){ color:var(--lumi-blue); }
.lumi-aperture i:nth-child(7){ color:var(--lumi-violet); }
.lumi-word span{ display:inline-block; margin-left:.05em; }
.lumi-caption{ margin-top:20px; font-size:9px; letter-spacing:.3em; color:var(--lumi-muted); animation:lumi-type .8s .65s var(--lumi-ease) both; }
.lumi-foot{ position:absolute; left:clamp(24px,4vw,64px); right:clamp(24px,4vw,64px); bottom:32px; display:flex; align-items:center; gap:16px; justify-content:space-between; font-size:9px; letter-spacing:.12em; }
.lumi-status{ color:var(--lumi-muted); }
.lumi-foot button{ font:inherit; letter-spacing:inherit; color:inherit; background:transparent; border:1px solid currentColor; min-height:44px; padding:0 16px; cursor:pointer; }
.lumi-foot button[hidden]{ display:none; }
.lumi-foot button:focus-visible{ outline:2px solid currentColor; outline-offset:4px; }
@media(hover:hover){ .lumi-foot button:hover{ opacity:.75; } }
.lumi-foot button:active{ transform:translateY(1px); }
#lumi-opening.is-leaving{ transform:translateY(-101%); pointer-events:none; }
#lumi-opening.is-leaving .lumi-stage{ opacity:0; transform:translateY(-24px); transition:opacity .3s,transform .5s var(--lumi-ease); }
@keyframes lumi-focus{ from{ opacity:0; transform:translateX(28px) scaleY(.04); } 45%{ opacity:1; transform:translateX(0) scaleY(.04); } to{ opacity:1; transform:translateX(0) scaleY(1); } }
@keyframes lumi-wave{ 0%,100%{ opacity:1; transform:scaleY(1); } 50%{ opacity:.55; transform:scaleY(.38); } }
@keyframes lumi-type{ from{ opacity:0; transform:translateY(16px); } to{ opacity:1; transform:translateY(0); } }
@media(max-width:414px){ .lumi-foot{ font-size:8px; bottom:24px; flex-wrap:wrap; } .lumi-aperture{ margin-bottom:24px; } }
@media(prefers-reduced-motion:reduce){
  #lumi-opening, #lumi-opening .lumi-stage{ transition:opacity .15s; transform:none; }
  #lumi-opening.is-leaving{ opacity:0; transform:none; }
  .lumi-aperture i,.lumi-word,.lumi-caption{ animation:none; opacity:1; transform:none; }
}

/* ---------- full-screen backdrop (behind the canvas) ---------- */
/* Preserve each uploaded frame's intrinsic proportions inside the viewport-safe stage. */
#w-l .w-l-img{
  position:relative; inset:auto; width:auto; height:auto;
  max-width:100%; max-height:100%; object-fit:contain;
}
#w-l .w-l-bg{ display:none; }
.w-s-img{ object-fit:contain; }

#fxbg{
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0; contain: paint;
  transition: opacity .6s cubic-bezier(.22, 1, .36, 1);
}
#fxbg.on{ opacity: 1; }
/* project pages: the site paints its own hero, so the locked backdrop only adds a hint of colour */
html.fx-work #fxbg.on{ opacity: .42; }
html.fx-work #fxbg .fx-veil{ background: rgba(20,20,20,.34); }

#fxbg .fx-par{
  position: absolute; inset: -9%;
  transform: translate3d(var(--fx-px, 0px), var(--fx-py, 0px), 0);
  transition: transform 1.2s cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
}

/* static blur: only opacity animates, so the blur is rasterised once */
#fxbg .fx-img{
  position: absolute; inset: 0;
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: cover;
  opacity: 0;
  will-change: opacity;
  filter: blur(var(--fx-blur, 30px)) saturate(1.05) brightness(.92);
  transition: opacity var(--fx-fade, 2.2s) cubic-bezier(.33, 0, .2, 1);
}
#fxbg .fx-img.on{ opacity: 1; }

#fxbg .fx-glow{
  position: absolute; inset: 0; opacity: .34; mix-blend-mode: screen;
  background: radial-gradient(80% 70% at 8% 92%, var(--fx-rgb, #5b7f74), transparent 64%);
  transition: opacity .8s ease;
}

#fxbg .fx-veil{
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 100% at 50% 50%, rgba(20,20,20,.02), rgba(20,20,20,.32) 100%),
    linear-gradient(90deg, rgba(20,20,20,.16) 0%, rgba(20,20,20,.05) 42%, rgba(20,20,20,.05) 62%, rgba(20,20,20,.2) 100%);
}

/* ---------- lifted hovered strip (above the canvas, below text) ---------- */
#fxstrip{
  position: fixed; z-index: 0; pointer-events: none;
  left: 0; top: 0; opacity: 0;
  transform: translate3d(var(--fx-x, 0px), calc(var(--fx-y, 0px) + var(--fx-lift, 14px)), 0) scale(var(--fx-scale, .985));
  transition: opacity .45s cubic-bezier(.22, 1, .36, 1), transform 1s cubic-bezier(.22, 1, .36, 1);
  will-change: transform, opacity;
}
#fxstrip.on{ opacity: 1; --fx-lift: -8px; --fx-scale: 1.04; }

#fxstrip .fxs-img{
  position: absolute; inset: 0;
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: cover;
  opacity: 0;
  transform: scale(1.02);
  will-change: opacity, transform;
  transition: opacity .55s cubic-bezier(.22, 1, .36, 1), transform 3.8s cubic-bezier(.16, 1, .3, 1);
}
#fxstrip .fxs-img.on{ opacity: 1; transform: scale(1.09); }

/* the opacity knob only shapes the HOME strips */
html.fx-home #gl{
  opacity: var(--fx-strip-op, 1);
  transition: opacity .45s cubic-bezier(.22, 1, .36, 1);
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
  body:not(:has(#nav)) #load:not(:empty)::after{ animation: none; opacity: .72; }
  #fxbg{ transition-duration: .12s; }
  #fxbg .fx-img{ transition: opacity .12s linear; }
  #fxstrip{ transition: opacity .12s linear; transform: translate3d(var(--fx-x, 0px), var(--fx-y, 0px), 0); }
  #fxstrip.on{ --fx-lift: 0px; --fx-scale: 1; }
  #fxstrip .fxs-img{ transition: opacity .12s linear; transform: none !important; }
}
/* ---------- custom logo ---------- */
.n0-logo{
  display: block;
  width: auto !important;
  max-width: none;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
#t-l .n0-logo{ display: inline-block; vertical-align: -.12em; }

/* ---------- social icons ---------- */

.fx-ic-host{ display: inline-flex !important; align-items: center; gap: 6px; }
#n3 a.fx-ic-host, footer a.fx-ic-host{ gap: 5px; }
svg.fx-ic{
  width: 11px !important; height: 11px !important;
  flex: none; display: inline-block; vertical-align: middle;
  opacity: .9;
}
#n3 svg.fx-ic{ width: 10px !important; height: 10px !important; }




/* ---------- Chinese glyphs only: same families, CJK-only fallback ---------- */
@font-face{
  font-family: "TNY";
  src: local("PingFang SC"), local("Hiragino Sans GB"), local("Microsoft YaHei"),
       local("Noto Sans SC"), local("Noto Sans CJK SC"), local("Source Han Sans SC"),
       local("Heiti SC"), local("SimHei");
  unicode-range: U+2E80-2FFF, U+3000-303F, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF;
  font-display: swap;
}
@font-face{
  font-family: "jws";
  src: local("PingFang SC"), local("Hiragino Sans GB"), local("Microsoft YaHei"),
       local("Noto Sans SC"), local("Noto Sans CJK SC"), local("Source Han Sans SC"),
       local("Heiti SC"), local("SimHei");
  unicode-range: U+2E80-2FFF, U+3000-303F, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF;
  font-weight: 700;
  font-display: swap;
}
@font-face{
  font-family: "jws";
  src: local("PingFang SC"), local("Hiragino Sans GB"), local("Microsoft YaHei"),
       local("Noto Sans SC"), local("Noto Sans CJK SC"), local("Source Han Sans SC"),
       local("Heiti SC"), local("SimHei");
  unicode-range: U+2E80-2FFF, U+3000-303F, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF;
  font-weight: 400;
  font-display: swap;
}

/* ---------- language switch: EN | 中文, sits just left of ABOUT ---------- */
#fxlang{
  white-space: nowrap; flex: none;
  position: fixed; z-index: 6; display: flex; align-items: center; gap: 6px;
  font-family: "jws", system-ui, sans-serif; font-size: 12px; letter-spacing: 0;
  line-height: 12px; color: #bac4b8; opacity: 0; pointer-events: auto;
  transition: opacity .35s ease;
}
#fxlang.ready{ opacity: 1; }
#fxlang a{ color: inherit; text-decoration: none; opacity: .38; transition: opacity .25s ease; cursor: pointer; }
#fxlang a:hover{ opacity: .8; }
#fxlang a.on{ opacity: 1; }
#fxlang i{ font-style: normal; opacity: .22; }
#fxlang .zh{ letter-spacing: .02em; }

/* tagline line spacing: the site sets 10px/10px, which reads cramped in a two-line block */
#n2{ line-height: 15px; }
#n2 > div{ height: 15px; }
#n2 .n2{ line-height: 15px; }

/* mobile / tablet: the switch rides in the footer row */
#fxlang.in-footer{
  position: static; right: auto; left: auto; top: auto; bottom: auto;
  margin: 0 14px; font-size: 11px; letter-spacing: 0; opacity: .75; line-height: 1;
}
#fxlang.in-footer a{ opacity: .5; }
#fxlang.in-footer a.on{ opacity: 1; }


/* ---------- mobile strip gallery ---------- */
.fx-gallery{ display: block; margin: 10vw 0 6vw; }
.fx-gallery-track{
  display: flex; gap: 2.2vw; overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory;
  padding: 0 5.5vw;
}
.fx-gallery-track::-webkit-scrollbar{ display: none; }
.fx-strip{
  flex: 0 0 auto; width: 21vw; height: 62vw; border-radius: 1.2vw;
  background-size: cover; background-position: 50% 50%;
  scroll-snap-align: start; display: block;
  filter: brightness(.94);
  transition: transform .35s cubic-bezier(.22,1,.36,1), filter .35s ease;
}
.fx-strip:active{ transform: scale(.97); filter: brightness(1); }
@media (min-width: 700px){
  .fx-gallery{ margin: 6vw 0 3vw; }
  .fx-strip{ width: 11vw; height: 32vw; }
  .fx-gallery-track{ padding: 0 2.2vw; gap: 1.2vw; }
}

/* ---------- portrait project pages: other projects rail ---------- */
#fxrail{
  position: fixed; right: 10px; top: 50%; transform: translateY(-50%);
  z-index: 5; display: flex; flex-direction: column; gap: 8px;
  max-height: 72vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 6px; border-radius: 10px;
  background: rgba(20,20,20,.28); backdrop-filter: blur(6px);
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
#fxrail::-webkit-scrollbar{ display: none; }
.fx-rail-item{
  width: 44px; height: 64px; flex: 0 0 auto; display: block;
  border-radius: 5px; background-size: cover; background-position: 50% 50%;
  opacity: .55; transition: opacity .3s ease, transform .3s cubic-bezier(.22,1,.36,1);
}
.fx-rail-item:hover, .fx-rail-item:active{ opacity: 1; transform: scale(1.04); }
.fx-rail-item.on{ opacity: 1; box-shadow: 0 0 0 1px rgba(186,196,184,.7); }
@media (min-width: 700px){
  #fxrail{ right: 14px; gap: 10px; }
  .fx-rail-item{ width: 54px; height: 78px; }
}

