:root {
    --paper: #f4f2f5;
    --paper-raised: #fbfafc;
    --ink: #18241d;
    --ink-soft: #5d6862;
    --rule: #d9d3dc;
    --heather: #85407f;
    --pine: #2e5b3b;
    --bloom: #cf9ac6;
    --k-idea: #a24f96;
    --k-story: #6e3a73;
    --k-make: #2e5b3b;
    --k-notebook: #2f6f66;
    --k-text: #59675f;
    --k-history: #82664a;
}
@media (prefers-color-scheme: dark) {
    :root {
    --paper: #121814;
    --paper-raised: #19211b;
    --ink: #ebe7ee;
    --ink-soft: #a9b4ad;
    --rule: #2b352e;
    --heather: #d39ac9;
    --pine: #86b98f;
    --bloom: #a8679c;
    --k-idea: #dca6d2;
    --k-story: #c49ad0;
    --k-make: #86b98f;
    --k-notebook: #7cc2b4;
    --k-text: #a9bbb0;
    --k-history: #c9a985;
    }
}
/* ljunggren.net — "The Lair". Ljung + gren: heather (Calluna vulgaris) lilac and pine green on a pale heather mist.
   No JS: motion is CSS only (one map draw-in, page cross-fades, responses to hover/focus). */

@font-face {
    font-family: "Bricolage";
    src: url("/fonts/bricolage-grotesque.woff2") format("woff2");
    font-weight: 200 800;
    font-stretch: 75% 100%;
    font-display: swap;
}
@font-face {
    font-family: "Literata";
    src: url("/fonts/literata.woff2") format("woff2");
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Literata";
    src: url("/fonts/literata-italic.woff2") format("woff2");
    font-weight: 200 900;
    font-style: italic;
    font-display: swap;
}

/* Colour tokens live in palette.light.css / palette.dark.css; the build puts them first. */
:root {
    --display: "Bricolage", "Avenir Next", "Segoe UI", system-ui, sans-serif;
    --text: "Literata", "Iowan Old Style", Georgia, serif;
    --measure: 68ch;
    --ease: cubic-bezier(.2, .7, .2, 1);
    --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4.5rem;
    color-scheme: light dark;
}

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

html { background: var(--paper); overflow-x: clip; -webkit-text-size-adjust: 100%; scroll-padding-top: var(--s5); }

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font: 400 1.125rem/1.7 var(--text);
    font-optical-sizing: auto;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

main, header.site, footer.site {
    width: min(100% - 2rem, 62rem);
    margin-inline: auto;
}

/* ---------- links & focus ---------- */
a {
    color: var(--heather);
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: color-mix(in srgb, var(--heather) 40%, transparent);
    text-underline-offset: .2em;
    transition: text-decoration-color .2s var(--ease), color .2s var(--ease);
}
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--heather); outline-offset: 3px; border-radius: 2px; }

.skip {
    position: absolute;
    left: var(--s4);
    top: -3rem;
    padding: var(--s2) var(--s4);
    background: var(--ink);
    color: var(--paper);
    font-family: var(--display);
    z-index: 2;
}
.skip:focus { top: var(--s4); }

/* ---------- header ---------- */
header.site {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s3) var(--s6);
    padding-block: var(--s5) var(--s4);
    view-transition-name: site-header;
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: var(--s2);
    color: var(--ink);
    text-decoration: none;
}
.brand-name {
    font: 760 1.6rem/1 var(--display);
    font-stretch: 82%;
    letter-spacing: -.02em;
}
.brand-name .ljung { color: var(--heather); }
.brand-name .gren { color: var(--pine); }
.brand-sub { font: 450 .95rem var(--display); color: var(--ink-soft); }

/* colour theme switch: three small buttons; /theme marks the active one */
.mode-switch {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--rule);
    border-radius: 999px;
}
.mode-switch a {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    color: var(--ink-soft);
    transition: color .2s var(--ease), background .2s var(--ease);
}
.mode-switch a:hover { color: var(--heather); }
.mode-switch svg { display: block; }
.sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

