@font-face {
  font-family: "Iosevka";
  src: url("assets/fonts/iosevka-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Iosevka";
  src: url("assets/fonts/iosevka-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Iosevka";
  src: url("assets/fonts/iosevka-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --lh: 1.5rem;
  --bg: #0f0f0f;
  --bg-raise: #151514;
  --ink: #f4dfcb;
  --dim: #a2937f;
  --faint: #635747;
  --acc: #ec8f52;
  --acc-ink: #0f0f0f;
  --arrow: #93c76f;
  --rule: #2b2925;
  --mono: "Iosevka", "Roboto Mono", ui-monospace, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--rule) var(--bg);
}

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--rule);
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--faint); }
::-webkit-scrollbar-thumb:active { background: var(--acc); }
::-webkit-scrollbar-corner { background: var(--bg); }

body {
  font-family: var(--mono);
  font-size: 1rem;
  line-height: var(--lh);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  cursor: url("assets/cursors/arrow.png") 5 0, default;
}

a, summary, button { cursor: url("assets/cursors/point.png") 9 1, pointer; }
p, pre, h1, h2, li, figcaption { cursor: url("assets/cursors/ibeam.png") 4 9, text; }
p a, pre a, .man summary, .man summary b { cursor: url("assets/cursors/point.png") 9 1, pointer; }

::selection { background: var(--acc); color: var(--acc-ink); }

:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 0.2em;
  text-decoration-thickness: from-font;
}
a:hover { color: var(--acc); text-decoration-color: var(--acc); }
a[href^="http"]::after { content: "↗"; color: var(--acc); padding-left: 0.5ch; }

b { font-weight: 700; }
kbd {
  font-family: var(--mono);
  border: 1px solid var(--faint);
  border-bottom-width: 2px;
  padding: 0 0.5ch;
}

#field {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

#page {
  position: relative;
  z-index: 2;
  max-width: calc(min(84ch, round(down, 100%, 1ch)));
  margin: 0 auto;
  padding: calc(var(--lh) * 2) 2ch calc(var(--lh) * 4);
}

.sec { margin-bottom: calc(var(--lh) * 3); }
.sec + .sec {
  border-top: 1px solid var(--rule);
  padding-top: calc(var(--lh) * 2 - 1px);
}

.aboutrow { display: flex; gap: 4ch; align-items: flex-start; }
.aboutrow > div { flex: 1; }
.aboutrat { flex: 0 0 240px; }
.aboutrat img { display: block; width: 100%; height: auto; }
.aboutrat figcaption { color: var(--faint); margin-top: calc(var(--lh) / 2); }

.logout { margin-top: calc(var(--lh) * 2); color: var(--dim); }

nav { display: flex; gap: 3ch; margin-bottom: calc(var(--lh) * 3); }
nav a { text-decoration: none; color: var(--dim); }
nav a::before { content: "["; visibility: hidden; }
nav a::after { content: "]"; visibility: hidden; }
nav a:hover { background: none; color: var(--acc); }
nav a:hover::before, nav a:hover::after { visibility: visible; color: var(--acc); }

.logotype {
  font-weight: 700;
  font-size: 2.25rem;
  line-height: calc(var(--lh) * 2);
  margin-bottom: var(--lh);
}
.arrow { color: var(--arrow); }

