@font-face {
  font-family: 'JetBrains Mono';
  src: url(/assets/fonts/jetbrains-mono.woff2) format('woff2');
  font-weight: 100 800;
  font-display: swap;
}
@font-face {
  font-family: 'Inter Tight';
  src: url(/assets/fonts/inter-tight.woff2) format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter Tight', system-ui, sans-serif;
  --measure: 760px; /* the reading column: headings, text and photos on every page */
}

/* ---- themes: every colour is a token. Day is the default; night and synthwave '84 override it. ---- */
:root {
  color-scheme: light;
  --name: 'DAY'; /* shown on the switcher in the status bar */
  --bg: #f7f6f2;
  --ink: #111;
  --ink-2: #444;
  --mute: #888;
  --faint: #bbb;
  --mark: #bbb; /* the # in headings */
  --line: #11112233;
  --rule: #111; /* the blueprint's heavy lines */
  --sel: #dfe6f0;
  --hover: #1111110d;
  --accent: #2f5d9b;
  --chip: #111;
  --chip-ink: #f7f6f2;
  --term-bg: #111;
  --term-ink: #e8e6df;
  --term-prompt: #7fa7dd;
  --term-mute: #8a8a8a;
  --photo-blend: multiply;
}
:root[data-theme='night'] {
  color-scheme: dark;
  --name: 'NIGHT';
  --bg: #141413;
  --ink: #e8e6df;
  --ink-2: #b5b3ad;
  --mute: #8a8a85;
  --faint: #4a4a47;
  --mark: #4a4a47;
  --line: #ffffff26;
  --rule: #3d3d3a;
  --sel: #22324a;
  --hover: #ffffff0d;
  --accent: #7fa7dd;
  --chip: #e8e6df;
  --chip-ink: #141413;
  --term-bg: #0c0c0b;
  --photo-blend: normal;
}
/* github.com/robb0wen/synthwave-vscode */
:root[data-theme='synthwave'] {
  color-scheme: dark;
  --name: "SYNTHWAVE '84";
  --bg: #262335;
  --ink: #fdfdfd;
  --ink-2: #c9c2dc;
  --mute: #848bbd;
  --faint: #495495;
  --mark: #fede5d;
  --line: #495495aa;
  --rule: #495495;
  --sel: #34294f;
  --hover: #37294d99;
  --accent: #ff7edb;
  --chip: #ff7edb;
  --chip-ink: #262335;
  --term-bg: #171520;
  --term-ink: #fdfdfd;
  --term-prompt: #36f9f6;
  --term-mute: #848bbd;
  --photo-blend: normal;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none; /* no rubber-band past the page, like a terminal */
}
body {
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.6 var(--mono);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--accent);
}
::selection {
  background: var(--sel);
}

/* ---- prompt bar ---- */
.bar {
  position: relative;
  z-index: 10; /* view-transition-name makes the bar a stacking context: lift it so .out covers the page */
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--rule);
}
.bar label {
  white-space: nowrap;
}
.bar .field {
  position: relative;
  flex: 1;
  min-width: 0;
}
.bar input {
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  outline: none;
  caret-color: var(--accent);
}
.bar .ghost {
  position: absolute;
  inset: 0;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
}
.bar .field:focus-within .ghost,
.bar input:not(:placeholder-shown) + .ghost {
  display: none;
}
.bar .cursor {
  margin-left: 4px;
}
.bar .hint {
  color: var(--mute);
  white-space: nowrap;
  margin-left: 16px;
}
.bar .hint b {
  color: var(--ink);
  font-weight: 500;
}
/* the one cursor: in the prompt, and behind text typing itself out live. Sized in em, so it fits any text */
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  background: var(--ink);
  vertical-align: -0.15em;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
.out {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  padding: 10px 24px 14px;
  white-space: pre-wrap;
}
.out[hidden] {
  display: none;
}
.out a {
  display: block;
  text-decoration: none;
  padding: 2px 0;
}
.out a:first-of-type,
.out a:hover {
  color: var(--accent);
}
.out .m {
  color: var(--mute);
}

