/* ------- v4-inspired palette ------- */
:root {
  --navy:           #0a192f;
  --navy-rgb:       10, 25, 47;
  --light-navy:     #112240;
  --lightest-navy:  #233554;
  --slate:          #8892b0;
  --light-slate:    #a8b2d1;
  --lightest-slate: #ccd6f6;
  --white:          #e6f1ff;
  --green:          #64ffda;
  --green-tint:     rgba(100, 255, 218, 0.1);
  --pink:           #f57dff;
  --shadow-card:    0 10px 30px -15px rgba(2, 12, 27, 0.7);
  --shadow-hover:   0 20px 30px -15px rgba(2, 12, 27, 0.7);
  --tab-height:     42px;
  --tab-width:      120px;
  --nav-height:     100px;
  --nav-scroll-height: 70px;
  --easing:         cubic-bezier(0.645, 0.045, 0.355, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
html[lang="zh"] body { font-family: 'Noto Sans SC', 'Inter', sans-serif; }

body {
  background: var(--navy);
  color: var(--slate);
  font-family: 'Inter', 'Noto Sans SC', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  counter-reset: section;
}

.mono { font-family: 'JetBrains Mono', monospace; }

a {
  color: var(--green);
  text-decoration: none;
  transition: color .25s var(--easing);
}
a:hover { color: var(--green); }

ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--green); color: var(--navy);
  padding: 8px 16px; border-radius: 4px; z-index: 100;
}
.skip-link:focus { left: 16px; }

/* ------- Top nav ------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 11;
  background: rgba(var(--navy-rgb), 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all .25s var(--easing);
}
.nav.scrolled {
  height: var(--nav-scroll-height);
  box-shadow: 0 10px 30px -10px rgba(2, 12, 27, 0.7);
}
.nav-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 50px;
  max-width: 1600px; margin: 0 auto;
}
.logo {
  width: 42px; height: 42px;
  color: var(--green);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .25s var(--easing);
}
.logo svg { width: 100%; height: 100%; }
.logo:hover { transform: translateY(-2px); }

.nav nav {
  display: flex; align-items: center; gap: 22px;
}
.nav-list {
  display: flex; gap: 8px; align-items: center;
}
.nav-list a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--lightest-slate);
  padding: 10px 14px;
  display: inline-flex; gap: 6px;
  transition: color .25s var(--easing);
}
.nav-list a:hover { color: var(--green); }
.num {
  color: var(--green);
  font-family: 'JetBrains Mono', monospace;
}

.resume-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 4px;
  padding: 8px 14px;
  background: transparent;
  transition: all .25s var(--easing);
}
.resume-link:hover {
  background: var(--green-tint);
  transform: translateY(-2px);
}

.lang-switcher {
  display: inline-flex; gap: 2px;
  padding: 3px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--lightest-navy);
}
.lang-switcher button {
  font-family: 'JetBrains Mono', monospace;
  background: transparent; border: 0;
  color: var(--slate);
  font-size: 11px; font-weight: 600;
  padding: 5px 8px; border-radius: 4px;
  transition: all .2s var(--easing);
}
.lang-switcher button:hover { color: var(--green); }
.lang-switcher button.active {
  background: var(--green-tint);
  color: var(--green);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent; border: 0;
  width: 30px; height: 30px;
  align-items: center; justify-content: center;
  z-index: 12;
}
.nav-toggle span {
  width: 30px; height: 2px;
  background: var(--green);
  border-radius: 2px;
  transition: all .3s var(--easing);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ------- Mobile menu ------- */
.mobile-menu {
  position: fixed; top: 0; right: 0;
  width: min(75vw, 400px); height: 100vh;
  background: var(--light-navy);
  box-shadow: -10px 0 30px -15px rgba(2, 12, 27, 0.7);
  padding: 100px 50px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  gap: 30px;
  transform: translateX(100%);
  transition: transform .3s var(--easing);
  z-index: 9;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu ol {
  width: 100%;
  display: flex; flex-direction: column; align-items: center;
  gap: 18px;
}
.mobile-menu ol a {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--lightest-slate);
  font-size: 16px;
}
.mobile-menu ol a:hover { color: var(--green); }
.mobile-menu ol .num {
  display: block;
  font-size: 12px;
  color: var(--green);
}
.resume-btn {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 4px;
  padding: 16px 50px;
}

/* ------- Fixed side bars ------- */
.side {
  position: fixed;
  bottom: 0;
  width: 40px;
  z-index: 10;
  color: var(--light-slate);
}
.side-left { left: 40px; right: auto; }
.side-right { right: 40px; left: auto; }
.side ul {
  display: flex; flex-direction: column; align-items: center;
  padding: 0; margin: 0; gap: 0;
}
.side ul::after {
  content: ""; display: block;
  width: 1px; height: 90px;
  margin: 20px auto;
  background: var(--light-slate);
}
.side ul li a {
  padding: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--light-slate);
  transition: all .25s var(--easing);
}
.side ul li a:hover {
  color: var(--green);
  transform: translateY(-3px);
}
.side-right a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--light-slate);
  writing-mode: vertical-rl;
  letter-spacing: 0.1em;
  padding: 10px;
  margin: 20px auto 0;
  display: inline-block;
  transition: all .25s var(--easing);
}
.side-right a:hover {
  color: var(--green);
  transform: translateY(-3px);
}
.side-right::after {
  content: ""; display: block;
  width: 1px; height: 90px;
  margin: 0 auto;
  background: var(--light-slate);
}