.caret {
  color: var(--ink);
  animation: blink 1.2s steps(2, jump-none) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.sub { color: var(--dim); margin-bottom: calc(var(--lh) * 2); }
.prompt { color: var(--acc); }

.fetch {
  display: flex;
  gap: 2ch;
  border: 1px solid var(--rule);
  padding: calc(var(--lh) - 1px) 2ch;
  background: var(--bg-raise);
  overflow-x: auto;
}
.fetch pre { font-family: var(--mono); line-height: var(--lh); }
.artbox {
  flex: 0 0 246px;
  width: 246px;
  height: 331px;
  overflow: hidden;
  align-self: center;
}
.fetch-art .w { color: #ffffff; }
.fetch pre.fetch-art {
  color: var(--dim);
  font-size: 12px;
  line-height: 12.6px;
  letter-spacing: 0;
  transform: scale(0.41);
  transform-origin: top left;
}
.fetch-info b { color: var(--dim); font-weight: 400; }
.fetch-info b.acc { color: var(--acc); font-weight: 600; }

h2 {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: calc(var(--lh) * 1.5);
  margin-bottom: var(--lh);
}
.hashbox {
  display: inline-block;
  border: 2px solid var(--acc);
  color: var(--acc);
  padding: 0 0.75ch;
  margin-right: 1.5ch;
}
.secnote { margin-bottom: var(--lh); }

.dim { color: var(--dim); }
.acc { color: var(--acc); }

.man { border: 1px solid var(--rule); margin-bottom: var(--lh); background: var(--bg-raise); }
.man summary {
  list-style: none;
  padding: calc(var(--lh) - 1px) 2ch;
  color: var(--dim);
}
.man summary::-webkit-details-marker { display: none; }
.man summary::before { content: "+ "; color: var(--acc); font-weight: 700; }
.man[open] summary::before { content: "- "; }
.man summary b {
  color: var(--acc);
  border: 2px solid var(--acc);
  padding: 1px 1ch;
}
.man summary:hover { color: var(--ink); }
.man summary:hover b { color: var(--acc-ink); background: var(--acc); }
.man[open] summary { border-bottom: 1px solid var(--rule); padding-bottom: calc(var(--lh) - 1px); }
.manbody { padding: var(--lh) 2ch; }
.manh {
  color: var(--faint);
  font-weight: 700;
  letter-spacing: 0.25ch;
  margin-top: var(--lh);
}
.manh:first-child { margin-top: 0; }
.manbody p { max-width: 68ch; }
.dash { color: var(--faint); }
.redact { color: var(--faint); user-select: none; }
.bracket::before { content: "[ "; color: var(--faint); }
.bracket::after { content: " ]"; color: var(--faint); }

.shot { margin: var(--lh) 0; max-width: 68ch; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}
.shot figcaption { color: var(--faint); margin-top: calc(var(--lh) / 2); max-width: 68ch; }

.tree { line-height: var(--lh); overflow-x: auto; }
.tree a { text-decoration: none; }

#s3 p { max-width: 64ch; margin-bottom: var(--lh); }
#s4 p { max-width: 64ch; margin-bottom: var(--lh); }
#s4 .tree { margin-bottom: var(--lh); }

#grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  z-index: 50;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

#scan { display: none; }

body.phosphor {
  --ink: #c8f5b0;
  --dim: #7fae6d;
  --faint: #48633e;
  --acc: #6bee4a;
  --acc-ink: #0c1409;
  --bg: #0c1409;
  --bg-raise: #111c0d;
  --rule: #24371d;
  background: var(--bg);
}
body.phosphor html { background: var(--bg); }

#boot {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  padding: calc(var(--lh) * 2) 4ch;
}
#bootlog { font-family: var(--mono); line-height: var(--lh); color: var(--dim); }
#bootlog .ok { color: var(--acc); }

.filebody { line-height: var(--lh); color: var(--dim); overflow-x: auto; }

#bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 80;
  display: flex;
  justify-content: space-between;
  gap: 2ch;
  background: var(--bg-raise);
  border-top: 2px solid var(--rule);
  padding: calc(var(--lh) / 4) 2ch;
  font-size: 1rem;
  line-height: var(--lh);
  white-space: nowrap;
  overflow: hidden;
}
#bar a { text-decoration: none; color: var(--dim); }
#bar a:hover { color: var(--acc); }
.barleft { overflow: hidden; text-overflow: ellipsis; }
#clock { color: var(--acc); }

@media (max-width: 720px) {
  .logotype { font-size: 1.5rem; line-height: calc(var(--lh) * 1.5); }
  .fetch { flex-direction: column; gap: var(--lh); padding: calc(var(--lh) - 1px) 2ch; align-items: center; }
  .fetch-info { font-size: 0.8125rem; align-self: stretch; overflow-x: auto; }
  .artbox { align-self: center; margin: 0 auto; }
  nav { gap: 2ch; flex-wrap: wrap; }
  .aboutrow { flex-direction: column; }
  .aboutrat { flex: none; max-width: 240px; }
  #page { padding-bottom: calc(var(--lh) * 5); }
}

@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
  html { scroll-behavior: auto; }
}
html { scroll-behavior: smooth; }

@media print {
  #grain, #scan, #bar, #boot, #field { display: none !important; }
  html, body { background: #fff; }
  body { color: #000; }
  .man, .fetch { border-color: #000; background: none; }
  .man summary { color: #000; }
  .dim, .manh, .fetch-info b { color: #444; }
  .acc, .secno, .prompt, .fetch-art { color: #000; }
  a { color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; color: #444; }
  details { display: block; }
  .manbody { display: block; }
}
