/* Mindmap CMS — "blog" theme
   Dark, reading-first, big type. Inherits templates from "default"; this file replaces its style.css.
   Re-skin by changing the tokens below. */
:root {
  --bg: #0f1013;
  --surface: #17191e;
  --surface-2: #1f2229;
  --text: #ecebe6;
  --text-soft: #c9c7c0;
  --muted: #8f8d87;
  --line: #2a2d34;
  --accent: #ffb85c;
  --accent-strong: #ffcf8f;
  --accent-soft: rgb(255 184 92 / .12);
  --warn: #ff8f6b;
  --warn-soft: rgb(255 143 107 / .12);
  --ok: #7fd6a4;
  --ok-soft: rgb(127 214 164 / .12);
  --radius: 14px;

  --serif: "Charter", "Bitstream Charter", "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --font: var(--sans); /* used by the inherited mindmap viewer */

  --step-0: clamp(1.1875rem, 1.05rem + .45vw, 1.375rem);   /* body: 19 → 22px */
  --step-1: clamp(1.375rem, 1.2rem + .8vw, 1.75rem);
  --step-2: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
  --step-3: clamp(2.25rem, 1.6rem + 3vw, 3.75rem);
  --step-4: clamp(2.75rem, 1.8rem + 5vw, 5.5rem);             /* post titles */
  --width: 76rem;
  --measure: 40rem;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--step-0)/1.7 var(--serif);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--sans); font-weight: 800; line-height: 1.08; letter-spacing: -0.025em; color: var(--text); text-wrap: balance; }
h1 { font-size: var(--step-3); margin: 0 0 .5em; }
h2 { font-size: var(--step-2); margin: 2em 0 .5em; }
h3 { font-size: var(--step-1); margin: 1.6em 0 .4em; letter-spacing: -0.015em; }
h4 { font-size: 1em; }
p, ul, ol { text-wrap: pretty; }

code { font-family: var(--mono); font-size: .82em; background: var(--surface-2); color: var(--accent-strong); padding: .12em .4em; border-radius: 6px; }
pre { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; overflow-x: auto; font-size: .8em; line-height: 1.6; }
pre code { background: none; padding: 0; color: var(--text-soft); font-size: 1em; }
blockquote { margin: 2rem 0; padding: .25rem 0 .25rem 1.5rem; border-left: 4px solid var(--accent); font-size: var(--step-1); font-style: italic; color: var(--text-soft); line-height: 1.5; }
hr { border: 0; height: 1px; background: var(--line); margin: 3rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .85em; font-family: var(--sans); }
th, td { border-bottom: 1px solid var(--line); padding: .6rem .5rem; text-align: left; }
th { color: var(--muted); font-weight: 600; }

.container { width: min(100% - 2.5rem, var(--width)); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.lead { font-size: var(--step-1); line-height: 1.45; color: var(--text-soft); margin: 0; }
.meta { font-family: var(--sans); color: var(--muted); font-size: .95rem; letter-spacing: .01em; margin: 0 0 1rem; }
.meta a { color: var(--muted); text-decoration: none; }
.meta a:hover { color: var(--accent); }
.kicker { font-family: var(--sans); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin: 0 0 1rem; }
.section-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0 0 1rem; }
.more { font-family: var(--sans); font-weight: 700; text-decoration: none; }
.skip-link { position: absolute; left: -999px; top: 1rem; background: var(--accent); color: var(--bg); padding: .5rem 1rem; border-radius: 8px; z-index: 20; }
.skip-link:focus { left: 1rem; }

/* ---------- header / nav ---------- */
.site-header { border-bottom: 1px solid var(--line); background: rgb(15 16 19 / .85); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 10; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; min-height: 5rem; flex-wrap: wrap; padding-block: .75rem; }
.logo { font: 800 1.5rem/1 var(--sans); letter-spacing: -0.03em; color: var(--text); text-decoration: none; }
.logo:hover { color: var(--accent); }
.menu { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; flex-wrap: wrap; font-family: var(--sans); font-size: 1rem; font-weight: 600; }
.menu a { display: block; padding: .45rem .85rem; border-radius: 999px; color: var(--text-soft); text-decoration: none; }
.menu a:hover, .menu__item.is-active > a { background: var(--accent-soft); color: var(--accent); }
.menu__item { position: relative; }
.menu--sub { display: none; position: absolute; top: 100%; left: 0; min-width: 14rem; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem; box-shadow: 0 16px 40px rgb(0 0 0 / .45); z-index: 5; }
.menu--sub a { border-radius: 8px; }
.menu__item.has-children:hover > .menu--sub, .menu__item.has-children:focus-within > .menu--sub { display: flex; }

