:root {
  --paper: #faf8f4; --ink: #22201c; --ink2: #5f594e; --ink3: #8c8578;
  --sand: #b0a893; --rule: #e9e3d6;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font-family: var(--serif); line-height: 1.7; }
body { margin: 0; }
.wrap { max-width: 640px; margin: 0 auto; padding: 52px 22px 96px; }
header.site { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 64px; }
header.site a { text-decoration: none; }
.brand { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--ink); }
nav a { font-family: var(--sans); font-size: 12px; color: var(--ink3); margin-left: 16px; text-decoration: none; }
nav a:hover { color: var(--ink); }
h1 { font-size: 30px; font-weight: 500; line-height: 1.32; letter-spacing: -.01em; margin: 0 0 14px; }
h2 { font-family: var(--sans); font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
     color: var(--sand); font-weight: 600; margin: 52px 0 4px; }
h3 { font-size: 17px; font-weight: 500; }
a { color: var(--ink); }
p { margin: 14px 0; }
.sub { font-size: 16px; line-height: 1.75; color: var(--ink2); max-width: 490px; }
.mono { font-family: var(--mono); font-size: 11px; color: var(--sand); letter-spacing: .05em; }
ul.plain { list-style: none; padding: 0; margin: 0; }
.item { display: flex; gap: 16px; align-items: flex-start; padding: 17px 0; border-bottom: 1px solid var(--rule); }
.item a.block { display: flex; gap: 16px; align-items: flex-start; text-decoration: none; color: var(--ink); width: 100%; }
.thumb { width: 56px; height: 56px; border-radius: 9px; flex: 0 0 auto; image-rendering: pixelated; margin-top: 3px; }
.item h3 { margin: 0; }
.item h3 span.tag { color: var(--sand); font-size: 13px; font-family: var(--sans); margin-left: 10px; }
.item p { margin: 5px 0 0; font-size: 14.5px; color: var(--ink2); font-family: var(--sans); line-height: 1.6; }
.item:hover h3 { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--sand); }
.post-item { display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
             padding: 13px 0; border-bottom: 1px solid var(--rule); }
.post-item a { font-size: 16px; text-decoration: none; }
.post-item a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--sand); }
.date { font-family: var(--sans); font-size: 12.5px; color: var(--ink3); }
article { font-size: 17px; }
article p { line-height: 1.8; }
article code { font-family: var(--mono); font-size: 14px; background: #f0ece2; padding: 2px 6px; border-radius: 6px; }
article pre { background: #f0ece2; border: 1px solid var(--rule); border-radius: 12px; padding: 16px; overflow-x: auto; }
article pre code { background: none; padding: 0; }
article ul li { margin: 6px 0; }
.close { margin-top: 60px; font-size: 16px; color: var(--ink2); }
.close em { font-style: italic; }
footer.site { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--rule); }
footer.site .mono { color: var(--ink3); }

/* ── motion & quality of life ─────────────────────────────────────────── */
::selection { background: #e9dfc8; color: var(--ink); }
:focus-visible { outline: 2px solid var(--sand); outline-offset: 3px; border-radius: 4px; }
html { scroll-behavior: smooth; }
h2 { scroll-margin-top: 24px; }

/* staggered fade-up on page enter */
@keyframes rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: rise .5s cubic-bezier(.2,.6,.2,1) both; }
.stagger > *:nth-child(1) { animation-delay: .03s; }
.stagger > *:nth-child(2) { animation-delay: .09s; }
.stagger > *:nth-child(3) { animation-delay: .15s; }
.stagger > *:nth-child(4) { animation-delay: .21s; }
.stagger > *:nth-child(5) { animation-delay: .27s; }
.stagger > *:nth-child(n+6) { animation-delay: .33s; }

/* sliding underline for nav + list links */
nav a, .post-item a, .close a {
  text-decoration: none;
  background-image: linear-gradient(var(--sand), var(--sand));
  background-repeat: no-repeat; background-size: 0% 1px; background-position: 0 100%;
  transition: background-size .28s cubic-bezier(.2,.6,.2,1), color .15s;
  padding-bottom: 2px;
}
nav a:hover, .post-item a:hover, .close a:hover { background-size: 100% 1px; }
nav a[aria-current="page"] { color: var(--ink); background-size: 100% 1px; }
.post-item a:hover { text-decoration: none; }

/* project rows: thumb lift + title underline slide */
.item { transition: border-color .2s; }
.item .thumb { transition: transform .3s cubic-bezier(.2,.6,.2,1), box-shadow .3s; }
.item:hover .thumb { transform: translateY(-2px) scale(1.03); box-shadow: 0 6px 18px rgba(60,50,30,.14); }
.item:hover h3 { text-decoration: none; }
.item h3 { background-image: linear-gradient(var(--sand), var(--sand));
  background-repeat: no-repeat; background-size: 0% 1px; background-position: 0 100%;
  transition: background-size .28s cubic-bezier(.2,.6,.2,1);
  display: inline; padding-bottom: 2px; }
.item:hover h3 { background-size: 100% 1px; }

/* article niceties */
.backlink { font-family: var(--sans); font-size: 13px; color: var(--ink3); text-decoration: none; }
.backlink:hover { color: var(--ink); }
.readtime { font-family: var(--sans); font-size: 12.5px; color: var(--ink3); margin-left: 10px; }
.article-thumb { width: 44px; height: 44px; border-radius: 8px; image-rendering: pixelated; margin-bottom: 14px; display: block; }

@media (prefers-reduced-motion: reduce) {
  .stagger > * { animation: none; }
  html { scroll-behavior: auto; }
  .item .thumb, nav a, .post-item a, .item h3, .close a { transition: none; }
}
.no-stagger .stagger > * { animation: none; }
