:root {
  --bg: #fff8ef;
  --bg-soft: #f2f8ff;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-strong: rgba(255, 255, 255, 0.88);
  --text: #13264a;
  --muted: rgba(19, 38, 74, 0.72);
  --line: rgba(67, 110, 206, 0.16);
  --line-strong: rgba(67, 110, 206, 0.28);
  --accent-a: #3d6fff;
  --accent-b: #16c1ac;
  --accent-c: #ffaf77;
  --shadow-soft: 0 18px 54px rgba(84, 106, 166, 0.12);
  --shadow-strong: 0 28px 72px rgba(84, 106, 166, 0.18);
  --radius-xl: 34px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 18%, rgba(22, 193, 172, 0.13), transparent 26%),
    radial-gradient(circle at 86% 16%, rgba(61, 111, 255, 0.14), transparent 28%),
    radial-gradient(circle at 80% 72%, rgba(255, 175, 119, 0.14), transparent 30%),
    linear-gradient(180deg, #fffaf4 0%, #fbfdff 48%, #fff7ef 100%);
  font-family: "Space Grotesk", "Noto Sans SC", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

button {
  font: inherit;
}

.zh {
  font-family: "Noto Sans SC", "Space Grotesk", "Helvetica Neue", sans-serif;
}

#starfield,
.noise,
.orb {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#starfield {
  z-index: 0;
}

.noise {
  z-index: 1;
  opacity: 0.05;
  background-image:
    linear-gradient(transparent 0, rgba(61, 111, 255, 0.04) 50%, transparent 100%),
    linear-gradient(90deg, transparent 0, rgba(22, 193, 172, 0.04) 50%, transparent 100%);
  background-size: 100% 4px, 4px 100%;
  mix-blend-mode: soft-light;
}

.orb {
  z-index: 1;
  inset: auto;
  border-radius: 999px;
  filter: blur(28px);
  opacity: 0.48;
}

.orb-a {
  top: 88px;
  left: 52%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(61, 111, 255, 0.22), transparent 70%);
}

.orb-b {
  top: 420px;
  right: 12%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(22, 193, 172, 0.22), transparent 72%);
}

.orb-c {
  bottom: 160px;
  left: 10%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 175, 119, 0.2), transparent 72%);
}

.topbar,
.page-shell {
  position: relative;
  z-index: 2;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(18px, 3vw, 36px) 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  border: 1px solid rgba(22, 193, 172, 0.26);
  background: linear-gradient(135deg, rgba(22, 193, 172, 0.12), rgba(61, 111, 255, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-weight: 700;
  font-size: 1.1rem;
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-name {
  font-size: 1.02rem;
}

.brand-sub,
.hero-summary-line,
.hero-meta-row,
.stage-copy-line,
.stage-points,
.support-section p,
.stack-text,
.footer {
  color: var(--muted);
}

.brand-sub.zh {
  font-size: 0.92rem;
}

.brand-sub,
.nav,
.eyebrow,
.hero-meta-row,
.stage-badge,
.stage-doc-link,
.stage-status,
.section-kicker,
.skill-pill,
.stack-kicker,
.theme-control {
  font-family: "JetBrains Mono", monospace;
}

.nav {
  display: flex;
  gap: 22px;
  font-size: 0.92rem;
}

.nav a {
  display: grid;
  gap: 2px;
  justify-items: end;
  opacity: 0.8;
}

.nav-en {
  color: var(--text);
}

.nav-zh {
  font-size: 0.8rem;
  color: var(--muted);
}

.page-shell {
  padding: 0 clamp(18px, 3vw, 36px) 84px;
}

.hero-stage {
  --stage-glow-a: rgba(61, 111, 255, 0.17);
  --stage-glow-b: rgba(22, 193, 172, 0.16);
  --stage-glow-c: rgba(255, 175, 119, 0.18);
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(520px, 1.22fr);
  gap: clamp(18px, 2vw, 32px);
  align-items: stretch;
  min-height: min(88vh, 860px);
  padding: 28px 0 32px;
}

.hero-stage.is-fullstack {
  --stage-glow-a: rgba(61, 111, 255, 0.18);
  --stage-glow-b: rgba(22, 193, 172, 0.14);
  --stage-glow-c: rgba(255, 175, 119, 0.2);
}

.hero-stage.is-frontend {
  --stage-glow-a: rgba(110, 116, 255, 0.18);
  --stage-glow-b: rgba(22, 193, 172, 0.18);
  --stage-glow-c: rgba(150, 203, 255, 0.2);
}

.hero-stage.is-dataviz {
  --stage-glow-a: rgba(22, 193, 172, 0.2);
  --stage-glow-b: rgba(255, 175, 119, 0.16);
  --stage-glow-c: rgba(61, 111, 255, 0.16);
}

.hero-stage.is-academic {
  --stage-glow-a: rgba(106, 132, 255, 0.14);
  --stage-glow-b: rgba(22, 193, 172, 0.12);
  --stage-glow-c: rgba(255, 175, 119, 0.14);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 20px 0;
}

.eyebrow,
.section-kicker {
  margin: 0;
  letter-spacing: 0.16em;
  font-size: 0.8rem;
  color: var(--accent-b);
}

.title-stack {
  display: grid;
  gap: 10px;
}

.hero-title {
  margin: 0;
  max-width: 8ch;
  font-size: clamp(3.4rem, 7vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.hero-title-zh {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(1.12rem, 2vw, 1.62rem);
  color: rgba(19, 38, 74, 0.82);
  letter-spacing: -0.03em;
}

.hero-summary {
  display: grid;
  gap: 10px;
  max-width: 35rem;
}

.hero-summary-line {
  margin: 0;
  font-size: clamp(1rem, 1.25vw, 1.06rem);
  line-height: 1.65;
}

.theme-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 41rem;
}

.theme-control {
  --mx: 0px;
  --my: 0px;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 14px 16px;
  border: 1px solid rgba(67, 110, 206, 0.16);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(245, 249, 255, 0.72));
  box-shadow: 0 12px 32px rgba(79, 101, 158, 0.08);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transform: translate(var(--mx), var(--my));
  transition:
    transform 180ms cubic-bezier(0.18, 0.9, 0.28, 1),
    border-color 180ms ease,
    box-shadow 200ms ease,
    background 220ms ease,
    opacity 180ms ease;
}

.theme-control::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.52) 46%, transparent 70%);
  opacity: 0;
  transform: translateX(-26%);
  transition: opacity 180ms ease, transform 220ms ease;
}

