:root {
  color-scheme: light;
  --background: #f7f7f4;
  --surface: #fcfcfa;
  --surface-subtle: #f0f0ec;
  --text: #1b1d21;
  --text-muted: #666a73;
  --border: #d9dbd7;
  --border-strong: #b8bbb5;
  --accent: #5b46d8;
  --accent-strong: #4732be;
  --focus: #6c57e5;
  --selection: #ddd7ff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #111216;
  --surface: #17181d;
  --surface-subtle: #202127;
  --text: #ececf0;
  --text-muted: #a4a6ae;
  --border: #303238;
  --border-strong: #4a4c55;
  --accent: #a99afa;
  --accent-strong: #c0b5ff;
  --focus: #b4a7ff;
  --selection: #3b3267;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --background: #111216;
    --surface: #17181d;
    --surface-subtle: #202127;
    --text: #ececf0;
    --text-muted: #a4a6ae;
    --border: #303238;
    --border-strong: #4a4c55;
    --accent: #a99afa;
    --accent-strong: #c0b5ff;
    --focus: #b4a7ff;
    --selection: #3b3267;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-size: 17px;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  transition: background-color 140ms ease, color 140ms ease;
}

::selection { background: var(--selection); }

a {
  color: inherit;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

button { font: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: var(--text);
  color: var(--background);
  transform: translateY(-160%);
}

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

.site-header,
.site-footer,
.page {
  width: min(100% - 48px, 1040px);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
  border-bottom: 1px solid var(--border);
}

.identity-link {
  font-weight: 650;
  letter-spacing: -0.015em;
  text-decoration: none;
  white-space: nowrap;
}

.header-tools,
.primary-nav,
.language-switch,
.theme-switch {
  display: flex;
  align-items: center;
}

.header-tools { gap: 20px; }
.primary-nav { gap: 18px; font-size: 15px; }
.primary-nav a { text-decoration: none; color: var(--text-muted); }
.primary-nav a[aria-current="page"] { color: var(--text); }

.language-switch {
  gap: 6px;
  font-size: 14px;
  white-space: nowrap;
}

.language-switch a { color: var(--text-muted); text-decoration: none; }
.language-switch [aria-current="page"] { color: var(--text); font-weight: 650; }
.language-switch span { color: var(--border-strong); }

.theme-switch {
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-subtle);
}

.theme-switch button {
  min-height: 36px;
  padding: 5px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
}

.theme-switch button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--border);
}

.page { padding-block: 88px 104px; }

.eyebrow,
.section-label,
.project-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.06em;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.55fr);
  gap: 80px;
  align-items: end;
}

h1,
h2,
h3,
p { text-wrap: pretty; }

h1 {
  max-width: 720px;
  margin: 18px 0 20px;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.12;
  letter-spacing: -0.045em;
  font-weight: 580;
}

.lede {
  max-width: 680px;
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(18px, 2vw, 21px);
}

.focus-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
}

.focus-list li { padding: 6px 0; border-bottom: 1px solid var(--border); }

.section { margin-top: 104px; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.06em;
  font-weight: 650;
}

.section-head a { font-size: 14px; color: var(--text-muted); }

.featured-project {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
  gap: 48px;
  align-items: center;
  padding-block: 32px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.project-copy h3,
.page-title {
  margin: 12px 0 14px;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.22;
  letter-spacing: -0.025em;
  font-weight: 580;
}

.project-copy p:not(.project-meta) { color: var(--text-muted); }

.project-link { display: inline-block; margin-top: 10px; font-weight: 620; }

.evidence-frame {
  position: relative;
  height: 350px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-subtle);
}

.evidence-frame iframe {
  width: 166.67%;
  height: 166.67%;
  border: 0;
  pointer-events: none;
  transform: scale(0.6);
  transform-origin: top left;
}

.evidence-frame > a {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.path-card {
  min-height: 176px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}

.path-card:hover { border-color: var(--border-strong); }
.path-card strong { display: block; margin-bottom: 8px; font-size: 18px; font-weight: 620; }
.path-card span { color: var(--text-muted); font-size: 15px; }

.page-intro { max-width: 720px; }
.page-title { font-size: clamp(34px, 5vw, 52px); }
.page-intro > p { max-width: 650px; color: var(--text-muted); font-size: 19px; }

.project-list,
.publication-list { margin-top: 64px; border-top: 1px solid var(--border); }

.list-entry {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 32px;
  align-items: start;
  padding: 30px 0;
  border-bottom: 1px solid var(--border);
}

.list-entry h2 { margin: 0 0 8px; font-size: 22px; line-height: 1.35; font-weight: 580; }
.list-entry p { margin: 0; color: var(--text-muted); }
.list-entry > a { font-weight: 620; white-space: nowrap; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-block: 30px 42px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
}

.site-footer p { margin: 0; }
.footer-links { display: flex; gap: 16px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 860px) {
  .site-header { align-items: flex-start; padding-block: 18px; }
  .header-tools { flex-wrap: wrap; justify-content: flex-end; gap: 10px 16px; }
  .primary-nav { order: 3; width: 100%; justify-content: flex-end; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .featured-project { grid-template-columns: 1fr; }
  .path-grid { grid-template-columns: 1fr; }
  .path-card { min-height: 0; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .site-header, .site-footer, .page { width: min(100% - 32px, 1040px); }
  .site-header { display: block; }
  .identity-link { display: block; margin-bottom: 14px; }
  .header-tools { justify-content: flex-start; }
  .primary-nav { order: initial; width: auto; justify-content: flex-start; }
  .theme-switch { width: 100%; margin-top: 2px; }
  .theme-switch button { flex: 1; min-height: 42px; }
  .page { padding-block: 64px 76px; }
  .section { margin-top: 72px; }
  .featured-project { gap: 28px; padding-block: 24px; }
  .evidence-frame { height: 260px; }
  .evidence-frame iframe { width: 200%; height: 200%; transform: scale(0.5); }
  .list-entry { grid-template-columns: 1fr; gap: 12px; }
  .site-footer { flex-direction: column; }
}

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