header.site .brand { margin-right: auto; }
header.site .mode-switch { order: 3; }
header.site nav:not(.mode-switch) {
    display: flex;
    gap: var(--s1) var(--s4);
    font: 500 .95rem var(--display);
}
header.site nav:not(.mode-switch) a {
    color: var(--ink-soft);
    text-decoration: none;
    padding-block: var(--s1);
    border-bottom: 2px solid transparent;
    transition: color .2s var(--ease), border-color .2s var(--ease);
    white-space: nowrap;
}
header.site nav:not(.mode-switch) a:hover { color: var(--ink); }
header.site nav:not(.mode-switch) a[aria-current] { color: var(--ink); border-color: var(--pine); }

@media (max-width: 46rem) {
    /* swipeable entry points instead of a hamburger */
    header.site .mode-switch { order: 0; }
    header.site nav:not(.mode-switch) {
        order: 1;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        mask-image: linear-gradient(to right, #000 85%, transparent);
        padding-right: var(--s6);
    }
    header.site nav:not(.mode-switch)::-webkit-scrollbar { display: none; }
}

/* ---------- type ---------- */
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.14; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-weight: 720; font-stretch: 86%; font-size: clamp(2.2rem, 1.4rem + 4vw, 3.8rem); margin: var(--s2) 0 var(--s4); }
h2 { font-weight: 650; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem); margin: var(--s7) 0 var(--s4); }
h3 { font-weight: 640; font-size: 1.25rem; margin: var(--s6) 0 var(--s3); }
p { margin: 0 0 var(--s4); }

.lede {
    font-style: italic;
    font-size: clamp(1.2rem, 1.05rem + .6vw, 1.45rem);
    line-height: 1.5;
    color: var(--ink-soft);
    max-width: 52ch;
    text-wrap: pretty;
}

.crumb { margin: var(--s6) 0 0; font: 500 .95rem var(--display); }
.crumb a { color: var(--ink-soft); text-decoration: none; }
.crumb a:hover { color: var(--heather); }

/* ---------- kind marker: a node in the type's colour ---------- */
.kind {
    --k: var(--k-text);
    display: inline-flex;
    align-items: center;
    gap: .45em;
    font: 600 .85rem var(--display);
    color: var(--k);
}
.kind::before {
    content: "";
    width: .6em;
    height: .6em;
    border-radius: 50%;
    background: var(--k);
}
.kind-idea { --k: var(--k-idea); }
.kind-story { --k: var(--k-story); }
.kind-project, .kind-experiment { --k: var(--k-make); }
.kind-engineering-notebook { --k: var(--k-notebook); }
.kind-historical-note { --k: var(--k-history); }
.kind-reflection { --k: var(--heather); }

/* ---------- home ---------- */
.hero { padding-block: var(--s7) var(--s4); max-width: 46rem; }
.hero-title {
    font-size: clamp(2.6rem, 1.2rem + 6.5vw, 5.2rem);
    font-weight: 780;
    font-stretch: 78%;
    line-height: 1.04;
    letter-spacing: -.02em;
    margin: 0 0 var(--s5);
}
.intro { font-size: 1.25rem; line-height: 1.6; max-width: 40rem; }
.intro strong { font-weight: 600; }
.intro blockquote {
    margin: var(--s5) 0 0;
    padding: 0 0 0 var(--s4);
    border-left: 3px solid var(--pine);
    font-style: italic;
    color: var(--ink-soft);
}

