@font-face {
  font-family: 'GeistMono';
  src: url('font.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }

/* ── Variables ── */
:root {
  --bg: #0d0d0d;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, 0.52);
  --border: rgba(255, 255, 255, 0.1);
  --highlight: #ffffff;
  --card-bg: #131313;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-shadow: transparent;
  --separator: rgba(255, 255, 255, 0.1);
  --signature-filter: invert(1) brightness(1.2);
}

body.dark {
  --bg: #0f0f10;
  --fg: #e8e8e8;
  --muted: rgba(255, 255, 255, 0.45);
  --border: rgba(255, 255, 255, 0.15);
  --highlight: #ffffff;
  --card-bg: #1a1a1c;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-shadow: transparent;
  --separator: rgba(255, 255, 255, 0.8);
  --signature-filter: invert(1) brightness(1.2);
}

body.light {
  --bg: #f7f7f3;
  --fg: #111312;
  --muted: rgba(17, 19, 18, 0.52);
  --border: rgba(17, 19, 18, 0.12);
  --highlight: #111312;
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-border: rgba(17, 19, 18, 0.1);
  --card-shadow: transparent;
  --separator: rgba(17, 19, 18, 0.14);
  --signature-filter: none;
}

body {
  background: var(--bg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--fg);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.12s ease-out, color 0.12s ease-out;
}

.theme-grid-transition {
  position: fixed;
  inset: 0;
  z-index: 90;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

body.theme-changing * {
  transition-duration: 0.12s;
  transition-timing-function: ease-out;
}

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

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

/* ── Page Container ── */
.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 156px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
  z-index: 20;
}

.site-topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: rgba(255,255,255,0.36);
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.light .site-topbar,
body.light .section-label,
body.light .project-index {
  color: rgba(17,19,18,0.42);
}

.clock-group,
.top-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-time {
  font-variant-numeric: tabular-nums;
}

.top-links {
  justify-content: flex-end;
}

.top-links a {
  color: rgba(255,255,255,0.52);
  transition: color 0.15s ease;
}

.top-links a:hover {
  color: #fff;
}

body.light .top-links a {
  color: rgba(17,19,18,0.58);
}

body.light .top-links a:hover {
  color: #111312;
}

.home-stack {
  display: flex;
  flex-direction: column;
  gap: 52px;
  padding-top: 30px;
}

.intro-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Profile Photos ── */
.profile-photos {
  position: relative;
  width: 64px;
  height: 64px;
}

.profile-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 0;
  object-fit: cover;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 1;
  user-select: none;
  filter: grayscale(100%);
  image-rendering: -webkit-optimize-contrast;
}

h1 {
  color: var(--fg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: 0.01em;
}

.intro-copy {
  max-width: 620px;
  color: rgba(255,255,255,0.76);
  font-size: 17px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0.01em;
  text-wrap: pretty;
}

.intro-muted {
  color: rgba(255,255,255,0.48);
}

body.light .intro-copy {
  color: rgba(17,19,18,0.78);
}

body.light .intro-muted {
  color: rgba(17,19,18,0.52);
}

.intro-copy a,
.footer a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  background-image: repeating-linear-gradient(to right, rgba(255,255,255,0.28) 0, rgba(255,255,255,0.28) 2px, transparent 2px, transparent 5px);
  background-position: bottom right;
  background-repeat: no-repeat;
  background-size: calc(100% - 3px) 1px;
  padding-bottom: 4px;
}

body.light .intro-copy a,
body.light .footer a {
  color: #111312;
  background-image: repeating-linear-gradient(to right, rgba(17,19,18,0.32) 0, rgba(17,19,18,0.32) 2px, transparent 2px, transparent 5px);
}

.section-label {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: rgba(255,255,255,0.36);
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* ── Text Sections ── */
.section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.text-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.text-row span { white-space: pre; }
.text-muted { color: var(--muted); }
.text-highlight { color: var(--highlight); font-weight: 500; }

/* ── Dashed Separator ── */
.separator {
  width: 100%;
  height: 1px;
  border: none;
  border-top: 1px dashed var(--separator);
}

/* ── Project Cards ── */
.projects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.project-card {
  display: grid;
  grid-template-columns: 36px 74px minmax(0, 1fr) 18px;
  position: relative;
  min-height: 96px;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.2s ease;
  text-decoration: none;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-2px);
  background: #191919;
  border-color: rgba(255,255,255,0.16);
}

body.light .project-card:hover {
  background: rgba(255,255,255,0.94);
  border-color: rgba(17,19,18,0.18);
}

.project-index {
  align-self: start;
  color: rgba(255,255,255,0.35);
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.project-thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
}

.project-html-thumb {
  display: block;
  border: 0;
  pointer-events: none;
  overflow: hidden;
}

.nexu-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.nexu-thumb svg {
  width: 100%;
  height: 100%;
  display: block;
}

.nexu-blobs {
  transform: translate(0px, 130px);
}

.nexu-card:hover .nexu-blobs {
  animation: nexu-sweep 2.8s cubic-bezier(0.42, 0, 0.58, 1) forwards;
}

@keyframes nexu-sweep {
  0%   { transform: translate(0px, 130px); }
  35%  { transform: translate(0px, -320px); }
  100% { transform: translate(0px, -320px); }
}

.project-info { width: 100%; min-width: 0; padding-right: 0; }
.project-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-desc {
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Nexu blob (goo-merged dark shapes) ── */
.nexu-blob {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  height: auto;
  margin-top: 8px;
  overflow: visible;
  border-radius: 999px;
  background: transparent;
}

.blob-fg {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.blob-bg-svg {
  width: 100%;
  height: 38px;
  display: block;
  color: var(--fg);
  pointer-events: none;
  overflow: visible;
}

.blob-circle-fg {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.blob-circle-fg img {
  width: 20px;
  height: 20px;
  display: block;
  filter: brightness(0) invert(1);
}

.blob-pill-fg {
  height: 28px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 0 4px;
  margin-left: 0;
  flex: none;
  justify-content: flex-start;
  min-width: 0;
  overflow: hidden;
  border-radius: 999px;
  background: #202221;
}

.tag-pills-inner {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  height: 22px;
  padding: 0 3px;
  min-width: 0;
}

.tag-pill {
  position: relative;
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.tag-pill + .tag-pill::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 1px;
  background: rgba(255,255,255,0.20);
}

.project-tagline.nexu-blob { margin-top: 6px; }
.project-tagline .tag-pill { font-size: 13px; padding: 0 14px; }
.project-tagline .tag-pills-inner { height: 28px; }
.project-arrow {
  flex-shrink: 0;
  color: rgba(255,255,255,0.45);
}
.project-arrow svg { width: 14px; height: 14px; }

body.light .project-arrow {
  color: rgba(17,19,18,0.45);
}

/* ── Social Links Row ── */
.social-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  transition: color 0.2s;
}

.social-link:hover { color: var(--fg); }
.social-link svg { width: 16px; height: 16px; }

/* ── Footer ── */
.footer {
  color: rgba(255,255,255,0.38);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

body.light .footer {
  color: rgba(17,19,18,0.42);
}

.footer a {
  color: #fff;
}

.footer a:hover { opacity: 0.7; }

@media (prefers-reduced-motion: reduce) {
  body,
  body.theme-changing * {
    transition-duration: 0.01ms !important;
  }

  .theme-grid-transition {
    display: none;
  }

}

/* ── Signature ── */
.signature { text-align: center; }

.signature img {
  width: 104px;
  height: auto;
  opacity: 0.7;
  display: inline-block;
  filter: var(--signature-filter);
}

.project-signature img {
  opacity: 1;
  filter: brightness(0) invert(1);
}

/* ── Back Button (project pages) ── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  width: fit-content;
  transition: color 0.2s, transform 0.2s;
}

.back-btn:hover { color: var(--fg); transform: translateX(-2px); }
.back-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Project page content ── */
.project-hero {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.2s;
}

.project-hero:hover {
  transform: translateY(-2px);
}

.project-hero img {
  width: 60%;
  height: auto;
  object-fit: contain;
}

.project-hero img.nexu-hero-logo {
  width: 22%;
  max-width: 140px;
}

.project-hero .project-hero-nexu {
  width: 22%;
  max-width: 140px;
  display: block;
}

.project-hero:hover .project-hero-nexu .nexu-blobs,
.project-hero-nexu:hover .nexu-blobs {
  animation: project-nexu-sweep 3.2s cubic-bezier(0.42, 0, 0.58, 1) infinite;
}

.project-hero img.lovart-hero-logo {
  width: 72%;
  max-width: 420px;
}

.project-hero-lovart {
  padding: 0 72px;
}

.project-lovart-hero {
  width: min(420px, 100%);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 22px;
}

.project-lovart-icon {
  width: 72px;
  height: 72px;
  border: 0;
  flex: 0 0 auto;
  pointer-events: none;
}

.project-lovart-wordmark {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 320px;
  height: auto;
  display: block;
}

.project-animation-hero {
  width: min(220px, 52%);
  aspect-ratio: 1 / 1;
  border: 0;
  pointer-events: none;
}

@keyframes project-nexu-sweep {
  0%   { transform: translate(0px, 70px); }
  48%  { transform: translate(0px, -320px); }
  100% { transform: translate(0px, 70px); }
}

.project-title {
  font-size: 28px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.project-tagline {
  color: var(--muted);
  font-size: 14px;
  margin-top: -8px;
}

.project-body p {
  color: var(--fg);
  line-height: 1.7;
  font-size: 15px;
}

.project-body-images {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.project-body-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.page::after {
  content: "";
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  width: min(320px, calc(100vw - 32px));
  height: 36px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 36px, rgba(255,255,255,0.08) 36px, rgba(255,255,255,0.08) 37px, transparent 37px),
    linear-gradient(90deg, transparent 117px, rgba(255,255,255,0.08) 117px, rgba(255,255,255,0.08) 118px, transparent 118px),
    #111;
  transform: translateX(-50%);
  pointer-events: none;
  display: none;
}

.page::before {
  content: "Craft    Work    Life";
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 31;
  width: min(320px, calc(100vw - 32px));
  color: rgba(255,255,255,0.62);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
  display: none;
}

.project-meta {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px 20px;
  font-size: 13px;
}

.project-meta dt { color: var(--muted); }
.project-meta dd { color: var(--fg); }

/* ── Mobile ── */
@media (max-width: 640px) {
  .page { padding: 18px 16px 132px; gap: 26px; }
  body { font-size: 14px; }
  .project-title { font-size: 22px; }
  .site-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .home-stack {
    gap: 42px;
    padding-top: 24px;
  }
  .project-card {
    grid-template-columns: 28px 54px minmax(0, 1fr) 16px;
    min-height: 82px;
    gap: 12px;
    padding: 10px;
  }
  .project-thumb {
    width: 50px;
    height: 50px;
  }
  .project-name { font-size: 13px; }
  .project-desc { font-size: 11px; }
  .intro-copy {
    font-size: 16px;
    line-height: 23px;
  }
}

@media (min-width: 641px) and (max-height: 760px) {
  .page {
    padding-top: 18px;
  }
  .home-stack {
    gap: 34px;
    padding-top: 20px;
  }
  .intro-panel {
    gap: 12px;
  }
  .profile-photos,
  .profile-photo {
    width: 56px;
    height: 56px;
  }
  .project-card {
    min-height: 82px;
  }
  .project-thumb {
    width: 54px;
    height: 54px;
  }
}

/* ── Sunlit Effect (jackyzha0/sunlit) ── */
body {
  --sl-shadow: #2a2a2a;
  --sl-bounce: #c9c9c9;
  --sl-timing: cubic-bezier(0.455, 0.190, 0.000, 0.985);
}
body.sl-dark {
  --sl-shadow: #030307;
  --sl-bounce: #1b293f;
}

#dappled-light {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  display: none;
}
#glow {
  position: absolute;
  background: linear-gradient(309deg, var(--sl-bounce), var(--sl-bounce) 20%, transparent);
  transition: background 1.0s var(--sl-timing);
  height: 100%; width: 100%; opacity: 0.28;
}
#glow-bounce {
  position: absolute;
  background: linear-gradient(355deg, var(--sl-bounce) 0%, transparent 30%);
  transition: background 1.0s var(--sl-timing);
  opacity: 0.28; height: 100%; width: 100%; bottom: 0;
}
.sl-perspective {
  position: absolute;
  transition: transform 1.7s var(--sl-timing), opacity 4s ease;
  top: -30vh; right: 0;
  width: 80vw; height: 130vh;
  opacity: 0.07;
  transform-origin: top right;
  transform-style: preserve-3d;
  transform: matrix3d(
    0.7500,-0.0625,0.0000,0.0008,
    0.0000, 1.0000,0.0000,0.0000,
    0.0000, 0.0000,1.0000,0.0000,
    0.0000, 0.0000,0.0000,1.0000);
}
body.sl-dark .sl-perspective {
  opacity: 0.3;
  transform: matrix3d(
    0.8333, 0.0833,0.0000,0.0003,
    0.0000, 1.0000,0.0000,0.0000,
    0.0000, 0.0000,1.0000,0.0000,
    0.0000, 0.0000,0.0000,1.0000);
}
#leaves {
  position: absolute;
  background-size: cover; background-repeat: no-repeat;
  bottom: -20px; right: -700px;
  width: 1600px; height: 1400px;
  background-image: url('leaves.png');
  filter: grayscale(1) saturate(0) opacity(0.35) url(#wind);
  animation: sl-billow 8s ease-in-out infinite;
}
#blinds { position: relative; width: 100%; }
#blinds .shutter, #blinds .bar { background-color: var(--sl-shadow); }
#blinds > .shutters {
  display: flex; flex-direction: column; align-items: end;
  gap: 60px; transition: gap 1.0s var(--sl-timing);
}
body.sl-dark #blinds > .shutters { gap: 20px; }
#blinds > .vertical {
  top: 0; position: absolute; height: 100%; width: 100%;
  display: flex; justify-content: space-around;
}
.vertical > .bar { width: 5px; height: 100%; }
.shutter { width: 100%; height: 40px; transition: height 1.0s var(--sl-timing); }
body.sl-dark .shutter { height: 80px; }
#progressive-blur { position: absolute; height: 100%; width: 100%; }
#progressive-blur > div {
  position: absolute; height: 100%; width: 100%; inset: 0;
  backdrop-filter: blur(var(--blur-amount));
  mask-image: linear-gradient(252deg, transparent, transparent var(--stop1), black var(--stop2), black);
}
#progressive-blur > div:nth-child(1) { --blur-amount: 6px;  --stop1: 0%;  --stop2: 0%;  }
#progressive-blur > div:nth-child(2) { --blur-amount: 12px; --stop1: 40%; --stop2: 80%; }
#progressive-blur > div:nth-child(3) { --blur-amount: 48px; --stop1: 40%; --stop2: 70%; }
#progressive-blur > div:nth-child(4) { --blur-amount: 96px; --stop1: 70%; --stop2: 80%; }
@keyframes sl-billow {
  0%   { transform: perspective(400px) rotateX(0deg)  rotateY(0deg)  scale(1);    }
  25%  { transform: perspective(400px) rotateX(1deg)  rotateY(2deg)  scale(1.02); }
  50%  { transform: perspective(400px) rotateX(-4deg) rotateY(-2deg) scale(0.97); }
  75%  { transform: perspective(400px) rotateX(1deg)  rotateY(-1deg) scale(1.04); }
  100% { transform: perspective(400px) rotateX(0deg)  rotateY(0deg)  scale(1);    }
}