/* ---- ls pane ---- */
main {
  flex: 1;
  display: grid;
  grid-template-columns: 400px 1fr;
}
.ls {
  border-right: 1px solid var(--rule);
  padding: 18px 0;
}
.ls-inner {
  position: sticky;
  top: 0;
}
.ls .cmd,
.ls .group {
  padding: 0 24px 12px;
  color: var(--mute);
}
.ls .group {
  padding-top: 16px;
  padding-bottom: 6px;
  font-size: 11px;
}
.row {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 12px;
  align-items: baseline; /* the smaller meta sits on the same line as the name */
  padding: 7px 24px;
  text-decoration: none;
}
.row .perm,
.row .meta {
  color: var(--mute);
}
.row .meta {
  font-size: 11px;
}
.row.dir .name::after {
  content: '/';
  color: var(--accent);
}
.row.active {
  background: var(--sel);
}
.row:hover,
.row.focus {
  background: var(--hover);
  color: inherit;
}
.row.focus {
  box-shadow: inset 2px 0 var(--accent);
}
.row.leaf .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.draft {
  color: var(--mute);
  pointer-events: none; /* being written: nothing to open yet */
}
/* a note I'm writing right now, and its folder: the row says so until I pause */
.row.writing .meta {
  display: none;
}
.row.writing::after {
  content: 'writing…';
  color: var(--accent);
  font-size: 11px;
}
.row.leaf i {
  font-style: normal;
  color: var(--mute);
  margin-right: 8px;
}

/* ---- paths: every folder on the way is a link ---- */
.crumbs a {
  color: inherit;
  text-decoration: underline dotted var(--mute);
  text-underline-offset: 3px;
}
.crumbs a:hover {
  color: var(--accent);
}

