/* ---------- palette ---------- */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f6;
  --bg-hover: #f7f7f6;

  --fg: #282828;
  --fg-strong: #111111;
  --fg-muted: #6b6866;
  --fg-quiet: #9a9794;

  --rule: #ececea;
  --rule-strong: #282828;

  --card: #ffffff;
  --card-soft: #ffffff;
  --card-soft-border: #ededeb;
  --card-soft-border-hover: #d6d4d0;

  --shadow: #282828;
  --shadow-soft: #f3f3f1;

  --link: #282828;
  --accent: #b65332;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0e;
    --bg-soft: #181818;
    --bg-hover: #1f1f1f;

    --fg: #e8e6e2;
    --fg-strong: #f5f3ef;
    --fg-muted: #989593;
    --fg-quiet: #6a6866;

    --rule: #262625;
    --rule-strong: #e8e6e2;

    --card: #1a1a1a;
    --card-soft: #141414;
    --card-soft-border: #232322;
    --card-soft-border-hover: #3a3a38;

    --shadow: #e8e6e2;
    --shadow-soft: #2a2a28;

    --link: #e8e6e2;
    --accent: #d57e5c;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", "Menlo",
    "Cascadia Mono", "Consolas", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei Mono", monospace;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.serif {
  font-family: "Source Serif 4", "Iowan Old Style", "Charter", "Georgia",
    "Songti SC", "STSong", serif;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule-strong);
  transition: text-decoration-thickness 100ms ease, text-decoration-color 100ms ease;
}
a:hover {
  text-decoration-thickness: 2px;
  text-decoration-color: var(--fg);
}

p { margin: 0 0 1em; }

/* ---------- shell ---------- */

.shell {
  padding: 14px;
  overflow: hidden;
}
@media (min-width: 768px) {
  .shell { padding: 22px; }
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

/* ---------- header ---------- */

header.site {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 28px;
}
@media (min-width: 720px) {
  header.site {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.brand {
  font-family: "Source Serif 4", "Iowan Old Style", "Charter", "Georgia",
    "Songti SC", serif;
  font-size: 1.85rem;
  line-height: 1;
  color: var(--fg-strong);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; color: var(--accent); }

.site-nav {
  display: flex;
  gap: 18px;
  font-size: 0.875rem;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 7px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule-strong);
  opacity: 0.55;
}
.site-nav a:hover { opacity: 1; text-decoration-thickness: 2px; }
.site-nav a[aria-current="page"] {
  opacity: 1;
  text-decoration-thickness: 2px;
}

/* ---------- intro ---------- */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 32px;
  align-items: start;
  margin: 32px 0;
}
.intro.no-photo { grid-template-columns: 1fr; }
.intro p { margin-bottom: 1em; }
.intro p:last-child { margin-bottom: 0; }

.intro-photo {
  width: 168px;
}
.intro-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

@media (max-width: 560px) {
  .intro { grid-template-columns: 1fr; gap: 20px; }
  .intro-photo { width: 140px; }
}

/* ---------- timeline ---------- */

.timeline-wrap {
  padding-left: 8px;
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-left: 1px solid var(--rule);
  padding: 16px 0;
}
.timeline::before,
.timeline::after {
  content: "";
  position: absolute;
  left: -1px;
  width: 1px;
  height: 24px;
  pointer-events: none;
}
.timeline::before { top: 0; background: linear-gradient(to top, transparent, var(--bg)); }
.timeline::after { bottom: 0; background: linear-gradient(to bottom, transparent, var(--bg)); }

.t-item {
  position: relative;
  margin-left: 24px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}
.t-item:hover { text-decoration: none; }

.t-dot {
  position: absolute;
  left: -28px;
  top: 14px;
  width: 7px;
  height: 7px;
  background: var(--fg);
  border-radius: 2px;
  outline: 2px solid var(--bg);
}

/* plain row — no card */
.t-item.plain:hover { background: var(--bg-hover); }

/* featured — first/co-first author papers */
.t-item.feature {
  background: var(--card);
  border: 1px solid var(--rule-strong);
  box-shadow: 3px 3px 0 var(--shadow);
  transition: box-shadow 120ms ease, transform 120ms ease;
  gap: 8px;
}
.t-item.feature:hover { box-shadow: 5px 5px 0 var(--shadow); }
.t-item.feature .t-dot { top: 16px; }

/* soft — other co-authored papers */
.t-item.soft {
  background: var(--card-soft);
  border: 1px solid var(--card-soft-border);
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  gap: 8px;
}
.t-item.soft:hover {
  background: var(--card);
  border-color: var(--card-soft-border-hover);
  box-shadow: 3px 3px 0 var(--shadow-soft);
}

/* card heads */
.t-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
}
.t-title {
  font-weight: 600;
  line-height: 1.45;
  color: var(--fg-strong);
  flex: 1;
  min-width: 0;
}
.t-date {
  font-size: 0.75rem;
  color: var(--fg-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.t-body {
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.6;
}

.t-authors {
  font-size: 0.74rem;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.6;
}
.t-authors .me { color: var(--fg-strong); font-weight: 600; }

.t-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.t-tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border: 1px solid var(--rule);
  color: var(--fg-muted);
  text-decoration: none;
  background: var(--bg);
}
.t-tag:hover {
  color: var(--fg-strong);
  border-color: var(--fg);
  text-decoration: none;
}

/* ---------- sections ---------- */

.section-label {
  font-size: 0.72rem;
  color: var(--fg-quiet);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 32px 0 12px;
}

.block {
  margin-top: 28px;
}

/* ---------- contact list ---------- */

.contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.82rem;
}

/* ---------- footer ---------- */

footer.site {
  border-top: 1px solid var(--rule-strong);
  margin-top: 48px;
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
footer.site .mark {
  font-family: "Source Serif 4", "Iowan Old Style", "Charter", "Georgia", "Songti SC", serif;
  font-size: 1.05rem;
  color: var(--fg-strong);
}
footer.site .right {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--fg-quiet);
}

/* selection */
::selection { background: var(--fg); color: var(--bg); }
