:root {
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --ink: #17181C;
  --ink-2: #5C5F66;
  --ink-3: #8A8D94;
  --hairline: #E6E4DE;
  --accent: #C8402F;
  --accent-deep: #A33323;
  --panel: #191B20;
  --paper-on-dark: #F2F1EC;
  --radius: 12px;
  --font-sans: "Geist", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.page { overflow-x: clip; max-width: 100%; }
.container { width: min(72rem, 100%); margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px); }
a { color: inherit; }
::selection { background: var(--accent); color: #fff; }

.skip-link {
  position: absolute; top: -100px; left: 16px; z-index: 20;
  padding: 10px 14px; border-radius: var(--radius);
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Navigation */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  width: min(72rem, 100%);
  margin: 0 auto;
  padding: 18px clamp(20px, 5vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background .2s ease, box-shadow .2s ease;
}
.nav.scrolled {
  background: rgba(247, 246, 243, .9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--hairline);
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
}
.nav-seal { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.nav-links { display: flex; align-items: center; gap: clamp(8px, 2vw, 22px); }
.nav-links > a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.nav-links > a:hover { color: var(--accent); }
.nav-gh { justify-content: center; min-width: 28px; }
.nav a:focus-visible, .language-button:focus-visible, .project-row:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.language-switch { display: inline-flex; align-items: center; color: var(--ink-3); }
.language-button {
  appearance: none;
  border: 0;
  min-width: 31px;
  min-height: 44px;
  background: transparent;
  color: var(--ink-3);
  font: 500 12px/1 var(--font-mono);
  cursor: pointer;
}
.language-button[aria-pressed="true"] { color: var(--ink); }
.language-divider { color: var(--hairline); font-size: 13px; }

/* Hero */
.hero { padding-top: clamp(122px, 18vh, 178px); }
.hero-content { max-width: 54rem; }
.hero-title { font-weight: 700; line-height: 1.02; }
.hero-cn { display: block; font-size: clamp(3.25rem, 6vw, 5.25rem); letter-spacing: .04em; }
.hero-latin { display: block; margin-top: 8px; color: var(--ink-2); font-size: clamp(1.5rem, 2.6vw, 2.2rem); font-weight: 600; letter-spacing: -.01em; }
.hero-lead { max-width: 42rem; margin-top: 28px; color: var(--ink-2); font-size: clamp(1.05rem, 1.6vw, 1.25rem); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero-mail { margin-top: 18px; color: var(--ink-3); font-size: 14px; }
.hero-mail a { color: var(--accent); font-family: var(--font-mono); font-size: 13px; text-decoration: none; }
.hero-mail a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Keyword marquee */
.marquee {
  margin-top: clamp(58px, 9vh, 96px);
  padding: 18px 0;
  overflow: hidden;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.marquee-track { display: flex; align-items: center; width: max-content; animation: marquee 48s linear infinite; }
.marquee-sequence { display: inline-flex; align-items: center; }
.marquee-item { padding: 0 8px; color: var(--ink-3); font-size: clamp(18px, 2vw, 26px); font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.marquee-dot { width: 6px; height: 6px; flex: none; margin: 0 20px; border-radius: 50%; background: var(--accent); opacity: .5; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Projects */
.section { padding-top: clamp(76px, 10vw, 128px); }
.section-title { font-size: clamp(1.7rem, 3vw, 2.35rem); font-weight: 700; letter-spacing: .01em; }
.section-lead { max-width: 42rem; margin-top: 10px; color: var(--ink-2); }
.project-group { margin-top: clamp(40px, 5vw, 56px); }
.group-title {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink-3);
  font: 500 12.5px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.group-title::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .6; }
.project-list {
  margin-top: 14px;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(28px, 4vw, 56px);
  border-top: 1px solid var(--hairline);
}
.project-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 0 26px;
  border-bottom: 1px solid var(--hairline);
}
.project-name a { text-decoration: none; }
.project-name a:hover { color: var(--accent-deep); }
.project-name a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.project-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.project-marks { display: inline-flex; flex: none; align-items: center; gap: 4px; }
.project-logo { display: block; width: 22px; height: 22px; object-fit: contain; }
.project-marks-dual { gap: 2px; }
.project-marks-dual .project-logo { width: 17px; height: 17px; }
.project-name { min-width: 0; font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.project-meta { margin-top: 3px; color: var(--ink-3); font: 12px/1.5 var(--font-mono); }
.project-desc { flex: 1; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.project-links { display: flex; align-items: center; gap: 18px; margin-top: 4px; }
.project-link { min-height: 32px; display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.project-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.project-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.project-link:not(.project-link-site) { color: var(--ink-2); }
.project-link:not(.project-link-site):hover { color: var(--ink); }
.project-links:not(:has(.project-link-site)) .project-link { color: var(--accent); }

@media (max-width: 1024px) {
  .project-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Contact */
.contact-panel { padding: clamp(44px, 7vw, 76px) clamp(26px, 6vw, 68px); border-radius: 20px; background: var(--panel); color: var(--paper-on-dark); }
.contact-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; }
.contact-lead { margin-top: 12px; color: rgba(242,241,236,.72); font-size: clamp(1rem, 1.6vw, 1.15rem); }
.contact-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

/* Buttons */
.btn { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 13px 24px; border-radius: var(--radius); font: 600 15px/1 var(--font-sans); text-decoration: none; transition: background .16s ease, border-color .16s ease; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--hairline); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-invert { background: var(--paper-on-dark); color: var(--ink); }
.btn-invert:hover { background: #fff; }
.btn-outline { color: var(--paper-on-dark); border: 1px solid rgba(242,241,236,.42); }
.btn-outline:hover { border-color: rgba(242,241,236,.9); }

/* Footer */
.footer { margin-top: clamp(76px, 10vw, 128px); padding: 28px 0 40px; border-top: 1px solid var(--hairline); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.footer-name { font-weight: 600; font-size: 15px; }
.footer-meta { color: var(--ink-3); font: 12.5px var(--font-mono); letter-spacing: .05em; }
.footer-meta a { text-decoration: none; }
.footer-meta a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .nav { padding: 14px 20px; }
  .nav-links { gap: 10px; }
  .nav-links > a { font-size: 13px; }
  .hero { padding-top: 104px; }
  .hero-lead { margin-top: 24px; font-size: 1.02rem; }
  .marquee { margin-top: 58px; }
  .marquee-dot { margin: 0 15px; }
  .project-list { grid-template-columns: minmax(0, 1fr); }
  .project-row { padding: 20px 0; }
  .project-link { min-height: 44px; }
  .contact-cta .btn { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
}