.theme-control:hover {
  border-color: rgba(67, 110, 206, 0.26);
  box-shadow: 0 18px 42px rgba(79, 101, 158, 0.12);
}

.theme-control:hover::after,
.theme-control.is-active::after {
  opacity: 1;
  transform: translateX(0%);
}

.theme-control:active {
  transform: translate(var(--mx), var(--my)) scale(0.975);
}

.theme-control.is-active {
  border-color: rgba(67, 110, 206, 0.34);
  background: linear-gradient(135deg, rgba(248, 252, 255, 0.94), rgba(233, 244, 255, 0.9));
  box-shadow: 0 20px 44px rgba(61, 111, 255, 0.14);
}

.theme-control-en {
  font-size: 0.9rem;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-weight: 700;
}

.theme-control-zh {
  font-size: 0.8rem;
  color: var(--muted);
}

.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.88rem;
  line-height: 1.55;
}

.stage-panel {
  --panel-rx: 0deg;
  --panel-ry: 0deg;
  position: relative;
  overflow: hidden;
  min-height: 700px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 18% 16%, var(--stage-glow-a), transparent 24%),
    radial-gradient(circle at 84% 18%, var(--stage-glow-b), transparent 26%),
    radial-gradient(circle at 72% 80%, var(--stage-glow-c), transparent 28%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.86), rgba(243, 248, 255, 0.76));
  box-shadow: var(--shadow-strong);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  transform: perspective(1200px) rotateX(var(--panel-rx)) rotateY(var(--panel-ry));
  transform-style: preserve-3d;
  transition:
    transform 240ms ease,
    background 360ms ease,
    box-shadow 320ms ease;
}

.stage-flash,
.stage-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stage-grid {
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(67, 110, 206, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(67, 110, 206, 0.08) 1px, transparent 1px);
  background-size: 78px 78px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.56), rgba(0, 0, 0, 0.08));
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.56), rgba(0, 0, 0, 0.08));
}

.stage-flash {
  background: linear-gradient(110deg, transparent 16%, rgba(255, 255, 255, 0.72) 48%, transparent 72%);
  opacity: 0;
  transform: translateX(-46%);
}

.stage-flash.is-flashing {
  animation: stage-flash 680ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes stage-flash {
  0% {
    opacity: 0;
    transform: translateX(-46%);
  }
  22% {
    opacity: 0.72;
  }
  100% {
    opacity: 0;
    transform: translateX(48%);
  }
}

.stage-head,
.stage-body {
  position: relative;
  z-index: 1;
}

.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 26px;
}

.stage-badge,
.stage-doc-link,
.float-tag,
.stage-status,
.skill-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(67, 110, 206, 0.16);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 30px rgba(89, 113, 173, 0.1);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.stage-doc-link {
  white-space: nowrap;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.stage-doc-link:hover {
  transform: translateY(-1px);
  border-color: rgba(67, 110, 206, 0.28);
}

.stage-body {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(330px, 1fr);
  gap: 18px;
  min-height: 584px;
}

.stage-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 12px 18px 6px;
}

