:root {
  color-scheme: dark;
  --bg: #11130f;
  --bg-soft: #171912;
  --surface: #1e2118;
  --surface-2: #25291e;
  --paper: #efe5cf;
  --paper-soft: rgba(239, 229, 207, 0.72);
  --muted: rgba(239, 229, 207, 0.62);
  --faint: rgba(239, 229, 207, 0.42);
  --line: rgba(239, 229, 207, 0.14);
  --line-strong: rgba(239, 229, 207, 0.24);
  --amber: #d88a4c;
  --moss: #7f9d73;
  --rust: #b86343;
  --ink: #0c0d0a;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --shadow-soft:
    rgba(0, 0, 0, 0.28) 0 10px 28px,
    rgba(0, 0, 0, 0.18) 0 2px 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(216, 138, 76, 0.06), transparent 420px),
    linear-gradient(90deg, rgba(239, 229, 207, 0.02) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 72px 72px, auto;
  color: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 9px, rgba(239, 229, 207, 0.022) 9px 10px),
    linear-gradient(115deg, transparent, rgba(127, 157, 115, 0.08), transparent);
}

::selection {
  background: var(--amber);
  color: var(--ink);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 1000;
  transform: translateY(-140%);
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition: transform 160ms var(--ease-out);
}

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

.page-shell {
  width: min(100%, 1500px);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 64px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 48px);
  background: rgba(17, 19, 15, 0.72);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  transition:
    border-color 180ms var(--ease-out),
    background-color 180ms var(--ease-out);
}

.site-header[data-elevated="true"] {
  background: rgba(17, 19, 15, 0.88);
  border-color: var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--paper);
  font-weight: 600;
  white-space: nowrap;
}

.brand img {
  width: 28px;
  height: 28px;
  display: block;
  border-radius: 7px;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 3vw, 34px);
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition:
    color 160ms var(--ease-out),
    transform 160ms var(--ease-out);
}

.site-nav a:hover {
  color: var(--paper);
}

.site-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon-action,
.rail-btn,
.modal-close {
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(239, 229, 207, 0.04);
  color: var(--paper-soft);
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
  transition:
    color 150ms var(--ease-out),
    background-color 150ms var(--ease-out),
    border-color 150ms var(--ease-out),
    transform 120ms var(--ease-out);
}

.icon-action svg,
.rail-btn svg,
.modal-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-action:first-child svg,
.icon-action[href] svg {
  fill: currentColor;
  stroke: none;
}

.icon-action:hover,
.rail-btn:hover,
.modal-close:hover {
  color: var(--paper);
  background: rgba(239, 229, 207, 0.08);
  border-color: var(--line-strong);
}

.icon-action:active,
.rail-btn:active,
.modal-close:active,
.primary-link:active,
.secondary-link:active,
.more-link:active {
  transform: scale(0.97);
}

.icon-action[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: max-content;
  max-width: 160px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(30, 33, 24, 0.96);
  color: var(--paper);
  font-size: 12px;
  line-height: 1.3;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition:
    opacity 140ms var(--ease-out),
    transform 140ms var(--ease-out);
}

.icon-action[data-tip]:hover::after,
.icon-action[data-tip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

main {
  display: flex;
  flex-direction: column;
  gap: clamp(56px, 9vw, 120px);
  padding-bottom: 64px;
  min-width: 0;
}

main > * {
  min-width: 0;
}

.personal-hero {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.8fr);
  align-items: center;
  gap: clamp(36px, 7vw, 92px);
  padding: clamp(54px, 8vw, 110px) clamp(20px, 5vw, 64px) 32px;
}

.hero-copy {
  min-width: 0;
}

.kicker,
.section-label,
.orbit-top,
.board-top {
  margin: 0;
  color: var(--amber);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 920px;
  margin: 18px 0 24px;
  color: var(--paper);
  font-size: clamp(46px, 8vw, 112px);
  line-height: 0.98;
  font-weight: 600;
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-lede {
  max-width: 620px;
  margin: 0;
  color: var(--paper-soft);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.78;
  text-wrap: pretty;
}

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

.primary-link,
.secondary-link,
.more-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  touch-action: manipulation;
  transition:
    color 160ms var(--ease-out),
    background-color 160ms var(--ease-out),
    border-color 160ms var(--ease-out),
    transform 120ms var(--ease-out);
}

.primary-link {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid transparent;
  box-shadow: rgba(216, 138, 76, 0.22) 0 12px 34px;
}

.primary-link:hover {
  background: #fff2d9;
}

.secondary-link,
.more-link {
  color: var(--paper);
  border: 1px solid var(--line);
  background: rgba(239, 229, 207, 0.04);
}

