/* infimory.ai — minimal. No frameworks, no external fonts, no tracking. */

:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #757575;
  --rule: #e4e4e4;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", "Source Han Serif SC", "Noto Serif SC",
    "Noto Serif CJK SC", "Songti SC", STSong, "SimSun", serif;
  font-size: 18px;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  max-width: 660px;
  margin: 0 auto;
  padding: 96px 24px 80px;
}

/* ---------- language switch ---------- */

.lang {
  position: fixed;
  top: 22px;
  right: 24px;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #5f5f5f;
  background: var(--bg);
  padding: 6px 2px 6px 10px;
  cursor: pointer;
  border: 0;
  font-family: inherit;
}

.lang:hover { color: var(--text); }

html[data-lang="en"] .zh { display: none; }
html[data-lang="zh"] .en { display: none; }

/* ---------- type ---------- */

h1 {
  margin: 0 0 40px;
  font-size: 28px;
  line-height: 1.35;
  font-weight: 400;
  letter-spacing: -0.01em;
}

h2 {
  margin: 46px 0 10px;
  font-size: 18px;
  line-height: 1.6;
  font-weight: 700;
}

p {
  margin: 0 0 18px;
}

p.lead {
  font-size: 21px;
  line-height: 1.6;
  margin-bottom: 32px;
}

p.tight {
  margin-bottom: 8px;
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: #c9c9c9;
}

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

/* ---------- signature + footer ---------- */

.sig {
  margin-top: 52px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

footer {
  margin-top: 64px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-size: 15px;
  color: var(--muted);
}

footer a { color: var(--muted); }
footer a:hover { color: var(--text); }

.sep { padding: 0 10px; color: var(--rule); }

/* ---------- writing index ---------- */

.entry {
  margin: 0 0 26px;
}

.entry .date {
  display: block;
  font-size: 15px;
  color: var(--muted);
}

.entry .title {
  font-size: 20px;
}

.back {
  display: block;
  margin-bottom: 40px;
  font-size: 15px;
  color: var(--muted);
  text-decoration: none;
}

.back:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- careers ---------- */

.role {
  margin: 36px 0;
}

.role h2 {
  margin: 0 0 6px;
}

.role p {
  margin: 0 0 6px;
  color: #333;
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  body { font-size: 17px; }
  .wrap { padding: 72px 20px 64px; }
  h1 { font-size: 24px; margin-bottom: 32px; }
  p.lead { font-size: 19px; }
  .lang { top: 16px; right: 18px; }
}

@media print {
  .lang, footer { display: none; }
}

/* ---------- blog post: numbered sections + left index ---------- */

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.meta {
  margin: -26px 0 40px;
  font-size: 15px;
  color: var(--muted);
}

.post article { counter-reset: sec; }

.post article h2 {
  counter-increment: sec;
  font-size: 20px;
  margin: 56px 0 12px;
  scroll-margin-top: 32px;
}

.post article h2::before {
  content: counter(sec);
  margin-right: 14px;
  color: #a9a9a9;
  font-weight: 400;
}

.toc { display: none; }

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
  font-size: 14px;
  line-height: 1.5;
}

.toc-list li {
  counter-increment: toc;
  margin-bottom: 16px;
}

.toc-list a {
  position: relative;
  display: block;
  padding-left: 22px;
  color: var(--muted);
  text-decoration: none;
  transition: color 120ms linear;
}

.toc-list a::before {
  content: counter(toc);
  position: absolute;
  left: 0;
  color: #c2c2c2;
}

.toc-list a:hover { color: var(--text); }

.toc-list a.is-active,
.toc-list a.is-active::before { color: var(--text); }

@media (min-width: 1100px) {
  .post .wrap {
    display: flex;
    align-items: flex-start;
    gap: 60px;
    /* 24px padding x2 + 200 index + 60 gap + 660 text */
    max-width: 968px;
  }

  .post .col-main {
    flex: 1;
    min-width: 0;
    max-width: 660px;
  }

  .toc {
    display: block;
    flex: none;
    width: 200px;
    position: sticky;
    top: 96px;
    padding-top: 4px;
  }
}
