/* nategu.com — cold paper, ink, and status marks that mean something */

:root {
  --paper:    #F7F8F6;
  --paper-2:  #EDEFEA;
  --ink:      #161D24;
  --ink-soft: #5C6771;
  --rule:     #DCE0DB;
  --ok:       #2F7A4A;
  --wip:      #A8701C;
  --idle:     #8A929A;
  --link:     #23405C;

  --measure: 60ch;
  --gutter:  2.75rem;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:    #10141A;
    --paper-2:  #171C23;
    --ink:      #E4E8E3;
    --ink-soft: #949DA6;
    --rule:     #262D35;
    --ok:       #6FBF8C;
    --wip:      #D5A055;
    --idle:     #7E868F;
    --link:     #9CC0E0;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Newsreader", Georgia, "Songti SC", serif;
  font-size: 1.0625rem;
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

:lang(zh), .cn { font-family: "Newsreader", "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", sans-serif; }

/* --- language switch: without JS both languages show --- */
html[data-lang="en"] .cn { display: none; }
html[data-lang="cn"] .en { display: none; }

/* --- page frame: a status gutter to the left of a single column --- */
.page {
  max-width: calc(var(--measure) + var(--gutter) + 3rem);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 6rem;
}

.bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin-left: var(--gutter);
  margin-bottom: 3.25rem;
}

.name {
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin: 0;
}
.name a { color: inherit; text-decoration: none; }

.langs { display: flex; gap: 0.75rem; font-size: 0.875rem; }
.langs button {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.875rem;
  color: var(--ink-soft);
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.langs button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.langs button:hover { color: var(--ink); }

/* --- body column --- */
.col { margin-left: var(--gutter); max-width: var(--measure); }

.lede {
  font-size: 1.375rem;
  line-height: 1.48;
  font-weight: 300;
  margin: 0 0 2.75rem;
}
.lede .quiet { color: var(--ink-soft); }

p { margin: 0 0 1.15rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: from-font; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 2px; }

/* --- the real screenshot --- */
figure { margin: 0 0 3.5rem; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}
figcaption {
  margin-top: 0.7rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* --- works: entries in a list, not cards --- */
.work { position: relative; margin: 0 0 2.9rem; }

.work .mark {
  position: absolute;
  left: calc(-1 * var(--gutter));
  top: 0.62em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--idle);
}
.work[data-status="shipped"] .mark { border-color: var(--ok); background: var(--ok); }
.work[data-status="prototype"] .mark {
  border-color: var(--wip);
  background: linear-gradient(to right, var(--wip) 0 50%, transparent 50% 100%);
}

.work h2 {
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin: 0 0 0.4rem;
}

.work .state {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin: 0.5rem 0 0;
}
.work .state b { font-weight: 500; color: var(--ink); }

.legend {
  margin: 0 0 3.25rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.legend span { display: inline-flex; align-items: center; gap: 0.45rem; }
.legend i {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--idle);
  flex: none;
}
.legend .s-ok { border-color: var(--ok); background: var(--ok); }
.legend .s-wip { border-color: var(--wip); background: linear-gradient(to right, var(--wip) 0 50%, transparent 50% 100%); }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0 0 2.25rem;
}

h3 {
  font-size: 1.0625rem;
  font-weight: 500;
  margin: 0 0 0.75rem;
}

.foot {
  margin-top: 3.25rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.foot a { color: var(--link); }

@media (max-width: 640px) {
  :root { --gutter: 0rem; }
  .page { padding: 3rem 1.25rem 4rem; }
  .lede { font-size: 1.1875rem; }
  .work { padding-left: 1.1rem; }
  .work .mark { left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* --- writing --- */
.entry {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 1.25rem;
  margin: 0 0 1.75rem;
}
.entry h2 {
  grid-column: 1;
  font-size: 1.0625rem;
  font-weight: 500;
  margin: 0;
}
.entry h2 a { color: inherit; text-decoration-color: var(--ink-soft); }
.entry h2 a:hover { text-decoration-color: currentColor; }
.entry .when {
  grid-column: 2;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  white-space: nowrap;
  padding-top: 0.3em;
}
.entry .sum {
  grid-column: 1 / -1;
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin: 0.2rem 0 0;
}

.group { margin: 0 0 3rem; }
.group > h3 { margin-bottom: 0.35rem; }
.about {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin: -0.35rem 0 1.9rem;
}
.group > .about { margin-bottom: 1.75rem; }
.quiet-note { font-size: 0.9375rem; color: var(--ink-soft); }

/* --- a post --- */
.post-title {
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.26;
  margin: 0 0 0.45rem;
}
.dateline {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin: 0 0 2.5rem;
}
article h4 {
  font-size: 1.0625rem;
  font-weight: 500;
  margin: 2.4rem 0 0.8rem;
}
article blockquote {
  margin: 1.6rem 0;
  padding-left: 1.15rem;
  border-left: 2px solid var(--rule);
  color: var(--ink-soft);
}
article blockquote p { margin-bottom: 0.6rem; }

/* --- claims with their evidence --- */
.claim { margin: 0 0 2.4rem; }
.claim h4 { margin: 0 0 0.5rem; }
.claim .proof {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin: 0.55rem 0 0;
  padding-left: 1.15rem;
  border-left: 2px solid var(--rule);
}

@media (max-width: 640px) {
  .post-title { font-size: 1.5rem; }
  .entry { grid-template-columns: 1fr; }
  .entry .when { grid-column: 1; padding-top: 0.15rem; order: 3; }
}
