:root {
  --text: #171717;
  --muted: #666666;
  --line: rgba(23, 23, 23, 0.12);
  --photo-line: rgba(23, 23, 23, 0.18);
  --background: #fbf7ef;
  --header-background: rgba(251, 247, 239, 0.92);
  --nav-underline: currentColor;
}

body.view-intro {
  --line: rgba(251, 247, 239, 0.62);
  --background: #aebdb8;
  --header-background: rgba(174, 189, 184, 0.92);
  --nav-underline: #fbf7ef;
}

body.view-cover {
  --text: #fbf7ef;
  --muted: rgba(251, 247, 239, 0.74);
  --line: rgba(251, 247, 239, 0.34);
  --background: #3e668f;
  --header-background: rgba(62, 102, 143, 0.92);
  --nav-underline: #fbf7ef;
  --cover-blue-width: 54.5%;
}

body.view-cover::before,
body.view-cover::after {
  content: "";
  inset: 0;
  position: fixed;
  z-index: -2;
}

body.view-cover::before {
  background: linear-gradient(
    90deg,
    #3e668f 0 var(--cover-blue-width),
    transparent var(--cover-blue-width) 100%
  );
}

body.view-cover::after {
  background-image: url("cover-photo.jpeg");
  background-position: center;
  background-size: cover;
  left: var(--cover-blue-width);
  z-index: -1;
}

body.view-academic {
  --background: #fbf7ef;
  --header-background: rgba(251, 247, 239, 0.92);
  --nav-underline: currentColor;
}

body.view-fun {
  --line: rgba(251, 247, 239, 0.62);
  --background: #efd2c2;
  --header-background: rgba(239, 210, 194, 0.92);
  --nav-underline: #fbf7ef;
}

body.view-past-lives {
  --line: rgba(251, 247, 239, 0.62);
  --background: #d8d4e2;
  --header-background: rgba(216, 212, 226, 0.92);
  --nav-underline: #fbf7ef;
}

body.view-company {
  --line: rgba(251, 247, 239, 0.62);
  --background: #d6e4eb;
  --header-background: rgba(214, 228, 235, 0.92);
  --nav-underline: #fbf7ef;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: inherit;
}

.site-header {
  align-items: center;
  background: var(--header-background);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin: 0;
  max-width: none;
  padding: 22px 24px;
  position: relative;
  width: 100%;
}

.site-name {
  align-items: baseline;
  display: inline-flex;
  gap: 9px;
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
}

