/* Shared palette keeps the original light theme and adds a softer dark one. */
:root {
  color-scheme: light;
  --background: #fff;
  --text: #111;
  --muted: #6b6b6b;
  --border: #ddd;
  --surface: #f2f2f2;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #191919;
  --text: #e5e5e5;
  --muted: #aaa;
  --border: #444;
  --surface: #292929;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --background: #191919;
    --text: #e5e5e5;
    --muted: #aaa;
    --border: #444;
    --surface: #292929;
  }
}

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td {
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  font-weight: inherit;
  font-style: inherit;
  font-family: inherit;
  font-size: 100%;
  vertical-align: baseline;
}

body {
  line-height: 1;
  color: var(--text);
  background: var(--background);
}

ol,
ul {
  list-style: none;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  vertical-align: middle;
}

caption,
th,
td {
  text-align: left;
  font-weight: normal;
  vertical-align: middle;
}

a img {
  border: none;
}

input,
button {
  margin: 0;
  padding: 0;
  font: 16px 'PT Serif', 'STZhongsong', '华文中宋', 'Microsoft Yahei', serif;
}

input::-moz-focus-inner,
button::-moz-focus-inner {
  border: 0;
  padding: 0;
}

@font-face {
  font-family: FontAwesome;
  font-style: normal;
  font-weight: normal;
  font-display: swap;
  src: url("fonts/fontawesome-webfont.eot?v=#4.0.3");
  src: url("fonts/fontawesome-webfont.eot?#iefix&v=#4.0.3") format("embedded-opentype"), url("fonts/fontawesome-webfont.woff?v=#4.0.3") format("woff"), url("fonts/fontawesome-webfont.ttf?v=#4.0.3") format("truetype"), url("fonts/fontawesome-webfont.svg#fontawesomeregular?v=#4.0.3") format("svg");
}

html,
body,
#container {
  height: 100%;
}

body {
  background: var(--background);
  font: 16px 'PT Serif', 'STZhongsong', '华文中宋', 'Microsoft Yahei', serif;
  -webkit-text-size-adjust: 100%;
}

.outer {
  max-width: 800px;
  margin: 0 auto;
}

.outer:before,
.outer:after {
  content: "";
  display: table;
}

.outer:after {
  clear: both;
}

@media screen and (max-width: 839px) {
  .outer {
    padding: 0 20px;
  }
}

.left,
.alignleft {
  float: left;
}

.right,
.alignright {
  float: right;
}

.clear {
  clear: both;
}

#container {
  position: relative;
}

.logo {
  width: 94px;
  height: 57px;
  background-image: url("images/logo.png");
  -webkit-background-size: 74px 28px;
  -moz-background-size: 74px 28px;
  background-size: 74px 28px;
  background-position: left center;
  background-repeat: no-repeat;
}

.logo-text {
  width: auto;
  color: var(--text);
  font-size: 30px;
  line-height: 57px;
  margin-right: 25px;
  text-decoration: none;
  background-image: none;
}

.article-meta a,
a.article-title,
.article-entry a,
.article-more-link a,
#comments a,
.archive-year-wrap a,
.archive-category-wrap a,
.archive-tag-wrap a,
.archive-article-title,
#page-nav a,
#footer a,
.article-entry .gist .gist-file .gist-meta a,
.layout-wrap-inner .category-list a,
.tag-cloud a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
}

.article-meta a:hover,
a.article-title:hover,
.article-entry a:hover,
.article-more-link a:hover,
#comments a:hover,
.archive-year-wrap a:hover,
.archive-category-wrap a:hover,
.archive-tag-wrap a:hover,
.archive-article-title:hover,
#page-nav a:hover,
#footer a:hover,
.article-entry .gist .gist-file .gist-meta a:hover,
.layout-wrap-inner .category-list a:hover,
.tag-cloud a:hover {
  border-bottom-color: var(--text);
}

.article-entry a {
  border-bottom: 1px dotted var(--text);
}

.article-entry h1 {
  font-size: 2em;
}

.article-entry h2 {
  font-size: 1.5em;
}

.article-entry h3 {
  font-size: 1.3em;
}

.article-entry h4 {
  font-size: 1.2em;
}

.article-entry h5 {
  font-size: 1em;
}

.article-entry h6 {
  font-size: 1em;
  color: var(--muted);
}

.article-entry hr {
  border: 1px dashed var(--border);
}

.article-entry strong {
  font-weight: bold;
}

