:root {
  --bg: #0a0a0b;
  --bg-card: rgba(255, 255, 255, 0.03);
  --text: #f0f0f2;
  --text-secondary: #8e8e96;
  --accent: #c9a96e;
  --accent-hover: #dfc08a;
  --border: rgba(255, 255, 255, 0.08);
  --font-serif: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --max-width: 980px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.45, 0, 0.15, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* prefers-reduced-motion: keep fade but remove movement */
@media (prefers-reduced-motion: reduce) {
  .anim-item {
    filter: none !important;
    transform: none !important;
  }

  .hero-banner {
    filter: none !important;
  }
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

a:hover {
  color: var(--accent-hover);
}

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

ul {
  list-style: none;
}

/* ===== Layout ===== */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2.5rem;
}

.section {
  padding: clamp(5rem, 10vw, 8rem) 0;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--text);
  margin-bottom: 2.5rem;
}

.section-title::after {
  content: "";
  display: block;
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin-top: 0.75rem;
  opacity: 0.5;
  transition: width 0.8s var(--ease);
}

.section-title.is-visible::after {
  width: 60px;
}

/* ===== Header ===== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: background 0.5s var(--ease-smooth),
    border-color 0.5s var(--ease-smooth);
}

.site-header.is-scrolled {
  background: rgba(10, 10, 11, 0.85);
  border-bottom-color: var(--border);
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.04em;
  transition: color 0.3s var(--ease);
}

.nav-logo:hover {
  color: var(--accent);
}

.nav-menu {
  display: flex;
  gap: 2.2rem;
}

.nav-menu a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
  transition: color 0.3s var(--ease);
}

.nav-menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s var(--ease);
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--text);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 72px;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.lang-toggle:hover {
  border-color: rgba(201, 169, 110, 0.5);
  color: var(--accent);
}

.lang-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang-toggle .lang-option {
  font-weight: 600;
  opacity: 0.5;
  transition: opacity 0.25s ease, color 0.25s ease;
}

.lang-toggle .lang-sep {
  opacity: 0.4;
}

.lang-toggle[data-lang="en"] .lang-option-en,
.lang-toggle[data-lang="zh"] .lang-option-zh {
  color: var(--accent);
  opacity: 1;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ===== Hero ===== */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8rem 2rem 5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(201, 169, 110, 0.04), transparent);
  pointer-events: none;
}

.hero-banner {
  width: 100%;
  max-width: 1080px;
  overflow: hidden;
  border-radius: 16px;
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  filter: blur(8px);
  transition: opacity 1.8s var(--ease), transform 2s var(--ease), filter 1.6s var(--ease);
  will-change: transform;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.hero.is-loaded .hero-banner {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.hero-image {
  width: 100%;
  max-height: 56vh;
  object-fit: cover;
  object-position: center;
  transition: transform 1.6s var(--ease);
  will-change: transform;
}

.hero:hover .hero-image {
  transform: scale(1.02);
}

.hero-inner {
  text-align: center;
  max-width: 800px;
  padding: 3rem 2.5rem 2rem;
  margin-top: -1.5rem;
  position: relative;
  z-index: 2;
}

.hero-kicker {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1.4s var(--ease) 0.2s, transform 1.6s var(--ease) 0.2s;
}

.hero-inner.is-visible .hero-kicker {
  opacity: 1;
  transform: translateY(0);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: 0.12em;
  color: var(--text);
  margin-bottom: 0;
  position: relative;
  display: block;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.6s var(--ease) 0.4s, transform 1.8s var(--ease) 0.4s;
}

.hero-inner.is-visible .hero-title {
  opacity: 1;
  transform: translateY(0);
}

.hero-name-sub {
  font-family: var(--font-serif);
  font-size: clamp(0.9rem, 1.8vw, 1.15rem);
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 1.2rem 0 1.4rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.4s var(--ease) 0.65s, transform 1.6s var(--ease) 0.65s;
  position: relative;
  display: block;
}

.hero-name-sub::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  height: 1px;
  width: 60%;
  background: linear-gradient(90deg, transparent, rgba(201, 169, 110, 0.4), transparent);
  bottom: -0.5em;
  transition: transform 1.6s var(--ease) 0.9s;
}

.hero-inner.is-visible .hero-name-sub {
  opacity: 1;
  transform: translateY(0);
}

.hero-inner.is-visible .hero-name-sub::after {
  transform: translateX(-50%) scaleX(1);
}

.hero-tagline {
  font-size: clamp(0.92rem, 1.8vw, 1.05rem);
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.7;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1.4s var(--ease) 0.85s, transform 1.6s var(--ease) 0.85s;
}

.hero-inner.is-visible .hero-tagline {
  opacity: 1;
  transform: translateY(0);
}

.hero-location {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.3rem 0 2.8rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.4s var(--ease) 1s, transform 1.6s var(--ease) 1s;
}

.hero-inner.is-visible .hero-location {
  opacity: 1;
  transform: translateY(0);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.4s var(--ease) 1.15s, transform 1.6s var(--ease) 1.15s;
}

.hero-inner.is-visible .hero-cta {
  opacity: 1;
  transform: translateY(0);
}

.hero-float-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 2.5rem;
}

.hero-float-card {
  text-align: left;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.4s var(--ease), transform 1.6s var(--ease),
    border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  backdrop-filter: blur(12px);
}

.hero-float-card:hover {
  border-color: rgba(201, 169, 110, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.hero-inner.is-visible .hero-float-card {
  opacity: 1;
  transform: translateY(0);
}

.hero-inner.is-visible .hero-float-card:nth-child(1) { transition-delay: 1.3s; }
.hero-inner.is-visible .hero-float-card:nth-child(2) { transition-delay: 1.45s; }
.hero-inner.is-visible .hero-float-card:nth-child(3) { transition-delay: 1.6s; }

.hero-float-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.hero-float-value {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 600;
  line-height: 1.4;
}

/* ===== Buttons ===== */

.btn {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 8px;
  transition: all 0.4s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

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

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: none;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--bg);
  box-shadow: 0 8px 24px rgba(201, 169, 110, 0.25);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--text-secondary);
  color: var(--accent);
}