/* the idea map — the one bold element */
.map { margin: var(--s4) 0 var(--s6); }
.map svg { display: block; width: 100%; height: auto; overflow: hidden; font-family: var(--display); }
.map a { text-decoration: none; }
.map .spoke { stroke: var(--rule); stroke-width: 1.2; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s var(--ease) .15s forwards; }
.map .thread { fill: none; stroke: var(--heather); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.3s var(--ease) .7s forwards; }
.map .hub circle { fill: var(--pine); stroke: var(--ink); stroke-width: 1.5; }
.map .hub text { font-size: 15px; font-weight: 650; fill: var(--ink); }
/* calluna: pine stems (hubs), heather blooms (pieces) */
.map .node circle { fill: var(--bloom); stroke: var(--k-text); stroke-width: 2.5; transition: r .2s var(--ease), fill .2s var(--ease); }
.map .node text { font-size: 13px; fill: var(--ink-soft); transition: fill .2s var(--ease); }
.map .node.is-idea circle { stroke: var(--k-idea); }
.map .node.is-story circle { stroke: var(--k-story); }
.map .node.is-project circle, .map .node.is-experiment circle { stroke: var(--k-make); }
.map .node.is-engineering-notebook circle { stroke: var(--k-notebook); }
.map .node.is-historical-note circle { stroke: var(--k-history); }
.map .node.is-reflection circle { stroke: var(--heather); }
.map .node, .map .hub { animation: appear .5s var(--ease) both; animation-delay: .5s; }
.map .hub { animation-delay: .1s; }
.map a:hover circle, .map a:focus-visible circle { r: 8; fill: var(--pine); }
.map a:hover text, .map a:focus-visible text { fill: var(--ink); }
.map a:focus-visible { outline: none; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { from { opacity: 0; } }

@media (max-width: 40rem) {
    /* too small to read at phone width: make it a wider canvas you can swipe across */
    .map { overflow-x: auto; scrollbar-width: none; margin-inline: -1rem; padding-inline: 1rem; }
    .map::-webkit-scrollbar { display: none; }
    .map svg { width: 210%; max-width: none; }
}

.home-block h2, .connections h2 { font-size: 1.15rem; color: var(--ink-soft); font-weight: 600; margin-bottom: var(--s3); }

/* ---------- entry lists: items hang on a thread ---------- */
.entries { list-style: none; margin: 0 0 var(--s6); padding: 0; max-width: 46rem; }
.entry {
    --k: var(--k-text);
    position: relative;
    padding: var(--s4) 0 var(--s4) var(--s6);
    border-left: 1.5px solid var(--rule);
}
.entry::before {
    content: "";
    position: absolute;
    left: -.4rem;
    top: 1.55rem;
    width: .7rem;
    height: .7rem;
    border-radius: 50%;
    background: var(--paper);
    border: 2.5px solid var(--k);
    transition: background .2s var(--ease), transform .2s var(--ease);
}
.entry:hover::before { background: var(--k); transform: scale(1.15); }
.entry.is-idea { --k: var(--k-idea); }
.entry.is-story { --k: var(--k-story); }
.entry.is-project, .entry.is-experiment { --k: var(--k-make); }
.entry.is-engineering-notebook { --k: var(--k-notebook); }
.entry.is-historical-note { --k: var(--k-history); }
.entry.is-reflection { --k: var(--heather); }
.entry .kind { display: flex; margin-bottom: var(--s1); }
.entry .kind::before { display: none; } /* the thread node already carries the colour */
.entry-title {
    font: 650 clamp(1.2rem, 1.05rem + .6vw, 1.45rem)/1.25 var(--display);
    color: var(--ink);
    text-decoration: none;
    text-wrap: balance;
}
.entry-title:hover { color: var(--heather); }
.entry p { margin: var(--s1) 0 0; color: var(--ink-soft); max-width: 58ch; }
.empty { color: var(--ink-soft); font-style: italic; }

/* ---------- object page ---------- */
.object { max-width: var(--measure); }
.object-head { margin-bottom: var(--s6); }
.object-head .kind { margin-top: var(--s4); }

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2) var(--s5);
    margin: var(--s4) 0 0;
    font: 450 .9rem var(--display);
    color: var(--ink-soft);
}
.facts div, .facts dt, .facts dd { margin: 0; }
.facts dt { font-weight: 650; color: var(--ink); }
.facts dt::after { content: ":"; }
.facts dd { margin-right: var(--s2); }
.facts dt, .facts dd { display: inline; }

.notice {
    margin: 0 0 var(--s6);
    padding: var(--s4) var(--s5);
    background: var(--paper-raised);
    border-left: 4px solid var(--pine);
    border-radius: 0 6px 6px 0;
    font-size: 1rem;
}