.article-entry em,
.article-entry cite {
  font-style: italic;
}

.article-entry sup,
.article-entry sub {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

.article-entry sup {
  top: -0.5em;
}

.article-entry sub {
  bottom: -0.2em;
}

.article-entry small {
  font-size: 0.85em;
}

.article-entry acronym,
.article-entry abbr {
  border-bottom: 1px dotted;
}

.article-entry ul,
.article-entry ol,
.article-entry dl {
  margin: 0 25px;
  line-height: 1.4em;
}

.article-entry ul ul,
.article-entry ol ul,
.article-entry ul ol,
.article-entry ol ol {
  margin-top: 0;
  margin-bottom: 0;
}

.article-entry ul {
  list-style: disc;
}

.article-entry ol {
  list-style: decimal;
}

.article-entry dt {
  font-weight: bold;
}

#header {
  font-size: 14px;
  position: relative;
  border-bottom: 1px solid var(--border);
}

#header.mobile-on #main-nav,
#header.mobile-on #sub-nav {
  display: block;
}

#header-outer {
  height: 100%;
  position: relative;
}

#header-inner {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
}

#main-nav {
  float: left;
  margin-left: -15px;
}

.main-nav-link,
#main-nav-toggle,
.search-form-submit {
  float: left;
  color: var(--text);
  text-decoration: none;
  -webkit-transition: opacity 0.2s;
  -moz-transition: opacity 0.2s;
  -ms-transition: opacity 0.2s;
  transition: opacity 0.2s;
  display: block;
  padding: 20px 10px;
}

.main-nav-link {
  font-weight: 300;
}

/* @media screen and (max-width: 839px) {
  .main-nav-link {
    float: none;
    text-align: center;
  }
} */
#main-nav-toggle {
  display: none;
  font-size: 16px;
  margin-left: -15px;
  font-family: FontAwesome;
}

#main-nav-toggle:before {
  content: "\f0c9";
}

@media screen and (max-width: 839px) {
  #main-nav-toggle {
    display: block;
  }
}

#logo {
  float: left;
}

/* @media screen and (max-width: 839px) {
  #logo {
    float: none;
    margin: 0 auto;
    display: block;
    background-position: center;
  }
} */
#sub-nav {
  float: right;
}

/* @media screen and (max-width: 839px) {
  #main-nav,
  #sub-nav {
    display: none;
    float: none;
  }
} */
#search-form-wrap {
  top: 15px;
  padding: 20px 15px;
}

@media screen and (max-width: 839px) {
  #search-form-wrap {
    text-align: center;
  }
}

.search-form:before,
.search-form:after {
  content: "";
  display: table;
}

.search-form:after {
  clear: both;
}

@media screen and (max-width: 839px) {
  .search-form {
    display: inline-block;
  }
}

.search-form-input {
  width: 150px;
  border: none;
  float: left;
  font-size: 14px;
  background: none;
  color: var(--text);
  outline: none;
}

.search-form-input::-webkit-search-results-decoration,
.search-form-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-form-submit {
  float: left;
  padding: 0;
  font-family: FontAwesome;
  border: none;
  background: none;
  cursor: pointer;
}

.article {
  margin: 50px 0;
  border-bottom: 1px solid var(--border);
}

.article-inner {
  margin-bottom: 15px;
  overflow: hidden;
}

.article-meta:before,
.article-meta:after {
  content: "";
  display: table;
}

.article-meta:after {
  clear: both;
}

.article-meta a {
  color: var(--muted);
}

.article-date {
  float: left;
}

.article-category {
  float: left;
  margin-left: 8px;
  color: var(--muted);
}

.article-category:before {
  content: "\2022";
}

.article-category span {
  margin-left: 8px;
}

.article-category-link {
  margin-left: 8px;
}

.article-comment-link-wrap {
  float: left;
  margin-left: 8px;
  color: var(--muted);
}

.article-comment-link-wrap:before {
  content: "\2022";
}

.article-comment-link {
  margin-left: 8px;
}

.article-header {
  margin-bottom: 10px;
}

.article-title {
  font-size: 1.7em;
  font-weight: 500;
  line-height: 1em;
}

.article-entry {
  color: var(--text);
  padding: 0;
}

.article-entry:before,
.article-entry:after {
  content: "";
  display: table;
}

.article-entry:after {
  clear: both;
}

.article-entry p,
.article-entry table {
  line-height: 1.4em;
  margin: 1.4em 0;
}

