:root {
  --bg: #f8fcff;
  --text: #102033;
  --muted: #6f8194;
  --line: rgba(42, 123, 173, 0.16);
  --soft-line: rgba(42, 123, 173, 0.08);
  --surface: #ffffff;
  --surface-blue: #eef8ff;
  --accent: #21c9d7;
  --accent-blue: #2e8df4;
  --deep-blue: #164b91;
  --graphite: #263b52;
  --shadow: 0 24px 70px rgba(46, 141, 244, 0.12);
  --max: 1180px;
  --pad: clamp(20px, 4vw, 64px);
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Avenir Next", "SF Pro Display", "SF Pro Text", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  font-weight: 400;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 34%), rgba(33, 201, 215, 0.18), transparent 24rem),
    radial-gradient(circle at 78% 22%, rgba(46, 141, 244, 0.1), transparent 30rem),
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.9), transparent 34rem);
  opacity: 0.86;
  transition: background-position 240ms ease;
}

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

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

button {
  font: inherit;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.06;
  background-image:
    linear-gradient(rgba(46, 141, 244, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(33, 201, 215, 0.06) 1px, transparent 1px);
  background-size: 132px 132px;
  mask-image: linear-gradient(to bottom, black, transparent 62%);
}

.scroll-sentinel {
  position: absolute;
  top: 0;
  width: 1px;
  height: 1px;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 22px var(--pad);
  color: var(--text);
  transition: background 180ms ease, border-color 180ms ease, padding 180ms ease;
}

.site-header.is-scrolled {
  padding-block: 14px;
  background: rgba(248, 252, 255, 0.84);
  border-bottom: 1px solid var(--soft-line);
  backdrop-filter: blur(18px);
}

.brand-mark,
.header-link,
.nav a {
  font-size: 13px;
  letter-spacing: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 520;
}

.brand-mark::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-blue));
  box-shadow: 0 0 18px rgba(33, 201, 215, 0.38);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 36px);
}

.nav a,
.header-link {
  color: var(--muted);
  transition: color 160ms ease;
}

.nav a:hover,
.header-link:hover,
.brand-mark:hover {
  color: var(--text);
}

.header-link {
  justify-self: end;
  text-decoration: underline;
  text-decoration-color: rgba(46, 141, 244, 0.3);
  text-underline-offset: 5px;
}

.hero,
.projects,
.contact,
.footer {
  width: min(var(--max), calc(100% - var(--pad) * 2));
  margin-inline: auto;
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: 90vh;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 104px 0 44px;
  text-align: center;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(46, 141, 244, 0.13);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.hero::before {
  width: min(76vw, 860px);
  aspect-ratio: 1;
  background:
    radial-gradient(circle, transparent 0 52%, rgba(33, 201, 215, 0.16) 52.2% 52.5%, transparent 52.7%),
    conic-gradient(from 120deg, transparent 0 66%, rgba(46, 141, 244, 0.2), rgba(33, 201, 215, 0.22), transparent 78% 100%);
  animation: orbitalDrift 18s linear infinite;
}

.hero::after {
  width: min(50vw, 540px);
  aspect-ratio: 1;
  border-style: dashed;
  opacity: 0.58;
  animation: orbitalDrift 28s linear reverse infinite;
}

@keyframes orbitalDrift {
  to {
    transform: translate(-50%, -50%) rotate(1turn);
  }
}

.hero-copy {
  width: min(100%, 940px);
}

.identity {
  margin: 0 0 20px;
  color: var(--deep-blue);
  font-size: clamp(16px, 1.8vw, 24px);
  font-weight: 520;
}

.hero h1 {
  max-width: 940px;
  margin: 0 auto;
  font-size: clamp(56px, 9.4vw, 124px);
  line-height: 0.9;
  font-weight: 650;
  letter-spacing: 0;
  min-height: 1.82em;
  text-wrap: balance;
}

.type-cursor {
  display: inline-block;
  width: 0.08em;
  height: 0.74em;
  margin-left: 0.08em;
  background: var(--accent);
  transform: translateY(0.08em);
  animation: cursorBlink 860ms steps(1) infinite;
}

@keyframes cursorBlink {
  50% {
    opacity: 0;
  }
}

.positioning {
  margin: 24px auto 0;
  color: var(--graphite);
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 430;
}

.hero-bio {
  max-width: 520px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 16px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-top: 32px;
}

.text-link,
.quiet-link,
.signal-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 160ms ease, transform 160ms ease;
}

