:root {
  color-scheme: dark;
  --font-sans: "Google Sans", "Google Sans Variable", Arial, sans-serif;
  --font-sans-cjk: "Noto Sans SC", "Google Sans", "Google Sans Variable", Arial, sans-serif;
  --font-mono: "SFMono-Regular", "Roboto Mono", Consolas, monospace;

  --black: #120108;
  --white: #fcfdff;
  --neon: #f91d7a;

  --white-72: rgba(252, 253, 255, 0.72);
  --white-48: rgba(252, 253, 255, 0.48);
  --white-24: rgba(252, 253, 255, 0.24);
  --white-16: rgba(252, 253, 255, 0.16);
  --white-8: rgba(252, 253, 255, 0.08);
  --black-72: rgba(18, 1, 8, 0.72);
  --black-48: rgba(18, 1, 8, 0.48);
  --black-12: rgba(18, 1, 8, 0.12);

  --bg: var(--black);
  --text: var(--white);
  --muted: var(--white-72);
  --soft: var(--white-48);
  --line: var(--white-16);
  --accent: var(--neon);

  --page: min(100% - 128px, 1280px);
  --gap: 8px;
  --card-radius: clamp(20px, calc(3vw - 4px), 36px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 400;
  line-height: 28px;
  letter-spacing: 0;
}

body.has-lightbox {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

img {
  display: block;
  width: 100%;
}

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

button {
  font: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

h1,
h2,
p,
figure {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 20;
  transform: translateY(-150%);
  background: var(--white);
  color: var(--black);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 16px;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.intro,
.period,
.site-footer {
  width: var(--page);
  margin: 0 auto;
}

.site-header {
  padding-top: 112px;
}

.nav {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 32px;
}

.brand,
.nav-actions a {
  color: var(--accent);
  font-size: 28px;
  font-weight: 400;
  line-height: 36px;
  text-transform: lowercase;
}

.brand:hover,
.nav-actions a:hover {
  color: var(--white);
}

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

.period-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  font-size: 14px;
  font-weight: 400;
  line-height: 0.75;
  text-align: center;
  opacity: 0.5;
  transition: opacity 160ms ease;
}

.period-nav a[aria-current="true"] {
  opacity: 1;
}

.period-nav a:hover {
  opacity: 0.8;
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 32px;
  white-space: nowrap;
}



.language-switch {
  display: flex;
  gap: 16px;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.language-switch button {
  display: block;
  padding: 10px 4px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 28px;
  font-weight: 400;
  line-height: 36px;
  text-align: center;
  text-transform: lowercase;
  cursor: pointer;
  opacity: 0.72;
  transition:
    color 180ms ease,
    opacity 180ms ease;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.language-switch button[aria-checked="true"] {
  color: var(--white);
  opacity: 1;
}

.intro {
  padding: 24px 0 120px;
}

.intro-body {
  max-width: 1120px;
}

.intro-text {
  font-size: 28px;
  font-weight: 400;
  line-height: 36px;
  white-space: pre-line;
  max-width: 1120px;
  margin-bottom: 24px;
}


.period {
  padding: 0 0 96px;
  content-visibility: auto;
  contain-intrinsic-size: 1200px;
}

.period + .period {
  padding-top: 0;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense;
  grid-auto-rows: 1px;
  gap: var(--gap);
}

.bento-item {
  min-width: 0;
  overflow: hidden;
  border-radius: var(--card-radius);
  corner-shape: squircle;
}

.period-date-tile {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  align-self: start;
  border-radius: 50%;
  padding: 24px;
  background: var(--accent);
  color: var(--white);
}

.period-tile-title {
  display: grid;
  place-items: center;
  gap: 0;
  width: 100%;
  max-width: 88%;
  font-size: 28px;
  font-weight: 400;
  line-height: 0.75;
  letter-spacing: 0;
  text-align: center;
  white-space: pre-line;
  text-wrap: balance;
}

.period-description-tile {
  display: flex;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
  padding: 28px;
  border: 0;
  background: var(--accent);
  color: var(--white);
  cursor: zoom-in;
  font: inherit;
  text-align: left;
  transition: filter 220ms ease;
}

.period-description-tile:hover {
  filter: brightness(1.06) saturate(1.06);
}

.period-tile-description {
  min-width: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 28px;
  overflow-wrap: anywhere;
}

.bento-image {
  display: block;
  overflow: visible;
  border-radius: 0;
  line-height: 0;
}

.image-button {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--card-radius);
  corner-shape: squircle;
  overflow: hidden;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
  line-height: 0;
  transition:
    filter 220ms ease,
    opacity 220ms ease;
}

.image-button:hover {
  filter: brightness(1.06) saturate(1.06);
  opacity: 0.92;
}

.image-button:active {
  transform: translateY(0);
}

.bento-image img,
.bento-video video {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--card-radius);
  corner-shape: squircle;
  object-fit: cover;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0;
  touch-action: pan-x pan-y;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 180ms ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox.is-open {
  opacity: 1;
}

.lightbox-scrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #000;
  cursor: zoom-out;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-stage {
  position: absolute;
  inset: 64px;
  z-index: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.lightbox-stage img,
.lightbox-stage video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 0;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  object-fit: contain;
  transform-origin: center;
  will-change: transform, filter;
  -webkit-user-drag: none;
}

.lightbox-stage video {
  pointer-events: auto;
}

.lightbox-stage img[hidden],
.lightbox-stage video[hidden] {
  display: none;
}

.lightbox-period-card {
  position: relative;
  width: min(100%, 760px);
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: clamp(28px, 5vw, 64px);
  border-radius: var(--card-radius);
  corner-shape: squircle;
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  pointer-events: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.45) transparent;
  transform-origin: center;
  will-change: transform, opacity;
}

.lightbox-period-close {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: calc(clamp(28px, 5vw, 64px) * -0.45) calc(clamp(28px, 5vw, 64px) * -0.45) 8px auto;
  padding: 0 0 4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
  opacity: 0.9;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.lightbox-period-close:hover {
  opacity: 1;
  transform: scale(1.08);
}

.lightbox-period-close:active {
  transform: scale(0.94);
}

.lightbox-period-card[hidden] {
  display: none;
}

.lightbox-period-card.is-date {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.lightbox-period-card.is-date .lightbox-period-title {
  font-size: 28px;
  line-height: 36px;
  text-align: center;
  text-wrap: balance;
  white-space: pre-line;
}

.lightbox-period-card.is-date .lightbox-period-body,
.lightbox-period-card.is-date .lightbox-period-toggle {
  display: none;
}

.lightbox-period-title {
  font-size: 28px;
  font-weight: 400;
  line-height: 36px;
}

.lightbox-period-body {
  margin-top: 32px;
  white-space: pre-line;
  font-size: 20px;
  line-height: 28px;
}

.lightbox-period-toggle {
  margin-top: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font-size: 20px;
  line-height: 28px;
  text-decoration: underline;
  text-underline-offset: 5px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-period-footer {
  display: grid;
  gap: 20px;
  margin-top: clamp(40px, 6vw, 72px);
}

.lightbox-period-footer[hidden] {
  display: none;
}

.lightbox-period-bottom-close {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font-size: 20px;
  line-height: 28px;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-transform: lowercase;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-period-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.lightbox-period-links a {
  color: var(--white);
  font-size: 20px;
  line-height: 28px;
  opacity: 0.72;
  text-transform: lowercase;
  transition:
    opacity 160ms ease,
    color 160ms ease;
}

.lightbox-period-links a:hover {
  opacity: 1;
}

.lightbox-period-links a[aria-current="true"] {
  opacity: 1;
  cursor: default;
  pointer-events: none;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  cursor: pointer;
  font-size: 48px;
  font-weight: 300;
  line-height: 1;
  transform: translateY(-50%);
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.lightbox-arrow:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-50%) scale(1.06);
}

.lightbox-arrow:active {
  transform: translateY(-50%) scale(0.96);
}

.lightbox-arrow-prev {
  left: 24px;
}

.lightbox-arrow-next {
  right: 24px;
}

.lightbox-arrow[hidden] {
  display: none;
}

.empty-note {
  color: var(--white-48);
  font-size: 20px;
  font-weight: 400;
  line-height: 28px;
}

.site-footer {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 32px;
  padding: 48px 0 96px;
}

.footer-brand {
  color: var(--accent);
  font-size: 28px;
  font-weight: 400;
  line-height: 36px;
  text-transform: lowercase;
}

.footer-brand:hover {
  color: var(--white);
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px 24px;
}

.footer-actions a {
  color: var(--accent);
  font-size: 28px;
  font-weight: 400;
  line-height: 36px;
  text-transform: lowercase;
}

.footer-actions a:hover {
  color: var(--white);
}

.site-footer-copyright {
  color: var(--white);
  font-size: 28px;
  font-weight: 400;
  line-height: 36px;
  text-transform: lowercase;
}

@keyframes bento-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.bento-item--loading {
  border-radius: var(--card-radius);
  overflow: hidden;
  background: linear-gradient(90deg, var(--white-8) 25%, var(--white-16) 50%, var(--white-8) 75%);
  background-size: 200% 100%;
  animation: bento-shimmer 1.4s ease-in-out infinite;
}

.bento-item--loading img {
  opacity: 0;
}

.bento-image img {
  transition: opacity 0.25s ease;
}

@media (min-width: 1360px) {
  :root {
    --page: min(100% - 80px, 1280px);
  }

  .bento-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  :root {
    --page: min(100% - 64px, 1280px);
  }

  .site-header {
    padding-top: 80px;
  }

  .nav {
    grid-template-columns: 1fr auto;
    gap: 20px 32px;
  }

  .bento-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .period-description-tile {
    padding: 22px;
  }

  .period-tile-title {
    font-size: 28px;
    line-height: 0.75;
  }

  .period-tile-description {
    font-size: 20px;
    line-height: 28px;
  }
}

@media (max-width: 760px) {
  :root {
    --page: min(100% - 56px, 460px);
    --card-radius: clamp(8px, calc(2.4vw - 4px), 16px);
  }

  .site-header {
    padding-top: 44px;
  }

  .nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .nav-actions {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
  }

  .period-nav {
    display: flex;
    flex-wrap: nowrap;
    width: 100vw;
    margin: 24px calc(50% - 50vw) 0;
    padding: 0 calc(50vw - 50%) 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

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

  .intro {
    padding: 44px 0 48px;
  }

  .intro-text,
  .brand,
  .nav-actions a,
  .footer-brand,
  .footer-actions a,
  .footer-actions span {
    font-size: 28px;
    line-height: 36px;
  }

  .intro-text {
    max-width: 330px;
  }


  .period {
    padding-bottom: 56px;
  }

  .period-date-tile {
    padding: 10px;
  }

  .period-tile-title {
    font-size: 20px;
    line-height: 0.75;
  }

  .period-description-tile {
    padding: 16px;
  }

  .period-tile-description {
    font-size: 20px;
    line-height: 28px;
  }

  .bento-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bento-image {
    min-height: 0;
  }

  .lightbox-stage {
    inset: 24px;
  }

  .lightbox-arrow {
    width: 44px;
    height: 44px;
    padding-bottom: 4px;
    font-size: 38px;
  }

  .lightbox-arrow-prev {
    left: 10px;
  }

  .lightbox-arrow-next {
    right: 10px;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-bottom: 72px;
  }

  .footer-actions {
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
  }
}

@media (max-width: 420px) {
  :root {
    --page: min(100% - 40px, 460px);
  }

  .site-header {
    padding-top: 36px;
  }

  .period-tile-title {
    max-width: 92%;
    font-size: 20px;
    line-height: 0.75;
  }
}

.cv-page {
  font-size: 20px;
  line-height: 28px;
}

.cv-page .site-header,
.cv {
  width: var(--page);
  margin: 0 auto;
}

.cv :where(h2, h3, p, a, li, dt, dd, span) {
  font-size: inherit;
  line-height: inherit;
}

.brand[aria-current="page"],
.nav-actions a[aria-current="page"] {
  color: var(--white);
}

.cv {
  padding: 24px 0 112px;
}

.cv-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: end;
  padding: 0 0 72px;
}

.cv-hero-copy {
  display: grid;
  gap: 16px;
}

.cv-toc a,
.cv-section-title {
  color: var(--accent);
}

.cv-title {
  max-width: 960px;
  color: var(--white);
  font-size: 28px;
  font-weight: 400;
  line-height: 36px;
  letter-spacing: 0;
}

.cv-hero-copy p {
  font-size: 28px;
  line-height: 36px;
}

.cv-section-title {
  margin: 0 0 16px;
}

.cv-toc-period {
  display: inline;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cv-toc-dash {
  padding: 0 0.3em;
}

.cv-toc a {
  color: var(--white);
  white-space: nowrap;
  overflow-wrap: normal;
  transition:
    color 160ms ease,
    opacity 160ms ease;
}

.cv-toc a:hover,
.cv-section a:hover {
  color: var(--accent);
}

.cv-toc a[aria-current="true"] {
  color: var(--accent);
}

.cv-toc-period {
  opacity: 0.62;
}

.cv-toc-period[aria-current="true"],
.cv-toc-period:hover {
  opacity: 1;
}

.cv-layout {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 72px;
  padding-top: 48px;
}

.cv-aside {
  position: sticky;
  top: 24px;
  align-self: start;
  min-width: 0;
}

.cv-toc {
  display: grid;
  gap: 8px;
}

.cv-content {
  min-width: 0;
}

.cv-section {
  display: block;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.cv-content > .cv-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.cv-section-title,
.cv-job h3 {
  font-weight: 400;
}

.cv-section-body,
.cv-job-body,
.cv-jobs {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.cv-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 0;
  list-style: none;
  min-width: 0;
}

.cv-list li {
  position: relative;
  padding-left: 0;
}

.cv-list li::before {
  content: "•";
  position: absolute;
  top: 0;
  left: -1em;
  color: var(--white-48);
  font-size: 0.72em;
  line-height: inherit;
}

.cv :where(p, a, li, h1, h2, h3, dt, dd) {
  overflow-wrap: anywhere;
}

.cv-job {
  display: grid;
  gap: 16px;
  padding-top: 28px;
  border-top: 1px solid var(--white-8);
  min-width: 0;
}

.cv-job:first-child {
  padding-top: 0;
  border-top: 0;
}

.cv-job-head {
  display: grid;
  gap: 4px;
  align-content: start;
}

.cv-job-date {
  font-variant-numeric: tabular-nums;
  overflow-wrap: normal;
}

.cv-job-date-dash {
  padding: 0 0.3em;
}

.cv-job-head p,
.cv-section-body p + p {
  color: var(--muted);
}

@media (max-width: 900px) {
  .cv-page .nav,
  .cv-hero,
  .cv-layout,
  .cv-section,
  .cv-job {
    grid-template-columns: 1fr;
  }

  .cv-page .nav-actions {
    justify-content: start;
  }

  .cv-layout,
  .cv-section,
  .cv-job {
    gap: 16px;
  }

  .cv-aside {
    position: static;
  }

  .cv-toc {
    display: flex;
    flex-wrap: nowrap;
    max-width: 100%;
    margin: 0;
    padding: 0 0 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .cv-toc::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 760px) {
  .cv-page .site-header {
    padding-top: 44px;
  }

  .cv-toc {
    display: none;
  }

  .nav-actions .language-switch button {
    padding: 0 4px;
  }

  .cv :where(p, a, li, h2, h3, dt, dd, span) {
    font-size: 20px;
    line-height: 28px;
  }

  .cv-page .nav-actions {
    display: flex;
  }

  .cv-title,
  .cv-hero-copy p {
    font-size: 28px;
    line-height: 36px;
  }

  .cv {
    padding: 44px 0 72px;
  }

  .cv-hero {
    gap: 40px;
    padding: 0 0 48px;
  }

  .cv-layout {
    padding-top: 32px;
  }

  .cv-section {
    padding: 28px 0;
  }

  .cv-job {
    padding-top: 24px;
  }
}

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

body[data-lang="zh"] {
  font-family: var(--font-sans-cjk);
}
