:root {
  color-scheme: dark;
  --bg: #0d1110;
  --panel: rgba(20, 27, 27, 0.78);
  --panel-strong: rgba(18, 24, 24, 0.94);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4f7f6;
  --muted: #aebbb8;
  --soft: #d6dfdc;
  --teal: #49c8bd;
  --amber: #e6b35a;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  line-height: 1.7;
}

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

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 13, 13, 0.72);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(73, 200, 189, 0.45);
  background: rgba(73, 200, 189, 0.12);
  color: var(--teal);
  font-size: 13px;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 26px);
  color: var(--muted);
  font-size: 14px;
}

.nav-links a {
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--white);
}

.hero {
  position: relative;
  min-height: 94vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 128px clamp(18px, 5vw, 72px) 64px;
}

.hero-bg,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(7, 10, 10, 0.92) 0%, rgba(7, 10, 10, 0.78) 38%, rgba(7, 10, 10, 0.2) 100%),
    linear-gradient(0deg, #0d1110 0%, rgba(13, 17, 16, 0) 34%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(56px, 8vw, 112px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.35;
}

.hero-subtitle {
  max-width: 660px;
  color: var(--soft);
  font-size: clamp(18px, 2vw, 24px);
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid var(--line);
  font-weight: 700;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

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

.button.primary {
  border-color: rgba(73, 200, 189, 0.6);
  background: var(--teal);
  color: #07100f;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(640px, 100%);
  margin: 56px 0 0;
}

.hero-stats div,
.intro-panel,
.facts,
.skill-grid article,
.project-body,
.link-grid a,
.contact-section {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-stats div {
  padding: 18px;
}

.hero-stats dt {
  font-size: 26px;
  font-weight: 800;
}

.hero-stats dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.section {
  padding: 96px clamp(18px, 5vw, 72px);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: 40px;
  align-items: end;
  max-width: 1180px;
  margin: 0 auto 34px;
}

.profile-grid,
.skill-grid,
.timeline,
.link-grid,
.contact-section {
  max-width: 1180px;
  margin: 0 auto;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
}

.intro-panel {
  padding: clamp(24px, 4vw, 42px);
}

.intro-panel p {
  max-width: 820px;
  color: var(--soft);
  font-size: 18px;
}

.intro-panel p:last-child {
  margin-bottom: 0;
}

.facts {
  display: grid;
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.facts div {
  padding: 22px;
  background: var(--panel-strong);
}

.facts span,
.link-grid span,
.project-meta span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
}

.facts strong,
.link-grid strong {
  font-size: 17px;
}

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

.skill-grid article {
  min-height: 260px;
  padding: 24px;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.skill-grid article:hover,
.link-grid a:hover {
  transform: translateY(-4px);
  border-color: rgba(73, 200, 189, 0.45);
}

.skill-icon {
  display: inline-flex;
  margin-bottom: 54px;
  color: var(--amber);
  font-weight: 800;
}

.skill-grid p,
.project-body p,
.project-body li {
  color: var(--soft);
}

.timeline {
  display: grid;
  gap: 22px;
}

.project {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
}

.project-meta {
  padding-top: 22px;
  border-top: 1px solid rgba(73, 200, 189, 0.42);
}

.project-meta strong {
  font-size: 18px;
}

.project-body {
  padding: clamp(22px, 4vw, 34px);
}

.project-body ul {
  margin: 18px 0 0;
  padding-left: 20px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.tags span {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 13px;
}

.open-section {
  background: #111716;
}

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

.link-grid a {
  min-height: 150px;
  padding: 24px;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.contact-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(28px, 5vw, 46px);
}

.contact-section h2 {
  max-width: 720px;
}

.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(73, 200, 189, 0.55);
  background: rgba(9, 13, 13, 0.86);
  color: var(--white);
  cursor: pointer;
  backdrop-filter: blur(14px);
}

.to-top.is-visible {
  display: block;
}

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

  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .section-heading,
  .profile-grid,
  .project {
    grid-template-columns: 1fr;
  }

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

  .project-meta {
    padding-top: 0;
    border-top: 0;
  }

  .contact-section {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 92vh;
    padding-top: 150px;
  }

  .hero-overlay {
    background:
      linear-gradient(90deg, rgba(7, 10, 10, 0.94) 0%, rgba(7, 10, 10, 0.78) 100%),
      linear-gradient(0deg, #0d1110 0%, rgba(13, 17, 16, 0) 34%);
  }

  .hero-stats,
  .skill-grid,
  .link-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding-top: 70px;
    padding-bottom: 70px;
  }

  .skill-grid article {
    min-height: auto;
  }

  .skill-icon {
    margin-bottom: 28px;
  }
}

/* Mobile polish */
body {
  overflow-x: hidden;
}

.button {
  text-align: center;
}

.facts strong,
.link-grid strong,
.contact-actions a {
  overflow-wrap: anywhere;
}

@media (max-width: 960px) {
  .nav-links {
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 640px) {
  .site-header {
    gap: 10px;
    padding: 12px 16px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }

  .nav-links {
    gap: 10px;
    font-size: 13px;
  }

  .nav-links a {
    flex: 0 0 auto;
    padding: 4px 2px;
  }

  .hero {
    min-height: 100svh;
    align-items: flex-end;
    padding: 136px 16px 34px;
  }

  .hero-bg {
    object-position: 64% center;
  }

  .hero-overlay {
    background:
      linear-gradient(90deg, rgba(7, 10, 10, 0.96) 0%, rgba(7, 10, 10, 0.84) 100%),
      linear-gradient(0deg, #0d1110 0%, rgba(13, 17, 16, 0.34) 48%, rgba(13, 17, 16, 0.1) 100%);
  }

  h1 {
    margin-bottom: 14px;
    font-size: 54px;
    line-height: 1;
  }

  h2 {
    font-size: 30px;
  }

  h3 {
    font-size: 20px;
  }

  .hero-subtitle {
    font-size: 17px;
    line-height: 1.75;
  }

  .hero-actions,
  .contact-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 22px;
  }

  .button {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
  }

  .hero-stats {
    gap: 8px;
    margin-top: 28px;
  }

  .hero-stats div {
    padding: 14px 16px;
  }

  .hero-stats dt {
    font-size: 22px;
  }

  .section {
    padding-left: 16px;
    padding-right: 16px;
    padding-top: 70px;
    padding-bottom: 70px;
  }

  .section-heading {
    gap: 12px;
    margin-bottom: 24px;
  }

  .intro-panel,
  .project-body,
  .skill-grid article,
  .link-grid a,
  .contact-section {
    padding: 20px;
  }

  .intro-panel p {
    font-size: 16px;
  }

  .facts div {
    padding: 18px 20px;
  }

  .project-body ul {
    padding-left: 18px;
  }

  .tags {
    gap: 6px;
    margin-top: 18px;
  }

  .contact-section h2 {
    font-size: 28px;
  }

  .to-top {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: 46px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .hero-stats dt {
    font-size: 20px;
  }
}