.article-entry h1,
.article-entry h2,
.article-entry h3,
.article-entry h4,
.article-entry h5,
.article-entry h6 {
  font-weight: 600;
  line-height: 1.4em;
  margin: 1em 0;
}

.article-entry ul,
.article-entry ol,
.article-entry dl {
  margin-top: 1.4em;
  margin-bottom: 1.4em;
}

.article-entry img,
.article-entry video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: auto;
}

.article-entry iframe {
  border: none;
}

.article-entry table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

.article-entry th {
  font-weight: 600;
  border-bottom: 3px solid var(--border);
  padding-bottom: 0.5em;
}

.article-entry td {
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.article-entry blockquote {
  font-family: 'PT Serif', 'STZhongsong', '华文中宋', 'Microsoft Yahei', serif;
  font-size: 1.4em;
  margin: 1.4em 20px;
  text-align: center;
}

.article-entry blockquote footer {
  font-size: 16px;
  margin: 1.4em 0;
  font-family: font-sans;
}

.article-entry blockquote footer cite:before {
  content: "—";
  padding: 0 0.5em;
}

.article-entry .pullquote {
  text-align: left;
  width: 45%;
  margin: 0;
}

.article-entry .pullquote.left {
  margin-left: 0.5em;
  margin-right: 1em;
}

.article-entry .pullquote.right {
  margin-right: 0.5em;
  margin-left: 1em;
}

.article-entry .caption {
  color: var(--muted);
  display: block;
  font-size: 0.9em;
  margin-top: 0.5em;
  position: relative;
  text-align: center;
}

.article-entry .video-container {
  position: relative;
  padding-top: 56.25%;
  height: 0;
  overflow: hidden;
}

.article-entry .video-container iframe,
.article-entry .video-container object,
.article-entry .video-container embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin-top: 0;
}

.article-more-link a {
  color: var(--muted);
  border-bottom-color: var(--muted);
}

.article-footer {
  font-size: 0.85em;
  padding: 1.4em 0;
  line-height: 1.4em;
  margin: 0;
}

.article-footer:before,
.article-footer:after {
  content: "";
  display: table;
}

.article-footer:after {
  clear: both;
}

.article-footer a {
  color: var(--muted);
  text-decoration: none;
}

.article-footer a:hover {
  color: var(--text);
}

.article-tag-list-item {
  float: left;
  margin-right: 10px;
}

.article-tag-list-link:before {
  content: "#";
}

#article-nav {
  position: relative;
  margin: 20px 0;
}

#article-nav:before,
#article-nav:after {
  content: "";
  display: table;
}

#article-nav:after {
  clear: both;
}

.article-nav-link-wrap {
  text-decoration: none;
  text-shadow: 0 1px var(--background);
  color: var(--muted);
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  text-align: center;
  display: block;
}

.article-nav-link-wrap:hover {
  color: var(--text);
}

@media screen and (min-width: 840px) {
  .article-nav-link-wrap {
    width: 50%;
    margin-top: 0;
    margin-top: 50px;
  }
}

#article-nav-newer {
  float: left;
  text-align: left;
}

#article-nav-older {
  float: right;
  text-align: right;
}

.article-nav-caption {
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--border);
  line-height: 1em;
  font-weight: 600;
}

#article-nav-newer .article-nav-caption {
  margin-right: -2px;
}

.article-nav-title {
  font-size: 0.85em;
  line-height: 1.4em;
  margin-top: 0.5em;
}

.article-gallery {
  background: var(--text);
  position: relative;
}

.article-gallery-photos {
  position: relative;
  overflow: hidden;
}

.article-gallery-img {
  display: none;
  max-width: 100%;
}

.article-gallery-img:first-child {
  display: block;
}

.article-gallery-img.loaded {
  position: absolute;
  display: block;
}

.article-gallery-img img {
  display: block;
  max-width: 100%;
  margin: 0 auto;
}

.article-toc {
  display: none;
  position: fixed;
  left: 50%;
  top: 110px;
  font-size: 0.9em;
  width: 260px;
  margin-left: 400px;
  padding-left: 20px;
  overflow-y: auto;
  line-height: 1.4em;
  max-height: 85%;
}

.article-toc h3 {
  font-weight: bold;
  margin-left: 20px;
}

.article-toc li {
  list-style: none;
  margin-left: 20px;
  margin-top: 2px;
}

.article-toc li a {
  color: var(--text);
  text-decoration: none;
}

.article-toc li a.active {
  font-weight: bold;
}

