:root {
  --xh-paper: #fbfaf7;
  --xh-paper-strong: #ffffff;
  --xh-ink: #172033;
  --xh-muted: #626a78;
  --xh-line: #d9d8d2;
  --xh-midnight: #102039;
  --xh-midnight-soft: #1f3049;
  --xh-rose: #c85f7b;
  --xh-rose-soft: #f8edf0;
  --xh-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --xh-sans: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

html[data-theme="dark"] {
  --xh-paper: #0c1422;
  --xh-paper-strong: #111d2e;
  --xh-ink: #f3efe8;
  --xh-muted: #aeb6c4;
  --xh-line: #2d3a4d;
  --xh-midnight: #e7edf6;
  --xh-midnight-soft: #cfd9e8;
  --xh-rose: #ee8da7;
  --xh-rose-soft: #321d2a;
}

body {
  background: var(--xh-paper);
  color: var(--xh-ink);
  font-family: var(--xh-sans);
  letter-spacing: 0.005em;
}

body,
.navbar {
  background-color: var(--xh-paper) !important;
}

h1,
h2,
h3,
.navbar-brand {
  color: var(--xh-ink);
  font-family: var(--xh-serif);
  font-weight: 600;
  letter-spacing: -0.025em;
}

a {
  color: var(--xh-midnight);
}

a:hover,
a:focus {
  color: var(--xh-rose);
}

.navbar {
  border-bottom: 1px solid var(--xh-line);
  box-shadow: none !important;
}

.navbar .navbar-brand {
  font-size: 1.28rem;
}

.navbar .nav-link {
  color: var(--xh-muted) !important;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--xh-ink) !important;
}

main.container {
  padding-top: 2.25rem;
}

footer {
  border-top-color: var(--xh-line) !important;
  color: var(--xh-muted) !important;
}

.xh-home,
.xh-page {
  margin: 0 auto;
  max-width: 1120px;
}

.xh-hero {
  align-items: center;
  display: grid;
  gap: clamp(2.5rem, 6vw, 5.5rem);
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  min-height: 66vh;
  padding: 3.5rem 0 5rem;
}

.xh-eyebrow {
  color: var(--xh-rose);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 0 0 1.25rem;
  text-transform: uppercase;
}

.xh-hero h1 {
  font-size: clamp(2.35rem, 5vw, 4.25rem);
  line-height: 1.18;
  margin: 0 0 1.5rem;
}

.xh-hero-lead {
  color: var(--xh-muted);
  font-family: var(--xh-serif);
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  line-height: 1.85;
  margin: 0;
  max-width: 42rem;
}

.xh-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.xh-button {
  align-items: center;
  background: var(--xh-midnight);
  border: 1px solid var(--xh-midnight);
  color: var(--xh-paper-strong) !important;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 650;
  gap: 1.25rem;
  justify-content: space-between;
  min-width: 9.6rem;
  padding: 0.82rem 1rem;
  text-decoration: none !important;
}

.xh-button--ghost {
  background: transparent;
  border-color: var(--xh-line);
  color: var(--xh-ink) !important;
}

.xh-button:hover,
.xh-button:focus {
  background: var(--xh-rose);
  border-color: var(--xh-rose);
  color: #fff !important;
}

.xh-hero-figure {
  margin: 0;
}

.xh-hero-figure img {
  aspect-ratio: 1;
  display: block;
  height: auto;
  object-fit: cover;
  width: 100%;
}

.xh-hero-figure figcaption {
  color: var(--xh-muted);
  font-size: 0.68rem;
  margin-top: 0.65rem;
}

.xh-section {
  border-top: 1px solid var(--xh-line);
  padding: 3.25rem 0 4rem;
}

