@font-face {
  font-family: 'Jacquard 24';
  src: url('./fonts/Jacquard24-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root {
  --main-width: 43rem;
  --page-gutter: clamp(1.25rem, 5vw, 4rem);
  color-scheme: light;
  --paper: rgb(240, 244, 248);
  --ink: #30312d;
  --muted: #62635c;
  --rule: #888980;
  --sky-ink: 41 70 111;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.75;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body {
  position: relative;
  isolation: isolate;
  margin: 0;
  padding: 0 var(--page-gutter);
  min-width: 280px;
  min-height: 100vh;
  background: var(--paper);
}
/* Opaque 4px tile: 37.5% Bayer coverage, with paper and multiply colors baked in. */
body, .site-menu {
  background-image: url('./sky-tile.png');
  background-size: 4px 4px;
  background-repeat: repeat;
  background-position: 0 0;
  image-rendering: pixelated;
}
/* Keep tile scaling crisp without changing image/canvas rendering in content. */
body > *, .site-menu > * { image-rendering: auto; }
/* A fixed paper veil fades the pattern without moving its document-aligned dots. */
body::before, .site-menu::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom,
    rgb(240 244 248 / 1), rgb(240 244 248 / .83) 25%,
    rgb(240 244 248 / .59) 50%, rgb(240 244 248 / .31) 75%,
    rgb(240 244 248 / 0));
}
.site-sky {
  position: absolute;
  z-index: -1;
  inset: 0;
  --sky-gutter: max(var(--page-gutter), (100% - var(--main-width)) / 2);
  --sky-band-height: round(nearest, max(300px, 100svh), 1px);
  overflow: clip;
  pointer-events: none;
  color: rgb(var(--sky-ink) / .439216);
  mix-blend-mode: multiply;
}
.sky-band {
  position: absolute;
  top: calc(var(--band-index) * var(--sky-band-height));
  width: 100%;
  height: var(--sky-band-height);
}
.sky-star {
  position: absolute;
  width: 1px;
  height: 1px;
  left: calc(round(nearest, var(--star-side) * (100% - var(--sky-gutter)) + var(--star-x) * var(--sky-gutter), 1px) - var(--star-half));
  top: calc(round(nearest, var(--star-y), 1px) - var(--star-half));
}
@media (prefers-reduced-motion: no-preference) {
  .sky-star {
    animation: star-twinkle var(--twinkle-duration, 6s) ease-in-out var(--twinkle-delay, 0s) infinite;
  }
}
@keyframes star-twinkle {
  0%, 100% { opacity: .08; }
  45% { opacity: 1; }
  70% { opacity: .35; }
}
/* Keep the original border's layout space; draw its pixels on the shared grid. */
.pixel-rule { border-color: transparent !important; }
.pixel-rule:not(.top-bar) { position: relative; }
.pixel-rule::after {
  content: '';
  position: absolute;
  pointer-events: none;
  left: var(--rule-left);
  top: var(--rule-top);
  width: var(--rule-width);
  height: 1px;
  background: repeating-linear-gradient(to right, var(--rule) 0 1px, transparent 1px 2px);
  background-size: 2px 1px;
  background-repeat: repeat-x;
  background-position-x: var(--rule-phase);
}
::selection { background: #30312d; color: #e5e5df; }
a { color: inherit; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }
.skip-link { position: absolute; top: -5rem; }
.skip-link:focus { top: .5rem; background: var(--paper); z-index: 3; }
.site-header { max-width: 72rem; margin: 0 auto; }
.social-links { display: flex; align-items: center; gap: .6rem; }
.social-links a { display: grid; place-items: center; width: 36px; height: 36px; }
.social-links img { display: block; opacity: .8; }
.social-links a:hover img { opacity: 1; }

/* Top bar */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  max-width: 72rem;
  margin: 0 auto;
  background: var(--paper);
}
.top-bar, .site-menu-bar {
  display: flex;
  align-items: center;
  gap: .9rem;
  min-height: 3.5rem;
  padding: .6rem 0;
  border-bottom: 1px dashed var(--rule);
}
.amagi-icon {
  display: block;
  width: 28px;
  height: 28px;
  background: currentColor;
  -webkit-mask: url('./icons/amagi.png') center / contain no-repeat;
  mask: url('./icons/amagi.png') center / contain no-repeat;
}
.top-bar-home, .site-menu-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  margin-left: -4px;
}
.top-bar-title {
  font-family: 'Jacquard 24', Georgia, serif;
  font-size: 1.75rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  visibility: hidden;
}
.top-bar.is-scrolled .top-bar-title { visibility: visible; }
.menu-button, .menu-close {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin-left: auto;
  padding: .5rem 0 .5rem .5rem;
  border: 0;
  background: none;
  font-size: .8rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.menu-button:hover:not(:disabled), .menu-close:hover:not(:disabled) {
  background: none;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: .25em;
}
.menu-button-lines { width: 18px; height: 9px; border-top: 1.5px solid; border-bottom: 1.5px solid; }
.menu-close-x { position: relative; width: 18px; height: 18px; }
.menu-close-x::before, .menu-close-x::after {
  content: '';
  position: absolute;
  top: 50%;
  left: -1px;
  width: 20px;
  border-top: 1.5px solid;
  transform: rotate(45deg);
}
.menu-close-x::after { transform: rotate(-45deg); }
@media (prefers-reduced-motion: no-preference) {
  .top-bar-home:hover .amagi-icon { animation: icon-spin .6s cubic-bezier(.2, .8, .2, 1); }
}
@keyframes icon-spin {
  from { transform: rotate(0); }
  to { transform: rotate(-1turn); }
}

/* Full-screen menu */
.site-menu {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0 var(--page-gutter) 3rem;
  border: 0;
  overflow-y: auto;
  color: var(--ink);
  background-color: var(--paper);
  background-attachment: local;
  isolation: isolate;
}
.site-menu::backdrop { background: none; }
body:has(.site-menu[open]) { overflow: hidden; }
.site-menu-bar, .site-menu-body { max-width: 72rem; margin: 0 auto; }
.site-menu-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(2rem, 6vw, 6rem);
  row-gap: 3rem;
  padding-top: clamp(2rem, 6vh, 4rem);
}
.site-menu-pages { grid-row: span 2; }
/* On a desktop the entries deserve the room; narrower screens keep even columns
   so the wordmark and the big page links still fit. */
