:root {
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Cormorant Garamond", "Songti SC", "Noto Serif SC", serif;
  --radius: 22px;
  --shadow: 0 24px 80px rgba(30, 24, 18, 0.08);
  --max: 980px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="light"] {
  --bg: #f6f1e8;
  --bg2: #efe7da;
  --ink: #2a241c;
  --muted: #7a6f62;
  --line: rgba(42, 36, 28, 0.1);
  --panel: rgba(255, 252, 247, 0.72);
  --accent: #8b6b4a;
  --accent-soft: rgba(139, 107, 74, 0.12);
  --glow: rgba(196, 164, 120, 0.28);
  --photo: #e8dfd1;
  --danger: #b45454;
  --ok: #4f7a5a;
  --btn-on-ink: #f6f1e8;
}

html[data-theme="dark"] {
  --bg: #12110f;
  --bg2: #1a1815;
  --ink: #f2ebe1;
  --muted: #a89d90;
  --line: rgba(242, 235, 225, 0.1);
  --panel: rgba(28, 26, 23, 0.78);
  --accent: #d4b48c;
  --accent-soft: rgba(212, 180, 140, 0.12);
  --glow: rgba(212, 180, 140, 0.12);
  --photo: #24211c;
  --danger: #e08b8b;
  --ok: #8fbf9b;
  --btn-on-ink: #1a1510;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 12% -8%, var(--glow), transparent 60%),
    radial-gradient(700px 420px at 88% 8%, var(--accent-soft), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  line-height: 1.75;
  font-weight: 300;
  transition: background .45s var(--ease), color .35s var(--ease);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
.hidden { display: none !important; }

.ambient {
  position: fixed;
  inset: auto auto 8% -10%;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: var(--glow);
  filter: blur(70px);
  opacity: .55;
  pointer-events: none;
  z-index: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  letter-spacing: .08em;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .92rem;
}
.nav a:hover, .nav a.quiet { color: var(--ink); }
.theme-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  display: grid;
  place-items: center;
}
html[data-theme="light"] .i-moon { display: none; }
html[data-theme="dark"] .i-sun { display: none; }

main {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  padding: 36px 0 96px;
}

.hero { margin-top: 18px; }
.hero-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 36px;
  align-items: center;
  padding: 34px;
  border-radius: calc(var(--radius) + 8px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.portrait {
  width: 220px;
  height: 260px;
  border-radius: 28px;
  overflow: hidden;
  background: var(--photo);
  border: 1px solid var(--line);
  position: relative;
}
#avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  filter: saturate(.92) contrast(1.02);
}
#avatar.show { display: block; }
.portrait-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 4.5rem;
  color: var(--accent);
  background: linear-gradient(160deg, var(--accent-soft), transparent 60%), var(--photo);
}
.kicker {
  margin: 0 0 10px;
  color: var(--accent);
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: .76rem;
}
.hero-text h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  line-height: 1.12;
}
.role {
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 1.05rem;
}
.lead {
  margin: 0 0 22px;
  max-width: 36em;
  font-size: 1.02rem;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.btn:hover {
  background: var(--accent-soft);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn.primary {
  background: var(--ink);
  color: var(--btn-on-ink);
  border-color: transparent;
}
html[data-theme="dark"] .btn.primary {
  background: var(--accent);
  color: var(--btn-on-ink);
}
.btn.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}
.btn.ghost {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255,255,255,.08);
  color: #fff;
  border-color: rgba(255,255,255,.2);
}

.section { margin-top: 72px; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 8px;
}
.section-head span {
  font-family: var(--font-serif);
  color: var(--accent);
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 2rem;
}
.section-desc {
  margin: 0 0 22px;
  color: var(--muted);
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  padding: 28px;
}
.about { margin: 0; font-size: 1.05rem; max-width: 42em; }
.meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 28px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.meta dt {
  color: var(--muted);
  font-size: .82rem;
  letter-spacing: .06em;
}
.meta dd { margin: 4px 0 0; }

.photos {
  columns: 3 180px;
  column-gap: 14px;
}
.photo-card {
  break-inside: avoid;
  margin: 0 0 14px;
  padding: 0;
  border: 1px solid var(--line);
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  background: var(--photo);
}
.photo-card img {
  width: 100%;
  display: block;
  transition: transform .55s var(--ease);
  filter: saturate(.95);
}
.photo-card:hover img { transform: scale(1.03); }

.stack { display: grid; gap: 14px; }
.music-card, .project-card {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
}
.project-card { grid-template-columns: 1fr; }
.music-card h3, .project-card h3 {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
}
.music-card p, .project-card p { margin: 0; color: var(--muted); }
.music-card .note {
  margin-top: 8px;
  color: color-mix(in srgb, var(--ink) 80%, var(--muted));
}
.music-cover, .music-cover-ph {
  width: 84px;
  height: 84px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--photo);
  border: 1px solid var(--line);
}
.music-cover img { width: 100%; height: 100%; object-fit: cover; }
.music-cover-ph {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 1.6rem;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tag {
  font-size: .78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.links { display: flex; flex-wrap: wrap; gap: 12px; }
.link-chip {
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
}
.link-chip:hover {
  text-decoration: none;
  background: var(--accent-soft);
}
.empty {
  color: var(--muted);
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--muted);
  padding: 28px 16px 40px;
  border-top: 1px solid var(--line);
  letter-spacing: .04em;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 9, 8, .82);
  display: grid;
  place-items: center;
  padding: 28px;
}
.lightbox img {
  max-width: min(920px, 100%);
  max-height: 74vh;
  border-radius: 14px;
}
.lightbox p {
  color: #f5efe6;
  margin: 12px 0 0;
  text-align: center;
}

@media (max-width: 760px) {
  .topbar { padding: 12px 14px; }
  .hero-card { grid-template-columns: 1fr; padding: 22px; gap: 22px; }
  .portrait { width: 140px; height: 168px; border-radius: 22px; }
  .meta { grid-template-columns: 1fr; }
  .photos { columns: 2 140px; }
}
