:root {
  color-scheme: light;
  --ink: #20242a;
  --muted: #626c77;
  --line: #d5d5d5;
  --paper: #f6f3ec;
  --surface: #ffffff;
  --soft: #eaf4f0;
  --accent: #1f7a68;
  --accent-dark: #14584d;
  --blue: #2f5f98;
  --violet: #6d5bd0;
  --signal: #16b8a6;
  --electric: #36a3ff;
  --gold: #b9822c;
  --shadow: 0 24px 70px rgba(25, 31, 36, 0.13);
  --glow: 0 18px 54px rgba(0, 0, 0, 0.22);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  position: relative;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(22, 184, 166, 0.12), transparent 28%, rgba(54, 163, 255, 0.08) 52%, transparent 78%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(47, 95, 152, 0.06) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 100%, 56px 56px, 56px 56px;
  line-height: 1.65;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    repeating-linear-gradient(90deg, transparent 0 108px, rgba(0, 0, 0, 0.06) 108px 110px),
    linear-gradient(90deg, transparent, rgba(22, 184, 166, 0.12), transparent);
  background-size: 100% 100%, 42vw 100%;
  background-position: 0 0, -42vw 0;
  animation: signal-sweep 12s linear infinite;
}

@keyframes signal-sweep {
  to { background-position: 0 0, 142vw 0; }
}

a { color: inherit; text-decoration: none; }
button {
  border: 0;
  color: inherit;
  font: inherit;
  text-align: inherit;
}
img { display: block; max-width: 100%; }
h1 span + span::before { content: " / "; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px clamp(20px, 4vw, 58px);
  border-bottom: 1px solid rgba(32, 36, 42, 0.1);
  background: rgba(246, 243, 236, 0.8);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--ink), var(--accent-dark));
  color: #fff;
  font-size: 13px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.nav {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.nav a {
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
}
.nav a:hover {
  border-color: rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.55);
  color: var(--accent-dark);
}

main {
  width: min(1140px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  position: relative;
  min-height: min(680px, calc(100vh - 69px));
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr);
  align-items: center;
  gap: clamp(30px, 7vw, 80px);
  padding: clamp(42px, 7vh, 76px) 0 42px;
}

.hero::before {
  position: absolute;
  top: 48px;
  bottom: 48px;
  left: -22px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--signal), var(--electric), var(--gold));
  box-shadow: 0 0 24px rgba(22, 184, 166, 0.45);
  content: "";
}

.hero-copy {
  min-width: 0;
  max-width: 100%;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 820px;
  margin-bottom: 24px;
  font-size: clamp(44px, 7vw, 84px);
  line-height: 1.05;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  background: linear-gradient(95deg, var(--ink) 0%, #111827 44%, var(--accent-dark) 72%, var(--blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.16;
  letter-spacing: 0;
}
h3 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.35;
}

.lead {
  max-width: 760px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 18px;
  overflow-wrap: anywhere;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.hero-points span {
  padding: 7px 10px;
  border: 1px solid rgba(0, 0, 0, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.hero-actions,
.inline-actions,
.resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}
.button:hover { transform: translateY(-2px); }
.button.primary {
  border-color: rgba(0, 0, 0, 0.25);
  background: linear-gradient(135deg, var(--accent), #0d6e89);
  color: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
}
.button.primary:hover { background: var(--accent-dark); }
.button.secondary,
.button.ghost {
  background: rgba(255, 255, 255, 0.78);
}
.button.secondary:hover,
.button.ghost:hover {
  border-color: rgba(0, 0, 0, 0.28);
  box-shadow: 0 12px 30px rgba(25, 31, 36, 0.1);
}

.profile-panel {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(0, 0, 0, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(234, 244, 240, 0.78)),
    rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.profile-panel::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--signal), var(--electric), var(--gold));
  content: "";
}

.avatar {
  width: 148px;
  height: 148px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.28);
  background: var(--soft);
  box-shadow: 0 16px 38px rgba(47, 95, 152, 0.18);
}

.photo-frame {
  position: relative;
  width: fit-content;
}

.photo-frame span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(32, 36, 42, 0.86);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.profile-name {
  margin-bottom: 4px;
  font-size: 25px;
  font-weight: 900;
}
.profile-role { margin: 0; color: var(--muted); }
.profile-list { display: grid; gap: 12px; margin: 0; }
.profile-list dt { color: var(--muted); font-size: 12px; }
.profile-list dd { margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.last-updated {
  width: fit-content;
  margin: 2px 0 0;
  padding: 5px 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.copy-link {
  padding: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}
.copy-link:hover { color: var(--accent-dark); }

.section {
  padding: 76px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.16);
}

.resume {
  margin-bottom: 52px;
}
.resume p {
  color: var(--muted);
}
.resume-tile {
  min-width: min(100%, 260px);
  padding: 20px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.resume-tile strong {
  display: block;
  margin-bottom: 6px;
  font-size: 20px;
}
.resume-tile span {
  color: var(--muted);
}

.intro,
.split,
.resume {
  display: grid;
  grid-template-columns: 0.35fr 1fr;
  gap: clamp(24px, 6vw, 72px);
  align-items: start;
}

.intro-copy p {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 18px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
  box-shadow: 0 20px 50px rgba(25, 31, 36, 0.08);
}
.metric-strip div {
  padding: 18px;
  background: rgba(255, 255, 255, 0.78);
}
.metric-strip strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-dark);
  font-size: 18px;
}
.metric-strip span { color: var(--muted); font-size: 14px; }

