:root {
  --canvas: #edf3f7;
  --panel: #f8fbfd;
  --white: #ffffff;
  --ink: #101d28;
  --muted: #5b6974;
  --faint: #84919a;
  --blue: #0b4d8d;
  --blue-dark: #092f55;
  --blue-pale: #c7e6f1;
  --orange: #f05a2a;
  --line: #c8d5dd;
  --display: "STZhongsong", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", SimSun, serif;
  --sans: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, monospace;
  --sidebar: 280px;
  --content: 1040px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.1'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
h1, h2, h3, p, blockquote { margin-top: 0; }
::selection { color: var(--white); background: var(--blue); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 999;
  padding: 9px 13px; color: var(--white); background: var(--ink);
  transform: translateY(-160%); transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

/* One shared shell for every page */
.site-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 34px 28px 28px;
  color: #dce9f1;
  background: var(--ink);
  border-right: 1px solid #29414f;
}
.identity { display: flex; align-items: center; gap: 12px; }
.identity-mark {
  width: 38px; height: 38px; display: grid; place-items: center; flex: none;
  color: var(--white); background: var(--blue); border-radius: 4px;
  box-shadow: 4px 4px 0 var(--orange); font: 700 13px/1 var(--mono);
}
.identity strong { display: block; color: var(--white); font-family: var(--display); font-size: 19px; letter-spacing: .05em; }
.identity small { display: block; margin-top: 1px; color: #718a9a; font: 9px/1.4 var(--mono); letter-spacing: .08em; }
.sidebar-rule { height: 1px; margin: 31px 0 26px; background: #2b424f; }
.sidebar-label { margin-bottom: 10px; color: #6f8796; font: 9px/1.4 var(--mono); letter-spacing: .11em; text-transform: uppercase; }
.side-nav { display: grid; gap: 5px; }
.side-nav a {
  position: relative;
  display: grid;
  grid-template-columns: 27px 1fr auto;
  align-items: center;
  min-height: 45px;
  padding: 8px 10px;
  color: #9eb0bb;
  border: 1px solid transparent;
  font-size: 13px;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.side-nav a:hover { color: var(--white); border-color: #36505f; background: #142936; }
.side-nav a[aria-current="page"] { color: var(--white); border-color: #3a5a6e; background: #173346; }
.side-nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: -29px; top: 9px; bottom: 9px; width: 3px; background: var(--orange);
}
.nav-index { color: #647d8c; font: 9px/1 var(--mono); }
.nav-arrow { color: var(--orange); font-family: var(--mono); opacity: 0; transition: opacity .18s ease; }
.side-nav a:hover .nav-arrow, .side-nav a[aria-current="page"] .nav-arrow { opacity: 1; }
.sidebar-bottom { margin-top: auto; padding-top: 28px; }
.sidebar-status { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; color: #7f95a3; font: 9px/1.5 var(--mono); }
.sidebar-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #62d0a8; box-shadow: 0 0 0 5px rgba(98,208,168,.1); }
.sidebar-email { color: #c3d2db; font-size: 11px; border-bottom: 1px solid #405662; }
.sidebar-email:hover { color: var(--white); border-color: var(--orange); }
.mobile-head { display: none; }
.menu-button { border: 0; padding: 8px; color: var(--ink); background: transparent; }

.main { min-width: 0; }
.content {
  width: min(calc(100% - 88px), var(--content));
  margin-inline: auto;
  padding-block: 66px 74px;
}
.eyebrow { margin-bottom: 22px; color: var(--blue); font: 700 10px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.eyebrow span { margin-right: 8px; color: var(--orange); }
.page-title {
  max-width: 820px;
  margin-bottom: 18px;
  font-family: var(--display);
  font-size: clamp(44px, 6vw, 76px);
  line-height: 1.06;
  letter-spacing: -.04em;
}
.page-intro { max-width: 700px; margin-bottom: 0; color: var(--muted); font-size: 17px; }
.page-head { padding-bottom: 50px; border-bottom: 1px solid var(--line); }

/* Index: simple thesis + four doors */
.home-content { min-height: 100vh; display: flex; flex-direction: column; }
.home-hero { padding-bottom: 58px; }
.home-name { margin-bottom: 22px; color: var(--blue); font: 700 11px/1.4 var(--mono); letter-spacing: .11em; }
.home-title {
  max-width: 860px;
  margin-bottom: 27px;
  font-family: var(--display);
  font-size: clamp(51px, 7.1vw, 88px);
  line-height: 1.02;
  letter-spacing: -.05em;
}
.home-title .pursuit { display: block; }
.home-title .motto {
  position: relative;
  z-index: 0;
  display: inline-block;
  color: var(--blue-dark);
  white-space: nowrap;
}
.home-title .motto::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -.01em; right: -.02em; bottom: .04em;
  height: .16em;
  background: var(--blue-pale);
  transform: rotate(-.7deg);
}
.home-lede { max-width: 680px; margin-bottom: 0; color: var(--muted); font-size: 17px; }
.home-lede strong { color: var(--ink); }
.directory { margin-top: auto; }
.directory-label { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; color: var(--faint); font: 9px/1.4 var(--mono); letter-spacing: .1em; }
.directory-label::after { content: ""; width: 46px; height: 1px; background: var(--orange); }
.door-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.door {
  min-height: 148px;
  display: flex;
  flex-direction: column;
  padding: 20px 21px;
  border: 1px solid var(--line);
  background: rgba(248,251,253,.7);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.door:hover { transform: translateY(-3px); border-color: var(--blue); box-shadow: 6px 6px 0 var(--blue-pale); }
.door-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.door-index { color: var(--orange); font: 10px/1 var(--mono); }
.door-arrow { color: var(--blue); font-family: var(--mono); transition: transform .18s ease; }
.door:hover .door-arrow { transform: translateX(3px); }
.door h2 { margin: 26px 0 3px; font-family: var(--display); font-size: 23px; }
.door p { margin: 0; color: var(--muted); font-size: 12px; }

/* Reusable content language */
.section { padding-block: 52px; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }
.section-title { margin-bottom: 27px; font-family: var(--display); font-size: 29px; letter-spacing: -.02em; }
.entry-list { display: grid; gap: 13px; }
.entry {
  display: grid;
  grid-template-columns: 130px minmax(0,1fr);
  gap: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  background: rgba(248,251,253,.68);
}
.entry-meta { color: var(--faint); font: 10px/1.55 var(--mono); }
.entry-type { display: inline-block; margin-bottom: 9px; color: var(--blue); font-weight: 700; letter-spacing: .05em; }
.entry h3 { margin-bottom: 7px; font-family: var(--display); font-size: 22px; line-height: 1.35; }
.entry p { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.entry p + p { margin-top: 11px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip { padding: 4px 7px; color: var(--blue-dark); border: 1px solid var(--line); background: var(--canvas); font: 9px/1.3 var(--mono); }
.entry.featured { color: #dce9f1; border-color: var(--blue-dark); background: var(--blue-dark); }
.entry.featured .entry-meta { color: #85a5bb; }
.entry.featured .entry-type { color: #8fd1bc; }
.entry.featured p { color: #b8ccd9; }
.entry.featured .chip { color: #dce9f1; border-color: #42637b; background: #123f67; }

.timeline { position: relative; display: grid; gap: 0; margin-left: 11px; border-left: 1px solid var(--line); }
.timeline-item { position: relative; padding: 0 0 46px 35px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px;
  border: 1px solid var(--blue); background: var(--canvas); transform: rotate(45deg);
}
.timeline-date { display: block; margin-bottom: 6px; color: var(--faint); font: 10px/1.4 var(--mono); }
.timeline-item h3 { margin-bottom: 2px; font-family: var(--display); font-size: 23px; }
.timeline-role { margin-bottom: 13px; color: var(--blue); font-size: 12px; font-weight: 700; }
.timeline-copy { max-width: 730px; margin-bottom: 0; color: var(--muted); font-size: 13px; }
.timeline-copy strong { color: var(--ink); }
.education-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.education-card { min-height: 158px; padding: 21px; border: 1px solid var(--line); background: rgba(248,251,253,.68); }
.education-card time { color: var(--faint); font: 10px/1.4 var(--mono); }
.education-card h3 { margin: 29px 0 3px; font-family: var(--display); font-size: 22px; }
.education-card p { margin: 0; color: var(--muted); font-size: 12px; }
.skills { display: flex; flex-wrap: wrap; gap: 7px; }
.skill { padding: 7px 10px; border: 1px solid var(--line); background: rgba(248,251,253,.6); font: 10px/1.3 var(--mono); }

/* Honest empty states for not-yet-published sections */
.empty-state {
  min-height: 410px;
  display: grid;
  place-items: center;
  margin-top: 52px;
  padding: 50px;
  border: 1px dashed #9eb0bb;
  background:
    linear-gradient(rgba(200,213,221,.28) 1px,transparent 1px),
    linear-gradient(90deg,rgba(200,213,221,.28) 1px,transparent 1px),
    rgba(248,251,253,.5);
  background-size: 32px 32px;
  text-align: center;
}
.empty-mark { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 23px; color: var(--white); background: var(--ink); font: 700 15px/1 var(--mono); box-shadow: 5px 5px 0 var(--orange); }
.empty-state h2 { margin-bottom: 9px; font-family: var(--display); font-size: 28px; }
.empty-state p { max-width: 430px; margin: 0 auto; color: var(--muted); font-size: 13px; }
.empty-note { margin-top: 18px !important; color: var(--faint) !important; font: 9px/1.5 var(--mono) !important; letter-spacing: .07em; }

.page-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 31px; color: var(--faint); font: 9px/1.5 var(--mono); letter-spacing: .05em; }
.page-footer a { color: var(--blue); }
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .45s ease, transform .45s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .site-shell { display: block; }
  .sidebar { display: none; }
  .mobile-head {
    position: sticky; top: 0; z-index: 70;
    min-height: 64px; display: flex; align-items: center; justify-content: space-between;
    padding: 11px 18px; border-bottom: 1px solid var(--line); background: rgba(237,243,247,.92); backdrop-filter: blur(13px);
  }
  .mobile-head .identity strong { color: var(--ink); }
  .mobile-head .identity small { color: var(--faint); }
  .mobile-nav {
    position: fixed; inset: 64px 0 auto; z-index: 69; display: none;
    padding: 13px 15px 18px; border-bottom: 1px solid var(--line); background: var(--canvas); box-shadow: 0 15px 30px rgba(16,29,40,.1);
  }
  .mobile-nav.open { display: grid; }
  .mobile-nav a { min-height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
  .mobile-nav a[aria-current="page"] { color: var(--blue); font-weight: 700; }
  .content { width: min(calc(100% - 38px), var(--content)); padding-block: 48px 56px; }
  .home-content { min-height: calc(100vh - 64px); }
}

@media (max-width: 620px) {
  .content { width: min(calc(100% - 30px), var(--content)); padding-block: 40px 48px; }
  .home-hero { padding-bottom: 45px; }
  .home-title { font-size: clamp(44px, 14.4vw, 60px); }
  .home-title .motto { white-space: normal; }
  .home-lede, .page-intro { font-size: 15px; }
  .door-grid, .education-grid { grid-template-columns: 1fr; }
  .door { min-height: 132px; }
  .door h2 { margin-top: 20px; }
  .page-title { font-size: 47px; }
  .page-head { padding-bottom: 38px; }
  .section { padding-block: 41px; }
  .entry { grid-template-columns: 1fr; gap: 13px; padding: 19px; }
  .entry h3 { font-size: 20px; }
  .empty-state { min-height: 360px; padding: 30px 22px; }
  .page-footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