@media (min-width: 900px) {
  .site-menu-body { grid-template-columns: 1fr 3fr; }
}
.site-menu-wordmark {
  display: block;
  font-family: 'Jacquard 24', Georgia, serif;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  line-height: 1;
  margin-bottom: 2rem;
}
.site-menu-primary { display: flex; flex-direction: column; align-items: flex-start; }
.site-menu-primary a {
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  line-height: 1.1;
  letter-spacing: -.04em;
  text-decoration: none;
  padding: .1em 0;
}
.site-menu-primary a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.site-menu h2 { display: flex; justify-content: space-between; gap: 1rem; }
.site-menu h2 a { color: var(--muted); }
.site-menu h2 {
  font-family: 'Courier New', Courier, monospace;
  font-size: .75rem;
  line-height: 1.6;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 0 0 .5rem;
  padding-bottom: .5rem;
  border-bottom: 1px dashed var(--rule);
}
.site-menu ul { list-style: none; margin: 0; padding: 0; }
.site-menu li { display: flex; gap: 1rem; align-items: baseline; padding: .55rem 0; border-bottom: 1px dashed var(--rule); }
.site-menu-recent time, .site-menu-elsewhere span { font-family: 'Courier New', Courier, monospace; font-size: .75rem; color: var(--muted); flex: none; }
.site-menu-recent time { width: 6rem; }
.site-menu-elsewhere span { margin-left: auto; }
.site-menu li a { text-decoration: none; line-height: 1.35; }
.site-menu li a:hover { text-decoration: underline; }
.site-menu .social-links { margin-top: 1.2rem; margin-left: -8px; }
@media (prefers-reduced-motion: no-preference) {
  .site-menu[open] { animation: menu-in .25s ease-out both; }
  .site-menu[open] .site-menu-body { animation: menu-rise .35s cubic-bezier(.2, .8, .2, 1) both; }
}
@keyframes menu-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes menu-rise { from { transform: translateY(1rem); } to { transform: none; } }
@media (forced-colors: active) {
  .amagi-icon { forced-color-adjust: none; background: LinkText; }
  .site-menu-bar .amagi-icon { background: CanvasText; }
}

.masthead {
  min-width: 190px;
  text-decoration: none;
  display: block;
  width: 90%;
  max-width: calc(var(--main-width) * .9);
  margin: 2.7rem auto 3.2rem;
  font-family: 'Jacquard 24', Georgia, serif;
  font-size: clamp(3rem, 11vw, 7rem);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}