.fit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.fit-grid article {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.fit-grid article:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 0, 0, 0.36);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.fit-grid strong {
  color: var(--accent-dark);
  font-size: 17px;
  line-height: 1.25;
}

.fit-grid span {
  color: var(--muted);
  font-size: 14px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.text-link {
  color: var(--accent-dark);
  font-weight: 900;
}
.section-note {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
}

.project-feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 28px;
  align-items: center;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(0, 0, 0, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.92), rgba(234,244,240,0.82)),
    repeating-linear-gradient(135deg, transparent 0 18px, rgba(54, 163, 255, 0.045) 18px 20px);
  box-shadow: 0 22px 58px rgba(25, 31, 36, 0.1);
  overflow: hidden;
}
.project-feature::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(22, 184, 166, 0.14), transparent);
  transform: translateX(-100%);
  animation: card-scan 7s ease-in-out infinite;
}
@keyframes card-scan {
  0%, 45% { transform: translateX(-100%); }
  70%, 100% { transform: translateX(100%); }
}
.project-media img,
.project-card img,
.matrix-image {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(25, 31, 36, 0.09);
}
.project-media img {
  transform: perspective(900px) rotateY(3deg);
  transform-origin: center left;
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.project-feature:hover .project-media img {
  transform: perspective(900px) rotateY(0deg) translateY(-3px);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.2);
}
.tag {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}
.project-body p,
.project-card p,
.skill-grid p {
  color: var(--muted);
}

ul { margin: 0; padding-left: 20px; }
li + li { margin-top: 7px; }
.inline-actions a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.inline-actions a:first-child {
  border-color: rgba(0, 0, 0, 0.25);
  background: linear-gradient(135deg, var(--accent), #0d6e89);
  color: #fff;
}
.inline-actions a:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}
.project-card .inline-actions {
  margin: 10px 0 14px;
}

.project-grid,
.skill-grid,
.lab-grid {
  display: grid;
  gap: 18px;
}
.project-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}
.project-card,
.skill-grid > div,
.lab-grid a,
.resume-tile {
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}
.project-card {
  padding: 16px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.project-card:hover,
.skill-grid > div:hover,
.lab-grid a:hover,
.resume-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 0, 0, 0.34);
  box-shadow: 0 20px 52px rgba(25, 31, 36, 0.12);
}
.project-card img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 14px;
  transition: transform 220ms ease, filter 220ms ease;
}
.project-card:hover img {
  transform: scale(1.015);
  filter: saturate(1.08) contrast(1.03);
}
.project-card h3 { font-size: 18px; }

.skill-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.skill-grid > div {
  padding: 22px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.lab {
  overflow: hidden;
}
.matrix-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}
.matrix-image {
  width: 100%;
  margin: 0 0 24px;
}
.lab-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.lab-grid a {
  display: grid;
  gap: 5px;
  padding: 18px;
  overflow-wrap: anywhere;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.lab-grid strong {
  color: var(--accent-dark);
}
.lab-grid span {
  color: var(--muted);
  font-size: 14px;
}


@media (max-width: 920px) {
  .hero,
  .intro,
  .split,
  .resume,
  .project-feature {
    grid-template-columns: 1fr;
  }
  .project-grid,
  .metric-strip,
  .fit-grid,
  .lab-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  html,
  body {
    overflow-x: hidden;
  }
  main { width: min(100% - 24px, 1140px); }
  .site-header {
    position: static;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px 12px;
  }
  .nav {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    font-size: 13px;
  }
  .nav a {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
  }
  h1 {
    width: 100%;
    max-width: 100%;
    margin-bottom: 18px;
    font-size: 34px;
    line-height: 1.08;
    word-break: normal;
  }
  h1 span {
    display: block;
  }
  h1 span + span::before {
    content: "";
  }
  h2 {
    font-size: 28px;
  }
  .lead {
    max-width: 100%;
    font-size: 16px;
    line-height: 1.75;
    margin-bottom: 24px;
    word-break: break-word;
  }
  .hero-copy {
    width: 100%;
    overflow: hidden;
  }
  .button,
  .resume-tile {
    width: 100%;
  }
  .project-grid,
  .metric-strip,
  .fit-grid,
  .skill-grid,
  .lab-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    min-height: auto;
    gap: 26px;
    padding: 34px 0 48px;
  }
  .hero::before {
    display: none;
  }
  .section {
    padding: 52px 0;
  }
  .fit-grid article {
    padding: 16px;
  }
  .intro-copy p {
    font-size: 16px;
  }
  .metric-strip div {
    padding: 16px;
  }
  .profile-panel,
  .project-feature,
  .project-card,
  .skill-grid > div,
  .lab-grid a,
  .resume-tile {
    padding: 18px;
  }
  .profile-panel {
    gap: 14px;
  }
  .avatar {
    width: 112px;
    height: 112px;
  }
  .photo-frame span {
    display: none;
  }
  .project-media img {
    transform: none;
  }
  .project-feature {
    gap: 18px;
  }
  .project-card img {
    margin-bottom: 12px;
  }
  .matrix-wrap {
    margin: 0 -12px 20px;
    padding: 0 12px 10px;
  }
  .matrix-image {
    width: 680px;
    max-width: none;
    margin-bottom: 0;
  }
  .resume {
    margin-bottom: 36px;
  }
}

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