.text-link:hover,
.quiet-link:hover,
.signal-link:hover {
  color: var(--accent-blue);
  transform: translateY(-1px);
}

.signal-link:hover {
  border-color: var(--accent-blue);
}

.text-link::after,
.signal-link::after {
  content: "→";
  transform: translateY(-1px);
}

.quiet-link {
  color: var(--muted);
}

.portrait-fallback {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  color: rgba(46, 141, 244, 0.24);
  font-size: clamp(54px, 7vw, 94px);
  line-height: 0.88;
  font-weight: 500;
}

.projects,
.contact {
  padding: clamp(64px, 8vw, 112px) 0;
  border-top: 0;
}

.project-head {
  width: min(760px, 100%);
  margin-bottom: clamp(30px, 5vw, 56px);
}

.project-head h2 {
  margin: 0;
  color: var(--deep-blue);
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.96;
  font-weight: 620;
  letter-spacing: 0;
  text-wrap: balance;
}

.project-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  gap: clamp(34px, 6vw, 78px);
  align-items: start;
}

.tv-shell {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(232, 247, 255, 0.96)),
    #ffffff;
  border: 1px solid rgba(46, 141, 244, 0.22);
  border-radius: 18px;
  padding: clamp(14px, 2.4vw, 24px);
  box-shadow:
    0 28px 70px rgba(46, 141, 244, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    inset 0 -1px 0 rgba(46, 141, 244, 0.08);
  transition: transform 260ms ease, box-shadow 260ms ease;
}

.tv-shell:hover {
  transform: translateY(-4px);
  box-shadow:
    0 34px 84px rgba(46, 141, 244, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    inset 0 -1px 0 rgba(46, 141, 244, 0.08);
}

.tv-topline {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  min-height: 26px;
  margin-bottom: 14px;
  padding-inline: 2px;
  color: var(--muted);
  font-size: 13px;
}

.tv-topline::before {
  content: "";
  align-self: center;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(46, 141, 244, 0.22);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.65), transparent 34%),
    var(--accent);
  box-shadow:
    16px 0 0 rgba(46, 141, 244, 0.28),
    32px 0 0 rgba(33, 201, 215, 0.16);
}

.tv-topline span:first-child {
  margin-left: auto;
}

.tv-screen {
  position: relative;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: clamp(8px, 1.1vw, 14px) solid #172235;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(33, 201, 215, 0.16), transparent 30%),
    #0f2742;
  box-shadow:
    0 20px 34px rgba(22, 75, 145, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 36px rgba(0, 0, 0, 0.62);
  color: #f8fcff;
}

.tv-screen iframe {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0f2742;
}

.tv-screen.is-playing::after {
  pointer-events: none;
  opacity: 0.18;
}

.tv-screen.has-image {
  background-image:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.26)),
    var(--project-image);
  background-position: center;
  background-size: cover;
}

.tv-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.18) 0 16%, transparent 16.4% 100%),
    radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.2), transparent 18%),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 7px
    );
  opacity: 0.44;
}

.screen-placeholder {
  position: relative;
  z-index: 2;
  width: min(80%, 520px);
}

.screen-placeholder p {
  margin: 0 0 12px;
  font-size: clamp(28px, 4.5vw, 62px);
  line-height: 0.98;
  font-weight: 500;
}

.screen-placeholder span {
  display: block;
  max-width: 420px;
  color: rgba(248, 252, 255, 0.74);
  font-size: 15px;
}

