/*
 * hundred: a Pelican theme for 100things.wzzrd.com
 * One centred reading column, faded masthead, hairline-separated post list.
 * Colours: Solarized (light on base3, dark on base03). Fonts are self-hosted.
 */

/* ---------- Fonts ---------- */
@font-face { font-family: "Young Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/young-serif-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Red Hat Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/red-hat-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Red Hat Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/red-hat-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Zilla Slab"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/zilla-slab-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Zilla Slab"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../fonts/zilla-slab-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Zilla Slab"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/zilla-slab-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Zilla Slab"; font-style: italic; font-weight: 500; font-display: swap;
  src: url("../fonts/zilla-slab-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Zilla Slab"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/zilla-slab-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Zilla Slab"; font-style: italic; font-weight: 600; font-display: swap;
  src: url("../fonts/zilla-slab-latin-600-italic.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  /* Solarized light */
  --bg: #fdf6e3;        /* base3 */
  --fg: #586e75;        /* base01: body text */
  --strong: #073642;    /* base02: headings */
  --muted: #839496;     /* base0 */
  --faint: #93a1a1;     /* base1 */
  --rule: #eee8d5;      /* base2 */
  --accent: #268bd2;    /* blue */
  --tag: #6c71c4;       /* violet */
  --code-bg: #eee8d5;   /* base2 */
  --code-rail: #b58900; /* yellow */
  --quote-rail: #2aa198;/* cyan */
  --chip: #eee8d5;

  /* Solarized accents: the same in light and dark */
  --sol-yellow: #b58900; --sol-orange: #cb4b16; --sol-red: #dc322f; --sol-magenta: #d33682;
  --notice-tint: 11%;
  --sol-violet: #6c71c4; --sol-blue: #268bd2; --sol-cyan: #2aa198; --sol-green: #859900;

  --font-masthead: "Young Serif", Georgia, "Times New Roman", serif;
  --font-mono: "Red Hat Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-title: "Zilla Slab", Rockwell, Georgia, serif;
  --font-body: "Zilla Slab", Rockwell, Georgia, serif;

  --col: 42rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #002b36; --fg: #93a1a1; --strong: #eee8d5; --muted: #839496; --faint: #586e75; --rule: #073642;
    --accent: #268bd2; --tag: #6c71c4; --code-bg: #073642; --code-rail: #b58900; --quote-rail: #2aa198; --chip: #073642;
    --notice-tint: 17%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #002b36; --fg: #93a1a1; --strong: #eee8d5; --muted: #839496; --faint: #586e75; --rule: #073642;
  --accent: #268bd2; --tag: #6c71c4; --code-bg: #073642; --code-rail: #b58900; --quote-rail: #2aa198; --chip: #073642;
    --notice-tint: 17%;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-weight: 400; font-size: 1.2rem; line-height: 1.65;
  padding-inline: 16px; padding-block: 0 3rem;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
.wrap { max-width: var(--col); margin-inline: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: .3rem .6rem; z-index: 10; }

/* ---------- Masthead ---------- */
.masthead { text-align: center; padding-block: 2.5rem 1rem; display: grid; justify-items: center; gap: .35rem; }
/* Hackergotchi: shown whole, at its own shape (cut-out heads included), never cropped. */
.gotchi { display: block; height: 96px; width: auto; max-width: 160px; object-fit: contain; }
.site-title {
  font-family: var(--font-masthead); font-weight: 400; font-size: clamp(2.3rem, 7vw, 3.2rem);
  color: var(--faint); text-decoration: none; line-height: 1.1; transition: color .2s;
}
.site-title:hover { color: var(--strong); }
.tagline { font-family: var(--font-mono); color: var(--faint); font-size: .9rem; margin: 0; }
.site-nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .2rem 1.1rem; margin-top: .7rem;
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.site-nav a, .theme-toggle { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .theme-toggle:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--strong); }
.theme-toggle { background: none; border: 0; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }

/* ---------- Meta line (date | category | #tags | read time) ---------- */
.meta { font-family: var(--font-mono); color: var(--muted); font-size: .85rem; line-height: 1.6; font-variant-numeric: tabular-nums; }
.meta .sep { color: var(--faint); margin-inline: .45rem; }
.meta a { text-decoration: none; }
.meta a:hover { color: var(--accent); text-decoration: underline; }
.meta time, .meta .rt, .meta .tags a { white-space: nowrap; }
.meta .tags a { color: var(--tag); }

/* ---------- Post lists ---------- */
.post-list { list-style: none; padding: 0; margin: 2.5rem 0 0; }
.post-list > li { padding-block: 1.4rem; border-bottom: 1px solid var(--rule); }
.post-list h2 { font-family: var(--font-title); font-weight: 600; font-size: 1.45rem; line-height: 1.3; margin: 0 0 .3rem; color: var(--strong); text-wrap: balance; }
.post-list h2 a { text-decoration: none; }
.post-list h2 a:hover { color: var(--accent); }
.series-tag { font-weight: 400; font-style: italic; color: var(--muted); }
.post-list .summary { margin: .55rem 0 0; font-size: 1.05rem; }
.list-head { margin: 3rem 0 0; font-family: var(--font-title); font-weight: 500; font-size: 1.9rem; line-height: 1.2; color: var(--strong); }
.list-head .hash { color: var(--tag); }
.list-sub { font-family: var(--font-mono); color: var(--muted); font-size: .85rem; margin: .3rem 0 0; }
.pager { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 1.5rem; font-family: var(--font-mono); font-size: .85rem; color: var(--muted); }
.pager a { color: var(--accent); }
.pager .off { color: var(--faint); }

/* Archive / index pages */
.year { font-family: var(--font-title); font-weight: 500; font-size: 1.4rem; color: var(--strong); margin: 2.4rem 0 .3rem; }
.compact { list-style: none; padding: 0; margin: 0; }
.compact li { display: grid; grid-template-columns: 7.2rem 1fr; gap: .2rem 1rem; padding-block: .35rem; border-bottom: 1px solid var(--rule); }
.compact time { font-family: var(--font-mono); font-size: .85rem; color: var(--muted); padding-top: .2rem; }
.compact a { text-decoration: none; color: var(--strong); min-width: 0; }
.compact a:hover { color: var(--accent); }
@media (max-width: 30rem) { .compact li { grid-template-columns: 1fr; } }
.cloud { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; font-family: var(--font-mono); font-size: .95rem; }
.cloud a { color: var(--tag); text-decoration: none; }
.cloud a:hover { text-decoration: underline; }
.cloud .n { color: var(--faint); margin-left: .2rem; }
.cloud.cats a { color: var(--strong); }

/* ---------- Article ---------- */
.post-title { font-family: var(--font-title); font-weight: 500; font-size: clamp(2rem, 6vw, 2.9rem); line-height: 1.15; color: var(--strong);
  text-align: center; margin: 3.2rem 0 2.2rem; text-wrap: balance; }
.post-meta { text-align: right; margin-bottom: 1.6rem; }
@media (max-width: 34rem) { .post-meta { text-align: left; } }

.series-box { border-block: 1px solid var(--rule); padding-block: .9rem; margin-block: 0 1.8rem; font-size: 1.05rem; }
.box-label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.series-box ol, .toc ol { margin: .4rem 0 0; padding-left: 1.4rem; }
.series-box a, .toc a { color: var(--accent); text-decoration: none; }
.series-box a:hover, .toc a:hover { text-decoration: underline; }
.series-box .current { font-weight: 600; color: var(--strong); }
.toc { margin-block: 0 2rem; font-size: 1.05rem; }
.toc summary { cursor: pointer; }
.toc ol ol { margin-top: .1rem; }

/* ---------- Prose ---------- */
.prose { overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose dl { margin-block: 0 1.1rem; }
.prose li + li { margin-top: .25rem; }
.prose a { color: var(--accent); }
.prose strong { font-weight: 600; color: var(--strong); }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--font-title); color: var(--strong); line-height: 1.25; text-wrap: balance; scroll-margin-top: 1rem; }
.prose h1, .prose h2 { font-weight: 500; font-size: 1.6rem; margin: 2.6rem 0 1rem; }
.prose h3 { font-weight: 600; font-size: 1.25rem; margin: 2rem 0 .7rem; }
.prose h4 { font-weight: 600; font-size: 1.1rem; margin: 1.6rem 0 .5rem; }
.prose h1 + h2 { margin-top: 1rem; }
.prose .secno { color: var(--faint); font-weight: 400; margin-right: .75rem; }
.prose .anchor { color: var(--faint); text-decoration: none; margin-left: .4rem; opacity: 0; transition: opacity .15s; font-weight: 400; }
.prose :is(h1, h2, h3, h4):hover .anchor, .prose .anchor:focus { opacity: 1; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4rem auto; width: 40%; }
.prose blockquote { margin: 1.4rem 0; padding: .1rem 0 .1rem 1.1rem; border-left: 2px solid var(--quote-rail); color: var(--muted); font-style: italic; }
.prose blockquote p:last-child { margin-bottom: 0; }

.prose code, .prose kbd { font-family: var(--font-mono); font-size: .8em; background: var(--code-bg); color: var(--strong); padding: .08em .3em; border-radius: 3px; }
.prose kbd { border: 1px solid var(--faint); border-bottom-width: 2px; }

/* Code blocks (Pygments) */
.highlight, .prose pre { position: relative; margin-block: 1.4rem 1.6rem; border-left: 2px solid var(--code-rail); background: var(--code-bg); }
.highlight pre, .prose pre { margin: 0; padding: 1rem 1.1rem; overflow-x: auto; font-family: var(--font-mono); font-size: .82rem; line-height: 1.6; tab-size: 4; }
.highlight pre { border: 0; }
.prose pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.highlight .linenos, .highlight .linenodiv { color: var(--faint); padding-right: .8rem; user-select: none; }
.highlighttable { width: 100%; border-collapse: collapse; }
.highlighttable td { padding: 0; border: 0; }
.copy-btn {
  position: absolute; top: .4rem; right: .5rem; z-index: 1;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); background: var(--bg); border: 1px solid var(--rule); border-radius: 3px;
  padding: .15rem .45rem; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.highlight:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
@media (hover: none) { .copy-btn { opacity: 1; } }

/* Tables */
.table-wrap { overflow-x: auto; margin-block: 1.4rem 1.6rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: 1rem; font-variant-numeric: tabular-nums; }
.prose th { font-family: var(--font-mono); font-weight: 500; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left; padding: .5rem .9rem .5rem 0; border-bottom: 1px solid var(--faint); }
.prose td { padding: .5rem .9rem .5rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }

/* Images: single images centred; a paragraph of only images becomes a grid */
.prose img { display: block; margin-inline: auto; border-radius: 2px; }
.prose p > img:only-child, .prose p > a:only-child > img { margin-block: 1.6rem; }
.prose figure { margin: 1.6rem 0; }
.prose figcaption { font-size: .95rem; color: var(--muted); font-style: italic; text-align: center; margin-top: .45rem; }
.prose .gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin-block: 1.6rem; align-items: start; }
.prose .gallery > * { min-width: 0; margin: 0; }
.prose .gallery img { margin: 0; width: 100%; }

