:root {
  --bg: #F3F6F5;
  --text: #1C2B31;
  --muted: #5B6C72;
  --ink: #24495C;
  --contour: #8FB2B6;
  --rule: #D5DEDD;
  --code-bg: #E6ECEB;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #142229;
    --text: #DCE6E6;
    --muted: #93A6AA;
    --ink: #9CC7CC;
    --contour: #3F6670;
    --rule: #26383F;
    --code-bg: #1B2D35;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem;
}

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

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--bg);
  padding: 0.4rem 0.8rem;
}
.skip:focus { left: 0.5rem; }

/* header and footer */
header.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}
.site-name {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
}
header.site nav { display: flex; gap: 1.25rem; font-size: 1rem; }
header.site nav a { color: var(--muted); text-decoration: none; }
header.site nav a:hover { color: var(--ink); text-decoration: underline; }
header.site nav a[aria-current="page"] { color: var(--text); }

footer.site {
  margin-top: 5rem;
  padding-bottom: 3rem;
  color: var(--muted);
  font-size: 0.95rem;
}
footer.site p { margin: 0; padding-top: 1.5rem; border-top: 1px solid var(--rule); }

/* the lake */
.lake {
  position: relative;
  overflow: hidden;
  min-height: 15rem;
  display: flex;
  align-items: flex-end;
  margin-bottom: 2.5rem;
}
.lake svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.lake path {
  fill: none;
  stroke: var(--contour);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}
.lake-text {
  position: relative;
  width: 100%;
  padding-bottom: 1.5rem;
}
.lake h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.015em;
  max-width: 14ch;
  color: var(--text);
}
.lake p {
  margin: 0;
  max-width: 34rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .lake path {
    stroke-dasharray: 2400;
    stroke-dashoffset: 2400;
    animation: draw 2.4s ease-out forwards;
  }
  .lake path:nth-child(odd) { animation-duration: 3s; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}

/* post list */
.year { margin-bottom: 2.5rem; }
.year h2 {
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}
.posts { list-style: none; margin: 0; padding: 0; }
.posts li {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  padding: 0.85rem 0;
}
.posts time {
  color: var(--muted);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  padding-top: 0.15rem;
}
.posts a {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  color: var(--text);
}
.posts a:hover { color: var(--ink); text-decoration: underline; }
.posts p { margin: 0.3rem 0 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }

@media (max-width: 30rem) {
  .posts li { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* articles */
.post-head { margin: 1.5rem 0 2rem; }
.post-head h1 {
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}
.meta { margin: 0; color: var(--muted); font-size: 0.95rem; }

article p { margin: 0 0 1.15rem; }
article h2 {
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 2.4rem 0 0.8rem;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--code-bg);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}
pre {
  margin: 0 0 1.4rem;
  padding: 1rem 1.1rem;
  background: var(--code-bg);
  border-left: 3px solid var(--contour);
  overflow-x: auto;
  line-height: 1.5;
}
pre code { background: none; padding: 0; font-size: 0.85rem; }

.note {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 1rem;
  font-style: italic;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.pager a { text-decoration: none; color: var(--text); line-height: 1.35; }
.pager a:hover { color: var(--ink); }
.pager span { display: block; color: var(--muted); font-size: 0.9rem; margin-bottom: 0.2rem; }
.pager .newer { text-align: right; }

@media (max-width: 30rem) {
  .pager { grid-template-columns: 1fr; }
  .pager .newer { text-align: left; }
}

.notfound { min-height: 40vh; }