.secondary-link:hover,
.more-link:hover {
  border-color: var(--line-strong);
  background: rgba(239, 229, 207, 0.08);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 560px;
  margin: 44px 0 0;
}

.hero-stats div {
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.hero-stats dt {
  color: var(--paper);
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hero-stats dd {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 13px;
}

.tree-orbit {
  position: relative;
  min-width: 0;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(239, 229, 207, 0.09), rgba(239, 229, 207, 0.015)),
    var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.orbit-rings {
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(239, 229, 207, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.orbit-rings::before,
.orbit-rings::after {
  content: "";
  position: absolute;
  inset: 32px;
  border: 1px solid rgba(216, 138, 76, 0.14);
  border-radius: 50%;
}

.orbit-rings::after {
  inset: 76px;
  border-color: rgba(127, 157, 115, 0.16);
}

.orbit-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--faint);
}

.orbit-top span {
  color: var(--amber);
}

.orbit-feature {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 30px;
}

.feature-art {
  width: 120px;
  aspect-ratio: 1;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(216, 138, 76, 0.5), rgba(127, 157, 115, 0.34)),
    var(--surface-2);
  background-size: cover;
  background-position: center;
  box-shadow:
    rgba(0, 0, 0, 0.34) 0 14px 28px,
    rgba(239, 229, 207, 0.12) 0 0 0 1px inset;
}

.feature-copy {
  min-width: 0;
}

.feature-copy span {
  display: block;
  color: var(--moss);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.feature-copy strong {
  display: block;
  color: var(--paper);
  font-size: clamp(24px, 3.5vw, 38px);
  line-height: 1.12;
  font-weight: 600;
  text-wrap: balance;
}

.feature-copy a {
  display: inline-flex;
  margin-top: 16px;
  color: var(--amber);
  text-decoration: none;
  font-weight: 600;
}

.orbit-notes {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.orbit-note {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  color: var(--paper-soft);
  text-decoration: none;
}

.orbit-note span {
  color: var(--faint);
  font-size: 13px;
}

.orbit-note strong {
  min-width: 0;
  overflow: hidden;
  color: var(--paper);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-section,
.profile-band {
  margin-inline: clamp(18px, 5vw, 64px);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 24px;
  align-items: end;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section-head .section-label {
  grid-column: 1 / -1;
}

.section-head h2 {
  margin: 0;
  color: var(--paper);
  font-size: clamp(28px, 5vw, 58px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: 0;
  text-wrap: balance;
}

.music-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) repeat(2, minmax(0, 0.8fr));
  gap: 16px;
  grid-auto-flow: dense;
}

.music-card,
.article-item,
.friend-card,
.repo-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(239, 229, 207, 0.045);
  text-decoration: none;
  overflow: hidden;
  transition:
    transform 180ms var(--ease-out),
    border-color 180ms var(--ease-out),
    background-color 180ms var(--ease-out);
}

.music-card:hover,
.article-item:hover,
.friend-card:hover,
.repo-card:hover {
  border-color: var(--line-strong);
  background: rgba(239, 229, 207, 0.07);
}

.music-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.music-card:first-child {
  grid-row: span 2;
}

.music-cover {
  width: 100%;
  aspect-ratio: 1.1;
  background:
    linear-gradient(135deg, rgba(216, 138, 76, 0.32), rgba(127, 157, 115, 0.22)),
    var(--surface-2);
  background-position: center;
  background-size: cover;
}

.music-card:first-child .music-cover {
  aspect-ratio: 1.35;
}

.music-body,
.friend-card,
.repo-card {
  padding: 18px;
}

.music-meta,
.article-meta,
.repo-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--faint);
  font-size: 12px;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.music-title,
.article-title,
.repo-title,
.friend-title {
  margin: 0;
  color: var(--paper);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.3;
  font-weight: 600;
  text-wrap: balance;
}

.music-sub,
.article-desc,
.repo-desc,
.friend-desc {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.72;
}

.article-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.article-item {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 20px 8px;
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
}

.article-date {
  color: var(--faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.article-arrow {
  color: var(--amber);
  font-size: 20px;
  transform: translateX(0);
  transition: transform 180ms var(--ease-out);
}

.article-item:hover .article-arrow {
  transform: translateX(4px);
}

.compact .article-title {
  font-size: clamp(17px, 2vw, 21px);
}

.rail-shell {
  position: relative;
}

.friend-rail {
  display: grid;
  grid-auto-columns: minmax(280px, 360px);
  grid-auto-flow: column;
  gap: 16px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  scroll-padding-inline: 4px;
  padding: 4px 4px 14px;
  scrollbar-color: rgba(239, 229, 207, 0.28) transparent;
}

.friend-card {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

.friend-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.friend-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(216, 138, 76, 0.12);
  color: var(--amber);
  font-weight: 700;
}

.friend-category {
  color: var(--moss);
  font-size: 12px;
  font-weight: 600;
}

.friend-desc {
  flex: 1;
}

.friend-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.friend-tags span,
.repo-language {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--paper-soft);
  font-size: 12px;
  line-height: 1.2;
}

.rail-btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  background: rgba(30, 33, 24, 0.9);
}

.rail-prev {
  left: -14px;
}

.rail-next {
  right: -14px;
}

.rail-btn:active {
  transform: translateY(-50%) scale(0.97);
}

.repo-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.repo-card {
  display: flex;
  flex-direction: column;
  min-height: 250px;
}

.repo-title {
  font-size: 17px;
  word-break: break-word;
}

.repo-desc {
  flex: 1;
}

.repo-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--paper-soft);
  font-size: 13px;
}

