/* One narrow column of text, like a page someone wrote by hand. Serif for reading, mono for dates and code. */
:root {
  --paper: #ffffff;
  --ink: #0b0c0e;
  --muted: #3e4148;
  --rule: #b9bdc4;
  --link: #0b3fb8;
  --link-visited: #4a2a9e;
  --code-bg: #eef0f3;
  --quote: #8d939c;
  --linkedin: #0a66c2;
  --code-num: #0b5e43;
  --code-str: #7a3f00;
  /* Name band gradient: darker at top left, brighter at bottom right. */
  --hero-dark: color-mix(in srgb, var(--ink) 8%, var(--paper));
  --hero-bright: color-mix(in srgb, var(--ink) 2%, var(--paper));
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b0c0e; --ink: #f5f5f3; --muted: #bcc0c7; --rule: #4a4f57;
    --link: #a9c2ff; --link-visited: #cfbefb; --code-bg: #1b1e22; --quote: #5d636c; --linkedin: #6eaaf0;
    --code-num: #93e8c0; --code-str: #ffc892;
    --hero-dark: color-mix(in srgb, var(--link) 4%, var(--paper));
    --hero-bright: color-mix(in srgb, var(--link-visited) 12%, var(--paper));
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0b0c0e; --ink: #f5f5f3; --muted: #bcc0c7; --rule: #4a4f57;
  --link: #a9c2ff; --link-visited: #cfbefb; --code-bg: #1b1e22; --quote: #5d636c; --linkedin: #6eaaf0;
  --code-num: #93e8c0; --code-str: #ffc892;
    --hero-dark: color-mix(in srgb, var(--link) 4%, var(--paper));
    --hero-bright: color-mix(in srgb, var(--link-visited) 12%, var(--paper));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
img { max-width: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.page { max-width: 40rem; margin: 0 auto; padding-block: 3.5rem 4rem; }

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

h1, h2, h3 { line-height: 1.25; text-wrap: balance; }
p, li { text-wrap: pretty; }

/* Home */
.hero {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1.25rem 1.5rem; margin: 0 0 2rem;
  border-block: 1px solid var(--rule);
  background: linear-gradient(120deg, var(--hero-dark), var(--hero-bright));
}
.hero h1 { font-size: 2rem; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.portrait {
  width: 6.5rem; height: auto; flex: none; display: block;
  border-radius: 6px;
  border: 2px solid color-mix(in srgb, var(--paper) 60%, transparent);
}
.intro p { margin: 0 0 0.85rem; }
.intro p:last-child { margin-bottom: 0; }
.label {
  font-family: var(--serif); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  margin: 2.75rem 0 0.9rem;
}
.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.posts li { display: grid; gap: 0.1rem; }
.contact { margin: 2rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.posts time { font-size: 0.9rem; font-style: italic; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Shared chrome */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--serif); font-size: 0.9rem; color: var(--muted);
  background: transparent; border: 1px solid var(--rule); border-radius: 999px;
  min-height: 2.25rem; padding: 0 0.85rem; cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }
.theme-toggle:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.site-foot {
  margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.linkedin, .linkedin:visited { display: inline-flex; color: var(--linkedin); padding: 4px; margin: -4px; border-radius: 4px; }
.linkedin:hover { opacity: 0.85; }

/* Post */
.back { font-size: 0.95rem; margin: 0 0 2rem; }
.back a, .back a:visited { color: var(--muted); text-decoration: none; }
.back a:hover { color: var(--link); text-decoration: underline; }
.post header { margin: 0 0 2rem; }
.post h1 { font-size: 2rem; font-weight: 600; margin: 0 0 0.6rem; letter-spacing: -0.01em; }
.meta { font-size: 0.95rem; font-style: italic; color: var(--muted); margin: 0; }
.post h2 { font-size: 1.35rem; font-weight: 600; margin: 2.5rem 0 0.75rem; }
.post h3 { font-size: 1.1rem; font-weight: 600; margin: 2rem 0 0.5rem; }
.post { overflow-wrap: break-word; }
.post p { margin: 0 0 1.1rem; }
.post ul, .post ol { padding-left: 1.4rem; margin: 0 0 1.1rem; }
.post li { margin-bottom: 0.35rem; }
.post blockquote {
  margin: 0 0 1.2rem; padding: 0.1rem 0 0.1rem 1rem;
  border-left: 3px solid var(--quote); color: var(--muted); font-style: italic;
}
.post blockquote p { margin-bottom: 0.4rem; }
.post blockquote cite { font-style: normal; font-size: 0.9rem; }
code { font-family: var(--mono); font-size: 0.85em; background: var(--code-bg); padding: 0.1em 0.3em; border-radius: 3px; overflow-wrap: anywhere; }
pre {
  background: var(--code-bg); padding: 0.9rem 1rem; border-radius: 4px;
  overflow-x: auto; margin: 0 0 1.2rem; font-size: 0.82rem; line-height: 1.55;
  -webkit-overflow-scrolling: touch;
}
/* Syntax highlighting: Zola's class mode (theme "github-light") numbers its colors .z-1, .z-2…
   Only the classes the NGINX post uses are mapped. Check a new post's code blocks if it adds languages. */
.z-5 { color: var(--muted); font-style: italic; }  /* comments */
.z-8 { color: var(--link); }                       /* nginx directives, filter keys */
.z-1 { color: var(--code-num); }                   /* numbers */
.z-2 { color: var(--code-str); }                   /* strings */
pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; white-space: pre; }
.post figure { margin: 0 0 1.5rem; }
.post figure a { display: block; }
.post figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--rule); border-radius: 4px; background: #fff;
}
.post figcaption { margin-top: 0.5rem; font-size: 0.85rem; color: var(--muted); text-align: center; }
.post figcaption.mono-cap { font-family: var(--mono); font-size: 0.72rem; overflow-wrap: anywhere; }
.note {
  font-size: 0.95rem; color: var(--muted); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding-block: 0.8rem; margin: 0 0 2rem;
}
.note p { margin: 0; }

@media (max-width: 34rem) {
  body { font-size: 1rem; }
  .page { padding-block: 2rem 3rem; }
  .hero { gap: 1rem; padding: 1rem; margin-bottom: 1.5rem; }
  .portrait { width: 4.75rem; }
  .hero h1, .post h1 { font-size: 1.7rem; }
  pre { margin-left: -16px; margin-right: -16px; border-radius: 0; padding-inline: 16px; }
}
