/* --------------------------------------------------------------------------
   Xu Chen. — personal homepage
   Geist by Vercel, licensed under the SIL Open Font License 1.1.
   See assets/fonts/OFL.txt.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Geist";
  src: url("../assets/fonts/geist-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("../assets/fonts/geist-mono-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* Tokens ------------------------------------------------------------------ */

:root {
  color-scheme: light;

  --bg: #fafafa;
  --surface: #ffffff;
  --text: #171717;
  --muted: #71717a;
  --line: #e5e7eb;
  --line-strong: #d4d4d8;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --on-accent: #ffffff;

  --font-sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", "SFMono-Regular", Consolas,
    "Liberation Mono", monospace;

  --container: 960px;
  --gutter: 24px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0d1117;
  --surface: #161b22;
  --text: #f3f4f6;
  --muted: #a1a1aa;
  --line: #30363d;
  --line-strong: #3d444d;
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.14);
  --on-accent: #0d1117;
}

/* Base -------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 220ms ease, color 220ms ease;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

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

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

#main:focus {
  outline: none;
}

.container {
  width: min(calc(100% - (var(--gutter) * 2)), var(--container));
  margin-inline: auto;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 4px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transform: translateY(calc(-100% - 20px));
  transition: transform 160ms ease;
}

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

/* Header ------------------------------------------------------------------ */

.site-header {
  position: relative;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  padding-block: 6px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
  text-decoration: none;
}

.brand-dot {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 450;
  line-height: 1;
  letter-spacing: 0.005em;
  text-decoration: none;
  transition: color 180ms ease, background-color 180ms ease;
}

.nav-link:hover {
  background: var(--surface);
  color: var(--text);
}

.theme-toggle {
  display: none;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: 2px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease,
    border-color 180ms ease;
}

.js .theme-toggle {
  display: inline-grid;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.theme-icon {
  grid-area: 1 / 1;
  transition: opacity 180ms ease, transform 220ms var(--ease-out);
}

.theme-icon--sun {
  opacity: 0;
  transform: rotate(-40deg) scale(0.75);
}

html[data-theme="dark"] .theme-icon--sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}

html[data-theme="dark"] .theme-icon--moon {
  opacity: 0;
  transform: rotate(40deg) scale(0.75);
}

/* Hero -------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 46px 0 100px;
}

.hero-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow-mark {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.edition {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.13em;
  white-space: nowrap;
}

.edition-slash {
  margin-inline: 4px;
  color: var(--line-strong);
}

.hero-layout {
  position: relative;
  margin-top: 56px;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 650px;
}

.hero-title {
  font-size: clamp(3rem, 6.2vw, 4rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.065em;
  text-wrap: balance;
}

.hero-name {
  white-space: nowrap;
}

.accent-dot {
  color: var(--accent);
}

.hero-subtitle {
  margin-top: 19px;
  color: var(--muted);
  font-size: clamp(1.5rem, 2.6vw, 1.8rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.hero-intro {
  max-width: 590px;
  margin-top: 29px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.9;
  letter-spacing: 0.002em;
  text-wrap: pretty;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 35px;
}

.hero-links li {
  display: flex;
  align-items: center;
}

.hero-links li + li::before {
  width: 1px;
  height: 12px;
  margin-inline: 17px;
  background: var(--line-strong);
  content: "";
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-block: 6px;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.005em;
  text-decoration: none;
  transition: color 180ms ease;
}

.hero-link svg {
  color: var(--muted);
  transition: color 180ms ease, transform 180ms var(--ease-out);
}

.hero-link:hover {
  color: var(--accent);
}

.hero-link:hover svg {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.hero-link--anchor:hover svg {
  transform: translateY(2px);
}

/* Decorative coordinate field */

.hero-mark {
  position: absolute;
  top: 50%;
  right: 0;
  width: clamp(216px, 22vw, 264px);
  aspect-ratio: 1;
  color: var(--line-strong);
  transform: translateY(-52%);
  pointer-events: none;
}

.hero-mark svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.mark-grid {
  opacity: 0.55;
}

.mark-box {
  stroke: currentColor;
}

.mark-orbit {
  opacity: 0.85;
  stroke: currentColor;
}

.mark-cross {
  opacity: 0.7;
  stroke: currentColor;
}

