/* thinking capsules: shared style for every page */
:root {
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: 'Newsreader', Georgia, serif;
}
/* colours: ink and sage; dark: graphite and sage */
:root {
  --page-bg: #e9ebe4; --card-bg: #f8f8f3; --text: #1e2421; --muted: #6b716b; --line: #dde0d6;
  --chip-bg: #1e2421; --chip-text: #eef0e8; --link: #0b7566; --mark: rgba(201,170,92,.5); --accent: #4f7d6b;
  --shadow: 0 20px 50px -20px rgba(20,40,30,.25), 0 6px 16px -8px rgba(20,40,30,.12);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --page-bg: #111513; --card-bg: #181d1a; --text: #e3e6dc; --muted: #8f968c; --line: #28302b;
  --chip-bg: #e3e6dc; --chip-text: #111513; --link: #6fd6bf; --mark: rgba(201,170,92,.32); --accent: #c9aa5c;
  --shadow: 0 20px 50px -20px rgba(0,0,0,.6), 0 6px 16px -8px rgba(0,0,0,.4); color-scheme: dark;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --page-bg: #111513; --card-bg: #181d1a; --text: #e3e6dc; --muted: #8f968c; --line: #28302b;
  --chip-bg: #e3e6dc; --chip-text: #111513; --link: #6fd6bf; --mark: rgba(201,170,92,.32); --accent: #c9aa5c;
  --shadow: 0 20px 50px -20px rgba(0,0,0,.6), 0 6px 16px -8px rgba(0,0,0,.4); color-scheme: dark;
} }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
body { font-family: var(--mono); color: var(--text); background: var(--page-bg); padding: 40px 16px 56px; -webkit-font-smoothing: antialiased; }
@media (max-width: 480px) { body { padding: 16px 10px 40px; } }
#data { display: none; }

/* card */
.card { position: relative; max-width: 640px; margin: 0 auto; background: var(--card-bg); border-radius: 28px; box-shadow: var(--shadow); padding: 24px 28px 28px; }
@media (max-width: 480px) { .card { padding: 20px 18px 22px; border-radius: 22px; } }
.theme-toggle { position: absolute; top: 34px; right: 38px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--card-bg); color: var(--text); font-size: 15px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
@media (max-width: 480px) { .theme-toggle { top: 28px; right: 26px; } }
.loading { color: var(--muted); font-size: 12px; padding: 40px 0; text-align: center; }

/* banner + tiles */
.banner { height: 84px; border-radius: 18px; background-size: cover; background-position: center; image-rendering: pixelated; position: relative; display: flex; align-items: flex-end; padding: 10px; box-shadow: 0 10px 20px -12px rgba(20,20,30,.45); }
.tag { font-size: 12px; padding: 5px 9px; background: var(--l-bg); color: var(--l-fg); }
.tag::before { content: "> "; opacity: .6; }

/* nav chips */
.nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.chip, .chip:visited { font-size: 12px; padding: 5px 10px; background: var(--chip-bg); color: var(--chip-text); text-decoration: none; }
.chip::before { content: "> "; opacity: .6; }
.chip:hover { text-decoration: none; opacity: .88; }
.chip.ghost, .chip.ghost:visited { background: transparent; color: var(--text); border: 1px solid var(--line); }
.chip.ghost::before { content: none; }
.ref { font-size: 12px; color: var(--muted); margin: 22px 0 6px; }
.ref::before { content: "// "; }
h1.title { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.15; margin: 0 0 18px; }
h2 { font-family: var(--serif); font-weight: 400; }