@media screen and (min-width: 1400px) {
  .article-toc {
    display: block;
  }
}

#comments {
  margin: 50px 0;
}

.archives-wrap {
  margin: 50px 0;
}

.archives:before,
.archives:after {
  content: "";
  display: table;
}

.archives:after {
  clear: both;
}

.archive-year-wrap,
.archive-category-wrap,
.archive-tag-wrap {
  font-size: 1.4em;
  margin-bottom: 1em;
}

.archives {
  margin-left: 5px;
  border-left: 1px solid var(--border);
}

.archive-article-inner {
  padding: 10px 10px 10px 12px;
  margin: 15px 0 15px -2px;
  border-left: 3px solid transparent;
}

.archive-article-inner:hover {
  border-left-color: var(--text);
}

.archive-article-footer {
  margin-top: 1em;
}

.archive-article-date {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85em;
  line-height: 1em;
  margin-bottom: 0.5em;
  display: block;
}

#page-nav {
  margin: 50px auto;
  text-align: center;
  overflow: hidden;
}

#page-nav:before,
#page-nav:after {
  content: "";
  display: table;
}

#page-nav:after {
  clear: both;
}

#page-nav a,
#page-nav span {
  width: 36px;
  height: 36px;
  margin: 0 5px;
  line-height: 36px;
  text-align: center;
}

#page-nav a.prev,
#page-nav a.next {
  margin: 0;
  width: auto;
}

#page-nav .prev {
  float: left;
}

#page-nav .next {
  float: right;
}

#page-nav .page-number {
  display: inline-block;
}

#page-nav .current {
  color: var(--background);
  border-radius: 18px;
  background-color: var(--text);
}

#page-nav .space {
  color: var(--border);
}

#footer {
  padding: 50px 0;
  text-align: center;
}

#footer a {
  font-weight: 600;
}

#footer-info {
  line-height: 1.4em;
  font-size: 0.85em;
}


.article-entry .highlight {
  margin: 0;
  font-size: 14px;
  background: #23241f;
  padding: 15px 0;
  overflow: auto;
  color: #fff;
  line-height: 22.4px;
}

.article-entry .highlight .gutter pre,
.article-entry .gist .gist-file .gist-data .line-numbers {
  color: #666;
  font-size: 0.85em;
}

.article-entry pre,
.article-entry code {
  font-family: "Source Code Pro", Consolas, Monaco, Menlo, Consolas, monospace, '华文中宋';
}

.article-entry code {
  background: var(--surface);
  padding: 0 0.3em;
}

.article-entry pre {
  padding: 20px;
}

.article-entry pre code {
  background: none;
  text-shadow: none;
  padding: 0;
}

.article-entry pre .highlight {
  padding: 0;
}

.article-entry .highlight pre {
  border: none;
  margin: 0;
  padding: 0 20px;
}

.article-entry .highlight table {
  margin: 0;
  width: auto;
}

.article-entry .highlight td {
  border: none;
  padding: 0;
}

.article-entry .highlight figcaption {
  font-size: 0.85em;
  color: highlight-comment;
  line-height: 1em;
  margin-bottom: 1em;
}

.article-entry .highlight figcaption:before,
.article-entry .highlight figcaption:after {
  content: "";
  display: table;
}

.article-entry .highlight figcaption:after {
  clear: both;
}

.article-entry .highlight figcaption a {
  float: right;
}

.article-entry .highlight .gutter pre {
  text-align: right;
}

.article-entry .highlight .line {
  height: 22.4px;
}

.article-entry .gist {
  margin: 0;
  padding: 15px 0;
}

.article-entry .gist .gist-file {
  border: none;
  font-family: "Source Code Pro", Consolas, Monaco, Menlo, Consolas, monospace, '华文中宋';
  margin: 0;
}

.article-entry .gist .gist-file .gist-data {
  background: none;
  border: none;
}

.article-entry .gist .gist-file .gist-data .line-numbers {
  background: none;
  border: none;
  padding: 0 20px 0 0;
}

.article-entry .gist .gist-file .gist-data .line-data {
  padding: 0 !important;
}

.article-entry .gist .gist-file .highlight {
  margin: 0;
  padding: 0;
  border: none;
}

.article-entry .gist .gist-file .gist-meta {
  background: highlight-background;
  color: highlight-comment;
  font: 0.85em font-sans;
  text-shadow: 0 0;
  padding: 0;
  margin-top: 1em;
}

.article-entry .gist .gist-file .gist-meta a {
  font-weight: normal;
}