.stage-title,
.stage-title-zh {
  margin: 0;
}

.stage-title {
  max-width: 11ch;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.stage-title-zh {
  font-size: clamp(1.02rem, 1.6vw, 1.32rem);
  color: rgba(19, 38, 74, 0.82);
}

.stage-copy-line {
  margin: 0;
  line-height: 1.7;
}

.stage-points {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
  padding-left: 20px;
  line-height: 1.7;
}

.stage-points li::marker {
  color: var(--accent-a);
}

.stage-visual {
  position: relative;
  min-height: 100%;
  border-radius: calc(var(--radius-xl) - 8px);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.52), rgba(240, 246, 255, 0.36));
  border: 1px solid rgba(67, 110, 206, 0.12);
  overflow: hidden;
}

.stage-status {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  justify-content: flex-start;
  font-size: 0.8rem;
}

.stage-tags {
  position: absolute;
  inset: 24px 18px auto auto;
  width: min(260px, 46%);
  height: 180px;
}

.float-tag {
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  transform-origin: center;
  transition:
    transform 420ms cubic-bezier(0.2, 0.84, 0.22, 1),
    background 300ms ease,
    border-color 260ms ease,
    opacity 260ms ease;
}

.stage-cards {
  position: absolute;
  inset: 134px 24px 74px 24px;
}

.stack-card {
  position: absolute;
  top: 0;
  left: 0;
  width: min(280px, 72%);
  padding: 18px 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(67, 110, 206, 0.14);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transform-origin: center;
  transition:
    transform 460ms cubic-bezier(0.18, 0.84, 0.2, 1),
    background 320ms ease,
    opacity 260ms ease;
}

.card-a {
  z-index: 3;
}

.card-b {
  z-index: 2;
}

.card-c {
  z-index: 1;
}

.stack-kicker {
  display: block;
  margin-bottom: 10px;
}

.stack-title {
  margin: 0 0 8px;
  font-size: 1.54rem;
  line-height: 1.05;
}

.stack-text {
  margin: 0;
  line-height: 1.65;
}

.support-section {
  display: grid;
  gap: 18px;
  padding: 18px 0 8px;
}

.section-intro {
  display: grid;
  gap: 10px;
  max-width: 56rem;
}

.section-intro h2 {
  margin: 0;
  font-size: clamp(1.62rem, 3vw, 2.5rem);
  letter-spacing: -0.04em;
}

.section-intro p {
  margin: 0;
  line-height: 1.7;
}

.tag-grid,
.support-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skill-pill {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.skill-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(67, 110, 206, 0.28);
}

.support-card {
  flex: 1 1 280px;
  min-height: 180px;
  padding: 22px;
  border-radius: 26px;
  border: 1px solid rgba(67, 110, 206, 0.12);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.support-card h3,
.support-card p,
.footer {
  margin: 0;
}

.support-card h3 {
  margin-bottom: 10px;
  font-size: 1.32rem;
}

.support-card p {
  line-height: 1.7;
}

.support-card p + p {
  margin-top: 10px;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  padding-top: 24px;
  font-size: 0.92rem;
}

@media (max-width: 1200px) {
  .hero-stage {
    grid-template-columns: 1fr;
  }

  .hero-title {
    max-width: 10ch;
  }

  .stage-panel {
    min-height: 640px;
  }
}

@media (max-width: 960px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav a {
    justify-items: start;
  }

  .theme-controls {
    grid-template-columns: 1fr;
  }

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

  .stage-visual {
    min-height: 420px;
  }

  .stage-cards {
    inset: 148px 18px 82px 18px;
  }
}

@media (max-width: 680px) {
  .page-shell {
    padding-inline: 16px;
  }

  .hero-stage {
    min-height: auto;
    padding-top: 16px;
  }

  .hero-title {
    font-size: clamp(2.5rem, 15vw, 4rem);
  }

  .stage-panel {
    padding: 18px;
    min-height: 560px;
  }

  .stage-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .stage-tags {
    inset: 18px 14px auto auto;
    width: 220px;
  }

  .stage-cards {
    inset: 176px 16px 84px 16px;
  }

  .stack-card {
    width: min(240px, 86%);
  }

  .hero-meta-row {
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .stage-panel,
  .stage-badge,
  .stage-doc-link,
  .float-tag,
  .stage-status,
  .skill-pill,
  .stack-card,
  .support-card {
    background: rgba(255, 255, 255, 0.94);
  }
}
