@font-face {
  font-family: "tiktok";
  src: url("./assets/fonts/TikTokSans.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "tronica-mono";
  src: url("./assets/fonts/DepartureMono-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "mono";
  src: url("./assets/fonts/GeistMono.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --label: 0, 0, 0;
  --label-d: 54, 54, 48;
  --background-deep: 251, 250, 244;
  --label-1: rgba(var(--label), 1);
  --label-2: rgba(var(--label-d), 0.6);
  --label-3: rgba(var(--label-d), 0.32);
  --label-4: rgba(var(--label-d), 0.18);
  --line: rgba(var(--label-d), 0.1);
  --background-1: rgb(var(--background-deep));
  --background-elevated: #efede7;
  --selection-bg: #c0fe04;
  --cubic-66: cubic-bezier(0.66, 0, 0.01, 1);
  --pad: clamp(16px, 2.9vw, 56px);
  --gutter: clamp(12px, 1.6vw, 24px);
  --font-zh: "PingFang SC", "PingFang TC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.dark {
  --label: 255, 255, 255;
  --label-d: 230, 232, 232;
  --background-deep: 15, 17, 17;
  --label-1: rgba(var(--label), 1);
  --label-2: rgba(var(--label-d), 0.6);
  --label-3: rgba(var(--label-d), 0.32);
  --label-4: rgba(var(--label-d), 0.16);
  --line: rgba(var(--label-d), 0.08);
  --background-1: rgb(var(--background-deep));
  --background-elevated: #191b1b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: "tiktok", sans-serif;
  background: var(--background-1);
  color: var(--label-1);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--selection-bg);
  color: #000;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Bilingual — English on top, Chinese below */
.bilingual-line {
  display: block;
}

.bilingual-line > .en {
  display: block;
}

.zh-sub {
  display: block;
  font-family: var(--font-zh);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.3;
  color: var(--label-2);
  margin-top: 0.18em;
}

/* Scroll shell */
.scroll-shell {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.scroll-shell::-webkit-scrollbar {
  display: none;
}

/* Fixed chrome */
.chrome {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  font-family: "tronica-mono", monospace;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.chrome-top,
.chrome-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 28px var(--pad);
  gap: 16px;
}

.chrome-bottom {
  align-items: center;
}

.chrome a,
.chrome button {
  pointer-events: auto;
}

.brand {
  position: relative;
  padding: 8px;
  font-family: "tiktok", sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
}

.nav {
  display: flex;
  gap: clamp(12px, 2vw, 48px);
  align-items: center;
}

.nav-btn {
  position: relative;
  padding: 8px;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.nav-btn .zh-sub {
  font-size: 11px;
  margin-top: 3px;
  line-height: 1.2;
}

.chrome .status-left .zh-sub,
.chrome .status-mid .zh-sub {
  font-size: 10px;
  margin-top: 2px;
  opacity: 0.75;
}

.brand::before,
.nav-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px dotted transparent;
  pointer-events: none;
  transition: border-color 0.2s ease;
}

.brand:hover::before,
.nav-btn:hover::before,
.nav-btn:focus-visible::before {
  border-color: var(--label-1);
}

.theme-mark,
.sound-mark {
  font-variant-numeric: tabular-nums;
}

.status-left,
.status-mid,
.status-right {
  font-size: 14px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.globe {
  width: 22px;
  height: 22px;
  opacity: 0.85;
}

/* Atmosphere — soft CSS only; blue field comes from WebGL sV pipeline */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--background-1);
}

.atmosphere::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 70% 50% at 20% 5%, rgba(255, 255, 255, 0.7), transparent 55%),
    radial-gradient(ellipse 55% 42% at 85% -5%, rgba(255, 234, 214, 0.35), transparent 52%);
  filter: blur(2px);
  animation: drift 18s ease-in-out infinite alternate;
  opacity: 0.5;
}

.light-rays {
  position: fixed;
  inset: -10%;
  opacity: 0.5;
  pointer-events: none;
  z-index: 2;
  /* Bias bands toward mid-viewport (under hello), not the lower third */
  background:
    linear-gradient(118deg, transparent 22%, rgba(255, 255, 255, 0.5) 40%, transparent 52%),
    linear-gradient(128deg, transparent 34%, rgba(255, 255, 255, 0.28) 46%, transparent 58%),
    linear-gradient(108deg, transparent 12%, rgba(255, 255, 255, 0.22) 28%, transparent 42%);
  background-position: center 48%, center 44%, center 52%;
  background-size: 120% 120%;
  filter: blur(28px);
  mix-blend-mode: soft-light;
  animation: ray-sweep 16s ease-in-out infinite alternate;
}

.hero-underlay {
  position: absolute;
  inset: -8%;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.25s ease;
  opacity: 0;
}

.hero-underlay img {
  display: none;
}

.dark .hero-underlay img {
  opacity: 0.28;
  filter: blur(4px) saturate(1.05) brightness(0.45);
}

.dark .light-rays {
  opacity: 0.35;
  mix-blend-mode: screen;
}

@keyframes ray-sweep {
  from { transform: translate3d(-2%, -14%, 0) rotate(-1deg); }
  to { transform: translate3d(3%, -13%, 0) rotate(1.5deg); }
}

.dark .atmosphere::before {
  background:
    radial-gradient(ellipse 60% 45% at 18% 8%, rgba(80, 120, 180, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 40% at 82% 0%, rgba(120, 90, 180, 0.12), transparent 50%);
}

@keyframes drift {
  from { transform: translate3d(-1%, -1%, 0) scale(1.02); }
  to { transform: translate3d(2%, 1%, 0) scale(1.06); }
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: calc((100% - 2 * var(--pad)) / 3) calc((100% - 56px) / 2);
  background-position: var(--pad) 28px;
  opacity: 0.9;
  mask-image: linear-gradient(#000, #000);
}

.grid-plus {
  position: absolute;
  width: 10px;
  height: 10px;
  color: var(--label-3);
}

.grid-plus::before,
.grid-plus::after {
  content: "";
  position: absolute;
  background: currentColor;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.grid-plus::before {
  width: 9px;
  height: 1px;
}

.grid-plus::after {
  width: 1px;
  height: 9px;
}

/* WebGL + warp stages */
#warp {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

#webgl {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* Page content */
.page {
  position: relative;
  z-index: 3;
}

.section {
  position: relative;
  min-height: 100vh;
  padding: 96px var(--pad) 120px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  padding-top: 96px;
  padding-bottom: 88px;
  gap: 0;
}

.hero-left {
  grid-column: 1 / 8;
  grid-row: 1;
  align-self: start;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 4;
}

.hero-left .role {
  font-family: "tiktok", sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 2vw, 32px);
  line-height: 1.15;
  text-transform: none;
  letter-spacing: -0.01em;
}

.hero-tagline {
  grid-column: 5 / 8;
  justify-self: center;
  text-align: left;
  font-size: 14px;
  line-height: 1.35;
  color: var(--label-2);
  margin-top: 10px;
}

.hero-bio {
  grid-column: 8 / 13;
  font-size: 14px;
  line-height: 1.45;
  color: var(--label-1);
  max-width: 34ch;
  justify-self: end;
  margin-top: 56px;
  position: relative;
}

.hero-bio .redacted {
  display: inline-flex;
  gap: 2px;
  vertical-align: middle;
  margin: 0 2px;
}

.hero-bio .redacted i {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--label-1);
}

.about-copy .zh-sub {
  margin-top: 0.18em;
  font-size: 1em;
  font-weight: 400;
  line-height: 1.3;
  color: var(--label-2);
}

.hero-bio a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-bio a:hover {
  color: var(--label-2);
}

.about-copy .muted .zh-sub {
  opacity: 1;
}

.hero-title {
  align-self: start;
  font-family: "tiktok", sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 2vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: none;
  position: relative;
}

.hero-tagline .zh-sub {
  margin-top: 0.65em;
  font-size: 13px;
}

.hero-bio .zh-sub {
  margin-top: 0.75em;
  font-size: 13px;
  line-height: 1.55;
}

.hero-title .bilingual-line {
  white-space: nowrap;
}

.hero-title .zh-sub {
  font-size: clamp(13px, 2.1svw, 26px);
  margin-top: 0.12em;
  letter-spacing: 0.02em;
}

.hero-title span {
  display: block;
  white-space: nowrap;
}

.stickers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.sticker {
  position: absolute;
  user-select: none;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.12));
  animation: float 7s ease-in-out infinite;
  will-change: transform;
}

