/* =========================================================
   Zeqian Yu — personal academic website
   Modern-minimal design system
   ========================================================= */

:root {
  /* Palette */
  --bg: #fbfcfd;
  --bg-tint: #eef3f8;
  --surface: #ffffff;
  --ink: #131a24;
  --body: #3a4757;
  --muted: #6b7889;
  --line: #e5ebf1;
  --line-strong: #d3dde7;

  --accent: #1f5f8b;
  --accent-strong: #12466b;
  --accent-soft: #eaf2f9;
  --accent-ring: rgba(31, 95, 139, 0.28);

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(19, 26, 36, 0.05), 0 2px 8px rgba(19, 26, 36, 0.04);
  --shadow-md: 0 4px 16px rgba(19, 26, 36, 0.07), 0 12px 40px rgba(19, 26, 36, 0.06);
  --shadow-lg: 0 18px 50px rgba(21, 48, 74, 0.14);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;

  --maxw: 1080px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 50% -180px, var(--bg-tint), transparent 70%),
    var(--bg);
  color: var(--body);
  font-family: "Inter", "Inter var", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  font-feature-settings: "cv05" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

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

::selection {
  background: var(--accent-ring);
  color: var(--ink);
}

/* ---------- Layout helpers ---------- */
.wrap {
  width: min(var(--maxw), calc(100% - 48px));
  margin-inline: auto;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 252, 253, 0.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}

.site-header.scrolled {
  border-bottom-color: var(--line);
}

.header-inner {
  width: min(var(--maxw), calc(100% - 48px));
  margin-inline: auto;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.site-title {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.site-title:hover {
  color: var(--ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  transition: color 160ms var(--ease), background 160ms var(--ease);
}

.site-nav a:hover {
  color: var(--ink);
  background: rgba(31, 95, 139, 0.07);
}

.site-nav a.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

/* ---------- Reveal on load ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 720ms var(--ease) forwards;
}

.reveal.d1 { animation-delay: 60ms; }
.reveal.d2 { animation-delay: 140ms; }
.reveal.d3 { animation-delay: 220ms; }
.reveal.d4 { animation-delay: 300ms; }

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }
  html { scroll-behavior: auto; }
}

/* ---------- Home / hero ---------- */
.home {
  width: min(var(--maxw), calc(100% - 48px));
  margin: clamp(48px, 8vw, 96px) auto 0;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}

.identity {
  text-align: center;
}

.portrait {
  position: relative;
  width: 296px;
  height: 296px;
  margin: 0 auto 26px;
  border-radius: 50%;
  padding: 7px;
  background:
    conic-gradient(from 210deg, var(--accent-soft), #ffffff 40%, var(--bg-tint) 70%, var(--accent-soft));
  box-shadow: var(--shadow-lg);
}

.portrait::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(19, 26, 36, 0.06);
  pointer-events: none;
}

.portrait img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: 10% 42%;
}

.identity h1 {
  margin: 0;
  color: var(--ink);
  font-size: 32px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.chinese-name {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 19px;
  font-weight: 400;
}

.identity .role {
  margin: 14px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--body);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.role .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2fa36b;
  box-shadow: 0 0 0 3px rgba(47, 163, 107, 0.18);
}

/* Contact / social */
.socials {
  margin: 22px 0 0;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.social {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow-sm);
  transition: transform 160ms var(--ease), color 160ms var(--ease),
    border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.social:hover {
  transform: translateY(-2px);
  color: var(--accent-strong);
  border-color: var(--accent-ring);
  box-shadow: var(--shadow-md);
}

.social svg {
  width: 19px;
  height: 19px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid var(--accent-strong);
  border-radius: 12px;
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}

.contact-link:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.contact-link svg {
  width: 18px;
  height: 18px;
}

/* Intro copy */
.intro {
  max-width: 640px;
}

.eyebrow {
  margin: 0 0 16px;
  display: inline-block;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.intro h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 4.2vw, 44px);
  font-weight: 760;
  line-height: 1.14;
  letter-spacing: -0.025em;
}

.intro h2 .hl {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.intro .lead {
  margin: 24px 0 0;
  color: var(--body);
  font-size: 17.5px;
}

.intro p + p {
  margin-top: 16px;
}

/* Interest chips */
.chips {
  margin: 26px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.chip {
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--body);
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color 160ms var(--ease), color 160ms var(--ease),
    background 160ms var(--ease);
}

.chip:hover {
  border-color: var(--accent-ring);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.cta-row {
  margin: 30px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms var(--ease), background 160ms var(--ease),
    border-color 160ms var(--ease), box-shadow 160ms var(--ease), color 160ms var(--ease);
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn-primary {
  border: 1px solid var(--accent-strong);
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--accent-ring);
  color: var(--accent-strong);
  box-shadow: var(--shadow-md);
}

/* ---------- Interior pages ---------- */
.page {
  width: min(880px, calc(100% - 48px));
  margin: clamp(40px, 6vw, 76px) auto 0;
}

.page-head {
  margin-bottom: 40px;
}

.page-head .eyebrow {
  margin-bottom: 12px;
}

.page-head h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 4.4vw, 44px);
  font-weight: 760;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.page-head p.sub {
  margin: 16px 0 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 17px;
}

/* Cards */
.card {
  position: relative;
  padding: clamp(26px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 220ms var(--ease), transform 220ms var(--ease),
    border-color 220ms var(--ease);
}

.card + .card {
  margin-top: 24px;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

/* Research entry */
.entry-tag {
  display: inline-block;
  margin: 0 0 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.card h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 730;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.card .meta {
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 15px;
}

.card .meta .sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line-strong);
}

.card p {
  margin: 18px 0 0;
  color: var(--body);
}

/* Publication list (research page) */
.pub-list {
  display: grid;
  gap: 26px;
}

.pub h3 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.pub-meta {
  margin: 6px 0 0;
  color: var(--body);
  font-size: 15.5px;
}

.pub-note {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 14.5px;
}

.tag-row {
  margin: 22px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* CV download banner */
.cv-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.cv-banner .txt strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
}

.cv-banner .txt span {
  color: var(--muted);
  font-size: 15px;
}

/* CV timeline */
.section-title {
  margin: 44px 0 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.timeline {
  position: relative;
  margin-left: 6px;
  padding-left: 30px;
  border-left: 2px solid var(--line);
  display: grid;
  gap: 30px;
}

.tl-item {
  position: relative;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: -37px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}

.tl-item.now::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.tl-date {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.tl-item h3 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
}

.tl-item .place {
  margin: 4px 0 0;
  color: var(--body);
  font-size: 15.5px;
}

.tl-item .note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14.5px;
}

/* ---------- Footer ---------- */
.site-footer {
  width: min(var(--maxw), calc(100% - 48px));
  margin: clamp(64px, 9vw, 104px) auto 0;
  padding: 30px 0 46px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 14.5px;
}

.site-footer .foot-links {
  display: flex;
  gap: 18px;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--accent-strong);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  body { font-size: 16px; }

  .home {
    grid-template-columns: 1fr;
    gap: 40px;
    margin-top: 40px;
  }

  .portrait {
    width: 232px;
    height: 232px;
  }

  .intro {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .header-inner { height: 60px; }

  .site-nav a {
    padding: 7px 11px;
    font-size: 14px;
  }

  .site-title span.long { display: none; }

  .cv-banner { flex-direction: column; align-items: flex-start; }

  .site-footer { flex-direction: column; align-items: flex-start; }
}