.body { font-size: 1.1875rem; line-height: 1.72; text-wrap: pretty; hyphens: auto; }
.body h2, .body h3, .body h4 { position: relative; }
.anchor { margin-left: .35em; text-decoration: none; color: var(--rule); opacity: 0; transition: opacity .2s var(--ease); }
.anchor::before { content: "#"; }
:is(h2, h3, h4):hover .anchor, .anchor:focus-visible { opacity: 1; }
.body img { display: block; max-width: 100%; height: auto; margin: var(--s5) 0; border-radius: 6px; }
.body ul, .body ol { padding-left: 1.3em; }
.body li { margin-bottom: var(--s1); }
.body hr { border: 0; border-top: 1.5px solid var(--rule); margin: var(--s6) 0; }
/* display:block lets wide tables scroll on phones instead of widening the page */
.body table { display: block; overflow-x: auto; border-collapse: collapse; margin: var(--s5) 0; font-size: .9em; font-variant-numeric: tabular-nums; }
.body th, .body td { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.body th { font-family: var(--display); font-weight: 600; color: var(--ink-soft); border-bottom-width: 1.5px; }
.body blockquote { margin: var(--s5) 0; padding-left: var(--s4); border-left: 3px solid var(--rule); color: var(--ink-soft); }
pre, code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .85em; }
pre {
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: var(--s4);
    overflow-x: auto;
    line-height: 1.5;
}

.provenance {
    margin-top: var(--s6);
    padding-top: var(--s4);
    border-top: 1px dashed var(--rule);
    font-size: 1rem;
    color: var(--ink-soft);
}

/* connections: the same thread as the lists, in heather */
.thread-list { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--heather); }
.thread-list li { position: relative; padding: var(--s2) 0 var(--s4) var(--s5); }
.thread-list li::before {
    content: "";
    position: absolute;
    left: -.4rem;
    top: .95rem;
    width: .7rem;
    height: .7rem;
    border-radius: 50%;
    background: var(--pine);
    box-shadow: 0 0 0 3px var(--paper);
}
.rel { display: block; font: 600 .85rem var(--display); color: var(--ink-soft); }
.thread-list a { font: 650 1.2rem var(--display); }
.thread-list p { margin: var(--s1) 0 0; font-style: italic; color: var(--ink-soft); }

/* ---------- labels ---------- */
.labels, .cloud { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s6); }
.label {
    display: inline-flex;
    align-items: baseline;
    gap: .4em;
    padding: .2em .75em;
    border: 1px solid var(--rule);
    border-radius: 999px;
    font: 500 .9rem var(--display);
    color: var(--ink);
    text-decoration: none;
    transition: border-color .2s var(--ease), background .2s var(--ease);
}
.label:hover { border-color: var(--heather); background: var(--paper-raised); }
.label small { color: var(--ink-soft); font-size: .8em; }

.page-head { padding-block: var(--s6) var(--s4); max-width: 46rem; }

/* ---------- footer ---------- */
footer.site {
    margin-top: var(--s8);
    padding-block: var(--s5) var(--s7);
    border-top: 1.5px solid var(--rule);
    font: 450 .95rem var(--display);
    color: var(--ink-soft);
}
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.footer-links a { color: var(--ink-soft); }

/* ---------- page-to-page motion (no JS: cross-document view transitions) ---------- */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .32s; animation-timing-function: var(--ease); }
::view-transition-old(root) { animation: .18s var(--ease) both fade-out; }
::view-transition-new(root) { animation: .28s var(--ease) both fade-in; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .map .spoke, .map .thread { stroke-dashoffset: 0; }
}

@media print {
    header.site nav, footer.site, .map, .skip, .anchor, .mode-switch { display: none; }
    body { background: #fff; color: #000; }
}

/* generated */
.vt-about{view-transition-name:o-about}
.vt-backuppc-rescue{view-transition-name:o-backuppc-rescue}
.vt-better-today-than-perfect-too-late{view-transition-name:o-better-today-than-perfect-too-late}
.vt-lp250-halogen-hack{view-transition-name:o-lp250-halogen-hack}
.vt-marknadsnougat{view-transition-name:o-marknadsnougat}
.vt-non-linear-mind{view-transition-name:o-non-linear-mind}
.vt-php-hsv-color-mangler{view-transition-name:o-php-hsv-color-mangler}
.vt-trvzb-cried-one-percent{view-transition-name:o-trvzb-cried-one-percent}
.vt-weight-not-volume{view-transition-name:o-weight-not-volume}