/* ---------- page headers & entries ---------- */
main.container { padding-block: clamp(2.5rem, 6vw, 5rem) 6rem; }
.page-header { margin-bottom: clamp(2rem, 5vw, 3.5rem); max-width: 56rem; }
.page-header h1 { margin-bottom: .35em; }
.entry--post .page-header h1 { font-size: var(--step-4); line-height: 1.02; letter-spacing: -0.035em; }
.entry, .listing { max-width: 56rem; }
.entry > .prose, .entry__section, .post-nav, .backlinks { max-width: var(--measure); }
.entry__image { border-radius: var(--radius); margin: 0 0 3rem; width: 100%; max-width: 56rem; }
.entry__section { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.entry__section h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-top: 0; }
.backlinks ul { padding-left: 1.2rem; }
.breadcrumbs { font-family: var(--sans); font-size: .85rem; color: var(--muted); margin-bottom: 1.5rem; }
.breadcrumbs a { color: var(--muted); }

.prose > * + * { margin-top: 1.25em; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose li { color: var(--text); }
.prose li + li { margin-top: .35em; }
.prose img { border-radius: var(--radius); }
.prose--wide { max-width: none; }
.entry--post .prose > p:first-child::first-letter { float: left; font: 800 3.6em/.8 var(--sans); margin: .08em .1em 0 0; color: var(--accent); }

/* ---------- post list ---------- */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-row { display: grid; grid-template-columns: 9rem 1fr; gap: .25rem 2rem; padding: 1.75rem 0; border-top: 1px solid var(--line); }
.post-row:last-child { border-bottom: 1px solid var(--line); }
.post-row__date { font: 600 .95rem/2.2 var(--sans); color: var(--muted); white-space: nowrap; }
.post-row__title { font-size: var(--step-2); margin: 0; line-height: 1.12; }
.post-row__title a { color: var(--text); text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat; transition: background-size .25s ease, color .2s; }
.post-row__title a:hover { color: var(--accent); background-size: 100% 2px; }
.post-row__desc { margin: .5rem 0 0; color: var(--text-soft); max-width: var(--measure); }
@media (max-width: 640px) { .post-row { grid-template-columns: 1fr; } .post-row__date { line-height: 1.4; } }

.year + .year { margin-top: 3.5rem; }
.year__title { font-size: var(--step-3); color: var(--line); -webkit-text-stroke: 1px var(--muted); margin: 0 0 1rem; }

.chips, .term-cloud { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; font-family: var(--sans); }
.chip { display: inline-block; font-size: .85rem; font-weight: 600; padding: .25rem .75rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); text-decoration: none; letter-spacing: .02em; }
.chip:hover { background: var(--accent); color: var(--bg); }
.chip--categories { background: var(--ok-soft); color: var(--ok); }
.chip--categories:hover { background: var(--ok); color: var(--bg); }
.term-cloud .chip { font-size: 1.1rem; padding: .5rem 1.1rem; }
.chip .count { opacity: .6; margin-left: .35rem; }

/* ---------- home ---------- */
.latest { margin: clamp(3rem, 8vw, 6rem) 0; }
.latest__link { display: block; text-decoration: none; color: inherit; padding: clamp(1.75rem, 4vw, 3rem); border-radius: calc(var(--radius) * 1.5); background: radial-gradient(120% 140% at 100% 0%, rgb(255 184 92 / .14), transparent 55%), var(--surface); border: 1px solid var(--line); transition: border-color .2s, transform .2s; }
.latest__link:hover { border-color: var(--accent); transform: translateY(-2px); color: inherit; }
.latest__image { border-radius: var(--radius); margin-bottom: 2rem; width: 100%; aspect-ratio: 21/9; object-fit: cover; }
.latest__title { font-size: var(--step-4); line-height: 1.02; letter-spacing: -0.035em; margin: 0 0 .4em; }
.latest__desc { font-size: var(--step-1); color: var(--text-soft); margin: 0 0 1.5rem; max-width: 46rem; line-height: 1.45; }
.latest__more { color: var(--accent); font-weight: 700; }
.home__more { margin-top: 2rem; }
.home__more .more { display: inline-block; margin-top: 1.5rem; }

/* ---------- prev / next ---------- */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 4rem; }
.post-nav__link { display: flex; flex-direction: column; gap: .4rem; padding: 1.25rem 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; background: var(--surface); }
.post-nav__link span { font: 600 .75rem var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.post-nav__link strong { font: 700 1.1rem/1.25 var(--sans); color: var(--text); }
.post-nav__link:hover { border-color: var(--accent); }
.post-nav__link:hover strong { color: var(--accent); }
.post-nav__link--newer { text-align: right; grid-column: 2; }
@media (max-width: 640px) { .post-nav { grid-template-columns: 1fr; } .post-nav__link--newer { grid-column: auto; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 4rem 0 2rem; font-family: var(--sans); font-size: 1rem; }
.site-footer__inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 3rem; }
@media (max-width: 760px) { .site-footer__inner { grid-template-columns: 1fr; } }
.site-footer__about p { color: var(--muted); margin: .75rem 0 0; max-width: 24rem; }
.site-footer .menu { flex-direction: column; gap: 0; }
.site-footer .menu a { padding: .3rem 0; border-radius: 0; background: none; color: var(--text-soft); }
.site-footer .menu a:hover { color: var(--accent); }
.site-footer .menu--sub { display: flex; position: static; border: 0; box-shadow: none; padding: 0 0 0 .75rem; background: none; }
.site-footer__bottom { color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); padding-top: 1.5rem; }