/* Home projects: one shared card with inset dividers. */
.work-section .section-label {
  margin-bottom: 18px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: #797981;
}
.work-section .section-label > :last-child {
  font-size: 12px;
}
.work-section .projects {
  gap: 0;
  padding: 8px 18px;
  border: 1px solid #e5e5e7;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.025);
  overflow: hidden;
}
.work-section .project-card {
  grid-template-columns: 48px minmax(0, 1fr);
  min-height: 108px;
  gap: 20px;
  padding: 24px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  transform: none;
}
.work-section .project-card + .project-card {
  border-top: 1px solid #eeeeef;
}
.work-section .project-card:hover {
  background: #fafafa;
}
.work-section .project-card:focus-visible {
  outline: 2px solid #777780;
  outline-offset: -3px;
  border-radius: 8px;
}
.work-section .project-index,
.work-section .project-arrow {
  display: none;
}
.work-section .project-thumb {
  width: 48px;
  height: 48px;
}
.work-section .project-name {
  color: #1c1c20;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
}
.work-section .project-desc {
  margin-top: 5px;
  color: #797981;
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
}
@media (max-width: 640px) {
  .work-section .projects { padding: 4px 14px; }
  .work-section .project-card {
    grid-template-columns: 44px minmax(0, 1fr);
    min-height: 100px;
    gap: 16px;
    padding: 20px 4px;
  }
  .work-section .project-thumb { width: 44px; height: 44px; }
  .work-section .project-name { font-size: 15px; }
  .work-section .project-desc { font-size: 13px; }
}
