:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --ink: #1f2433;
  --muted: #6d7280;
  --faint: #e8e9ef;
  --header-bg: rgba(255, 255, 255, 0.94);
  --heading: #2b2f45;
  --body-copy: #525766;
  --card-copy: #5d6372;
  --veil-start: rgba(255, 255, 255, 0.92);
  --veil-mid: rgba(255, 255, 255, 0.58);
  --veil-soft: rgba(255, 255, 255, 0.12);
  --skip-bg: #1f2433;
  --skip-text: #ffffff;
  --icon-tile: #f5f6f8;
  --blue: #1d9bf0;
  --violet: #7c4dff;
  --pink: #e645b5;
  --green: #1faa7a;
  --yellow: #f5c542;
  --orange: #ff8a3d;
  --shadow: 0 20px 60px rgba(31, 36, 51, 0.12);
  --soft-shadow: 0 10px 34px rgba(31, 36, 51, 0.09);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

[data-theme="dark"] {
  --bg: #0d1119;
  --surface: #151b26;
  --ink: #edf1f7;
  --muted: #9aa4b4;
  --faint: #293241;
  --header-bg: rgba(13, 17, 25, 0.94);
  --heading: #f3f5f9;
  --body-copy: #b9c1ce;
  --card-copy: #aeb8c7;
  --veil-start: rgba(13, 17, 25, 0.9);
  --veil-mid: rgba(13, 17, 25, 0.52);
  --veil-soft: rgba(13, 17, 25, 0.1);
  --skip-bg: #edf1f7;
  --skip-text: #0d1119;
  --icon-tile: #eef0f4;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
  --soft-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 8%, rgba(124, 77, 255, 0.09), transparent 28rem),
    radial-gradient(circle at 78% 16%, rgba(29, 155, 240, 0.1), transparent 24rem),
    var(--bg);
  color: var(--ink);
  transition: background-color 240ms ease, color 240ms ease;
}

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

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 4px;
  background: var(--skip-bg);
  color: var(--skip-text);
  font-size: 13px;
  font-weight: 700;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

section[id],
footer[id] {
  scroll-margin-top: 132px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  width: 100%;
  margin: 0;
  padding: 22px max(24px, calc((100vw - 1180px) / 2));
  background: var(--header-bg);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(232, 233, 239, 0.7);
}

.brand {
  display: inline-flex;
  width: fit-content;
  flex-direction: column;
  gap: 2px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand span {
  width: fit-content;
  font-size: 18px;
  line-height: 1;
  background: linear-gradient(120deg, var(--pink), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand small {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 38px;
  font-size: 15px;
  color: var(--body-copy);
}

.main-nav a,
.footer-contact a {
  transition:
    color 180ms ease,
    transform 180ms ease;
}

.main-nav a:hover,
.footer-contact a:hover {
  color: var(--blue);
}

.header-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  font-size: 13px;
  font-weight: 700;
  color: var(--body-copy);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.meta-item svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.theme-toggle {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--faint);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, background-color 240ms ease;
}

.theme-toggle:hover { border-color: var(--blue); }
.theme-toggle:active { transform: scale(0.94); }

.theme-toggle:focus-visible {
  outline: 3px solid rgba(29, 155, 240, 0.36);
  outline-offset: 3px;
}

.theme-icon {
  grid-area: 1 / 1;
  font-size: 18px;
  line-height: 1;
  transition: opacity 180ms ease, transform 240ms ease;
}

.theme-icon-moon,
[data-theme="dark"] .theme-icon-sun {
  opacity: 0;
  transform: rotate(-30deg) scale(0.6);
}

[data-theme="dark"] .theme-icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 360px;
  align-items: center;
  gap: 86px;
  width: min(1120px, calc(100% - 48px));
  min-height: 560px;
  margin: 0 auto;
  padding: 70px 0 82px;
}

.hero-copy {
  max-width: 680px;
}

.hello {
  margin: 0 0 10px;
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 800;
  line-height: 1.04;
  color: #cfd3dc;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(38px, 6.2vw, 78px);
  font-weight: 850;
  line-height: 1.08;
  max-width: 720px;
  color: #cfd3dc;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hero-copy h1 span {
  display: block;
}

.hero-copy h1 .name-line {
  display: block;
  width: fit-content;
  background: linear-gradient(110deg, var(--pink), var(--violet), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-copy h1 .muted-line {
  color: #cfd3dc;
}

.hero-note {
  max-width: 620px;
  margin: 24px 0 0;
  font-size: 18px;
  line-height: 1.85;
  color: var(--muted);
}

.portrait-wrap {
  position: relative;
  width: min(360px, 100%);
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pink), var(--violet), var(--blue));
  box-shadow: var(--shadow);
}

.portrait-wrap::before {
  position: absolute;
  inset: -16px;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(124, 77, 255, 0.2), transparent 68%);
  content: "";
}