.article-entry .gist .gist-file .gist-meta a:hover {
  text-decoration: underline;
}

pre .tag,
pre .css .rules,
pre .css .value,
pre .css .function,
pre .preprocessor,
pre .pragma {
  color: #f8f8f2;
}

pre .strongemphasis,
pre .strong,
pre .emphasis {
  color: #a8a8a2;
}

pre .bullet,
pre .blockquote,
pre .horizontal_rule,
pre .number,
pre .regexp,
pre .alias .keyword,
pre .literal,
pre .hexcolor {
  color: #ae81ff;
}

pre .tag .value,
pre .code,
pre .title,
pre .css .class,
pre .class .title:last-child {
  color: #a6e22e;
}

pre .link_url {
  font-size: 80%;
}

pre .strong,
pre .strongemphasis {
  font-weight: bold;
}

pre .emphasis,
pre .strongemphasis,
pre .class .title:last-child {
  font-style: italic;
}

pre .keyword,
pre .function,
pre .change,
pre .winutils,
pre .flow,
pre .nginx .title,
pre .tex .special,
pre .header,
pre .attribute,
pre .symbol,
pre .symbol .string,
pre .tag .title,
pre .value,
pre .alias .keyword:first-child,
pre .css .tag,
pre .css .unit,
pre .css .important {
  color: #f92672;
}

pre .function .keyword,
pre .class .keyword:first-child,
pre .constant,
pre .css .attribute {
  color: #66d9ef;
}

pre .variable,
pre .params,
pre .class .title {
  color: #f8f8f2;
}

pre .string,
pre .css .id,
pre .subst,
pre .type,
pre .ruby .class .parent,
pre .built_in,
pre .django .template_tag,
pre .django .variable,
pre .smalltalk .class,
pre .django .filter .argument,
pre .smalltalk .localvars,
pre .smalltalk .array,
pre .attr_selector,
pre .pseudo,
pre .addition,
pre .stream,
pre .envvar,
pre .apache .tag,
pre .apache .cbracket,
pre .tex .command,
pre .prompt,
pre .link_label,
pre .link_url {
  color: #e6db74;
}

pre .comment,
pre .javadoc,
pre .annotation,
pre .decorator,
pre .template_comment,
pre .pi,
pre .doctype,
pre .deletion,
pre .shebang,
pre .apache .sqbracket,
pre .tex .formula {
  color: #75715e;
}

pre .coffeescript .javascript,
pre .javascript .xml,
pre .tex .formula,
pre .xml .javascript,
pre .xml .vbscript,
pre .xml .css,
pre .xml .cdata,
pre .xml .php,
pre .php .xml {
  opacity: 0.5;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 24px;
}

.video-card-link {
  display: block;
  color: var(--text);
  text-decoration: none;
}

.video-thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
}

.video-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.2);
  font-size: 32px;
  opacity: 0;
  transition: opacity 150ms;
}

.video-card-link:hover .video-play,
.video-card-link:focus-visible .video-play {
  opacity: 1;
}

.video-card-title {
  margin: 12px 0 6px;
  font-size: 1em;
  font-weight: 400;
  line-height: 1.4;
}

.video-card-date {
  color: var(--muted);
  font-size: 0.85em;
}

@media screen and (max-width: 760px) {
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 480px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
}

.layout-wrap {
  margin: 50px 0;
}

.layout-title {
  font-size: 1.4em;
  margin-bottom: 1em;
}

.layout-wrap-inner .category-list,
.layout-wrap-inner .category-list-child {
  line-height: 1.8em;
}

.layout-wrap-inner .category-list:before,
.layout-wrap-inner .category-list-child:before,
.layout-wrap-inner .category-list:after,
.layout-wrap-inner .category-list-child:after {
  content: "";
  display: table;
}

.layout-wrap-inner .category-list:after,
.layout-wrap-inner .category-list-child:after {
  clear: both;
}

.layout-wrap-inner .category-list-child {
  margin-left: 24px;
}

.layout-wrap-inner li:before {
  content: '>';
  float: left;
  padding: 0 16px 0 0;
}

.layout-wrap-inner .category-list-count {
  margin-left: 8px;
  color: var(--muted);
}

.layout-wrap-inner .category-list-count:before {
  content: '(';
}

.layout-wrap-inner .category-list-count:after {
  content: ')';
}

.tag-cloud a {
  margin-right: 8px;
}

.tag-cloud a:before {
  content: '#';
}