/* ===== About ===== */

.about-content {
  max-width: 640px;
}

.section-about .about-lead {
  font-size: 1.1rem;
  line-height: 1.85;
  margin-bottom: 1.2rem;
  color: var(--text);
}

.section-about .about-lead strong {
  color: var(--accent);
  font-weight: 600;
}

.section-about .about-body {
  color: var(--text-secondary);
  line-height: 1.85;
}

/* ===== Skills ===== */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.skill-group {
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.skill-group:hover {
  border-color: rgba(201, 169, 110, 0.25);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(201, 169, 110, 0.1);
}

.skill-group-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
  color: var(--text);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-tags li {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  color: var(--text-secondary);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.skill-tags li:hover {
  color: var(--text);
  border-color: var(--border);
}

/* ===== Projects ===== */

.project {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  border-radius: 12px;
  transition: transform 0.5s var(--ease), background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.project:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.project:hover {
  transform: translateX(6px);
  background: rgba(255, 255, 255, 0.02);
  box-shadow: -4px 0 0 0 var(--accent);
}

.project-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: var(--text);
}

.project-meta {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 1rem;
}

.project-role {
  font-size: 0.88rem;
  color: var(--accent);
  margin-bottom: 0.85rem;
  font-weight: 600;
}

.project-points {
  margin-bottom: 0.75rem;
  padding-left: 1.1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.85;
}

.project-points li {
  margin-bottom: 0.3rem;
  position: relative;
}

.project-points li::before {
  content: "";
  position: absolute;
  left: -1.1rem;
  top: 0.7em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}

.project-tech {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.project-compact .project-title {
  font-size: 1.15rem;
}

/* ===== Community ===== */

.community-block {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.community-photo {
  width: 100%;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.5s var(--ease), transform 0.5s var(--ease);
}

.community-photo:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(201, 169, 110, 0.15);
}

.community-photo img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  transition: transform 1.2s var(--ease);
}

.community-photo:hover img {
  transform: scale(1.03);
}

.community-content {
  max-width: 720px;
}

.community-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2rem;
}

.community-list li {
  margin-bottom: 0;
  padding-left: 1.1rem;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.75;
}

.community-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

.community-list li:last-child {
  margin-bottom: 0;
}

/* ===== Media ===== */

.reel-intro {
  max-width: 640px;
  margin: 0 auto 2rem;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  text-align: center;
}

.reel-tracks {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.reel-track {
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.reel-track:hover {
  border-color: rgba(201, 169, 110, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.reel-track-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.reel-audio {
  width: 100%;
  max-width: 100%;
  height: 40px;
}

.reel-audio::-webkit-media-controls-panel {
  background: rgba(255, 255, 255, 0.04);
}

.media-cta {
  text-align: center;
  padding: 3rem 0;
}

.media-cta-text {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

/* ===== Education ===== */

.education-item {
  margin-bottom: 0.4rem;
  color: var(--text);
  line-height: 1.7;
}

.education-item strong {
  font-weight: 600;
}

.work-auth {
  margin-top: 1.2rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* ===== Contact ===== */

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.contact-list li a {
  font-weight: 500;
  font-size: 1rem;
  position: relative;
  display: inline-block;
}

.contact-list li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s var(--ease);
}

.contact-list li a:hover::after {
  width: 100%;
}

/* ===== Footer ===== */

.site-footer {
  padding: 2rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0;
}

/* ===== Scroll Progress Bar ===== */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  z-index: 200;
  box-shadow: 0 0 10px rgba(201, 169, 110, 0.5);
}

/* ===== Scroll Animations ===== */

.anim-item {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.9s var(--ease),
    filter 0.8s var(--ease);
  filter: blur(4px);
}

.anim-item.anim-scale {
  transform: scale(0.88) translateY(20px);
}

.anim-item.anim-slide-left {
  transform: translateX(-60px) translateY(0);
}

.anim-item.anim-slide-right {
  transform: translateX(60px) translateY(0);
}

.anim-item.is-visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
  filter: blur(0);
}

/* Stagger children: JS sets --anim-delay inline */
.anim-item {
  transition-delay: var(--anim-delay, 0s);
}

/* ===== Responsive ===== */

@media (max-width: 768px) {
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.75rem 2rem;
    background: rgba(10, 10, 11, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
  }

  .nav-menu[hidden] {
    display: none !important;
  }

  .nav-menu:not([hidden]) {
    display: flex;
  }

  .nav-menu li {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-menu li:last-child {
    border-bottom: none;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding: 6rem 1.25rem 3.5rem;
  }

  .hero-inner {
    padding: 1.5rem 0.5rem 1.2rem;
  }

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

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 240px;
    text-align: center;
  }

  .container {
    padding: 0 1.25rem;
  }

  .nav {
    padding: 0.85rem 1.25rem;
  }

  .community-list {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: clamp(2.2rem, 11vw, 3rem);
    letter-spacing: 0.08em;
  }

  .hero-name-sub {
    font-size: 0.85rem;
    letter-spacing: 0.18em;
  }

  .hero-tagline {
    font-size: clamp(0.9rem, 4vw, 1rem);
  }

  .hero-location {
    font-size: 0.9rem;
  }

  .hero-kicker {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
  }
}

/* 小屏下保持可读性，避免文字过小 */
@media (max-width: 360px) {
  body {
    font-size: 15px;
  }

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