/* Shared stylesheet for shuwang21.github.io
   Replaces the three copies of inline CSS that used to live in
   index.html, misc.html and tips.html. */

:root {
  --bg:        #ffffff;
  --text:      #1c1c1c;
  --muted:     #6a6a6a;
  --rule:      #d8d8d8;
  --rule-soft: #ececec;
  --accent:    #0b5394;
  --link:      #0b5394;
  --link-hover:#c2410c;
  --plate:     transparent;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #17191d;
    --text:      #e4e4e4;
    --muted:     #9aa1a9;
    --rule:      #3a3f46;
    --rule-soft: #2a2e33;
    --accent:    #8ab4f8;
    --link:      #8ab4f8;
    --link-hover:#ffab70;
    --plate:     #ffffff;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica,
        Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

#page-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}

h1 {
  font-size: clamp(30px, 7vw, 42px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -1.5px;
}

#pic {
  width: 240px;
  max-width: 45%;
  height: auto;
  background: var(--plate);
  border-radius: 3px;
}

@media (prefers-color-scheme: dark) {
  #pic { padding: 6px 8px; }
}

/* ---------- nav ---------- */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 14px 0 32px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 15px;
}

.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--link-hover); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

/* ---------- typography ---------- */

h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 40px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule-soft);
}

h2:first-of-type { margin-top: 32px; }

p { margin: 0 0 4px; }

a { color: var(--link); }
a:hover { color: var(--link-hover); }

ul { margin: 0 0 8px 20px; }
p + ul { margin-top: 14px; }
li { margin-bottom: 14px; }
li ul { margin-top: 6px; margin-bottom: 0; }
li li { margin-bottom: 4px; }

.contact { margin-top: 14px; }
.contact p { line-height: 1.8; }

/* Author lists / venue lines under a publication title */
.meta { color: var(--muted); font-size: 15px; }

/* Keep long paper titles from overflowing narrow screens */
li a { overflow-wrap: anywhere; }

/* ---------- small screens ---------- */

@media (max-width: 560px) {
  body { font-size: 16px; }
  #page-wrap { padding: 28px 18px 60px; }
  .site-header { gap: 14px; }
  #pic { width: 180px; max-width: 60%; }
}

/* ---------- print ---------- */

@media print {
  .site-nav { display: none; }
  body { color: #000; background: #fff; }
  a { color: #000; }
}
