@font-face {
  font-family: "Nunito Sans";
  src: url("/public/nunito-sans.ttf") format("truetype");
  font-weight: 200 1000;
  font-display: swap;
}

/* The capital H is drawn from the KMFC PCB front silkscreen. */
@font-face {
  font-family: "KMFC Mark";
  src: url("/public/kmfc-mark.ttf") format("truetype");
  font-weight: 750;
  font-display: swap;
  unicode-range: U+0048;
}

@view-transition { navigation: none; }

:root {
  color-scheme: dark;
  --site-bg: #0a0a0a;
  --site-line: #2a2a2a;
  --site-text: #fff;
  --site-muted: #aaa;
  --site-quiet: #939393;
  --site-width: 1040px;
  --reading-width: 68ch;
  --site-gutter: clamp(20px, 5vw, 56px);
  --title-size: clamp(44px, 7vw, 72px);
  --section-size: clamp(24px, 3vw, 30px);
  --site-mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  --bulma-family-primary: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  --bulma-scheme-main: var(--site-bg);
  --bulma-text: #dedede;
  --bulma-text-strong: var(--site-text);
  --bulma-link-text: var(--site-text);
  background-color: var(--site-bg);
}

body {
  background: var(--site-bg);
  color: var(--site-text);
  -webkit-font-smoothing: antialiased;
}

.site-shell,
body > .container.is-max-desktop {
  width: min(var(--site-width), calc(100% - 2 * var(--site-gutter)));
  margin-inline: auto;
}

.site-header { border-bottom: 1px solid var(--site-line); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.header-inner { min-height: 72px; }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 750;
  line-height: 1;
}
.brand-mark::before {
  content: "H";
  font-family: "KMFC Mark";
  font-size: .84em;
  user-select: none;
}
.site-nav, .site-footer nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}
.site-nav a, .site-footer a { color: var(--site-muted); font-size: 14px; }
.site-nav a:hover, .site-footer a:hover { color: var(--site-text); text-decoration: underline; }
body a:focus-visible {
  outline: 2px solid var(--site-text);
  outline-offset: 4px;
}

