:root {
  --bg: #faf8f5;
  --fg: #22201d;
  --muted: #77716a;
  --accent: #b4532a;
  --rule: #e8e3db;
  --card: #ffffff;
  --code-bg: #f1ede6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17171a;
    --fg: #e6e2dc;
    --muted: #9b958d;
    --accent: #e48a5f;
    --rule: #2e2e33;
    --card: #1f1f23;
    --code-bg: #26262b;
  }
}
* { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 1rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.wrap { max-width: 60rem; margin: 0 auto; padding: 2rem 1rem 4rem; }
main > *:not(.works):not(.tiles):not(.grid):not(figure.hero), article > *:not(.grid):not(figure.wide) { max-width: 42rem; }
header.site { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem 1rem;
  border-bottom: 1px solid var(--rule); padding-bottom: 1rem; margin-bottom: 2rem; }
header.site a.brand { font-weight: 700; font-size: 1.2rem; color: var(--fg); text-decoration: none; letter-spacing: .01em; }
header.site nav { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; }
header.site nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
header.site nav a:hover { color: var(--accent); }
header.site nav a.lang { border: 1px solid var(--rule); border-radius: 4px; padding: 0 .4rem; font-size: .8rem; }
a { color: var(--accent); }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: 2rem; line-height: 1.2; margin: 0 0 .4rem; font-weight: 600; }
h2 { font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; margin: 2.2rem 0 .6rem; font-weight: 600; }
.meta { color: var(--muted); font-size: .88rem; margin-bottom: 1.2rem; }
.intro { font-size: 1.12rem; }
ul.posts { list-style: none; padding: 0; }
ul.posts li { margin: 0 0 1.3rem; }
ul.posts li > a { font-size: 1.1rem; font-weight: 600; text-decoration: none; }
ul.posts li > a:hover { text-decoration: underline; }
ul.posts li .meta { margin: .1rem 0 0; }
ul.posts li p { margin: .25rem 0 0; }
figure { margin: 0; }
figure img { display: block; width: 100%; height: auto; border-radius: 6px; background: var(--rule); }
figure figcaption { color: var(--muted); font-size: .82rem; margin-top: .35rem; text-align: center; }
figure.hero { margin-bottom: 1.5rem; }
figure.wide { margin: 1.2rem 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; }
.tile { position: relative; display: block; border-radius: 6px; overflow: hidden; aspect-ratio: 4/3; background: var(--rule); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.tile:hover img { transform: scale(1.04); }
.tile span { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.5rem .8rem .6rem; color: #fff; font-weight: 600;
  background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.grid { display: grid; gap: .8rem; margin: 1.2rem 0; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 40rem) { .grid.c4 { grid-template-columns: repeat(2, 1fr); } .grid.c3 { grid-template-columns: 1fr; } }
.works { columns: 2 22rem; column-gap: 1.2rem; margin-top: 1.5rem; }
.work { break-inside: avoid; margin-bottom: 1.4rem; background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: .6rem; }
details.params { margin-top: .5rem; font-size: .82rem; }
details.params summary { cursor: pointer; color: var(--muted); }
details.params dl { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .8rem; margin: .5rem 0 0; }
details.params dt { color: var(--muted); }
details.params dd { margin: 0; overflow-wrap: anywhere; }
code, pre { font-family: "JetBrains Mono", Consolas, "DejaVu Sans Mono", monospace; font-size: .84rem; background: var(--code-bg); }
code { padding: .08rem .3rem; border-radius: 3px; }
pre { padding: .8rem 1rem; overflow-x: auto; border-radius: 6px; line-height: 1.45; }
pre code { padding: 0; background: none; }
footer.site { margin-top: 3.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .85rem; }
.lb { position: fixed; inset: 0; background: rgba(10,10,12,.92); display: flex; align-items: center; justify-content: center; z-index: 10; cursor: zoom-out; }
.lb img { max-width: 96vw; max-height: 94vh; border-radius: 4px; }