.portrait-wrap img {
  width: 100%;
  height: 100%;
  border: 9px solid var(--surface);
  border-radius: inherit;
  object-fit: cover;
  object-position: 48% 35%;
}

.stack-section,
.projects-section,
.poetry-section {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.section-heading {
  margin-bottom: 30px;
}

.section-heading.centered {
  text-align: center;
}

.section-heading p {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.18;
  color: var(--heading);
  overflow-wrap: anywhere;
}

.photo-wall-section {
  width: 100%;
  margin: 0 0 84px;
}

.photo-wall-viewport {
  position: relative;
  height: min(72vh, 760px);
  min-height: 540px;
  overflow: hidden;
  background: var(--bg);
}

.photo-wall-viewport::before {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  height: 42%;
  background: linear-gradient(
    180deg,
    var(--veil-start) 0%,
    var(--veil-mid) 36%,
    var(--veil-soft) 78%,
    transparent 100%
  );
  content: "";
  pointer-events: none;
}

.photo-wall-track {
  display: flex;
  width: min(1380px, calc(100% - 28px));
  flex-direction: column;
  margin: 0 auto;
  animation: photo-wall-descend 72s linear infinite;
  will-change: transform;
}

.photo-wall-sequence {
  flex: none;
  padding: 7px 0;
  column-count: 4;
  column-gap: 14px;
}

.photo-wall-sequence figure {
  overflow: hidden;
  margin: 0 0 14px;
  break-inside: avoid;
  border-radius: 4px;
  background: #edf0f5;
}

.photo-wall-sequence img {
  width: 100%;
  height: auto;
  transition: filter 300ms ease;
}

.photo-wall-track.is-unavailable,
.photo-wall-loading {
  display: grid;
  min-height: 540px;
  place-items: center;
  margin: 0;
  color: var(--muted);
}

@keyframes photo-wall-descend {
  from {
    transform: translateY(-50%);
  }
  to {
    transform: translateY(0);
  }
}

.stack-section {
  padding: 42px 0 118px;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(88px, 1fr));
  gap: 26px 30px;
  align-items: center;
  justify-items: center;
  margin-top: 50px;
}

.stack-item {
  display: flex;
  width: 96px;
  height: 106px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(232, 233, 239, 0.9);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(31, 36, 51, 0.06);
}

.tool-icon-image {
  width: 48px;
  height: 48px;
  padding: 5px;
  border-radius: 12px;
  background: var(--icon-tile);
  object-fit: contain;
  box-shadow: inset 0 0 0 1px rgba(31, 36, 51, 0.08);
}

.tool-icon-image--dark-tile {
  background: #111318;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.stack-item span {
  max-width: 82px;
  font-size: 12px;
  font-weight: 700;
  color: var(--body-copy);
  line-height: 1.25;
  text-align: center;
}

.projects-section {
  padding: 0 0 90px;
}

.poetry-section {
  padding: 8px 0 124px;
}

.poetry-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--faint);
}

.poetry-heading p,
.poetry-heading h2 {
  margin: 0;
}