.chinese-name {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav {
  display: flex;
  gap: 22px;
}

.nav a {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover,
.nav a.is-active {
  color: var(--text);
}

.nav a.is-active {
  text-decoration: underline;
  text-decoration-color: var(--nav-underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

main {
  margin: 0 auto;
  max-width: 980px;
  padding: 0 24px;
}

.section {
  border-bottom: 1px solid var(--line);
  display: none;
  min-height: calc(100vh - 150px);
  padding: 76px 0;
}

.section.is-active {
  display: block;
}

.intro-section {
  padding-top: 112px;
}

.cover-section {
  border-bottom: 0;
  min-height: 100vh;
  padding: 0;
}

.section-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  margin: 0 0 18px;
}

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

h1 {
  font-size: clamp(2.5rem, 7vw, 4.7rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.02;
  margin-bottom: 24px;
  max-width: 760px;
}

h2 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.12;
  margin-bottom: 0;
}

h3 {
  font-size: 1.08rem;
  font-weight: 400;
  margin-bottom: 8px;
}

.intro {
  color: var(--muted);
  font-size: 1.18rem;
  max-width: 680px;
}

.intro-layout {
  align-items: end;
  display: grid;
  gap: 52px;
  grid-template-columns: minmax(0, 1fr) 220px;
}

.cover-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  min-height: 100vh;
}

.cover-copy {
  align-items: flex-start;
  display: flex;
  min-height: 100vh;
  padding: clamp(44px, 7vh, 70px) 0 76px;
  position: sticky;
  top: 0;
}

.cover-copy-inner {
  max-width: 620px;
}

.cover-title-placeholder {
  display: block;
  min-height: clamp(7.65rem, 14.3vw, 14.1rem);
}

.cover-spacer {
  min-height: 100vh;
  position: relative;
}

.cover-caption {
  bottom: 30px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 0;
  max-width: 340px;
  position: fixed;
  right: 30px;
  text-align: right;
}

.profile-photo {
  align-items: center;
  aspect-ratio: 3.7 / 4.3;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(23, 23, 23, 0.24);
  border-radius: 2px;
  box-shadow: none;
  display: flex;
  justify-content: center;
  margin: 0 0 0 -22px;
  overflow: hidden;
  position: relative;
  width: 258px;
}

.profile-photo img {
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: 60% 30%;
  position: absolute;
  transform: scale(1.1);
  width: 100%;
}

.profile-photo span {
  color: var(--muted);
  font-size: 2rem;
  font-weight: 600;
}


.section-title-row {
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  margin-bottom: 38px;
}

.section-title-row p,
.project-item p {
  color: var(--muted);
  margin-bottom: 0;
}

.project-list {
  display: grid;
  gap: 0;
}

.project-item {
  border-top: 1px solid var(--line);
  padding: 24px 0;
}

.project-item:last-child {
  padding-bottom: 0;
}

.project-note {
  margin-top: 14px;
}

.project-note h3,
.project-note p {
  color: var(--muted);
}

.past-life-list {
  border-top: 1px solid var(--line);
}

.past-life-item {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1fr) 150px;
  padding: 26px 0;
}

.past-life-heading h3 {
  margin-bottom: 0;
}

.past-life-copy {
  display: grid;
  gap: 10px;
}

.past-life-copy p {
  color: var(--muted);
  margin-bottom: 0;
}

.past-life-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.past-life-copy a {
  color: var(--text);
  font-size: 0.95rem;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.past-life-figure {
  align-self: start;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--photo-line);
  margin: 0;
  overflow: hidden;
}

.past-life-figure img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.past-life-figure figcaption {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 7px;
}

.past-life-figure.book-cover {
  aspect-ratio: 2 / 3;
  justify-self: start;
  width: 112px;
}

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

.company-item {
  margin: 0;
}

.company-photo {
  align-items: center;
  aspect-ratio: 4 / 3;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(23, 23, 23, 0.24);
  border-radius: 2px;
  box-shadow: none;
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
  position: relative;
}

.company-photo img {
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: left center;
  position: absolute;
  width: 100%;
}

.company-item:nth-child(3) .company-photo {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  width: 80%;
}

.company-item:nth-child(3) .company-photo img {
  object-position: 25% center;
  transform: scale(1.4);
}

.company-photo span {
  color: var(--muted);
  font-size: 0.92rem;
}

.company-item figcaption {
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer {
  color: var(--muted);
  margin: 0 auto;
  max-width: 980px;
  padding: 28px 24px 42px;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 700px) {
  body.view-cover::before {
    background: #3e668f;
  }

  body.view-cover::after {
    background-position: center;
    height: 48vh;
    inset: auto 0 0 0;
    left: 0;
    opacity: 0.92;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .nav {
    flex-wrap: wrap;
    gap: 12px 18px;
  }

  .section {
    padding: 58px 0;
  }

  .intro-section {
    padding-top: 78px;
  }

  .cover-section {
    min-height: 100vh;
    padding: 0;
  }

  .intro-layout {
    align-items: start;
    gap: 28px;
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .cover-layout {
    grid-template-columns: 1fr;
    min-height: 100vh;
  }

  .cover-copy {
    align-items: start;
    min-height: 100vh;
    padding: 58px 24px 52vh;
    position: relative;
  }

  .cover-spacer {
    display: none;
  }

  .cover-caption {
    bottom: 18px;
    left: 24px;
    max-width: calc(100vw - 48px);
    right: 24px;
  }

  .profile-photo {
    margin: 0;
    width: 188px;
  }

  .company-grid,
  .past-life-item {
    grid-template-columns: 1fr;
  }

  .past-life-figure,
  .past-life-figure.book-cover {
    max-width: 220px;
    width: 100%;
  }

  .section-title-row {
    grid-template-columns: 1fr;
  }
}