/* Footnotes (Markdown extra) */
.prose .footnote { font-size: 1rem; color: var(--muted); margin-top: 2.5rem; }
.prose .footnote hr { width: 100%; margin: 0 0 1rem; }
.prose sup a, .footnote-backref { text-decoration: none; }

/* ---------- After the post ---------- */
.post-foot { margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 1rem; font-size: 1.05rem; }
.post-foot a { text-decoration: none; display: grid; gap: .1rem; max-width: 48%; color: var(--strong); }
.post-foot a:hover { color: var(--accent); }
.post-foot .next { margin-left: auto; text-align: right; }
.comments { margin-top: 2.6rem; }
.comments h2 { font-family: var(--font-title); font-weight: 500; font-size: 1.3rem; color: var(--strong); margin: 0 0 .8rem; }
.comments noscript { font-family: var(--font-mono); font-size: .85rem; color: var(--muted); }

/* ---------- Footer ---------- */
.site-foot { margin-top: 4rem; padding-top: 1.6rem; border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1.2rem 2rem;
  font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.site-foot h2 { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; margin: 0 0 .4rem; color: var(--muted); }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.site-foot a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--faint); }
.site-foot a:hover { color: var(--accent); }
.site-foot p { margin: 0; }

/* ---------- Notices (flash messages) ----------
   <div class="notice notice--warning" role="note"> … </div>
   Variants: --info (blue), --success (green), --warning (yellow), --special (orange, the default),
   --danger (red). Each one tints the box with its accent, so it stands out in both themes. */