/* Layout anchors only — visible stickers live in WebGL so glass can refract them */
.sticker.sticker-dom-ghost {
  opacity: 0 !important;
  filter: none;
  animation: none;
}

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

.sticker-pen {
  width: min(160px, 11vw);
  top: 12%;
  right: 16%;
  animation-delay: 0.2s;
  z-index: 2;
  /* 3D cursor.glb replaces this sticker visually */
  opacity: 0 !important;
  filter: none;
  animation: none;
}

/* Hero sticker anchors — tuned to original particle “still” composition */
.sticker-tiktok {
  width: min(132px, 9.5vw);
  top: 4.5%;
  right: 22%;
  animation-delay: 1.1s;
  z-index: 5;
}
.sticker-badge {
  width: min(148px, 10.5vw);
  top: 18%;
  left: 34%;
  animation-delay: 0.6s;
}
.sticker-year {
  width: min(100px, 7.5vw);
  top: 24%;
  left: 48%;
  animation-delay: 0.8s;
}
.sticker-heart {
  width: min(120px, 8.5vw);
  top: 16%;
  right: 28%;
  animation-delay: 1.4s;
}
.sticker-smile {
  width: min(68px, 5vw);
  top: 50%;
  left: 43%;
  animation-delay: 1.8s;
}
.sticker-eyes {
  width: min(112px, 8vw);
  bottom: 30%;
  right: 36%;
  animation-delay: 1.3s;
}
.sticker-face {
  width: min(86px, 6.5vw);
  top: 46%;
  left: 22%;
  animation-delay: 0.4s;
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(var(--rot, 0deg)); }
  50% { transform: translate3d(0, -10px, 0) rotate(calc(var(--rot, 0deg) + 2deg)); }
}