body > .container.is-max-desktop {
  max-width: none;
  padding-top: clamp(48px, 7vw, 96px);
  font-size: 18px;
  line-height: 1.7;
}
body > .container.is-max-desktop.px-3 { padding-inline: 0 !important; }
body > .container.is-max-desktop > .title,
.content .view .home-intro h1 {
  color: var(--site-text);
  font-size: var(--title-size);
  font-weight: 760 !important;
  line-height: 1;
  letter-spacing: -.06em;
  overflow-wrap: anywhere;
}
body > .container.is-max-desktop > .content > .columns {
  color: var(--site-muted);
  font-size: 14px;
}
body:not(:has(.home-intro, .project-directory)) > .container > .content > .view > :not(.site-footer, style, script) {
  max-width: var(--reading-width);
}
.view > .table-of-contents {
  position: static;
  padding: 16px 0;
  margin-bottom: 24px;
  border-block: 1px solid var(--site-line);
}
.view > .table-of-contents #table-of-contents-list {
  position: static;
  padding-left: 0;
  white-space: normal;
}
.view > .table-of-contents #table-of-contents-list a { max-width: none; }
.view a { text-underline-offset: .24em; }
.view a[href^="http"]::after { content: none; }
.view > p a { text-decoration: underline; }
.view > p { color: #dedede; }

.view .mermaid {
  padding: 20px 12px;
  border: 1px solid var(--site-line);
  border-radius: 6px;
  overflow-x: auto;
}
.view .mermaid:has(.flowchart-link) > svg { min-width: 520px; }
.view .mermaid .flowchart-link {
  stroke: #bfbfbf !important;
  stroke-width: 2.5px !important;
}
.view .mermaid marker[id$="pointEnd"] { overflow: visible; }
.view .mermaid marker[id$="pointEnd"] path {
  fill: #e4e4e4 !important;
  stroke: #e4e4e4 !important;
  transform-box: fill-box;
  transform-origin: right center;
  transform: scale(1.55);
}
.view .mermaid span.edgeLabel:not(:empty) {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid #4b4b4b;
  border-radius: 4px;
  background-color: #222 !important;
  color: #eee !important;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.35;
}
/* Override xlog's default numbered headings and large heading margins. */
.content .view :is(h1, h2, h3, h4, h5, h6) {
  margin: 1.5em 0 .5em !important;
  padding: 0;
  border: 0;
}
.content .view :is(h1, h2, h3, h4, h5, h6)::before { content: none; }
.content .view > h2,
.content .view .section-heading h2 {
  color: var(--site-text);
  font-size: var(--section-size);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -.035em;
}
.content .view > h2 {
  padding-top: 18px;
  border-top: 1px solid var(--site-line);
}
.content .view > h3 {
  color: var(--site-text);
  font-size: 20px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -.025em;
}

body:has(.home-intro) > .container.is-max-desktop { padding-top: 0; font-size: 16px; line-height: 1.55; }
body:has(.home-intro) > .container > .content > .columns,
.view:has(.home-intro) > .table-of-contents { display: none; }
.home-intro { padding-block: clamp(48px, 7vw, 96px) clamp(32px, 4vw, 52px); }
.content .view .home-intro h1 {
  margin: 0 !important;
  --title-size: clamp(54px, 9vw, 100px);
}
.home-intro .show-on-parent-hover { display: none !important; }
.content .home-intro p {
  max-width: 56ch;
  margin: 24px 0 0;
  color: var(--site-muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.52;
}
.home-section { border-top: 1px solid var(--site-line); padding-block: 24px 36px; }
.about-copy { max-width: 68ch; color: #dedede; }
.content .about-copy p { margin: 0; }
.content .about-copy p + p { margin-top: 10px; }
.about-copy a { text-decoration: underline; }
.section-heading { margin-bottom: 12px; }
.content .view .section-heading h2 { margin: 0 !important; }
.writing-feature {
  display: grid;
  grid-template-columns: 1.13fr 1fr;
  gap: clamp(24px, 4.4vw, 56px);
  align-items: center;
  padding-top: 8px;
}
.writing-feature + .writing-feature {
  border-top: 1px solid var(--site-line);
  margin-top: 24px;
  padding-top: 24px;
}
.content .view .writing-feature h3 {
  margin: 0 !important;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: -.045em;
}
.writing-feature h3 a:hover { text-decoration: underline; }
.content .writing-feature p { max-width: 43ch; margin: 14px 0 0; color: var(--site-muted); }
.read-link { display: inline-block; margin-top: 20px; font-size: 14px; font-weight: 650; text-decoration: underline; }
.content .signal { margin: 0; text-align: start; }
.content .signal img { display: block; width: 100%; height: auto; }
.content .signal figcaption {
  color: var(--site-quiet);
  margin-top: 12px;
  font: 12px/1.4 var(--site-mono);
}
.content .twitter-tweet-rendered > iframe {
  border-radius: 12px;
}
.content img.tracked-room-photo {
  width: 100%;
  aspect-ratio: 19 / 10;
  object-fit: cover;
  object-position: center bottom;
}
:is(.object-tracking-gallery, .usb-hub-gallery) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
}
.usb-hub-gallery {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
:is(.object-tracking-gallery, .usb-hub-gallery) img {
  aspect-ratio: 16 / 9;
  object-fit: contain;
}
.content .project-directory > ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.content .project-directory > ul + ul {
  border-top: 1px solid var(--site-line);
  margin-top: 28px;
  padding-top: 28px;
}
.content .project-directory li {
  min-width: 0;
  padding: 12px;
  margin: 0;
  border: 1px solid var(--site-line);
  border-radius: 6px;
  background: #111;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.content .project-directory li > p { margin: 0; }
.project-directory li:not(:has(img)) { align-self: start; }
.project-directory li img + br { display: none; }
.content .project-directory li > p + p { margin-top: 5px; color: var(--site-muted); font-size: 14px; }
.project-directory li img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 10px;
  border-radius: 3px;
  background: var(--site-bg);
}
.project-directory li img:is([src$="playback-offset.svg"], [src$="dokomi.png"], [src$="usb-hub-pcb.png"]) {
  object-fit: contain;
}
.project-directory li img[src$="dokomi.png"] { padding: 20px; }
.project-directory a { text-decoration: underline; text-decoration-color: var(--site-quiet); }
.project-directory a:hover { text-decoration-color: var(--site-text); }
.project-directory .past-project {
  position: relative;
  display: inline-block;
  width: 11px;
  height: 8px;
  margin-left: 7px;
  border: 1px solid var(--site-muted);
  border-radius: 2px;
}
.project-directory .past-project::before {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 1px;
  width: 7px;
  height: 6px;
  border: 1px solid var(--site-muted);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}
.view > .page-backlinks {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--site-line);
}
.content .view .page-backlinks h2 {
  margin: 0 0 12px !important;
  color: var(--site-muted);
  font: 400 13px/1.4 var(--site-mono);
  letter-spacing: .04em;
}
.content .view .page-backlinks ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  list-style: none;
}
.content .view .page-backlinks li { margin: 0; }
.page-backlinks a {
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: var(--site-quiet);
  overflow-wrap: anywhere;
}
.page-backlinks a:hover { text-decoration-color: var(--site-text); }

.site-footer {
  margin-top: 40px;
  padding-block: 24px;
  border-top: 1px solid var(--site-line);
}
.site-footer nav { gap: 10px 20px; }
.site-footer a { font-size: 13px; }

@media (max-width: 680px) {
  .writing-feature { grid-template-columns: 1fr; }
  .home-section { padding-block: 22px 28px; }
  .content .project-directory > ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 440px) {
  .header-inner { min-height: 64px; }
  .wordmark { font-size: 16px; }
  .site-nav { gap: 12px; }
  .site-nav a { font-size: 13px; }
  .site-footer nav { gap: 10px 16px; }
}
@media (max-width: 360px) {
  .content .project-directory > ul { grid-template-columns: 1fr; }
}