.poetry-heading p {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.poetry-heading h2 {
  font-family: "STKaiti", "KaiTi", "FZKai-Z03", serif;
  font-size: clamp(92px, 13vw, 168px);
  font-weight: 400;
  line-height: 0.8;
  letter-spacing: 0;
  transform: rotate(-4deg);
}

.poetry-grid {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  gap: clamp(54px, 8vw, 112px);
  padding-top: 54px;
}

.poem {
  position: relative;
  padding-top: 20px;
  border-top: 3px solid var(--ink);
}

.poem-number {
  position: absolute;
  top: 24px;
  right: 0;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.poem h3 {
  margin: 0 0 30px;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.poem > p:last-child {
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  color: var(--body-copy);
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 2.25;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
  align-items: start;
  margin-top: 48px;
}

.project-card {
  overflow: hidden;
  border: 1px solid var(--faint);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.project-card img,
.project-cover {
  width: 100%;
  height: 220px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.project-cover {
  display: grid;
  place-items: center;
  padding: 28px;
}

.project-cover span {
  font-size: 30px;
  font-weight: 850;
  line-height: 1.05;
  text-align: center;
}

.soft-cover {
  background:
    radial-gradient(circle at 42% 42%, rgba(255, 138, 61, 0.82), transparent 0 24%, transparent 25%),
    radial-gradient(circle at 58% 54%, rgba(230, 69, 181, 0.42), transparent 0 34%, transparent 35%),
    linear-gradient(135deg, #e8f7ff, #f8edff 60%, #fff8e8);
  color: #273044;
}

.jd-cover {
  background:
    linear-gradient(135deg, rgba(29, 155, 240, 0.92), rgba(31, 170, 122, 0.86)),
    repeating-linear-gradient(90deg, transparent 0 20px, rgba(255, 255, 255, 0.18) 21px 22px);
  color: #ffffff;
}

.project-body {
  padding: 24px 24px 22px;
}

.project-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--violet);
}

.project-body h3 {
  margin: 0 0 14px;
  font-size: 24px;
  line-height: 1.2;
}

.project-body p {
  margin: 0;
  color: var(--card-copy);
  font-size: 15px;
  line-height: 1.75;
}

.project-actions {
  display: flex;
  min-height: 28px;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  font-size: 12px;
  font-weight: 800;
  color: var(--body-copy);
}

.project-actions a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.project-actions span {
  color: var(--muted);
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 44px 0 52px;
  border-top: 1px solid var(--faint);
  color: var(--muted);
}

.footer-contact {
  display: flex;
  gap: 28px;
  font-size: 14px;
}

.site-footer p {
  margin: 0;
  text-align: right;
  font-size: 13px;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    order: 3;
    gap: 22px;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero-section {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 48px;
    padding-top: 54px;
  }

  .portrait-wrap {
    width: min(300px, 78vw);
    margin: 0 auto;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stack-grid {
    grid-template-columns: repeat(4, minmax(78px, 1fr));
    gap: 24px;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .site-footer p {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .site-header,
  .hero-section,
  .stack-section,
  .projects-section,
  .poetry-section,
  .site-footer {
    width: calc(100% - 28px);
    max-width: 362px;
    margin-left: 14px;
    margin-right: 14px;
  }

  .site-header {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 16px 14px;
  }

  .header-meta {
    gap: 12px;
    font-size: 12px;
  }

  .main-nav {
    font-size: 13px;
  }

  .hero-section {
    padding: 38px 0 68px;
  }

  .hero-copy h1,
  .hello {
    font-size: clamp(32px, 10.4vw, 46px);
  }

  .hero-copy h1 {
    max-width: 100%;
    line-height: 1.12;
  }

  .hero-copy h1 span {
    max-width: 100%;
  }

  .hero-copy,
  .hero-note,
  .about-grid,
  .about-grid p,
  .section-heading,
  .section-heading h2,
  .project-card,
  .project-body {
    min-width: 0;
    max-width: 100%;
  }

  .portrait-wrap {
    width: min(270px, 70vw);
  }

  .section-heading h2 {
    font-size: clamp(27px, 8vw, 34px);
  }

  .hero-note {
    font-size: 16px;
    line-height: 1.72;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .photo-wall-section {
    margin-bottom: 44px;
  }

  .photo-wall-viewport {
    height: 68vh;
    min-height: 480px;
  }

  .photo-wall-track {
    width: calc(100% - 16px);
    animation-duration: 96s;
  }

  .photo-wall-sequence {
    column-count: 2;
    column-gap: 8px;
  }

  .photo-wall-sequence figure {
    margin-bottom: 8px;
  }

  .poetry-heading {
    align-items: start;
    flex-direction: column-reverse;
  }

  .poetry-grid {
    grid-template-columns: 1fr;
    gap: 64px;
    padding-top: 40px;
  }

  .poem > p:last-child {
    font-size: 15px;
    line-height: 2.15;
  }

  .stack-grid {
    grid-template-columns: repeat(3, minmax(74px, 1fr));
    gap: 18px;
  }

  .stack-item {
    width: 86px;
    height: 96px;
  }

  .tool-icon-image {
    width: 42px;
    height: 42px;
    padding: 4px;
    border-radius: 10px;
  }

  .project-body p {
    min-height: auto;
  }

  .footer-contact {
    flex-direction: column;
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .photo-wall-track {
    animation: none;
    transform: none;
    will-change: auto;
  }

  .photo-wall-sequence[aria-hidden="true"] {
    display: none;
  }

  .photo-wall-viewport {
    overflow-y: auto;
  }
}