.tv-meta {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 20px;
  align-items: end;
  margin-top: 16px;
  padding: 18px 2px 0;
  border-top: 1px solid rgba(46, 141, 244, 0.12);
}

.meta-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.tv-meta p:last-child {
  margin: 0;
  color: var(--graphite);
  font-size: 14px;
}

.tv-meta a {
  display: inline-flex;
  color: var(--graphite);
  font-size: 14px;
  border-bottom: 1px solid currentColor;
}

.tv-controls {
  display: flex;
  gap: 8px;
}

.tv-controls button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.tv-controls button:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
}

.tv-controls svg {
  width: 18px;
  height: 18px;
}

.tv-controls path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tv-controls [data-play] path {
  fill: currentColor;
  stroke: none;
}

.project-panel {
  position: relative;
  padding-bottom: 10px;
  min-width: 0;
}

.project-list {
  max-height: min(560px, 62vh);
  overflow-y: auto;
  overscroll-behavior-y: auto;
  touch-action: pan-y;
  padding-right: 12px;
  border-top: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-blue) transparent;
}

.project-list::-webkit-scrollbar {
  width: 4px;
}

.project-list::-webkit-scrollbar-track {
  background: transparent;
}

.project-list::-webkit-scrollbar-thumb {
  background: var(--accent-blue);
}

.project-item {
  border-bottom: 0;
}

.project-row {
  width: 100%;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 18px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: padding-left 180ms ease, color 180ms ease;
}

.project-row:hover {
  padding-left: 10px;
}

.project-row span,
.project-row small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.project-row strong {
  font-size: clamp(19px, 2.1vw, 29px);
  line-height: 1;
  font-weight: 560;
}

.project-item.is-active .project-row {
  color: var(--text);
}

.project-item.is-active .project-row strong {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 8px;
  text-decoration-thickness: 2px;
}

.project-item[data-project-style="video"] .project-row span {
  color: var(--accent);
}

.project-item[data-project-style="open-source"] .project-row strong::after,
.project-item[data-project-style="lab"] .project-row strong::after,
.project-item[data-project-style="visual"] .project-row strong::after {
  content: "";
  display: inline-block;
  width: 0.34em;
  height: 0.34em;
  margin-left: 0.38em;
  border: 1px solid currentColor;
  border-radius: 999px;
  transform: translateY(-0.12em);
  opacity: 0.36;
}

.project-detail {
  margin: -4px 0 24px 68px;
  padding-top: 2px;
}

.project-detail p {
  max-width: 520px;
  margin: 0 0 18px;
  color: var(--graphite);
  font-size: 15px;
}

.project-detail dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0;
}

.project-detail div {
  min-width: 0;
}

.project-detail dt {
  color: var(--muted);
  font-size: 12px;
}

.project-detail dd {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 14px;
}

.project-detail a {
  text-decoration: underline;
  text-decoration-color: rgba(46, 141, 244, 0.3);
  text-underline-offset: 4px;
}

.project-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 28px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--accent-blue);
  border-radius: 999px;
  color: var(--deep-blue);
  font-weight: 500;
  font-size: 14px;
  transition: background 160ms ease, color 160ms ease;
}

.button-link:hover {
  background: var(--accent-blue);
  color: #ffffff;
}

.contact {
  min-height: 78vh;
  display: grid;
  place-items: center;
  padding-top: clamp(86px, 11vw, 156px);
  padding-bottom: clamp(72px, 10vw, 132px);
}

.contact-inner {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 230px);
  grid-template-rows: auto minmax(118px, 1fr) auto;
  column-gap: clamp(72px, 12vw, 190px);
  row-gap: clamp(48px, 7vw, 96px);
  align-items: start;
  position: relative;
}

.contact-inner::before {
  content: "";
  position: absolute;
  inset: auto -34px -42px auto;
  width: min(24vw, 280px);
  aspect-ratio: 1;
  border: 1px solid rgba(46, 141, 244, 0.12);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(33, 201, 215, 0.12), rgba(46, 141, 244, 0.04), transparent 62%);
  pointer-events: none;
}