.mark-ticks {
  opacity: 0.9;
  stroke: currentColor;
}

.mark-dot {
  fill: var(--accent);
}

.mark-label {
  position: absolute;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  line-height: 1;
  letter-spacing: 0.13em;
}

.mark-label--top {
  top: -17px;
  left: 1px;
}

.mark-label--bottom {
  right: 1px;
  bottom: -14px;
}

/* Shared section rhythm ---------------------------------------------------- */

.section {
  padding-block: 88px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: 38px;
}

.section-head-copy {
  flex: 0 0 auto;
}

.section-head::after {
  flex: 1 1 64px;
  height: 1px;
  margin-bottom: 11px;
  background: var(--line);
  content: "";
}

.section-kicker {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.section-kicker span {
  color: var(--text);
}

.section-head h2 {
  margin-top: 13px;
  font-size: clamp(1.375rem, 2.4vw, 1.5rem);
  letter-spacing: -0.04em;
}

/* Expertise --------------------------------------------------------------- */

.expertise-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(40px, 8vw, 88px);
}

.expertise-card {
  padding: 26px 0 38px;
  border-top: 1px solid var(--line);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.card-index {
  padding-top: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  line-height: 1;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.card-icon {
  color: var(--muted);
}

.expertise-card h3 {
  margin-top: 31px;
  font-size: 1.125rem;
  font-weight: 550;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.expertise-card p {
  max-width: 34em;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.8;
}

/* Selected work ----------------------------------------------------------- */

.work {
  padding-bottom: 96px;
}

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

.work-item {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  margin-inline: -16px;
  padding: 28px 16px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: background-color 220ms ease;
}

.work-item:focus-visible {
  background: var(--surface);
}

.work-item:focus-visible::before {
  opacity: 1;
  transform: scaleY(1);
}

.work-item::before {
  position: absolute;
  top: 21px;
  bottom: 21px;
  left: 0;
  width: 1px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleY(0.35);
  transform-origin: center;
  transition: opacity 220ms ease, transform 260ms var(--ease-out);
}

.work-index {
  padding-top: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.work-main h3 {
  font-size: 1.125rem;
  font-weight: 550;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.work-main p {
  max-width: 430px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 2px;
}

.tag {
  padding: 4px 8px 5px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  line-height: 1.2;
  letter-spacing: 0.015em;
  white-space: nowrap;
  transition: border-color 220ms ease, color 220ms ease;
}

@media (hover: hover) {
  .work-item:hover {
    background: var(--surface);
  }

  .work-item:hover::before {
    opacity: 1;
    transform: scaleY(1);
  }

  .work-item:hover .tag {
    border-color: var(--line-strong);
    color: var(--text);
  }
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
  padding: 78px 0 30px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  transition: background-color 220ms ease, border-color 220ms ease;
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 48px;
  align-items: end;
}

.footer-title {
  margin-top: 16px;
  font-size: clamp(2.35rem, 4.8vw, 3.25rem);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -0.06em;
  text-wrap: balance;
}

.footer-note {
  max-width: 240px;
  margin-bottom: 8px;
  justify-self: end;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.8;
  text-align: right;
}

.footer-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 52px;
  border-top: 1px solid var(--line);
}

.footer-link {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 23px 0 21px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: color 180ms ease;
}

.footer-link-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  line-height: 1.2;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: color 180ms ease;
}

.footer-link-head svg {
  color: var(--muted);
  transition: color 180ms ease, transform 180ms var(--ease-out);
}

.footer-link-value {
  font-size: 1.125rem;
  font-weight: 450;
  line-height: 1.35;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.footer-link:hover {
  color: var(--accent);
}

.footer-link:hover .footer-link-head {
  color: var(--accent);
}

.footer-link:hover .footer-link-head svg {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  flex-wrap: wrap;
  margin-top: 54px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.6;
}

.copyright {
  letter-spacing: 0.003em;
}

.filings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  font-size: 0.6875rem;
}

.filing {
  overflow-wrap: anywhere;
}

.filing a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  transition: color 180ms ease, border-color 180ms ease;
}

.filing a:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-block: 4px;
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 1;
  text-decoration: none;
  transition: color 180ms ease;
}

.back-to-top svg {
  transition: transform 180ms var(--ease-out);
}

.back-to-top:hover {
  color: var(--text);
}

.back-to-top:hover svg {
  transform: translateY(-2px);
}

/* Entry motion ------------------------------------------------------------ */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.hero-kicker,
.hero-title,
.hero-subtitle,
.hero-intro,
.hero-links {
  animation: fade-up 440ms var(--ease-out) both;
}

.hero-kicker {
  animation-delay: 40ms;
}

.hero-title {
  animation-delay: 90ms;
}

.hero-subtitle {
  animation-delay: 140ms;
}

.hero-intro {
  animation-delay: 190ms;
}

.hero-links {
  animation-delay: 240ms;
}

.hero-mark {
  animation: fade-in 460ms ease 180ms both;
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 920px) {
  .hero-mark {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --gutter: 20px;
  }

  .header-inner {
    min-height: 68px;
  }

  .hero {
    padding: 38px 0 86px;
  }

  .hero-layout {
    margin-top: 46px;
  }

  .hero-title {
    font-size: clamp(2.75rem, 8.5vw, 3.5rem);
  }

  .hero-subtitle {
    font-size: clamp(1.375rem, 4.6vw, 1.5rem);
  }

  .hero-intro {
    font-size: 0.9375rem;
    line-height: 1.85;
  }

  .section {
    padding-block: 72px;
  }

  .work {
    padding-bottom: 80px;
  }

  .section-head {
    margin-bottom: 32px;
  }

  .work-item {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 14px 18px;
    padding: 26px 12px;
    margin-inline: -12px;
  }

  .tag-list {
    grid-column: 2;
    justify-content: flex-start;
    padding-top: 0;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .footer-note {
    margin-bottom: 0;
    justify-self: start;
    max-width: none;
    text-align: left;
  }

  .site-footer {
    padding-top: 68px;
  }
}

@media (max-width: 640px) {
  .nav-link {
    padding-inline: 8px;
  }

  .theme-toggle {
    margin-left: 1px;
  }

  .hero {
    padding-top: 32px;
    padding-bottom: 74px;
  }

  .hero-layout {
    margin-top: 40px;
  }

  .hero-title {
    font-size: clamp(2.5rem, 10.8vw, 3.4rem);
  }

  .hero-subtitle {
    margin-top: 15px;
  }

  .hero-intro {
    margin-top: 25px;
  }

  .hero-links {
    margin-top: 30px;
  }

  .hero-links li + li::before {
    margin-inline: 14px;
  }

  .section {
    padding-block: 62px;
  }

  .work {
    padding-bottom: 70px;
  }

  .section-head {
    gap: 20px;
    margin-bottom: 28px;
  }

  .section-head::after {
    margin-bottom: 8px;
  }

  .section-head h2 {
    margin-top: 11px;
  }

  .expertise-grid {
    grid-template-columns: 1fr;
    column-gap: 0;
  }

  .expertise-card {
    padding: 23px 0 27px;
  }

  .expertise-card h3 {
    margin-top: 22px;
    font-size: 1.0625rem;
  }

  .expertise-card p {
    margin-top: 8px;
    font-size: 0.84375rem;
  }

  .work-item {
    padding-block: 24px;
  }

  .work-main h3 {
    font-size: 1.0625rem;
  }

  .footer-title {
    font-size: clamp(1.875rem, 8.5vw, 2.4rem);
  }

  .footer-links {
    margin-top: 40px;
  }

  .footer-link {
    padding-block: 20px;
  }

  .footer-link-value {
    font-size: 1rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-top: 38px;
    padding-top: 20px;
  }

  .filings {
    order: 2;
  }

  .back-to-top {
    order: 3;
  }
}

@media (max-width: 560px) {
  .edition {
    display: none;
  }

  .eyebrow {
    font-size: 0.625rem;
    letter-spacing: 0.11em;
  }

  .header-inner {
    min-height: 64px;
  }

  .brand {
    font-size: 0.9375rem;
  }

  .site-nav {
    gap: 1px;
  }

  .nav-link {
    font-size: 0.78125rem;
    padding-inline: 7px;
  }

}

@media (max-width: 380px) {
  .hero-links {
    gap: 2px 0;
  }

  .hero-links li + li::before {
    margin-inline: 11px;
  }

  .work-index {
    font-size: 0.625rem;
  }

  .tag {
    padding-inline: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