/* About */
.about {
  min-height: 0;
  padding-top: 32px;
  padding-bottom: 40px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
}

.about-copy {
  grid-column: 1 / 8;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.about-copy p {
  font-family: "tiktok", sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 2vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--label-1);
}

.about-copy .muted {
  color: var(--label-1);
}

.about-copy a {
  text-decoration: underline;
  text-underline-offset: 0.08em;
  text-decoration-color: var(--label-3);
  transition: text-decoration-color 0.15s ease;
}

.about-copy a:hover {
  text-decoration-color: var(--label-1);
}

/* Work */
.work {
  padding-top: 8vh;
  padding-bottom: 16vh;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 28px var(--gutter);
}

.work-card {
  display: block;
  padding: 8px;
}

.work-card .thumb {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: rgba(var(--label-d), 0.03);
  border: 0;
  aspect-ratio: 16 / 9;
  line-height: 0;
}

.work-card .thumb img,
.work-card .thumb iframe.cover-frame {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.66s var(--cubic-66);
}

.work-card .thumb iframe.cover-frame {
  border: 0;
  pointer-events: none;
  background: #003AFF;
}

.work-card:hover .thumb img {
  transform: scale(1.025);
}

.work-card.is-static {
  cursor: default;
}

.work-card.is-static:hover .thumb img {
  transform: none;
}

.badge {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  background: var(--selection-bg);
  color: #000;
  font-family: "tronica-mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
  padding: 2px 4px;
  line-height: 1.4;
}

.badge .zh-sub {
  font-size: 10px;
  margin-top: 2px;
  color: rgba(0, 0, 0, 0.62);
}

.work-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 14px;
  text-transform: uppercase;
  min-width: 0;
}

.work-meta .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-meta .meta-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "tronica-mono", monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.chip {
  border: 1px solid var(--line);
  padding: 1px 6px;
  font-size: 12px;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}

.work-card.span-8 { grid-column: 5 / span 8; }
.work-card.span-6 { grid-column: span 6; }
.work-card.span-4 { grid-column: span 4; }
.work-card.span-3 { grid-column: span 3; }

.work-meta .name .zh-sub {
  font-size: 11px;
  margin-top: 3px;
  text-transform: none;
}

.chip .zh-sub {
  font-size: 10px;
  margin-top: 1px;
}

.statement h2 .zh-sub {
  font-size: clamp(16px, 3.2svw, 48px);
  margin-top: 0.14em;
  mix-blend-mode: difference;
  color: rgba(255, 255, 255, 0.72);
}