.contact h2 {
  grid-column: 1 / 3;
  max-width: 1120px;
  margin: 0;
  font-size: clamp(56px, 8vw, 132px);
  color: var(--deep-blue);
  font-weight: 560;
  line-height: 0.92;
  letter-spacing: 0;
}

.contact h2::after {
  content: "";
  display: inline-block;
  width: 0.12em;
  height: 0.12em;
  margin-left: 0.08em;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-0.02em);
}

.contact-links {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: clamp(30px, 5vw, 72px);
  width: min(100%, 860px);
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(16, 32, 51, 0.34);
  color: var(--text);
  font-size: clamp(20px, 2vw, 32px);
  font-weight: 430;
  line-height: 1;
  text-decoration: none;
}

.contact-links a::after {
  content: "↗";
  font-family: inherit;
  font-size: 0.72em;
  transform: translateY(-0.1em);
}

.contact-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.wechat-card {
  grid-column: 2;
  grid-row: 2 / 4;
  align-self: end;
  justify-self: end;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(42, 123, 173, 0.18);
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 20px 60px rgba(46, 141, 244, 0.08);
  color: var(--muted);
  font-size: 12px;
}

.wechat-card img,
.qr-fallback {
  width: clamp(156px, 12vw, 198px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  color: var(--muted);
}

.wechat-card img {
  object-fit: cover;
}

.signal-link {
  grid-column: 1;
  grid-row: 3;
  width: fit-content;
  justify-content: flex-start;
  gap: 12px;
  margin-top: clamp(10px, 2vw, 24px);
  padding-bottom: 10px;
  border-top: 0;
  border-bottom: 1px solid rgba(16, 32, 51, 0.34);
  font-size: clamp(24px, 2.6vw, 42px);
  font-weight: 430;
  color: var(--text);
  text-decoration: none;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 34px 0;
  color: var(--muted);
  border-top: 0;
  font-size: 13px;
}

.video-empty {
  display: grid;
  place-items: center;
  padding: 24px;
  color: #f8fcff;
  text-align: center;
}

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

  .nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 86vh;
    padding: 96px 0 42px;
  }

  .project-head {
    margin-bottom: 34px;
  }

  .contact-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    row-gap: 36px;
  }

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

  .project-list {
    max-height: 420px;
  }

  .tv-meta {
    grid-template-columns: 1fr;
  }

  .tv-shell {
    margin-bottom: 34px;
  }

  .contact h2,
  .contact-links,
  .wechat-card,
  .signal-link {
    grid-column: 1;
  }

  .contact-inner::before {
    inset: auto 0 -26px auto;
    width: 220px;
  }

  .contact-links {
    justify-content: flex-start;
  }

  .signal-link {
    grid-row: auto;
    margin-top: 10px;
  }

  .wechat-card {
    grid-row: auto;
    justify-self: start;
    margin-top: 14px;
  }
}

@media (max-width: 560px) {
  .hero,
  .projects,
  .contact,
  .footer {
    width: min(100% - 40px, var(--max));
  }

  .hero h1 {
    font-size: clamp(54px, 18vw, 88px);
    min-height: 1.96em;
  }

  .project-actions,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-actions {
    flex-wrap: wrap;
  }

  .contact {
    min-height: auto;
    padding-top: 76px;
    padding-bottom: 86px;
  }

  .contact h2 {
    font-size: clamp(46px, 17vw, 76px);
  }

  .contact-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px 28px;
  }

  .contact-links a {
    min-width: 0;
    font-size: 22px;
  }

  .wechat-card img,
  .qr-fallback {
    width: 160px;
  }

  .project-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .project-row small {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .hero::before,
  .hero::after {
    animation: none !important;
  }

  .text-link:hover,
  .quiet-link:hover,
  .signal-link:hover,
  .tv-shell:hover,
  .project-row:hover {
    transform: none;
  }
}