/* ---- preview ---- */
.preview {
  padding: 48px 64px 64px;
  font: 17px/1.6 var(--sans);
  min-width: 0;
}
/* blocks fill the pane like a terminal (capped for ultrawide screens); headings and running text share one readable measure */
.preview > * {
  max-width: 1400px;
}
.preview > :is(h1, h2, h3, h4, p, ul:not(.list), ol, blockquote, .door, .figs),
.preview .lede {
  max-width: var(--measure);
}
.preview .file {
  font: 11px var(--mono);
  color: var(--mute);
  margin-bottom: 28px;
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.preview .file .grow {
  flex: 1;
}
.preview .file span {
  white-space: nowrap;
}
.preview .file span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.preview .file a {
  color: var(--mute);
}
.preview h1 {
  font-weight: 500;
  font-size: 56px;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin-bottom: 20px;
  padding-left: 0.75em; /* the # hangs in its own column, so wrapped lines align with the first */
}
.preview h1::before {
  content: '#';
  display: inline-block;
  width: 0.75em;
  margin-left: -0.75em;
  color: var(--mark);
  font-weight: 400;
}
.preview h2 {
  font: 500 24px/1.25 var(--mono);
  letter-spacing: -0.02em;
  margin: 48px 0 14px;
  padding-left: 3ch; /* the ## hangs in its own column, like the h1's # */
}
.preview h2::before {
  content: '##';
  display: inline-block;
  width: 3ch;
  margin-left: -3ch;
  color: var(--mark);
  font-weight: 400;
}
/* on the home page the h2s are small labels over each block, not headings in a text */
.preview[data-kind='home'] h2 {
  font: 500 12px var(--mono);
  letter-spacing: 0;
  margin: 40px 0 12px;
}
.preview h2 .aside {
  color: var(--mute);
  font-weight: 400;
  margin-left: 8px;
}
.preview h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 32px 0 8px;
}
.preview p,
.preview ul,
.preview ol,
.preview blockquote,
.preview table,
.preview pre {
  margin-bottom: 14px;
}
.preview ul,
.preview ol {
  padding-left: 20px;
}
.preview li {
  margin-bottom: 4px;
}
.preview strong {
  font-weight: 600;
}
.preview blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 14px;
  color: var(--ink-2);
}
.preview code {
  font: 14px var(--mono);
  background: var(--sel);
  padding: 1px 5px;
}
.preview pre,
.term {
  font: 12.5px/1.6 var(--mono);
  background: var(--term-bg);
  color: var(--term-ink);
  padding: 16px 18px;
  overflow-x: auto;
  white-space: pre-wrap;
}
.preview pre code {
  background: none;
  padding: 0;
  font: inherit;
}
.term .p {
  color: var(--term-prompt);
}
.term .src {
  color: var(--term-mute);
}
.sibs {
  margin-top: 56px;
}
.sibs div {
  display: flex; /* where you are on the left, like the file header; prev and next on the right */
  gap: 16px;
  margin-top: 4px;
}
.sibs a {
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sibs a:hover {
  color: var(--term-prompt);
}
.sibs div > :first-child {
  color: var(--term-mute);
  margin-right: auto;
}
.preview hr {
  border: 0;
  border-top: 1px dashed var(--line);
  margin: 28px 0;
}
.preview table {
  margin-bottom: 24px;
  border-collapse: collapse;
  font: 12px/1.5 var(--mono);
}
.preview th,
.preview td {
  border: 1px solid var(--rule);
  padding: 6px 12px;
  text-align: left;
  vertical-align: top;
}
.preview th {
  font-weight: 500;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
}
.preview thead:has(th:empty) {
  display: none;
}
.preview .lede {
  font-size: 22px;
  line-height: 1.38;
  letter-spacing: -0.01em;
}
.blurb {
  color: var(--mute);
}

/* photos in the text, in full colour */
.preview img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px 0;
}
/* the photo: a lens on the face next to the name, in blueprint tint; hover or tap opens the whole picture */
.who {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.preview .who h1 {
  margin: 0;
}
.photo {
  --x: 50%; /* where the face is, from `focus:` in the frontmatter */
  --y: 25%;
  position: relative;
  flex: none;
  width: 48px;
  height: 48px;
  margin: 0;
  cursor: zoom-in;
}
.photo .lens {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  outline: 1px solid var(--rule);
}
.photo img {
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: var(--x) var(--y);
  filter: grayscale(1) contrast(1.15);
  mix-blend-mode: var(--photo-blend);
  transform-origin: var(--x) var(--y);
  transform: translate(calc(50% - var(--x)), calc(50% - var(--y))) scale(4); /* the face, centred */
}
.photo .lens::after {
  content: ''; /* the accent, screened over the grayscale */
  position: absolute;
  inset: 0;
  background: var(--accent);
  mix-blend-mode: screen;
  opacity: 0.3;
  pointer-events: none;
}
.photo figcaption {
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  padding: 6px 10px;
  font: 11px var(--mono);
  color: var(--mute);
  background: var(--bg);
  border-top: 1px solid var(--rule);
  visibility: hidden;
}
.photo:is(:hover, :focus) .lens {
  width: 300px;
  height: 326px;
}
.photo:is(:hover, :focus) img {
  transform: none;
}
.photo:is(:hover, :focus) figcaption {
  visibility: visible;
}

/* the contact strip (`images:` in the frontmatter): squares the size of the README lens; hover or tap opens the photo underneath */
.figs {
  position: relative; /* the open photo is placed against the strip, so it never runs off the page */
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.figs figure {
  margin: 0;
  cursor: zoom-in;
}
.preview .figs img {
  margin: 0;
}
.preview .figs figure > img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  outline: 1px solid var(--rule);
}
.preview .figs figure:is(:hover, :focus) > img {
  outline-color: var(--accent);
}
.figs figure:focus {
  outline: none; /* the square shows which one is open */
}
.figs .lens {
  position: absolute;
  z-index: 5;
  top: calc(100% + 8px);
  left: 0;
  max-width: 100%;
  outline: 1px solid var(--rule);
  background: var(--bg);
  visibility: hidden;
  pointer-events: none;
}
.preview .figs .lens img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(60vh, 480px);
}
.figs figcaption {
  padding: 6px 10px;
  font: 11px var(--mono);
  color: var(--mute);
  border-top: 1px solid var(--rule);
}
.figs figure:is(:hover, :focus) .lens {
  visibility: visible;
}
.figs:hover figure:not(:hover) .lens {
  opacity: 0; /* the pointer wins over a clicked one, so only one is ever open */
  visibility: hidden;
}

/* ---- home ---- */
.intro > :last-child {
  margin-bottom: 0;
}
.intro ul {
  list-style: none;
  padding: 0;
  font-size: 15px;
}
.now {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.now div {
  border: 1px solid var(--rule);
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.4;
}
.now div b {
  display: block;
  font: 500 11px var(--mono);
  margin-bottom: 6px;
}
.now div strong {
  font-weight: 500;
}
.list {
  list-style: none;
  padding: 0 !important;
}
.list li {
  padding: 12px 0;
  margin: 0;
  border-bottom: 1px dashed var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 16px;
  align-items: baseline;
}
.list li a {
  text-decoration: none;
}
.list li a:hover {
  text-decoration: underline;
}
.list li span {
  font: 11px var(--mono);
  color: var(--mute);
  text-align: right;
}
.list li small {
  grid-column: 1 / -1;
  color: var(--mute);
  font-size: 14px;
  margin-top: -2px;
}
.more {
  font: 11px var(--mono);
  color: var(--mute);
  margin-top: 8px;
  display: inline-block;
}
.door {
  font-size: 18px;
}
.door ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font: 13px var(--mono);
}