/* ------- Layout containers ------- */
main {
  margin: 0 auto;
  max-width: 1600px;
  min-height: 100vh;
  padding: 0 150px;
}

.section {
  margin: 0 auto;
  padding: 100px 0;
  max-width: 1000px;
}
.section.narrow { max-width: 900px; }

.section-heading {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 40px;
  font-size: clamp(26px, 5vw, 32px);
  color: var(--lightest-slate);
  font-weight: 600;
  white-space: nowrap;
}
.section-heading .num {
  font-family: 'JetBrains Mono', monospace;
  color: var(--green);
  font-size: clamp(16px, 3vw, 20px);
  font-weight: 400;
}
.section-heading::after {
  content: "";
  display: block;
  width: 300px;
  height: 1px;
  margin-left: 20px;
  background: var(--lightest-navy);
  position: relative; top: 2px;
}

/* ------- Hero ------- */
.hero {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 100vh;
  padding: 0;
  max-width: 1000px;
  margin: 0 auto;
}
.hero-eyebrow {
  color: var(--green);
  font-size: clamp(14px, 2vw, 16px);
  font-weight: 400;
  margin: 0 0 30px 4px;
}
.hero-name {
  color: var(--lightest-slate);
  font-size: clamp(40px, 8vw, 80px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.hero-tagline {
  color: var(--slate);
  font-size: clamp(34px, 7vw, 72px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-top: 10px;
}
.hero-bio {
  max-width: 540px;
  margin-top: 30px;
  font-size: 18px;
  color: var(--slate);
  line-height: 1.5;
}
.big-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--green);
  background: transparent;
  border: 1px solid var(--green);
  border-radius: 4px;
  padding: 18px 28px;
  margin-top: 50px;
  transition: all .25s var(--easing);
  width: fit-content;
}
.big-btn:hover {
  background: var(--green-tint);
  transform: translateY(-3px);
  box-shadow: 4px 4px 0 0 var(--green);
}
.whatsapp-btn { margin-top: 30px; }

/* ------- About ------- */
.about-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 50px;
  align-items: start;
}
.about-text p {
  margin-bottom: 16px;
  color: var(--slate);
  font-size: 17px;
  line-height: 1.55;
}
.about-text p:last-of-type { margin-bottom: 24px; }
.about-text .inline-link {
  color: var(--green);
  border-bottom: 1px solid transparent;
  pointer-events: none;
}
.mono-list-intro {
  font-size: 14px !important;
  color: var(--slate);
  margin-bottom: 8px !important;
}
.mono-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 16px;
}
.mono-list li {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--slate);
  padding-left: 22px;
  position: relative;
}
.mono-list li::before {
  content: "▹";
  position: absolute; left: 0; top: 0;
  color: var(--green);
  font-size: 14px;
  line-height: 18px;
}

.about-photo-wrap {
  display: flex; justify-content: center;
}
.about-photo {
  position: relative;
  display: block;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  background: var(--green);
  transition: all .25s var(--easing);
}
.photo-img {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 4px;
  overflow: hidden;
  filter: grayscale(100%) contrast(1);
  mix-blend-mode: multiply;
  background: var(--green);
  transition: all .25s var(--easing);
}
.photo-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.about-photo::after {
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  border: 2px solid var(--green);
  border-radius: 4px;
  z-index: -1;
  transition: all .25s var(--easing);
}
.about-photo:hover .photo-img {
  filter: none;
  mix-blend-mode: normal;
}
.about-photo:hover::after {
  inset: 8px -20px -20px 8px;
}

/* ------- Experience tabs ------- */
.tabs {
  display: flex;
  min-height: 340px;
}
.tab-list {
  position: relative;
  display: flex; flex-direction: column;
  border-left: 2px solid var(--lightest-navy);
  width: var(--tab-width);
  flex-shrink: 0;
}
.tab {
  background: transparent; border: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--slate);
  text-align: left;
  padding: 0 20px;
  height: var(--tab-height);
  display: inline-flex; align-items: center;
  border-radius: 0;
  white-space: nowrap;
  transition: all .25s var(--easing);
}
.tab:hover {
  color: var(--green);
  background: var(--light-navy);
}
.tab.active { color: var(--green); }
.tab-indicator {
  position: absolute;
  top: 0; left: -2px;
  width: 2px;
  height: var(--tab-height);
  background: var(--green);
  transform: translateY(0);
  transition: transform .25s var(--easing);
}

