/* The Word from Ninepoint Labs. Matches ninepointlabs.com:
   warm paper, one deep teal, white cards. Dark mode follows the OS. */
:root {
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --paper: #faf6ef;
  --ink: #23272b;
  --ink-soft: #565d63;
  --line: #e0d8c8;
  --surface: #ffffff;
  --teal: #0f6b6e;
  --focus: #8a5b00;
  --measure: 40rem;
  /* Names the gallery styles look for. */
  --bg: var(--paper);
  --text: var(--ink);
  --muted: var(--ink-soft);
  --rule: var(--line);
  --accent: var(--teal);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171a1d;
    --ink: #e8e4dc;
    --ink-soft: #a8a59d;
    --line: #313740;
    --surface: #1f2327;
    --teal: #6fc7c9;
    --focus: #f3bd55;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding: 0 1rem;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--font);
}
.site-header, main, .site-footer { max-width: var(--measure); margin: 0 auto; }

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

/* Header */
.site-header { padding: 2.5rem 0 1.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.lab {
  display: inline-flex; align-items: center; gap: .5rem; margin-bottom: .9rem;
  color: var(--teal); text-decoration: none;
  font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.lab img { display: block; }
.lab:hover span { text-decoration: underline; }
.masthead { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: baseline; justify-content: space-between; }
.site-title { color: var(--ink); text-decoration: none; font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.site-header nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.site-header nav a { color: var(--ink-soft); text-decoration: none; font-size: .95rem; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--teal); }

/* Type */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; text-wrap: balance; overflow-wrap: break-word; }
h1 { font-size: 2rem; margin: 0 0 .5rem; }
h2 { font-size: 1.4rem; margin: 2.2rem 0 .6rem; }
h3 { font-size: 1.15rem; margin: 1.8rem 0 .5rem; }
p, ul, ol, blockquote, pre, table, figure { margin: 0 0 1.2rem; }
.content { overflow-wrap: anywhere; }
.content img, .content video { max-width: 100%; height: auto; vertical-align: middle; border-radius: .5rem; }
.content p > img:only-child, .content figure img, .content video { display: block; margin: 1.5rem auto; }
blockquote { margin-left: 0; padding: .1rem 0 .1rem 1.1rem; border-left: 3px solid var(--teal); color: var(--ink-soft); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
code, pre { font-family: var(--mono); font-size: .85em; }
:not(pre) > code { background: var(--surface); border: 1px solid var(--line); padding: .05em .35em; border-radius: .3rem; }
pre { background: var(--surface); border: 1px solid var(--line); padding: 1rem 1.2rem; overflow-x: auto; border-radius: .75rem; line-height: 1.5; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: .45rem .7rem; border-bottom: 1px solid var(--line); }
th { font-weight: 700; }
.meta, time, .empty, small { color: var(--ink-soft); font-size: .88rem; }

/* Section labels, like the landing page's "Blogs" / "Products" */
.label, .archive h2 {
  margin: 2rem 0 .75rem; color: var(--teal);
  font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}

/* Home: each post is a card */
.intro { font-size: 1.05rem; color: var(--ink-soft); margin: 0 0 2rem; }
.summaries { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
.summary {
  padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: .75rem;
  background: var(--surface); transition: border-color .15s; overflow-wrap: anywhere;
}
.summary:hover { border-color: var(--teal); }
.summary h2 { margin: 0 0 .15rem; font-size: 1.3rem; }
.summary h2 a { color: var(--ink); text-decoration: none; }
.summary h2 a:hover { color: var(--teal); }
.summary .meta { margin-bottom: .6rem; }
.summary > :last-child { margin-bottom: 0; }
.more { font-size: .92rem; font-weight: 600; text-decoration: none; }
.more:hover { text-decoration: underline; }

/* Post */
.post header { margin-bottom: 2rem; }
.post > footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

/* Lists */
.post-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; list-style: none; padding: 0; }
.post-list a {
  display: grid; gap: .1rem; padding: .75rem 1rem;
  border: 1px solid var(--line); border-radius: .75rem; background: var(--surface);
  color: inherit; text-decoration: none; transition: border-color .15s;
}
.post-list a:hover { border-color: var(--teal); }
.post-list strong { font-weight: 600; }
.post-list time { color: var(--teal); font-size: .85rem; font-variant-numeric: tabular-nums; }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tags a {
  padding: .15rem .65rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink-soft); font-size: .85rem; text-decoration: none; transition: color .15s, border-color .15s;
}
.tags a:hover { color: var(--teal); border-color: var(--teal); }
.tags small { margin-left: .25rem; }

.neighbours, .pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; font-size: .92rem; }
.neighbours a, .pager a { text-decoration: none; }
.neighbours a:hover, .pager a:hover { text-decoration: underline; }
.draft {
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  background: var(--teal); color: var(--paper); padding: .1em .45em; border-radius: .3rem; vertical-align: middle;
}
.footnote { font-size: .88rem; color: var(--ink-soft); display: flex; gap: .5rem; }

/* Footer, like the landing page's icon row */
.site-footer { margin-top: 4rem; padding: 1.5rem 0 3rem; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .88rem; }
.site-footer p { margin: 1rem 0 0; }
.site-footer p a { color: var(--ink-soft); }
.site-footer p a:hover { color: var(--teal); }
.elsewhere { display: flex; flex-wrap: wrap; gap: .75rem; }
.elsewhere a {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface);
  color: var(--ink-soft); transition: color .15s, border-color .15s;
}
.elsewhere a:hover { border-color: var(--teal); color: var(--teal); }
.elsewhere svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }

/* Topic sidebar (home, archive, tag pages). Beside the posts on wide
   screens, a single scrolling row of chips above them on narrow ones. */
.has-sidebar { --wide: 58rem; }
.has-sidebar .site-header, .has-sidebar .site-footer, .has-sidebar .layout { max-width: var(--wide); margin-left: auto; margin-right: auto; }
.has-sidebar .layout { display: grid; grid-template-columns: minmax(0, 1fr) 13rem; gap: 3rem; align-items: start; }
.has-sidebar main { max-width: none; margin: 0; }
.sidebar { position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto; }
.sidebar .label { margin-top: 0; }
.topic-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .15rem; }
.topic-list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: .75rem;
  padding: .35rem .7rem; border-radius: .5rem; border: 1px solid transparent;
  color: var(--ink-soft); font-size: .92rem; text-decoration: none; overflow-wrap: anywhere;
  transition: color .15s, border-color .15s, background-color .15s;
}
.topic-list a:hover { color: var(--teal); border-color: var(--line); background: var(--surface); }
.topic-list a[aria-current] { color: var(--teal); border-color: var(--teal); background: var(--surface); font-weight: 600; }
.topic-list small { font-variant-numeric: tabular-nums; }

@media (max-width: 52rem) {
  .has-sidebar .layout { grid-template-columns: minmax(0, 1fr); gap: 0; max-width: var(--measure); }
  .has-sidebar .site-header, .has-sidebar .site-footer { max-width: var(--measure); }
  .sidebar { position: static; order: -1; margin-bottom: 2rem; max-height: none; overflow: visible; }
  .topic-list { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; scrollbar-width: thin; }
  .topic-list a {
    white-space: nowrap; overflow-wrap: normal; border-color: var(--line); border-radius: 999px;
    background: var(--surface); padding: .2rem .7rem; font-size: .85rem;
  }
}

@media (max-width: 34rem) {
  body { font-size: 1rem; }
  h1 { font-size: 1.65rem; }
  .site-header { padding-top: 1.75rem; }
  .site-title { font-size: 1.35rem; }
}
