:root {
  --bg: #0b0a14;
  --bg-elev: #14121f;
  --card: #1a1827;
  --card-hover: #211e30;
  --line: rgba(255, 255, 255, 0.08);
  --text: #ece9f5;
  --text-dim: #a09cb3;
  --text-mute: #6c6884;
  --gold: #d4b56a;
  --gold-soft: #f0d896;
  --accent: #8b6cef;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(139, 108, 239, 0.15), transparent 60%),
    radial-gradient(900px 500px at 10% 10%, rgba(212, 181, 106, 0.08), transparent 60%),
    var(--bg);
}

/* Lang switcher */
.lang-switch {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: inline-flex;
  background: rgba(20, 18, 31, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.lang-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  background: transparent;
  border: none;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 36px;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.is-active {
  background: var(--text);
  color: var(--bg);
}

/* When Chinese is active, swap body font to Noto Serif SC for headings */
body[data-lang="zh"] .title,
body[data-lang="zh"] .card-name {
  font-family: 'Noto Serif SC', 'Fraunces', 'Times New Roman', serif;
}
body[data-lang="zh"] .subtitle,
body[data-lang="zh"] .card-bio,
body[data-lang="zh"] .card-dates,
body[data-lang="zh"] .card-foot,
body[data-lang="zh"] .eyebrow,
body[data-lang="zh"] .chip,
body[data-lang="zh"] .lang-btn,
body[data-lang="zh"] .foot {
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
body[data-lang="zh"] .card-dates {
  letter-spacing: 0.04em;
}

/* Hero */
.hero {
  position: relative;
  padding: 96px 24px 56px;
  text-align: center;
  overflow: hidden;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
  font-weight: 500;
}
.title {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-weight: 800;
  font-size: clamp(48px, 9vw, 96px);
  line-height: 1;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 0%, #d8d3ea 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle {
  font-size: clamp(15px, 1.6vw, 19px);
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(closest-side, rgba(212, 181, 106, 0.18), transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

/* Filters */
.filters {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.chip {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: none;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chip:hover { color: var(--text); }
.chip.is-active {
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}
.chip .count {
  font-size: 11px;
  background: rgba(0, 0, 0, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
}
.chip:not(.is-active) .count {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-mute);
}

/* Grid */
.grid {
  max-width: 1240px;
  margin: 24px auto 80px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1), border-color 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
  cursor: default;
}
.card:hover {
  transform: translateY(-4px);
  background: var(--card-hover);
  border-color: rgba(212, 181, 106, 0.25);
}
.card-img {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: #000;
  overflow: hidden;
  position: relative;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}
.card:hover .card-img img { transform: scale(1.04); }
.card-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.5));
  pointer-events: none;
}
.tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  color: var(--gold-soft);
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(212, 181, 106, 0.3);
  font-weight: 500;
}
.card-body {
  padding: 20px 20px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-name {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.card-dates {
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  font-weight: 500;
}
.card-bio {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0;
  flex: 1;
}
.card-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-mute);
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-foot .dot { color: var(--gold); }

/* Hidden filter state */
.card[hidden] { display: none; }

/* Footer */
.foot {
  text-align: center;
  padding: 30px 24px 50px;
  color: var(--text-mute);
  font-size: 13px;
  border-top: 1px solid var(--line);
}
.foot .muted { color: var(--text-mute); opacity: 0.7; }

/* Responsive tweaks */
@media (max-width: 600px) {
  .hero { padding: 64px 20px 36px; }
  .grid { gap: 14px; padding: 0 16px; }
  .card-body { padding: 16px; }
  .card-name { font-size: 20px; }
  .lang-switch { top: 14px; right: 14px; }
  .lang-btn { padding: 6px 12px; font-size: 11px; }
}
