/*
  imfht.com — quiet personal site
  inspired by liangzhi.world (the spirit, not the copy)
*/

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

:root {
  --bg: #f6f4f0;
  --text: #2c2c2c;
  --quiet: #999;
  --faint: #ddd;
  --ink: #1a1a1a;

  --zh: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --en: "EB Garamond", "Georgia", serif;
  --mono: "JetBrains Mono", "Menlo", monospace;

  --w: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191919;
    --text: #c8c4bc;
    --quiet: #666;
    --faint: #333;
    --ink: #e0dcd4;
  }
}

html {
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--zh);
  color: var(--text);
  background: var(--bg);
  line-height: 2;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

main, article {
  max-width: var(--w);
  margin: 0 auto;
  padding: 18vh 1.5rem 10vh;
}

/* ——— brand ——— */
.brand {
  display: block;
  font-size: 1.15rem;
  letter-spacing: 0.3em;
  color: var(--quiet);
  margin-bottom: 3rem;
  transition: color 0.3s;
}
.brand:hover { color: var(--ink); }
.brand .en {
  display: block;
  font-family: var(--en);
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  margin-top: 0.25rem;
  font-style: italic;
}

/* ——— intro ——— */
.intro {
  font-size: 1rem;
  line-height: 1.9;
  margin-bottom: 0;
  color: var(--text);
}

/* ——— section ——— */
.section { margin-top: 3rem; }

.section-title {
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.35em;
  color: var(--quiet);
  margin-bottom: 1.4rem;
}

/* ——— list ——— */
.list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.list a {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 1rem;
  padding: 0.4rem 0;
  font-size: 1rem;
  line-height: 1.5;
  transition: color 0.2s;
}

.list a:hover .name { color: var(--ink); }

.list .name {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list .meta {
  color: var(--quiet);
  font-family: var(--en);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* ——— divider ——— */
hr {
  border: none;
  border-top: 1px solid var(--faint);
  margin: 3.5rem 0;
  width: 2rem;
}

/* ——— footer ——— */
footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 4rem;
  color: var(--quiet);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
footer a { color: var(--quiet); transition: color 0.2s; }
footer a:hover { color: var(--ink); }
footer .dot { color: var(--faint); margin: 0 0.3rem; }

/* ——— article pages ——— */
article h1 {
  font-weight: 400;
  font-size: 1.6rem;
  color: var(--ink);
  letter-spacing: 0.04em;
  line-height: 1.4;
  margin-bottom: 0;
}

article .subtitle {
  font-family: var(--en);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--quiet);
  letter-spacing: 0.2em;
  margin-top: 0.5rem;
}

article hr.short {
  width: 2rem;
  margin: 2.2rem 0;
}

article p {
  font-size: 1rem;
  line-height: 1.9;
  margin-bottom: 1.4rem;
  text-align: justify;
  color: var(--text);
}

article h2 {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: 0.03em;
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
}

article a {
  color: var(--ink);
  border-bottom: 1px solid var(--faint);
  transition: border-color 0.2s;
}
article a:hover { border-bottom-color: var(--ink); }

article ul {
  padding-left: 1.4rem;
  margin-bottom: 1.4rem;
}
article li {
  margin-bottom: 0.4rem;
  line-height: 1.8;
}

article .back {
  display: inline-block;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--quiet);
  letter-spacing: 0.2em;
  border: none;
}
article .back:hover { color: var(--ink); }

/* ——— responsive ——— */
@media (max-width: 600px) {
  main, article { padding: 12vh 1.25rem 8vh; }
  html { font-size: 17px; }
  .list a { grid-template-columns: 1fr; gap: 0.1rem; }
  .list .meta { font-size: 0.78rem; }
  footer { flex-direction: column; }
}
