/* pipobscure.com: one stylesheet, no fonts fetched, light and dark.
   Palette and base shared with bundle.pipobscure.com. */

:root {
  --bg: #f6f4ee;
  --band: #ecebe3;
  --panel: #ffffff;
  --rule: #d4d2c8;
  --ink: #1a1f1a;
  --ink-dim: #4a524a;
  --accent: #2e6b31;        /* links, buttons: 6.4:1 on --bg */
  --accent-ink: #ffffff;
  --accent-soft: #dcebd7;
  --code-bg: #1d2430;
  --code-ink: #e9eef7;
  --code-rule: #1d2430;
  --focus: #b35c00;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1420;
    --band: #131b29;
    --panel: #18212f;
    --rule: #2a3750;
    --ink: #e9eef7;
    --ink-dim: #b6c2d6;
    --accent: #7fcf83;
    --accent-ink: #0e1420;
    --accent-soft: #1d3324;
    --code-bg: #0a0f18;
    --code-ink: #e9eef7;
    --code-rule: #2a3750;
    --focus: #f0a93b;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.wrap { max-width: 60rem; margin: 0 auto; padding: 0 16px; }
@media (min-width: 40rem) { .wrap { padding: 0 24px; } }

h1, h2, h3, h4 { line-height: 1.2; text-wrap: balance; margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); letter-spacing: -.01em; }
h3 { font-size: 1.2rem; margin-top: 1.6em; }
h4 { font-size: 1.05rem; }
p, ul, ol, pre, blockquote, figure { margin: 0 0 1rem; }

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

kbd { font-family: var(--mono); font-size: .85em; padding: .05em .4em; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 4px; background: var(--panel); }
code { font-family: var(--mono); font-size: .9em; background: var(--accent-soft); padding: .05em .3em; border-radius: 4px; }
pre {
  background: var(--code-bg); color: var(--code-ink);
  border: 1px solid var(--code-rule); border-radius: 8px;
  padding: .9rem 1rem; overflow-x: auto; font-size: .85rem; line-height: 1.55; max-width: 100%;
}
pre code { background: none; padding: 0; font-size: inherit; color: inherit; }

.skip { position: absolute; left: 16px; top: -3rem; background: var(--accent); color: var(--accent-ink); padding: .5rem .8rem; border-radius: 6px; z-index: 10; }
.skip:focus { top: .5rem; }

/* header */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--rule); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.5rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.top nav ul { display: flex; flex-wrap: wrap; gap: .2rem 1rem; list-style: none; margin: 0; padding: 0; }
.top nav a { color: var(--ink-dim); text-decoration: none; font-size: .95rem; }
.top nav a:hover, .top nav a[aria-current] { color: var(--accent); text-decoration: underline; }
@media (max-width: 30rem) {
  .top { position: static; }
  .top-row { padding-top: .5rem; padding-bottom: .5rem; }
}

/* sections */
main > section { padding: 3.5rem 0; }
.band { background: var(--band); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }

.hero { padding-top: 3rem; }
.hero .logo { display: block; margin-bottom: 1rem; }
.lede { font-size: 1.2rem; color: var(--ink-dim); max-width: 44rem; }
.small { font-size: .95rem; color: var(--ink-dim); }

/* cards and grids */
.grid2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 44rem) { .grid2 { grid-template-columns: 1fr 1fr; gap: 1.5rem; } }
.grid2 > * { min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--rule); border-top: 4px solid var(--accent); border-radius: 10px; padding: 1rem 1.2rem; }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card .host { font-family: var(--mono); font-size: .85rem; color: var(--ink-dim); }

.links { padding-left: 1.2rem; }
.links li { margin-bottom: .35rem; }

/* blog */
main > .post, main > .archive { padding: 2.5rem 0 3.5rem; }
.prose { max-width: 44rem; }
.archive h2 { font-size: 1.4rem; margin-top: 2rem; }
.crumbs { font-size: .95rem; color: var(--ink-dim); }
.post h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); }
.post-content img, .post-content video, .post-content iframe { max-width: 100%; height: auto; }
.post-content iframe { aspect-ratio: 16 / 9; width: 100%; border: 0; }
.post-content blockquote { margin-left: 0; padding: .2rem 0 .2rem 1rem; border-left: 4px solid var(--rule); color: var(--ink-dim); }

.entries { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.entries li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .1rem 1rem; padding: .55rem 0; border-bottom: 1px solid var(--rule); }
.entries time { color: var(--ink-dim); font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.pager .n { color: var(--ink-dim); font-size: .95rem; }
.pager .off { visibility: hidden; }
.button { display: inline-block; padding: .5rem 1rem; border-radius: 8px; background: transparent; color: var(--accent); font-weight: 700; text-decoration: none; border: 2px solid var(--accent); }
.button:hover { text-decoration: underline; }

.foot { padding: 2rem 0 3rem; color: var(--ink-dim); font-size: .95rem; border-top: 1px solid var(--rule); }
.foot img { vertical-align: -3px; }