.masthead-ink, .top-bar-title-ink {
  display: block;
  position: relative;
  overflow: clip;
  overflow-clip-margin: 1px;
  width: calc(190em / 43);
  max-width: 100%;
  height: 1em;
}
.masthead-ink { min-width: 190px; width: 100%; height: auto; aspect-ratio: 190 / 43; }
.masthead-reveal, .masthead-reveal svg { display: block; width: 100%; height: 100%; }
.title-canvas { position: absolute; left: 0; top: 0; max-width: none; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .title-pending .masthead-reveal { opacity: 0; }
}
.has-title-canvas > .masthead-reveal { opacity: 0; }
@media (forced-colors: active), print {
  .title-canvas { display: none; }
  .title-pending .masthead-reveal, .has-title-canvas > .masthead-reveal { opacity: 1; }
}
@media (forced-colors: active) {
  .masthead { color: LinkText; }
}
main { max-width: var(--main-width); margin: 0 auto; min-height: 35vh; }
h1, h2, h3 { font-weight: 400; line-height: 1.15; }
h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); letter-spacing: -.04em; margin: .9rem 0 1.8rem; }
h2 { font-size: 1.65rem; margin: 2.8rem 0 1rem; letter-spacing: -.025em; }
h3 { font-size: 1.3rem; }
p { margin: 1.1rem 0; }
article { font-size: 1.125rem; }
article > time, .index-heading, .posts time, .site-footer {
  font-family: 'Courier New', Courier, monospace;
  font-size: .75rem;
  line-height: 1.6;
}
article > time { display: block; color: var(--muted); letter-spacing: .06em; }
article > h1 { padding-bottom: 1.7rem; border-bottom: 1px dashed var(--rule); }
pre { overflow-x: auto; padding: 1.15rem; border: 1px dashed var(--rule); background: #c8c8c240; line-height: 1.6; }
code { font-family: 'Courier New', Courier, monospace; font-size: .84em; }
:not(pre) > code { background: #bfc0b74d; padding: .12em .3em; }
/* Syntax highlighting (build-time highlight.js classes), muted to match the ink. */
.hljs-comment, .hljs-quote { color: #7c7d74; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-meta .hljs-keyword { color: #7a3e5c; }
.hljs-string, .hljs-regexp, .hljs-template-tag, .hljs-meta .hljs-string { color: #3f6b3a; }
.hljs-number, .hljs-literal, .hljs-symbol, .hljs-variable.constant_ { color: #9a5a1c; }
.hljs-attr, .hljs-property, .hljs-attribute { color: #29466f; }
.hljs-title, .hljs-title.function_, .hljs-title.class_, .hljs-type { color: #5a4a8a; }
.hljs-tag, .hljs-name, .hljs-meta, .hljs-subst, .hljs-params, .hljs-punctuation { color: inherit; }
.hljs-name { color: #7a3e5c; }
.hljs-meta { color: #62635c; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: bold; }
button, input { font: inherit; color: var(--ink); border: 1px solid var(--ink); border-radius: 0; padding: .5rem 1rem; background: transparent; max-width: 100%; }
button { cursor: pointer; font-size: 1rem; }
button:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
button:disabled { opacity: .55; cursor: wait; }
output { font-family: 'Courier New', Courier, monospace; font-size: .85rem; padding-top: .5rem; }
img, video, canvas, iframe { max-width: 100%; }
figcaption { text-align: center; color: var(--muted); }
iframe { display: block; width: 100%; border: 1px dashed var(--rule); margin: 1.5rem auto; }
blockquote { border-left: 1px solid var(--rule); margin-left: 0; padding-left: 1.5rem; }
/* Embed scripts can set inline margins, so override their horizontal alignment. */
.twitter-tweet, twitter-widget, .instagram-media, .bluesky-embed {
  margin-left: auto !important;
  margin-right: auto !important;
}
blockquote.twitter-tweet { width: 100%; max-width: 550px; }
.twitter-tweet-rendered { justify-content: center; }
.index { padding-top: .5rem; }
.index-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 1.5rem; }
.index-heading h1 { font: inherit; margin: 0; letter-spacing: inherit; }
.index-heading span { color: var(--muted); }
.posts { list-style: none; padding: 0; margin: 0; border-top: 1px dashed var(--rule); }
.posts li { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; align-items: baseline; padding: 1.8rem 0; border-bottom: 1px dashed var(--rule); }
.posts time { color: var(--muted); }
.posts a { font-size: 1.55rem; line-height: 1.25; text-decoration: none; }
.posts a:hover { text-decoration: underline; }
.site-footer { max-width: 72rem; margin: 5rem auto 0; padding: 1.4rem 0 2rem; border-top: 1px dashed var(--rule); display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: var(--muted); }
.site-footer .social-links { margin-left: -8px; }
.site-footer-links { display: flex; gap: 1.5rem; }
@media (max-width: 520px) {
  .masthead { margin: 2.2rem auto 2.5rem; }
  article { font-size: 1.05rem; }
  .posts li { grid-template-columns: 1fr; gap: .6rem; }
  .site-footer { flex-direction: column; align-items: flex-start; margin-top: 3.5rem; }
  .top-bar-title { font-size: 1.5rem; }
  .site-menu-body { grid-template-columns: 1fr; row-gap: 2.5rem; }
  .site-menu-pages { grid-row: auto; }
  .site-menu-recent time { width: auto; }
  .site-menu-recent li { flex-direction: column; gap: .2rem; }
}
@media (forced-colors: active), print {
  body, .site-menu { background-image: none; }
  .site-sky, body::before, .site-menu::before { display: none; }
  .pixel-rule::after { display: none; }
  .pixel-rule { border-color: currentColor !important; }
}