.contact-title .zh-sub {
  font-size: clamp(14px, 2.4svw, 42px);
  margin-top: 0.12em;
}

.contact-foot .zh-sub {
  font-size: 11px;
  margin-top: 3px;
  text-transform: none;
}

.contact-links .bilingual-line {
  text-align: center;
}
.work-card.span-8 .thumb,
.work-card.span-6 .thumb,
.work-card.span-4 .thumb,
.work-card.span-3 .thumb {
  aspect-ratio: 16 / 9;
}

.work-card.start-1 { grid-column: 1 / span 4; }
.work-card.start-3 { grid-column: 3 / span 4; }
.work-card.start-5 { grid-column: 5 / span 4; }
.work-card.start-7 { grid-column: 7 / span 4; }
.work-card.start-9 { grid-column: 9 / span 4; }

/* Statement / Contact */
.statement {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 120px var(--pad);
  position: relative;
  z-index: 3;
}

.statement h2 {
  font-size: clamp(48px, 10svw, 160px);
  line-height: 0.9;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  mix-blend-mode: difference;
  color: #fff;
  transition: opacity 0.45s ease;
}

.statement h2 .bilingual-line,
.statement h2 span {
  display: block;
}

.contact {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 120px var(--pad) 100px;
  position: relative;
  z-index: 3;
}

.contact-title {
  align-self: center;
  font-size: clamp(42px, 8svw, 140px);
  line-height: 0.92;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  max-width: 14ch;
  position: relative;
  z-index: 2;
}

.contact-title span {
  display: block;
}

.contact-title .line-1 {
  display: flex;
  gap: 0.55em;
  flex-wrap: wrap;
}

.contact-title .line-1 .bilingual-line {
  display: inline-block;
  vertical-align: top;
}

.contact-copy {
  margin-top: 8px;
  opacity: 0.55;
}

.contact-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  font-family: "tronica-mono", monospace;
  text-transform: uppercase;
  font-size: 14px;
}

.contact-links {
  display: flex;
  gap: 28px;
}

.contact-links a,
.contact-mail {
  position: relative;
  padding: 4px 0;
}

.contact-links a:hover,
.contact-mail:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--background-1);
  transition: opacity 0.45s ease, visibility 0.45s ease;
  pointer-events: none;
}

.loader.hide {
  opacity: 0;
  visibility: hidden;
  display: none;
}

.loader-line {
  width: 48px;
  height: 1px;
  background: var(--label-3);
  position: relative;
  overflow: hidden;
}

.loader-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--label-1);
  transform: translateX(-100%);
  animation: load 1.1s var(--cubic-66) infinite;
}

@keyframes load {
  to { transform: translateX(100%); }
}

@media (max-width: 1024px) {
  .hero {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .hero-bio,
  .hero-tagline,
  .hero-left {
    max-width: none;
    justify-self: start;
    margin-top: 0;
  }


  .about-copy {
    grid-column: 1 / -1;
  }


  .span-8,
  .span-6,
  .span-4,
  .span-3,
  .work-card.span-8,
  .work-card.span-6,
  .work-card.span-4,
  .work-card.span-3,
  .work-card.start-1,
  .work-card.start-3,
  .work-card.start-7,
  .work-card.start-5,
  .work-card.start-9 {
    grid-column: span 12;
  }

  .nav {
    gap: 8px;
  }

  .nav-btn {
    font-size: 12px;
    padding: 6px;
  }

  .sticker-pen { top: 18%; right: 8%; width: 96px; }
  .sticker-year { top: 30%; left: 48%; width: 72px; }
  .sticker-heart { top: 22%; right: 18%; width: 84px; }
  .sticker-tiktok { top: 6%; right: 8%; bottom: auto; width: 96px; }
  .sticker-face { top: 48%; left: 10%; bottom: auto; width: 56px; }
  .sticker-badge { top: 20%; left: 28%; width: 110px; }
  .sticker-eyes { bottom: 34%; right: 28%; width: 90px; }
  .sticker-smile { display: none; }
}

@media (max-width: 640px) {
  .chrome-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-mid {
    display: none;
  }

  .contact-title {
    font-size: 42px;
  }
}
