/* www.phuyai.cc: one stylesheet for every page. System fonts only; light and dark follow the
   reader's system setting. */

:root {
  color-scheme: light dark;
  --bg: #fbfbf8;
  --fg: #1d1f21;
  --muted: #5b6168;
  --accent: #1f5fa8;
  --accent-visited: #6a3d9a;
  --rule: #dcdcd4;
  --panel: #f1f1ec;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --fg: #e4e6e8;
    --muted: #a0a7ae;
    --accent: #7db3f0;
    --accent-visited: #c3a2ea;
    --rule: #33373c;
    --panel: #1d2024;
  }
}

*,
*::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: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem;
}

header.site {
  border-bottom: 1px solid var(--rule);
}

header.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.brand {
  font-weight: 650;
  color: var(--fg);
  text-decoration: none;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav a[aria-current="page"] {
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
}

main {
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
}

h1 {
  font-size: 1.85rem;
  line-height: 1.25;
  margin: 0.5rem 0 0.75rem;
}

h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin: 2rem 0 0.5rem;
}

h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.25rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

li + li {
  margin-top: 0.25rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:visited {
  color: var(--accent-visited);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  background: var(--panel);
  border-radius: 4px;
  padding: 0.1em 0.3em;
  overflow-wrap: anywhere;
}

.lead {
  font-size: 1.15rem;
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.note {
  background: var(--panel);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin: 1.25rem 0;
}

.note p:last-child {
  margin-bottom: 0;
}

dl dt {
  font-weight: 600;
}

dl dd {
  margin: 0 0 0.75rem;
}

footer.site {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}

footer.site .wrap {
  padding-top: 1rem;
  padding-bottom: 2rem;
}

footer.site p {
  margin: 0 0 0.5rem;
}
