/* Ice Lakes Labs — long-form technical post
   Light ground, Georgia for prose (the serif you liked from the probe),
   a real monospace stack for register dumps and code. */

:root {
  --ink:        #1c1f23;
  --ink-soft:   #4a5158;
  --paper:      #fbfaf7;
  --rule:       #d9d5cc;
  --accent:     #1f5f7a;   /* cold lake blue */
  --accent-dim: #eaf1f4;
  --code-bg:    #f3f1ec;
  --measure:    40rem;
}

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

body {
  margin: 0;
  padding: 0 1.25rem 6rem;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/1.65 Georgia, "Iowan Old Style", "Times New Roman", serif;
}

/* ---- rhythm ---------------------------------------------------------- */

header, #TOC, main, article { max-width: var(--measure); margin: 0 auto; }
p { margin: 0 0 1.15em; }

h1 {
  font-size: 2.1rem; line-height: 1.2; margin: 2.5rem 0 0.4em;
  letter-spacing: -0.01em;
}
/* the subtitle: first paragraph after the title */
h1 + p { font-size: 1.15rem; color: var(--ink-soft); font-style: italic; }

h2 {
  font-size: 1.5rem; line-height: 1.25; margin: 2.8em 0 0.6em;
  padding-top: 0.7em; border-top: 1px solid var(--rule);
}
h3 { font-size: 1.12rem; margin: 2em 0 0.5em; letter-spacing: 0.01em; }

/* TL;DR headings and the block that follows them */
h3[id$="-tldr"] {
  text-transform: uppercase; font-size: 0.82rem; letter-spacing: 0.11em;
  color: var(--accent); margin-bottom: 0.9em;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* ---- table of contents ----------------------------------------------- */

#TOC {
  background: var(--accent-dim);
  border: 1px solid var(--rule);
  padding: 1.2rem 1.5rem;
  margin: 2.5rem auto 3rem;
  font-size: 0.94rem;
}
/* Section headings already carry their own numbers ("1.", "2." ...), so
   bullets would double up. */
#TOC ul { list-style: none; margin: 0; padding-left: 0; }
#TOC ul ul { padding-left: 1rem; }
#TOC ul ul { font-size: 0.9em; color: var(--ink-soft); }
#TOC li { margin: 0.25em 0; }

/* ---- code, tables, figures ------------------------------------------- */

code, pre, kbd {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", monospace;
}
code { font-size: 0.88em; background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px; }
pre {
  background: var(--code-bg);
  border-left: 3px solid var(--rule);
  padding: 0.9rem 1.1rem;
  overflow-x: auto;             /* alignment is load-bearing — never wrap */
  font-size: 0.82rem;
  line-height: 1.45;
}
pre code { background: none; padding: 0; font-size: inherit; }

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.6em 0;
  font-size: 0.86rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
th, td { border: 1px solid var(--rule); padding: 0.45em 0.65em; text-align: left; vertical-align: top; }
th { background: var(--accent-dim); font-weight: 600; }
td:first-child { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 0.92em; white-space: nowrap; }

/* wide tables get their own scroller rather than blowing out the page */
.table-wrap { overflow-x: auto; margin: 1.6em 0; }
.table-wrap table { margin: 0; }

figure { margin: 2em 0; }
img { max-width: 100%; height: auto; display: block; border: 1px solid var(--rule); }
figcaption { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.5em; font-style: italic; }

blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.6em 0; padding: 0.2em 0 0.2em 1.1em;
  color: var(--ink-soft);
}

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5em 0; }

/* ---- narrow screens --------------------------------------------------- */

@media (max-width: 44rem) {
  body { font-size: 17px; padding: 0 1rem 4rem; }
  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.3rem; }
  pre { font-size: 0.74rem; }
  td:first-child { white-space: normal; }
}

@media print {
  body { background: #fff; font-size: 11pt; }
  #TOC { break-after: page; }
  pre, table, figure { break-inside: avoid; }
}

/* Long reference URLs must not blow out the measure on narrow screens. */
a[href^="http"] { overflow-wrap: anywhere; word-break: break-word; }
/* Tight lists: minimal gap between items, and no extra space where a
   sub-list opens under its parent. */
ul, ol { margin: 1em 0; padding-left: 1.4rem; }
li { margin: 0.1em 0; line-height: 1.45; }
li > ul, li > ol { margin: 0.1em 0 0.2em; }

/* Belt-and-braces: if pandoc ever emits a loose list, don't let it
   introduce paragraph gaps between items. */
li > p:only-child { margin: 0; }
li > p:first-child { margin-top: 0; }
li > p:last-child { margin-bottom: 0; }

/* /m ... /m — monospace run without the code-block background or padding. */
.mono {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", monospace;
  font-size: 0.88em;
  background: none;
  padding: 0;
}

/* ---- landing page ---------------------------------------------------- */

.index-page main, .site-header, .site-footer {
  max-width: var(--measure); margin: 0 auto;
}
.site-header { padding: 3rem 0 1rem; border-bottom: 1px solid var(--rule); }
.site-header h1 { margin: 0; font-size: 2rem; }
.tagline { color: var(--ink-soft); font-style: italic; margin: 0.3em 0 0; }

.post-entry { padding: 2rem 0; border-bottom: 1px solid var(--rule); }
.post-entry h2 { margin: 0.2em 0 0.3em; border: 0; padding: 0; font-size: 1.4rem; }
.post-entry h2 a { text-decoration: none; }
.post-entry h2 a:hover { text-decoration: underline; }
.post-date {
  margin: 0; font-size: 0.8rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-soft);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
.post-sub { margin: 0 0 0.5em; color: var(--ink-soft); font-style: italic; }
.post-summary { margin: 0 0 0.7em; }
.post-tags { margin: 0; }
.tag {
  display: inline-block; margin-right: 0.4em; padding: 0.1em 0.5em;
  background: var(--accent-dim); color: var(--accent);
  border-radius: 3px; font-size: 0.75rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
.site-footer { padding: 2rem 0; font-size: 0.85rem; color: var(--ink-soft); }

.back-link {
  font-size: 0.85rem; margin: 1.5rem auto; max-width: var(--measure);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