.xh-section-heading {
  align-items: baseline;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.xh-section-heading h2 {
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  margin: 0;
}

.xh-section-heading a {
  color: var(--xh-muted);
  font-size: 0.82rem;
  text-decoration: none;
}

.xh-grid {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.xh-project-card {
  background: var(--xh-paper-strong);
  border: 1px solid var(--xh-line);
  color: var(--xh-ink) !important;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  text-decoration: none !important;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.xh-project-card:hover {
  border-color: var(--xh-rose);
  transform: translateY(-2px);
}

.xh-project-card img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  width: 100%;
}

.xh-project-card__body {
  padding: 1.2rem 1.25rem 1.35rem;
}

.xh-card-topline {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.xh-card-topline h3 {
  font-size: 1.22rem;
  margin: 0;
}

.xh-project-card p,
.xh-thought p {
  color: var(--xh-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 0.8rem 0 0;
}

.xh-demo-badge {
  border: 1px solid var(--xh-rose);
  color: var(--xh-rose);
  display: inline-block;
  flex: 0 0 auto;
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  padding: 0.18rem 0.35rem;
}

.xh-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.xh-tag {
  background: var(--xh-rose-soft);
  color: var(--xh-rose);
  font-size: 0.7rem;
  padding: 0.18rem 0.42rem;
}

.xh-thought-list {
  border: 1px solid var(--xh-line);
}

.xh-thought {
  align-items: center;
  color: var(--xh-ink) !important;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr auto auto;
  padding: 1.3rem 1.4rem;
  text-decoration: none !important;
}

.xh-thought + .xh-thought {
  border-top: 1px solid var(--xh-line);
}

.xh-thought:hover {
  background: var(--xh-paper-strong);
}

.xh-thought h3 {
  font-size: 1.1rem;
  margin: 0;
}

.xh-meta {
  color: var(--xh-muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.xh-arrow {
  color: var(--xh-rose);
  font-size: 1.15rem;
}

.xh-academic-snapshot {
  align-items: start;
  background: var(--xh-paper-strong);
  border: 1px solid var(--xh-line);
  display: grid;
  gap: 1.5rem;
  grid-template-columns: auto 1fr;
  padding: 1.5rem;
}

.xh-academic-mark {
  color: var(--xh-midnight);
  font-family: var(--xh-serif);
  font-size: 2rem;
  line-height: 1;
}

.xh-academic-snapshot p {
  line-height: 1.8;
  margin: 0;
}

.xh-contact {
  align-items: center;
  border: 1px solid var(--xh-line);
  color: var(--xh-ink) !important;
  display: flex;
  justify-content: space-between;
  padding: 1.25rem 1.4rem;
  text-decoration: none !important;
}

.xh-page-header {
  padding: 2.5rem 0 2rem;
}

.xh-page-header h1 {
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  margin: 0 0 0.8rem;
}

.xh-page-header p {
  color: var(--xh-muted);
  font-size: 1rem;
  line-height: 1.75;
  margin: 0;
  max-width: 48rem;
}

.xh-demo-notice {
  background: var(--xh-rose-soft);
  border-left: 2px solid var(--xh-rose);
  color: var(--xh-muted);
  font-size: 0.78rem;
  line-height: 1.65;
  margin-bottom: 2rem;
  padding: 0.75rem 0.9rem;
}

.xh-projects-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-bottom: 4rem;
}

.xh-blog-list {
  border-top: 1px solid var(--xh-line);
  margin-bottom: 4rem;
}

.xh-blog-row {
  align-items: start;
  border-bottom: 1px solid var(--xh-line);
  color: var(--xh-ink) !important;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 1.5rem 0.25rem;
  text-decoration: none !important;
}

.xh-blog-row h2 {
  font-size: 1.28rem;
  margin: 0;
}

.xh-blog-row p {
  color: var(--xh-muted);
  line-height: 1.65;
  margin: 0.55rem 0 0;
}

.xh-blog-row__meta {
  align-items: end;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.xh-academic-grid {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 4rem;
}

.xh-academic-block {
  border-top: 1px solid var(--xh-line);
  min-height: 12rem;
  padding: 1.6rem 2rem 1.6rem 0;
}

.xh-academic-block:nth-child(2n) {
  border-left: 1px solid var(--xh-line);
  padding-left: 2rem;
}

.xh-academic-block h2 {
  font-size: 1.2rem;
  margin: 0 0 1rem;
}

.xh-academic-block li,
.xh-academic-block p {
  color: var(--xh-muted);
  line-height: 1.75;
}

.xh-detail-cover {
  aspect-ratio: 3 / 2;
  margin: 1.5rem 0 2rem;
  object-fit: cover;
  width: 100%;
}

.xh-callout {
  background: var(--xh-paper-strong);
  border-left: 2px solid var(--xh-rose);
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
}

.xh-code-window {
  background: #0d1829;
  color: #f5f0e7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  margin: 1.5rem 0;
  overflow-x: auto;
  padding: 1.25rem;
}

.xh-project-meta {
  border-bottom: 1px solid var(--xh-line);
  color: var(--xh-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
}

.post article blockquote {
  border-left-color: var(--xh-rose) !important;
  color: var(--xh-ink);
  font-family: var(--xh-serif);
  font-size: 1.18rem;
}

.post-title,
.post-header h1 {
  font-family: var(--xh-serif) !important;
}

@media (max-width: 900px) {
  .xh-hero {
    gap: 2.5rem;
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 2rem;
  }

  .xh-hero-copy {
    order: 1;
  }

  .xh-hero-figure {
    max-width: 38rem;
    order: 2;
  }

  .xh-projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  main.container {
    padding-top: 1.25rem;
  }

  .xh-hero {
    padding-bottom: 3rem;
  }

  .xh-hero h1 {
    font-size: 2.25rem;
  }

  .xh-grid,
  .xh-projects-grid,
  .xh-academic-grid {
    grid-template-columns: 1fr;
  }

  .xh-academic-block:nth-child(2n) {
    border-left: 0;
    padding-left: 0;
  }

  .xh-thought {
    gap: 0.8rem;
    grid-template-columns: 1fr auto;
  }

  .xh-thought .xh-meta {
    display: none;
  }

  .xh-section-heading {
    align-items: start;
    flex-direction: column;
  }

  .xh-blog-row {
    grid-template-columns: 1fr;
  }

  .xh-blog-row__meta {
    align-items: start;
    flex-direction: row;
  }

  .xh-academic-snapshot {
    grid-template-columns: 1fr;
  }
}

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