.tab-panels {
  flex-grow: 1;
  padding-left: 30px;
  position: relative;
}
.tab-panel {
  display: none;
  animation: fadeIn .35s ease both;
}
.tab-panel.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.tab-panel h3 {
  font-size: 22px;
  color: var(--lightest-slate);
  font-weight: 500;
  margin-bottom: 4px;
}
.tab-panel h3 .at { color: var(--green); }
.tab-panel h3 .company { color: var(--green); }
.tab-panel .time {
  font-size: 13px;
  color: var(--slate);
  margin-bottom: 22px;
}
.tab-panel ul {
  display: flex; flex-direction: column;
  gap: 12px;
}
.tab-panel ul li {
  position: relative;
  padding-left: 28px;
  color: var(--slate);
  font-size: 16px;
  line-height: 1.45;
}
.tab-panel ul li::before {
  content: "▹";
  position: absolute; left: 0; top: 2px;
  color: var(--green);
  font-size: 14px;
}

/* ------- Skills ------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.skill-card {
  background: var(--light-navy);
  border-radius: 4px;
  padding: 32px 28px;
  box-shadow: var(--shadow-card);
  transition: all .25s var(--easing);
  position: relative;
}
.skill-card:hover {
  transform: translateY(-7px);
  box-shadow: var(--shadow-hover);
}
.skill-icon {
  color: var(--green);
  margin-bottom: 28px;
}
.skill-card h3 {
  color: var(--lightest-slate);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}
.skill-card p {
  color: var(--slate);
  font-size: 15px;
  line-height: 1.5;
}

/* ------- Contact ------- */
.contact {
  text-align: center;
  max-width: 600px;
  padding: 100px 0 80px;
}
.contact-eyebrow {
  color: var(--green);
  font-size: 14px;
  margin-bottom: 20px;
}
.contact-title {
  color: var(--lightest-slate);
  font-size: clamp(40px, 8vw, 80px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 24px;
}
.contact-body {
  color: var(--slate);
  font-size: 17px;
  line-height: 1.5;
  margin-bottom: 32px;
}
.contact .big-btn { margin: 24px auto 0; }
.contact-alt {
  margin-top: 30px;
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  color: var(--slate);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.contact-alt a {
  color: var(--light-slate);
  transition: color .25s var(--easing);
}
.contact-alt a:hover { color: var(--green); }

/* ------- Footer ------- */
.footer {
  padding: 30px 50px 20px;
  text-align: center;
}
.footer-inner { max-width: 1000px; margin: 0 auto; }
.footer-social {
  display: none;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}
.footer-social a {
  color: var(--light-slate);
  padding: 10px;
  display: inline-flex;
  transition: all .25s var(--easing);
}
.footer-social a:hover { color: var(--green); transform: translateY(-3px); }
.footer-text {
  font-size: 12px;
  color: var(--light-slate);
  line-height: 1.6;
}
.footer-text a { color: var(--light-slate); }
.footer-text a:hover { color: var(--green); }

/* ------- Reveal animations ------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s ease-out, transform .8s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ------- Responsive ------- */
@media (max-width: 1200px) {
  main { padding: 0 100px; }
  .nav-inner { padding: 0 40px; }
}

@media (max-width: 1080px) {
  main { padding: 0 100px; }
  .side-left { left: 20px; }
  .side-right { right: 20px; }
}

@media (max-width: 900px) {
  .nav-list, .resume-link, .nav .lang-switcher { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-inner { padding: 0 30px; }
  main { padding: 0 50px; }
  .side { display: none; }
  .section-heading::after { width: 200px; }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 50px;
  }
  .about-photo-wrap { order: -1; max-width: 280px; margin: 0 auto; }
  .tabs { flex-direction: column; min-height: auto; }
  .tab-list {
    flex-direction: row;
    width: 100%;
    border-left: 0;
    border-bottom: 2px solid var(--lightest-navy);
    overflow-x: auto;
    margin-bottom: 24px;
  }
  .tab-indicator {
    top: auto; bottom: -2px; left: 0;
    width: var(--tab-width);
    height: 2px;
    transform: translateX(0);
  }
  .tab-panels { padding-left: 0; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .nav-inner { padding: 0 25px; height: 70px; }
  .nav { height: 70px; }
  .nav.scrolled { height: 60px; }
  main { padding: 0 25px; }
  .section { padding: 80px 0; }
  .section-heading { font-size: 26px; gap: 8px; }
  .section-heading::after { width: 70px; margin-left: 14px; }
  .hero { min-height: calc(100vh - 70px); }
  .hero-name { font-size: clamp(36px, 11vw, 60px); }
  .hero-tagline { font-size: clamp(28px, 9vw, 50px); }
  .hero-bio { font-size: 16px; }
  .big-btn { padding: 14px 22px; font-size: 13px; }
  .tab-list { --tab-width: 100px; }
  .tab { padding: 0 14px; font-size: 12px; }
  .tab-panel h3 { font-size: 18px; }
  .skill-card { padding: 26px 22px; }
  .footer-social { display: flex; }
  .mono-list { grid-template-columns: 1fr; }
  .contact { padding: 80px 0 50px; }
  .contact-title { font-size: clamp(36px, 10vw, 56px); }
}

@media (max-width: 400px) {
  .nav-inner { padding: 0 18px; }
  main { padding: 0 18px; }
  .tab-list { --tab-width: 90px; }
}

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