.repo-stars {
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.profile-band {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 82px);
  align-items: center;
  padding: clamp(28px, 6vw, 64px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(127, 157, 115, 0.14), transparent 45%),
    rgba(239, 229, 207, 0.04);
}

.profile-band h2 {
  margin: 12px 0 0;
  font-size: clamp(30px, 5vw, 64px);
  line-height: 1.08;
  font-weight: 600;
  text-wrap: balance;
}

.profile-band p:last-child {
  margin: 0;
  color: var(--paper-soft);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.85;
  text-wrap: pretty;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 36px clamp(18px, 5vw, 64px) 48px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
}

.site-footer div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-footer strong {
  color: var(--paper);
  font-weight: 600;
}

.site-footer nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer a {
  color: var(--paper-soft);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--amber);
}

.modal-layer[hidden] {
  display: none;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 13, 10, 0.72);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  width: min(100%, 420px);
  max-height: min(86vh, 620px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: rgba(0, 0, 0, 0.45) 0 18px 60px;
  padding: 24px;
  opacity: 1;
  transform: scale(1);
  transition:
    opacity 180ms var(--ease-out),
    transform 180ms var(--ease-out);
}

@starting-style {
  .modal-card {
    opacity: 0;
    transform: scale(0.95);
  }
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
}

.modal-content h2 {
  margin: 0 42px 16px 0;
  color: var(--paper);
  font-size: 24px;
  line-height: 1.25;
}

.modal-content p {
  margin: 0 0 16px;
  color: var(--paper-soft);
}

.qr-image {
  width: min(100%, 260px);
  height: auto;
  display: block;
  margin: 16px auto;
  border-radius: 8px;
  background: var(--paper);
}

.modal-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.modal-links a {
  color: var(--amber);
  text-decoration: none;
  font-weight: 600;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .music-card:hover,
  .article-item:hover,
  .friend-card:hover,
  .repo-card:hover {
    transform: translateY(-3px);
  }

  .article-item:hover {
    transform: none;
  }
}

@media (max-width: 1180px) {
  .personal-hero {
    grid-template-columns: 1fr;
  }

  .tree-orbit {
    max-width: 760px;
  }

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

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

@media (max-width: 780px) {
  .site-header {
    grid-template-columns: auto auto;
    justify-content: space-between;
    gap: 12px;
  }

  .site-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    order: 3;
  }

  .site-actions {
    gap: 6px;
  }

  .icon-action {
    width: 34px;
    height: 34px;
  }

  .personal-hero {
    padding-top: 42px;
  }

  .hero h1 {
    font-size: clamp(42px, 15vw, 68px);
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .orbit-feature {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .feature-art {
    width: 92px;
  }

  .orbit-note {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .section-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .more-link {
    width: fit-content;
  }

  .music-grid,
  .repo-list {
    grid-template-columns: 1fr;
  }

  .music-card:first-child {
    grid-row: auto;
  }

  .article-item {
    grid-template-columns: 1fr auto;
    gap: 8px 16px;
    padding: 18px 0;
  }

  .article-date {
    grid-column: 1 / -1;
  }

  .rail-btn {
    display: none;
  }

  .friend-rail {
    grid-auto-columns: minmax(260px, 84vw);
    margin-inline: -4px;
  }

  .profile-band {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer nav {
    justify-content: flex-start;
  }
}

@media (max-width: 460px) {
  body {
    font-size: 15px;
  }

  .brand span {
    max-width: 5em;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero-links {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-link,
  .secondary-link {
    width: 100%;
  }

  .tree-orbit {
    padding: 18px;
  }
}

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