.fancybox-skin {
  padding: 0 !important;
  border-radius: 0;
  font-family: 'PT Serif', 'STZhongsong', '华文中宋', 'Microsoft Yahei', serif;
}

.fancybox-skin .fancybox-title .child {
  background: none;
  font-weight: 400;
  font-size: 16px;
  font-family: 'PT Serif', 'STZhongsong', '华文中宋', 'Microsoft Yahei', serif;
  text-shadow: 1px 3px 3px rgba(0, 0, 0, 0.5);
}

/* Project metadata uses the theme's muted article styling. */
.project-status { float: left; color: var(--muted); }
.project-external-links, .article-entry .project-external-links { display: flex; flex-wrap: wrap; gap: 16px; list-style: none; padding: 0; margin: 12px 0 20px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.main-nav-link[aria-current] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

/* Keep keyboard navigation visible without adding outlines to pointer clicks. */
a:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-list-item { margin: 0 0 12px; }
.project-list-item:last-child { margin-bottom: 0; }
.project-list + .project-list { margin-top: 12px; }
.project-list-item .article-entry { margin-left: 40px; }

/* Keep the footer at the viewport bottom when a page has little content. */
#container {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
}

#main {
  flex: 1 0 auto;
  width: 100%;
  box-sizing: border-box;
}

#header,
#footer {
  flex-shrink: 0;
}

.project-title-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 0;
  box-sizing: border-box;
  line-height: 1.5;
  width: fit-content;
  max-width: 100%;
}

.project-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.project-icon-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
}
.project-title-link > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.project-icon { display: block; }
.project-page .article-meta { display: flex; align-items: baseline; flex-wrap: wrap; }
.project-page .article-meta a { display: inline-block; padding-block: 6px; }
.project-page .archives { border: 0; margin-left: 0; }
.project-page .archive-article-inner { border: 0; margin-left: 0; padding-left: 0; }
.project-page .archive-article-title { display: inline-block; padding-block: 6px; }
.project-page .archive-article-date { margin-bottom: 0; }

#header-inner { overflow: visible; align-items: center; }
#main-nav { display: flex; align-items: center; flex-wrap: wrap; margin-left: 0; }
.main-nav-link { float: none; display: inline-flex; align-items: center; }
@media screen and (max-width: 600px) {
  #header-inner { flex-direction: column; align-items: flex-start; }
  #logo { margin-right: 0; }
  #main-nav { width: 100%; gap: 0 20px; padding-bottom: 8px; }
  .main-nav-link { padding: 12px 0; min-height: 44px; box-sizing: border-box; }
  .projects-index { margin: 32px 0; }
}

.project-list-item[data-project="billy"] .project-icon,
.project-list-item[data-project="poopee"] .project-icon {
  border-radius: 6px;
}

/* A compact icon control matches the existing navigation. */
.theme-toggle {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); }
.theme-toggle:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}
::selection { background: var(--text); color: var(--background); }
@media screen and (max-width: 600px) {
  .theme-toggle { padding-inline: 0; }
}

/* Preserve brand artwork while keeping black icons visible in either theme. */
.project-icon { background: #fff; border-radius: 4px; }

.theme-toggle[hidden], .theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: block; }
:root[data-theme="dark"] .theme-icon-moon { display: none; }

/* Fade the palette after the first paint, keeping initial loads flash-free. */
@media (prefers-reduced-motion: no-preference) {
  .theme-ready body,
  .theme-ready #header,
  .theme-ready .article,
  .theme-ready .article-entry,
  .theme-ready .article-entry code,
  .theme-ready .article-entry hr,
  .theme-ready .article-entry th,
  .theme-ready .article-entry td,
  .theme-ready .article-meta,
  .theme-ready .article-meta *,
  .theme-ready .article-category,
  .theme-ready .article-nav-caption,
  .theme-ready .archive-article-date,
  .theme-ready .archives,
  .theme-ready .archive-article-inner,
  .theme-ready .project-status,
  .theme-ready .video-card-date,
  .theme-ready .video-card-thumbnail,
  .theme-ready a,
  .theme-ready button {
    transition: background-color 300ms ease-out, color 300ms ease-out,
                border-color 300ms ease-out, outline-color 300ms ease-out,
                opacity 200ms ease;
  }
}

/* Keep the blog navigation above the full-height photo archive. */
.photos-page #container {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}
#photos-main { flex: 1 1 auto; min-height: 0; }
#photos-main iframe { display: block; width: 100%; height: 100%; border: 0; }
