/* Palette + rhythm */
:root{
  color-scheme: light;
  --bg:#1b1b1b;
  --fg:#f1eee7;
  --muted:#9f968b;
  --accent:#d67252;
  --line:#2c2c2c;
  --wrap:860px;
  --font:"IBM Plex Mono","Menlo","Consolas","Liberation Mono",monospace;
}

@media (prefers-color-scheme: dark){
  :root{
    color-scheme: dark;
    --bg:#0f0f0f;
    --fg:#e6e1d9;
    --muted:#a39c94;
    --accent:#e9755c;
    --line:#242424;
  }
}

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

body{
  margin:0;
  background:var(--bg);
  color:var(--fg);
  line-height:1.7;
  font-family:var(--font);
  font-size:17px;
  text-rendering:optimizeLegibility;
}

.page{
  max-width:var(--wrap);
  margin:0;
  padding:2.25rem 2.5rem 3rem;
}

.header,
.content,
.footer{
  max-width:740px;
  width:100%;
}

.header{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:.8rem;
  padding-bottom:.45rem;
  margin-bottom:1rem;
}

.menu{
  display:grid;
  grid-auto-flow:row;
  grid-auto-rows:auto;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:.6rem;
  width:100%;
  align-items:start;
}

.menu a{
  color:var(--accent);
  font-weight:700;
  text-decoration:underline;
  text-underline-offset:2px;
  border-bottom:none;
  padding:.2rem 0;
  letter-spacing:.015em;
  text-align:left;
  font-size:1.05rem;
  line-height:1.1;
}

.menu a:hover,
.menu a:focus-visible{
  color:var(--fg);
  background:transparent;
}

.menu-logo{
  grid-column:1;
  grid-row:1 / span 2;
  display:flex;
  align-items:flex-start;
  justify-content:flex-start;
  padding:.2rem 0;
  color:var(--accent);
  text-decoration:none;
}

.menu-logo svg{
  width:72px;
  height:72px;
}

.menu-logo:hover,
.menu-logo:focus-visible{
  color:var(--fg);
}

.header hr,
.footer hr{
  width:100%;
  border:0;
  height:1px;
  background:#2a2a2a;
  color:#2a2a2a;
}

.header hr{
  margin:.8rem 0 1rem;
}

.footer{
  margin-top:2.2rem;
}

.footer hr{
  margin:1.4rem 0 .9rem;
}

/* Body text */
p{margin:.9em 0}
a{
  color:var(--accent);
  text-decoration:underline;
}
a:hover,
a:focus-visible{
  color:var(--fg);
  border-bottom-color:var(--fg);
}

h1,h2,h3,h4{
  margin:1.35rem 0 .5rem;
  font-weight:700;
  letter-spacing:.015em;
}

h1{font-size:1.9rem;}
h2{font-size:1.7rem;}
h3{font-size:1.15rem;}

.muted{
  color:var(--muted);
}

ul,ol{
  padding-left:1.2rem;
  margin:.7rem 0 1.1rem;
}

ol{
  list-style-position:inside;
  padding-left:0;
}

blockquote{
  margin:1.1rem 0;
  padding:.5rem 1rem;
  border-left:3px solid var(--accent);
  background:rgba(0,0,0,.02);
}

.post-list{
  list-style:none;
  padding:0;
  margin:1rem 0 0;
  display:flex;
  flex-direction:column;
  gap:.3rem;
}

.post-list li{
  padding:.25rem 0;
}

.post-row{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:1rem;
}

.post-date{
  color:var(--muted);
  white-space:nowrap;
  font-size:.95rem;
}

.post-list .summary{
  margin:.2rem 0 0;
  color:var(--muted);
  font-size:.95rem;
  line-height:1.5;
}

.pager{
  margin-top:1rem;
}

.pager .next{
  display:inline;
  padding:0;
  background:transparent;
  color:var(--accent);
  border:none;
  text-decoration:none;
  border-bottom:1px solid currentColor;
}

.pager .next:hover,
.pager .next:focus-visible{
  color:var(--fg);
  border-bottom-color:var(--fg);
}

/* Articles */
article{
  background:var(--bg);
  color:var(--fg);
  padding:0;
  border:none;
  border-radius:10px;
  box-shadow:none;
}

article h2:first-child,
article h1:first-child{
  margin-top:0;
}

/* Code */
pre.chroma{
  margin:1.2rem 0 1.6rem;
  padding:1rem 1rem;
  background:#000;
  border:1px solid #2f2f2f;
  border-radius:8px;
  overflow-x:auto;
}

code{
  background:#111;
  color:#f5f2ec;
  padding:.15em .4em;
  border-radius:4px;
  font-size:.9em;
  border:1px solid #2f2f2f;
}

pre code{
  background:transparent;
  color:inherit;
  padding:0;
  border:none;
  font-size:inherit;
  border-radius:0;
}

.key-link{
  display:inline-block;
  padding:.15em .4em;
  border:1px solid var(--accent);
  border-radius:4px;
  color:var(--fg);
  text-decoration:none;
  background:#111;
  font-family:var(--font);
  font-size:.9em;
}

.key-link:hover,
.key-link:focus-visible{
  color:var(--fg);
  border-color:var(--fg);
}

.chroma .c{color:#8c847b}
.chroma .k,.chroma .s,.chroma .o,.chroma .n,.chroma .p,.chroma .nf,.chroma .nb,.chroma .nv{color:inherit}
.chroma .ge,.chroma .gs{font-style:normal;font-weight:normal;background:none}

@media(max-width:640px){
  body{font-size:16px;}
  .page{
    padding:1.5rem 1rem 2rem;
  }
  .menu{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    grid-template-rows:repeat(3, auto);
    grid-auto-rows:auto;
    grid-auto-flow:row;
    gap:.6rem;
  }
  .menu-logo{
    grid-row:1 / span 3;
  }
  .menu-logo svg{
    width:88px;
    height:88px;
  }
  .content{max-width:100%;}
  article{padding:0;}
}