/* ---------- blocks (templates inherited from the default theme) ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s; }
.card:hover { border-color: #3a3e47; }
.card > img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--surface-2); }
.card > h1, .card > h2, .card > h3, .card > h4 { margin: 1.5rem 1.5rem 0; font-size: var(--step-1); }
.card .content { padding: .5rem 1.5rem 1.5rem; font-size: .9em; color: var(--text-soft); }
.card .content > :first-child { margin-top: .5rem; }
.card .content > :last-child { margin-bottom: 0; }
.card.featured { border-color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 1.5rem; margin: 3rem 0; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 2.5rem; margin: 2.5rem 0; }

.hero { position: relative; overflow: hidden; margin: 0 0 2rem; padding: clamp(1rem, 4vw, 3rem) 0 clamp(2rem, 5vw, 4rem); border-bottom: 1px solid var(--line); }
.hero::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 38%; background: var(--hero-image) center / contain no-repeat; opacity: .35; filter: grayscale(1) brightness(1.4); pointer-events: none; }
.hero__inner { position: relative; z-index: 1; max-width: 52rem; }
.hero h1 { font-size: clamp(3rem, 2rem + 6vw, 7rem); line-height: .98; letter-spacing: -0.045em; margin-bottom: .3em; }
.hero__text { font-size: var(--step-1); line-height: 1.5; color: var(--text-soft); max-width: 40rem; }
@media (max-width: 800px) { .hero::after { display: none; } }

.callout { border-radius: var(--radius); padding: 1.25rem 1.5rem; margin: 2rem 0; background: var(--accent-soft); border-left: 4px solid var(--accent); }
.callout--warning { background: var(--warn-soft); border-color: var(--warn); }
.callout--success { background: var(--ok-soft); border-color: var(--ok); }
.callout__title { font-family: var(--sans); font-weight: 800; margin: 0 0 .35rem; }
.callout > :last-child { margin-bottom: 0; }

.details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 1rem 0; }
.details summary { cursor: pointer; padding: 1rem 1.25rem; font: 700 1.05rem var(--sans); }
.details summary h2, .details summary h3 { display: inline; font-size: 1em; }
.details__body { padding: 0 1.25rem 1.25rem; }

/* ---------- mindmap page (viewer inherited from the default theme) ---------- */
.mindmap-page { width: 100%; font-family: var(--sans); font-size: 1rem; }
.mindmap-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.mindmap-toolbar h1 { margin: 0 auto 0 0; font-size: var(--step-2); }
.mindmap-toolbar input, .mindmap-toolbar button { font: inherit; font-size: .9rem; padding: .5rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.mindmap-toolbar button { cursor: pointer; }
.mindmap-toolbar button:hover { border-color: var(--accent); color: var(--accent); }
.mindmap-stats { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--muted); font-size: .9rem; }
.mindmap-stats b { color: var(--text); }
.mindmap-layout { display: grid; grid-template-columns: 1fr 20rem; gap: 1rem; }
@media (max-width: 900px) { .mindmap-layout { grid-template-columns: 1fr; } }
.mindmap-canvas { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; min-height: 60vh; max-height: 78vh; }
.mindmap-canvas svg { display: block; }
.mindmap-details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; font-size: .9rem; align-self: start; position: sticky; top: 6rem; }
.mindmap-details h3 { margin: 0 0 .25rem; font-size: 1.1rem; }
.mindmap-details ul { padding-left: 1.1rem; margin: .25rem 0 .75rem; }
.mindmap-details code { font-size: .8rem; }
.mindmap-warnings { margin-top: 1rem; font-size: .9rem; }
.mm-link { fill: none; stroke: var(--line); stroke-width: 1.5; }
.mm-node { cursor: pointer; }
.mm-node text { font: 13px var(--sans); fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.mm-node.is-match text { fill: var(--accent); font-weight: 700; }
.mm-node.is-related circle { stroke: var(--accent) !important; stroke-width: 3; }
.mm-node.is-selected circle { stroke: var(--text) !important; stroke-width: 3.5; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
.prose img, .card > img, .latest__image, .entry__image { filter: brightness(.88) saturate(.9); }
.post-row--nodate { grid-template-columns: 1fr; }
.prose .post-row, .entry__section .post-row { grid-template-columns: 7.5rem 1fr; padding: 1.25rem 0; }
.prose .post-row--nodate, .entry__section .post-row--nodate { grid-template-columns: 1fr; }
.prose .post-row__title, .entry__section .post-row__title { font-size: var(--step-1); }
@media (max-width: 640px) { .prose .post-row, .entry__section .post-row { grid-template-columns: 1fr; } }
