/* Zichao Yu — site styles. Flat paper and ink with a vermilion accent.
   System fonts plus a self-hosted script face for the name; light and dark
   follow the OS. */

/* Great Vibes, SIL Open Font License 1.1 (assets/fonts/OFL-great-vibes.txt),
   subset to Basic Latin. */
@font-face {
  font-family: "Great Vibes";
  src: url("../fonts/great-vibes.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --bg: #f4f1ea;
  --card: #fbf9f4;
  --fg: #24211d;
  --muted: #6f665a;
  --line: #e2dacb;
  --field: #ebe5d9;
  --seal: #b23a2c;
  --seal-line: rgba(178, 58, 44, 0.38);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;
  --script: "Great Vibes", "Snell Roundhand", "Segoe Script", cursive;

  --measure: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191714;
    --card: #211e1a;
    --fg: #e8e1d3;
    --muted: #a0978a;
    --line: #36312b;
    --field: #2a2621;
    --seal: #d4604f;
    --seal-line: rgba(212, 96, 79, 0.45);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.3;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--seal-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.24em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

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

:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 2px;
}

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

.muted {
  color: var(--muted);
}

/* ------------------------------------------------------------------ layout */

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 6rem 1.5rem 3rem;
}

.section {
  margin-top: 3rem;
}

.section > h2,
.label {
  margin-bottom: 0.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer {
  margin-top: 5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* -------------------------------------------------------------------- home */

.home {
  max-width: 44rem;
  margin: 0 auto;
  padding: 5rem 1.5rem 3rem;
}

.hero {
  text-align: center;
}

.avatar {
  display: block;
  width: 7.5rem;
  height: 7.5rem;
  margin: 0 auto 1.5rem;
  border-radius: 6px;
  object-fit: cover;
}

.name {
  font-family: var(--script);
  font-size: 3.75rem;
  font-weight: 400;
  line-height: 1.25;
}

.role {
  margin-top: 0.625rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.chip {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--fg);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  border-color: currentColor;
}

.about {
  margin-top: 3.5rem;
}

.interests {
  margin-top: 2.25rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0.25rem 0.625rem;
  font-size: 0.875rem;
  line-height: 1.5;
  background: var(--field);
  border-radius: 4px;
}

.heading {
  margin: 4rem 0 1.25rem;
  font-size: 1.75rem;
  letter-spacing: -0.01em;
}

.entries,
.pubs {
  margin: 0;
  padding: 0;
  list-style: none;
}

.entries li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.125rem 1.5rem;
}

.entries li + li {
  margin-top: 0.75rem;
}

.entry-org {
  font-weight: 600;
}

.entry-role {
  color: var(--muted);
}

.entry-date {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.pubs li + li {
  margin-top: 1.5rem;
}

.pub-title {
  font-weight: 600;
}

.pub-meta {
  margin-top: 0.25rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--muted);
}

.pub-meta strong {
  color: var(--fg);
  font-weight: 600;
}

.home .footer {
  text-align: center;
}

/* ---------------------------------------------------------------- subpages */

.back {
  font-size: 0.9375rem;
}

.page-head {
  margin-top: 2.5rem;
}

.page-title {
  font-size: 2rem;
  letter-spacing: -0.01em;
}

.page-meta {
  margin-top: 0.25rem;
  color: var(--muted);
}

.lead {
  margin-top: 1.25rem;
}

/* ----------------------------------------------------------------- tracker */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.search {
  flex: 1 1 100%;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 1rem;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  -webkit-appearance: none;
  appearance: none;
}

.search::placeholder {
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.filters button {
  padding: 0.3rem 0.8rem;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.filters button:hover {
  border-color: var(--muted);
}

.filters button[aria-pressed="true"] {
  color: var(--bg);
  background: var(--fg);
  border-color: var(--fg);
}

.filters .n {
  margin-left: 0.25rem;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

.count {
  margin-left: 0.375rem;
  font-variant-numeric: tabular-nums;
}

.list > li {
  padding: 0.875rem 0;
  border-top: 1px solid var(--line);
}

.list > li:last-child {
  border-bottom: 1px solid var(--line);
}

.row-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  column-gap: 1rem;
}

.row-title {
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
}

a.row-title:hover {
  color: var(--seal);
  text-decoration: underline;
}

.row-desc {
  margin-top: 0.125rem;
}

.row-meta,
.row-sub {
  font-size: 0.875rem;
  color: var(--muted);
}

.row-sub {
  margin-top: 0.25rem;
}

.row-products {
  color: var(--fg);
}

/* ------------------------------------------------------------------ narrow */

@media (max-width: 34rem) {
  .page,
  .home {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .page {
    padding-top: 3.5rem;
    padding-bottom: 2.5rem;
  }

  .home {
    padding-top: 3.5rem;
  }

  .name {
    font-size: 3.125rem;
  }

  .about {
    margin-top: 2.75rem;
  }

  .heading {
    margin-top: 3.25rem;
    font-size: 1.5rem;
  }
}
