@font-face { font-family: "Courier Prime"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../assets/fonts/courier-prime-400-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Courier Prime"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../assets/fonts/courier-prime-400-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Courier Prime"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(../assets/fonts/courier-prime-700-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Courier Prime"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(../assets/fonts/courier-prime-700-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@property --bg { syntax: "<color>"; inherits: true; initial-value: #173a6a; }
@property --ink { syntax: "<color>"; inherits: true; initial-value: #f2f5fa; }
@property --soft { syntax: "<color>"; inherits: true; initial-value: #b8c7e0; }
@property --dim { syntax: "<color>"; inherits: true; initial-value: #5578b0; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #ffd166; }
@property --rule { syntax: "<color>"; inherits: true; initial-value: #24497f; }

:root {
  --bg: #173a6a;
  --ink: #f2f5fa;
  --soft: #b8c7e0;
  --dim: #5578b0;
  --accent: #ffd166;
  --rule: #24497f;
  --mono: "Courier Prime", "Courier New", monospace;
  --text: var(--mono);
  --display: var(--text);
  color-scheme: dark;
  --cell: 12px;
  --row: 14px;
  --nav-h: 50px;
  --motd: 270px;
}
@media (max-width: 899px) {
  :root { --cell: 10px; --row: 12px; }
}
@media (max-width: 599px) {
  :root { --cell: 7px; --row: 8px; }
}

* { box-sizing: border-box; }
body {
  cursor: grab;
  transition: --bg 1.6s ease, --ink 1.6s ease, --soft 1.6s ease, --dim 1.6s ease, --accent 1.6s ease, --rule 1.6s ease;
}
body.night {
  --bg: #0b1d3a;
  --ink: #ffffff;
  --soft: #c5d3ea;
  --dim: #5a80b8;
  --accent: #ffd977;
  --rule: #17325c;
}
body.night #scene pre:nth-child(1) { text-shadow: 0 0 4px color-mix(in srgb, var(--dim) 70%, transparent); }
body.night #scene pre:nth-child(2) { text-shadow: 0 0 5px color-mix(in srgb, var(--ink) 45%, transparent); }
body.night #scene pre:nth-child(3) { text-shadow: 0 0 7px var(--accent), 0 0 2px var(--accent); }
body.night #scene pre:nth-child(n+4) { text-shadow: 0 0 5px color-mix(in srgb, currentColor 55%, transparent); }
body.seed { cursor: crosshair; }
body.dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.panel, .nav { cursor: auto; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--dim); text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

#scene {
  position: fixed; inset: 0; overflow: hidden;
  pointer-events: none; user-select: none; -webkit-user-select: none;
}
#scene pre {
  position: absolute; top: 0; left: 0; margin: 0;
  font: var(--cell)/var(--row) var(--mono);
  letter-spacing: 0; white-space: pre;
  font-variant-ligatures: none;
  -webkit-text-size-adjust: none; text-size-adjust: none;
}
#scene pre:nth-child(1) { color: var(--dim); }
#scene pre:nth-child(2) { color: var(--ink); }
#scene pre:nth-child(3) { color: var(--accent); }
#scene pre:nth-child(4) { color: #ff6f6f; }
#scene pre:nth-child(5) { color: #ffa860; }
#scene pre:nth-child(6) { color: #6fd8c8; }
#scene pre:nth-child(7) { color: #7cb3ff; }
#scene pre:nth-child(8) { color: #b59cff; }
#scene pre:nth-child(9) { color: #ff86d3; }

#caption {
  position: fixed; right: 20px; bottom: 14px; margin: 0;
  font-size: 11px; color: var(--soft); white-space: pre;
  max-width: calc(100vw - 40px); overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

#tip {
  position: fixed; left: 0; top: 0; z-index: 3; margin: 0;
  max-width: 24em; padding: 7px 10px;
  font-size: 12px; line-height: 1.5; color: var(--soft);
  background: var(--bg);
  border: 1px solid var(--rule);
  pointer-events: none; opacity: 0; transition: opacity 0.15s;
}
#tip.on { opacity: 1; }
#tip.chart { max-width: none; width: max-content; }
#tip .tip-text { width: 0; min-width: 100%; margin: 0 0 8px; }
#tip .tip-chart { margin: 0; font-size: inherit; line-height: 1.3; white-space: pre; }
#tip .tip-hint { width: 0; min-width: 100%; margin: 8px 0 0; color: color-mix(in srgb, var(--accent) 70%, var(--soft)); }
#tip .bar { color: var(--ink); }
#tip .now { color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .fig-note .fig-text {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
}

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; justify-content: flex-end; gap: 16px;
  padding: 14px 20px; font-size: 13px;
  background: linear-gradient(var(--bg) 40%, transparent);
}
.nav a { text-decoration: none; color: var(--soft); }
.nav a:hover, .nav a.on { color: var(--ink); }
.nav nav a.on { text-decoration: underline; text-underline-offset: 5px; }
.nav nav { display: flex; gap: 18px; }

main {
  position: relative; z-index: 1;
  width: min(36rem, calc(100% - 32px));
  margin-left: clamp(16px, 7vw, 110px);
  padding-top: calc(var(--nav-h) + 18px);
}
section { min-height: calc(100vh - var(--motd)); padding: 0 0 72px; scroll-margin-top: var(--motd); }
#top { height: calc(100vh + 240vh); padding: 0; }
#top .pin { position: sticky; top: var(--motd); height: calc(100vh - var(--motd)); padding: 0 0 24px; }
#top .panel { background: color-mix(in srgb, var(--bg) 62%, transparent); box-shadow: -24px 0 0 color-mix(in srgb, var(--bg) 62%, transparent); }
.panel {
  width: 100%; padding: 22px 24px 22px 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  box-shadow: -24px 0 0 color-mix(in srgb, var(--bg) 82%, transparent);
}

h1, h2, h3 { font-family: var(--display); }
h1 { font-size: clamp(30px, 5.2vw, 46px); line-height: 1.1; margin: 0 0 14px; font-weight: 700; }
h2 { font-size: 24px; font-weight: 700; line-height: 1.2; margin: 0 0 24px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
p { margin: 0 0 16px; }
.caret {
  display: inline-block; width: 0.6em; height: 1.15em; margin-left: 0.35em;
  vertical-align: text-bottom; background: currentColor;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.tty { font: 15px/1.5 var(--mono); color: var(--soft); }
.tty p, .tty h1, p.tty { margin: 0; }
.tty.ln, .tty .ln { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.tty.gap { height: 1.5em; }
.tty .ps { color: color-mix(in srgb, var(--accent) 70%, var(--soft)); }
.tty .cmd { color: var(--ink); }
.tty .cm { color: var(--soft); }
.tty .hide { visibility: hidden; }
.tty .cur { background: var(--ink); color: var(--bg); }
.tty .cur.blink { animation: blink 1.1s steps(1) infinite; }
.tty .caret { margin-left: 0; width: 0.6em; height: 1.2em; }
.tty .caret.solid { animation: none; }

#sshLine, #sshGap { position: relative; z-index: 3; }
.motd { position: sticky; top: var(--nav-h); z-index: 2; padding: 4px 0 6px; container-type: inline-size; }
.motd::before {
  content: ""; position: absolute; z-index: -1;
  top: calc(-1 * var(--nav-h)); bottom: -26px; left: -140px; right: -56px;
  background: var(--bg);
  -webkit-mask-image: linear-gradient(#000 calc(100% - 26px), transparent), linear-gradient(to right, #000 calc(100% - 56px), transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(#000 calc(100% - 26px), transparent), linear-gradient(to right, #000 calc(100% - 56px), transparent);
  mask-composite: intersect;
}
#name { font: inherit; margin: 0; }
#name .banner {
  display: block; white-space: pre; overflow: hidden;
  font: 700 min(12px, 100cqw / (var(--cols) * 0.6)) / 1.08 var(--mono);
  letter-spacing: 0; font-variant-ligatures: none;
}
#name .banner > span { display: block; }

.session { margin-bottom: 18px; }
.tty .lede { font: inherit; color: var(--ink); max-width: none; margin-bottom: 1.5em; }
.session .term { height: 9em; overflow: hidden; }
.session .term.scrolled { -webkit-mask-image: linear-gradient(transparent, #000 2.5em); mask-image: linear-gradient(transparent, #000 2.5em); }
.session .term .old { opacity: 0.55; }
.hero .hint, .hero .fig-note { transition: opacity 0.5s; }
.hero.boot .hint, .hero.boot .fig-note { opacity: 0; }

.cmdline {
  position: sticky; top: calc(var(--motd) + 26px); z-index: 1;
  padding: 4px 0; margin: -4px 0 12px;
  background: var(--bg);
  box-shadow: -24px 0 0 var(--bg), 0 -26px 0 var(--bg), -24px -26px 0 var(--bg);
}
.cmdline::after {
  content: ""; position: absolute; left: -24px; right: 0; top: 100%; height: 14px;
  background: linear-gradient(var(--bg), transparent); pointer-events: none;
}
.fig-window { display: none; }
.pending { opacity: 0; pointer-events: none; }
.tw-cur { background: var(--ink); color: var(--bg); }
.tw-rest { visibility: hidden; }
.lede { font-size: 17px; line-height: 1.55; max-width: 30em; }
.links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }

.hint { color: var(--soft); font-size: 12px; white-space: pre; margin: 0; }
.fig-note { color: var(--soft); font-size: 12px; line-height: 1.5; max-width: 34em; margin: 10px 0 0; }

.spot .tag { color: var(--soft); font-size: 13px; margin-bottom: 6px; }
.spot .spot-title { font-size: 17px; font-weight: 600; line-height: 1.4; margin: 0 0 8px; letter-spacing: 0; }
.spot .m { color: var(--soft); font-size: 12px; line-height: 1.5; }
.spot > p { font-size: 14px; }
.spot .prize { position: relative; padding-left: 16px; margin: 12px 0; line-height: 1.5; }
.spot .prize a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.spot .prize .mark { position: absolute; left: 0; top: 1px; color: var(--accent); font-family: var(--mono); }
.spot .prize .m { font-size: 12px; }
.theme { margin-bottom: 26px; }
.theme p { color: var(--soft); margin: 0; }
.theme .fields { color: var(--ink); font-size: 13px; margin: 0 0 6px; }

.filters { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 18px; }
.filters button {
  font: inherit; font-size: 13px; color: var(--soft); cursor: pointer;
  background: none; border: 0; padding: 2px 0;
}
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }

.pubs, .projects { list-style: none; margin: 0; padding: 0; }
.pubs li { display: grid; grid-template-columns: 3.2em 1fr; gap: 0 10px; padding: 12px 0; border-top: 1px solid var(--rule); }
.pubs .y { color: var(--soft); font-size: 13px; padding-top: 2px; }
.pubs .t { display: block; text-decoration: none; line-height: 1.45; }
.pubs .m { display: block; color: var(--soft); font-size: 12px; margin-top: 4px; line-height: 1.5; }
.pubs .c { color: var(--ink); white-space: nowrap; }
.awards li { grid-template-columns: 4.6em 1fr; }
.awards span.t { color: var(--ink); }

.astro-list {
  list-style: none; margin: 0 0 12px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(20ch, 1fr)); gap: 2px 1.5ch;
  font-size: 13px; line-height: 1.4;
}
.astro-list button {
  font: inherit; color: var(--ink); background: none; border: 0; padding: 1px 0; cursor: pointer; text-align: left;
}
.astro-list button:hover, .astro-list button:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.astro-list button[aria-current="true"] { color: var(--accent); }
.imgcat > .ln { margin: 0 0 8px; }
.imgcat .frame { display: block; position: relative; aspect-ratio: 16 / 9; background: var(--bg); cursor: pointer; }
.imgcat .frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.imgcat .frame:hover, .imgcat .frame:focus-visible { outline: 1px dashed var(--accent); outline-offset: 4px; }
.imgcat .cap { font-size: 12px; line-height: 1.45; color: var(--soft); margin: 6px 0 0; white-space: pre-wrap; }

.mail { max-width: 34em; }
.mail .intro { margin: 0 0 18px; color: var(--soft); }
.mail .row { display: flex; align-items: baseline; gap: 1ch; margin: 0 0 6px; }
.mail .row label { flex: none; width: 9ch; color: var(--soft); }
.mail input, .mail textarea {
  flex: 1; min-width: 0; font: inherit; color: var(--ink); caret-color: var(--accent);
  background: transparent; border: 0; border-bottom: 1px dashed var(--rule); border-radius: 0;
  padding: 2px 0; outline: none;
}
.mail input:focus, .mail textarea:focus { border-bottom-color: var(--accent); }
.mail input::placeholder { color: var(--dim); }
.mail .field { margin: 14px 0 0; }
.mail .field label { color: var(--soft); }
.mail .body { display: flex; gap: 1ch; margin-top: 4px; }
.mail .gt { color: color-mix(in srgb, var(--accent) 70%, var(--soft)); }
.mail textarea { resize: vertical; line-height: 1.5; border: 1px dashed var(--rule); padding: 4px 6px; }
.mail textarea:focus { border-color: var(--accent); }
.mail .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.mail .send { margin: 14px 0 0; }
.mail button {
  font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer;
}
.mail button:hover, .mail button:focus-visible { color: var(--ink); }
.mail button:disabled { color: var(--dim); cursor: wait; }
.mail .status { margin: 10px 0 0; white-space: pre-wrap; color: var(--ink); min-height: 1.5em; }
.mail .status.err { color: var(--accent); }

.projects li { padding: 14px 0; border-top: 1px solid var(--rule); }
.projects .head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.projects .stack { color: var(--dim); font-size: 12px; white-space: nowrap; }
.projects p { color: var(--soft); margin: 4px 0 6px; font-size: 14px; }
.projects .go { font-size: 12px; display: flex; gap: 16px; }

@media (max-width: 899px) {
  main { width: auto; margin: 0 16px; padding-top: calc(var(--nav-h) + 20px); }
  .nav { padding: 12px 16px; background: var(--bg); box-shadow: 0 1px 0 var(--rule); }
  .nav nav { gap: 12px; }
  .tty { font-size: 14px; }
  #term, #stageHint { display: none; }
  .hero.boot + .fig-window { visibility: hidden; }
  .motd { position: static; padding: 0 0 20px; }
  .motd::before { display: none; }
  section { min-height: 0; padding: 44px 0 0; }
  #top { height: auto; }
  #top .pin { position: static; height: auto; display: flex; flex-direction: column; padding: 0; }
  .panel, #top .panel { padding: 0; background: none; box-shadow: none; }
  #top .hero { display: contents; }
  #top .session { order: 0; margin: 0 0 8px; }
  #top .fig-window { order: 1; height: min(56vh, 104vw); margin: 0 -16px; }
  #top .fig-note { order: 2; margin: 4px 0 0; }
  .fig-window { display: block; position: relative; overflow: hidden; height: min(46vh, 88vw); margin: 0 -16px 20px; touch-action: pan-y; }
  .fig-window > #scene { position: absolute; inset: 0 0 20px 0; }
  .fig-window > #caption { position: absolute; left: 16px; right: 16px; bottom: 3px; text-align: center; font-size: 10px; }
  #work .fig-window, #awards .fig-window, #contact .fig-window, #astro .fig-window { display: none; }
  .nav nav { font-size: 12px; }
  .imgcat .frame { aspect-ratio: 3 / 2; }
  .mail { font-size: 16px; }
  #contact { min-height: calc(100vh - var(--motd)); min-height: calc(100svh - var(--motd)); }
  .cmdline { top: var(--motd); font-size: 15px; box-shadow: -16px 0 0 var(--bg), 16px 0 0 var(--bg); }
  .cmdline::after { left: -16px; right: -16px; }
  .cmdline .cmd { font-weight: 700; }
  .panel > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .spot .tag { display: none; }
  .panel { display: flex; flex-direction: column; }
  .panel > .cmdline { order: -2; }
  .panel > .fig-window, .panel > .fig-note { order: -1; }
  .panel > .fig-note { margin: -8px 0 22px; }
  .pubs li { display: block; padding: 14px 0; }
  .pubs .y { display: block; font-size: 12px; padding: 0; margin-bottom: 2px; }
  .pubs .t { font-size: 15px; }
  .projects .head { flex-direction: column; gap: 0; }
  .theme { margin-bottom: 22px; }
}
@media (max-height: 520px) {
  .motd { position: static; }
  #top .pin { position: static; height: auto; padding: 0 0 96px; }
}
@media (max-width: 420px) {
  .nav nav { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body { transition: none; }
  .caret { animation: none; }
  .tty .cur.blink { animation: none; }
  #tip { transition: none; }
}
@media print {
  #scene, #caption, #tip, .hint, .fig-note, .nav, .filters { display: none; }
  #top { height: auto; }
  #top .pin { position: static; height: auto; padding: 0; }
  body { background: #fff; color: #000; }
  section { min-height: 0; padding: 12px 0; }
  main { width: auto; margin: 0; }
  #name .banner, #sshLine, #sshGap, #lastLogin, #term, .cmdline, .motd::before { display: none; }
  .motd { position: static; }
  .pending { opacity: 1; }
  #name .sr-only { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; }
}