.notice {
  --n: var(--sol-orange);
  position: relative;
  margin-block: 1.6rem;
  padding: .85rem 1.1rem .9rem 1.2rem;
  background: color-mix(in srgb, var(--n) var(--notice-tint), var(--bg));
  border: 1px solid color-mix(in srgb, var(--n) 40%, var(--bg));
  border-left: 4px solid var(--n);
  border-radius: 3px;
  color: var(--fg);
  font-size: 1.05rem;
  line-height: 1.55;
}
.notice--info    { --n: var(--sol-blue); }
.notice--success { --n: var(--sol-green); }
.notice--warning { --n: var(--sol-yellow); }
.notice--special { --n: var(--sol-orange); }
.notice--danger  { --n: var(--sol-red); }
.notice-title {
  margin: 0 0 .25rem;
  font-family: var(--font-mono); font-size: .75rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--n) 78%, var(--strong));
}
.notice > :last-child { margin-bottom: 0; }
.notice p { margin: 0 0 .5rem; }
.notice a { color: var(--strong); text-decoration-color: var(--n); }
.notice strong { color: var(--strong); }
.notice code { background: color-mix(in srgb, var(--n) 14%, var(--bg)); }
.notice-close {
  position: absolute; top: .45rem; right: .55rem;
  width: 1.8rem; height: 1.8rem; display: grid; place-items: center;
  background: none; border: 0; border-radius: 3px; cursor: pointer;
  font-family: var(--font-mono); font-size: 1.1rem; line-height: 1; color: var(--muted);
}
.notice-close:hover { color: var(--strong); background: color-mix(in srgb, var(--n) 15%, var(--bg)); }
.notice:has(.notice-close) { padding-right: 2.6rem; }
.site-notice { margin-block: 1.4rem 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .site-nav, .site-foot, .comments, .copy-btn, .post-foot { display: none; }
  body { background: #fff; color: #000; }
}