/* ---- status bar ---- */
.status {
  display: flex;
  border-top: 1px solid var(--rule);
  font-size: 11px;
  position: sticky;
  bottom: 0;
  background: var(--bg);
}
.status > * {
  padding: 5px 14px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
}
/* the theme switcher: its label comes from the theme's --name */
.status .theme {
  font: inherit;
  font-weight: 700;
  border: 0;
  background: var(--chip);
  color: var(--chip-ink);
  cursor: pointer;
}
.status .theme::after {
  content: var(--name);
}
.status .grow {
  flex: 1;
  border: 0;
}

/* ---- zen: just the text. The prompt stays, so the way back is always there; phones are focused enough already ---- */
.bar .zen {
  font: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.bar .zen::after {
  content: 'zen';
}
[data-zen] .bar .zen::after {
  content: 'exit zen';
}
@media (min-width: 761px) {
  [data-zen] main {
    grid-template-columns: 1fr;
  }
  [data-zen] :is(.ls, .status) {
    display: none;
  }
  [data-zen] .preview {
    justify-self: center;
    width: 100%;
    max-width: calc(var(--measure) + 128px); /* the reading column and its padding */
  }
}

/* ---- help ---- */
dialog {
  margin: auto;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
  padding: 22px 26px;
  font: 13px/1.7 var(--mono);
  box-shadow: 6px 6px 0 var(--rule);
}
dialog::backdrop {
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}
dialog:focus,
dialog form:focus {
  outline: none;
}
dialog dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 24px;
}
dialog dt {
  font-weight: 700;
}
dialog dd {
  color: var(--ink-2);
}
dialog p {
  color: var(--mute);
  margin-top: 14px;
}

@media (max-width: 1449px) {
  main {
    grid-template-columns: 330px 1fr;
  }
  .row {
    grid-template-columns: 1fr auto;
  }
  .row .perm {
    display: none;
  }
  .preview {
    padding: 40px 40px 56px;
  }
}
@media (max-width: 760px) {
  main {
    grid-template-columns: 1fr;
    align-content: start;
  }
  /* a narrow terminal runs `ls`, not `ls -l`: just the names, flowing across */
  .ls {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 12px 16px;
  }
  .ls-inner {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 6px;
  }
  .ls .cmd,
  .ls .group,
  .row .perm,
  .row .meta,
  .row.leaf {
    display: none;
  }
  .row {
    display: block;
    padding: 3px 6px;
  }
  .row.open {
    background: var(--sel); /* the folder you're in */
  }
  .group ~ .row {
    color: var(--mute); /* the machine files, last */
  }
  .bar,
  .out {
    padding-left: 16px;
    padding-right: 16px;
  }
  .bar .hint {
    display: none;
  }
  .sibs div {
    flex-direction: column; /* one per line, like ls */
    gap: 2px;
  }
  .list li {
    grid-template-columns: 1fr; /* the detail goes under the title */
  }
  .list li span {
    text-align: left;
  }
  .preview {
    padding: 24px 16px 40px;
  }
  .preview h1 {
    font-size: 38px;
  }
  .preview h2 {
    font-size: 20px;
  }
  .preview .lede {
    font-size: 19px;
  }
  .photo {
    width: 36px;
    height: 36px;
  }
  .photo .lens {
    left: auto;
    right: 0; /* opens leftwards, onto the page */
  }
  .photo:is(:hover, :focus) .lens {
    width: 260px;
    height: 282px;
  }
  .figs {
    gap: 6px;
  }
  .preview .figs figure > img {
    width: 36px;
    height: 36px;
  }
  .now {
    grid-template-columns: 1fr;
  }
  .status > :nth-child(n + 4) {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
  }
}

/* ---- page to page: the shell stays put, only the preview changes ---- */
@view-transition {
  navigation: auto;
}
.bar {
  view-transition-name: bar;
}
.ls-inner {
  view-transition-name: ls;
}
.status {
  view-transition-name: status;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 140ms;
}
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}