/* text */
.text { font-size: 14px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: break-word; }
.muted { color: var(--muted); font-size: 12px; }
.fig { float: left; width: 44%; margin: 6px 20px 8px 0; white-space: normal; }
.fig img { display: block; width: 100%; height: auto; border-radius: 14px; }
.fig figcaption { font-size: 11px; line-height: 1.4; color: var(--muted); margin-top: 6px; }
.fig figcaption a, .fig figcaption a:visited { color: var(--muted); }
@media (max-width: 480px) { .fig { float: none; width: 100%; margin: 4px 0 12px; } }
.meta { clear: both; }
mark { background: linear-gradient(transparent 55%, var(--mark) 55%); color: inherit; padding: 0 1px; }
a, a:visited { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.quote { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; margin: 4px 0 14px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: break-word; color: var(--muted); }
.meta { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.8; }
.meta a, .meta a:visited { color: var(--muted); text-decoration: underline; }
.pn { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.pn a, .pn a:visited { font-size: 12.5px; padding: 8px 12px; text-decoration: none; max-width: 100%; }
.pn .prev, .pn .prev:visited { border: 1px solid var(--line); color: var(--text); }
.pn .next, .pn .next:visited { background: var(--chip-bg); color: var(--chip-text); margin-left: auto; }
.pn .next::after { content: " ⭢"; opacity: .7; }
.pn .lab { color: var(--muted); }
.pn .next .lab { color: inherit; opacity: .65; }
.pn a:hover { opacity: .88; }
.footer { text-align: center; font-size: 11px; color: var(--muted); margin-top: 24px; line-height: 1.8; }
.footer a, .footer a:visited { color: var(--muted); text-decoration: underline; }

/* lists */
.lrow { display: flex; gap: 12px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.lrow a { display: flex; gap: 12px; align-items: baseline; flex: 1; min-width: 0; text-decoration: none; }
.lrow a:hover .ltitle { text-decoration: underline; }
.lrow .ldate { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.lrow .ltitle { color: var(--text); }
.lrow .count { margin-left: auto; }
.count { color: var(--muted); font-size: 11px; white-space: nowrap; }
.snip { display: block; color: var(--muted); font-size: 11.5px; margin: -3px 0 6px; line-height: 1.5; }
.months { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.months .m { font: 12px var(--mono); padding: 5px 9px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; text-decoration: none; }
.months .m.on { background: var(--chip-bg); color: var(--chip-text); border-color: var(--chip-bg); }
.months .m.cur:not(.on) { border-color: var(--accent); }
.months .m.off { color: var(--muted); opacity: .45; cursor: default; }
.months .m.all { margin-left: 6px; border-style: dashed; }
.sec { margin-top: 24px; scroll-margin-top: 12px; }
.sec h2 { font-size: 24px; margin: 0 0 6px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sec h2 .count { font-family: var(--mono); }
.sec h2 .chip { font-size: 11px; font-family: var(--mono); margin-left: auto; }
details.mon { border-bottom: 1px solid var(--line); scroll-margin-top: 12px; }
details.mon summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 10px; padding: 12px 0; font-family: var(--serif); font-size: 21px; }
details.mon summary::-webkit-details-marker { display: none; }
details.mon summary::before { content: "+"; font: 13px var(--mono); color: var(--accent); width: 1ch; }
details.mon[open] summary::before { content: "−"; }
details.mon summary .count { font-family: var(--mono); }
details.mon .lrow:last-of-type { border-bottom: 0; }
details.mon .inner { padding: 0 0 12px; }
.empty { color: var(--muted); font-size: 12px; padding: 14px 0; }
.grow { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 13.5px; }
.grow:hover { text-decoration: none; }
.grow .gname { color: var(--text); }
.grow .gname::before { content: "⭢ "; color: var(--accent); }
.guides { border-top: 1px solid var(--line); }

/* home */
.avatar { width: 88px; height: 88px; border-radius: 50%; display: block; padding: 3px; background: var(--accent); image-rendering: pixelated; }
.name { font-family: var(--serif); font-weight: 400; font-size: 38px; line-height: 1.05; margin: 18px 0 12px; }
.bio { font-size: 13px; line-height: 1.7; margin: 0 0 18px; color: var(--muted); }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.search { display: flex; flex-direction: column; gap: 8px; margin: 0 0 22px; }
.slabel { font-size: 11px; color: var(--muted); margin-top: 6px; }
.slabel::before { content: "// "; }
.search input { font: 12.5px var(--mono); color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: 0; padding: 9px 12px; width: 100%; outline: none; min-width: 0; }
.search input:focus { border-color: var(--accent); }
.search input::placeholder { color: var(--muted); }
.dates { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dates label { display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; color: var(--muted); }
.dates input { padding: 7px 8px; font-size: 12px; }
.results { font-size: 12px; }
.results .status { color: var(--muted); font-size: 11px; display: flex; gap: 10px; }
.results .status a { color: var(--muted); text-decoration: underline; }
.results .list { max-height: 380px; overflow-y: auto; }
.results .lrow { font-size: 12px; padding: 6px 0; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; grid-auto-rows: 100px; }
.tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; border-radius: 20px; text-decoration: none; padding: 12px; overflow: hidden; background-size: cover; background-position: center; image-rendering: pixelated; box-shadow: 0 10px 20px -12px rgba(20,20,30,.45); transition: transform .18s ease; }
.tile:hover { transform: translateY(-3px) scale(1.02); text-decoration: none; }
.tile-hero { grid-column: span 2; grid-row: span 2; }
.tile .tag { line-height: 1.3; }
.tile .tag .count { color: inherit; opacity: .7; margin-left: 4px; font-size: inherit; }
.tile-hero .tag { font-family: var(--serif); font-size: 22px; padding: 6px 12px; }
.tile-hero .tag::before { content: none; }
.tile-hero .sub { font: 11px var(--mono); padding: 4px 8px; background: var(--l-bg); color: var(--l-fg); margin-bottom: 6px; opacity: .92; }
.badge { position: absolute; top: 9px; right: 12px; font-size: 13px; color: var(--l-bg); text-shadow: 0 0 6px var(--l-fg); }
.tile-who { height: 72px; margin: 4px 0 14px; }
.glabel { font-size: 11px; color: var(--muted); margin: 30px 0 10px; }
.glabel::before { content: "// "; }
.main .glabel:first-child { margin-top: 0; }
.other { font-size: 11.5px; color: var(--muted); line-height: 1.8; }
.other a, .other a:visited { color: var(--muted); text-decoration: underline; }
.card.home { max-width: 400px; padding: 32px 28px 24px; }
.card.home .theme-toggle { top: 20px; right: 20px; box-shadow: none; border: 1px solid var(--line); }

@media (min-width: 760px) {
  .card.home { max-width: 720px; display: grid; grid-template-columns: 230px 1fr; column-gap: 32px; padding: 36px; }
  .card.home .intro { position: sticky; top: 24px; align-self: start; }
  .card.home .footer { grid-column: 1 / -1; }
  .card.home .theme-toggle { top: 24px; right: 24px; }
}
@media (min-width: 900px) {
  .card { max-width: 760px; padding: 32px 44px 40px; }
  .card.list { max-width: 820px; }
  .banner { height: 110px; }
  h1.title { font-size: 42px; }
  .text { font-size: 15px; }
}
@media (min-width: 1100px) {
  .card.home { max-width: 1040px; grid-template-columns: 270px 1fr; }
  .card.home .grid { grid-template-columns: repeat(3, 1fr); }
}
/* tiles: one per page type, image and label colours per palette */
.p-ripple { background-image: url(assets/tile_ripple.png?v=2); --l-bg: #24332d; --l-fg: #c7d8c8; }
.p-moon { background-image: url(assets/tile_moon.png?v=2); --l-bg: #1c2530; --l-fg: #c9d3dc; }
.p-window { background-image: url(assets/tile_window.png?v=2); --l-bg: #3a3324; --l-fg: #e2d3a8; }
.p-path { background-image: url(assets/tile_path.png?v=2); --l-bg: #2c3a33; --l-fg: #b9cdb0; }
.p-orbit { background-image: url(assets/tile_orbit.png?v=2); --l-bg: #262a33; --l-fg: #c9c6d8; }
.p-layers { background-image: url(assets/tile_layers.png?v=2); --l-bg: #2d3530; --l-fg: #d4ddd0; }

/* links inside the text: underlined so they stand out */
.text a, .quote a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--link) 55%, transparent); }

/* archive filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; }
select { font: 12.5px var(--mono); color: var(--text); background-color: var(--card-bg); border: 1px solid var(--line); padding: 6px 28px 6px 10px; border-radius: 0; -webkit-appearance: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat; max-width: 100%; }
select:disabled { opacity: .45; }
.toggle { font: 12px var(--mono); padding: 5px 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.toggle.on { background: var(--chip-bg); color: var(--chip-text); border-color: var(--chip-bg); }

/* home grid: hero plus four tiles; on three columns the last one fills the row */
@media (min-width: 1100px) { .card.home .grid .tile:last-child:nth-child(5) { grid-column: span 2; } }
details.mon summary .chip { font: 11px var(--mono); margin-left: auto; }

/* wide screens: use the space; the sidebar grows while a search is in use */
.card.home { transition: max-width .2s ease; }
@media (min-width: 1100px) {
  .card.home { --side: 290px; grid-template-columns: var(--side) 1fr; transition: grid-template-columns .25s ease; }
  .card.home.searching { --side: 400px; }
}
@media (min-width: 1400px) {
  body { padding: 32px 32px 48px; }
  .card.home { max-width: 1480px; padding: 40px 44px; column-gap: 44px; --side: 330px; }
  .card.home.searching { --side: 460px; }
  .card.home .grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 120px; }
  .card.home .grid .tile:last-child:nth-child(5) { grid-column: auto; }
  .card.list { max-width: 1040px; }
}
