:root {
  --paper: #ffffff;
  --ink: #111111;
  --ink-soft: #2a2a2a;
  --ink-mute: #6a6a6a;
  --rule: #1111111a;

  --type: "Courier Prime", "Courier New", monospace;
  --type-display: "Special Elite", "Courier Prime", "Courier New", monospace;

  --line: 24px;
  --col: 68ch;
  --type-size: 14.5px;
}

html[data-theme="dark"] {
  --paper: #0e0e0e;
  --ink: #ededed;
  --ink-soft: #cfcfcf;
  --ink-mute: #7a7a7a;
  --rule: #ededed1f;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--paper);
}
body {
  font-family: var(--type);
  font-size: var(--type-size);
  line-height: var(--line);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  padding: clamp(32px, 6vh, 76px) 24px clamp(48px, 8vh, 96px);
}
::selection {
  background: var(--ink);
  color: var(--paper);
}

.page {
  max-width: var(--col);
  margin: 0 auto;
}

.typed {
  text-shadow: 0 0 0.4px rgba(17, 17, 17, 0.45);
}
html[data-theme="dark"] .typed {
  text-shadow: 0 0 0.4px rgba(237, 237, 237, 0.45);
}

.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  background: var(--paper);
  border: 1px dotted var(--ink-mute);
  color: var(--ink-mute);
  font-family: var(--type);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 10px;
  cursor: pointer;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
  z-index: 10;
}
.theme-toggle:hover {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
}

.ascii-term {
  position: fixed;
  bottom: 22px;
  left: 22px;
  font-family: var(--type);
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--ink-mute);
  opacity: 0.65;
  pointer-events: none;
  user-select: none;
  white-space: pre;
  z-index: 5;
}
.ascii-term .prompt {
  color: var(--ink-mute);
}
.ascii-term .cmd {
  color: var(--ink-soft);
  margin-left: 0.6ch;
}
.ascii-term .cursor {
  display: inline-block;
  margin-left: 0.15ch;
  animation: blink 1.05s steps(1, end) infinite;
}
@media (max-width: 920px) {
  .ascii-term {
    position: static;
    margin: var(--line) 0 0;
    padding-top: calc(var(--line) * 0.5);
    text-align: center;
    opacity: 0.5;
  }
}

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dotted var(--ink);
  transition:
    background 0.15s ease,
    color 0.15s ease;
  padding-bottom: 1px;
}
a:hover {
  background: var(--ink);
  color: var(--paper);
}

.topline {
  display: flex;
  justify-content: flex-end;
  color: var(--ink-mute);
  font-size: 0.8em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: calc(var(--line) * 1.1);
}

h1.name {
  font-family: var(--type-display);
  font-weight: 400;
  font-size: clamp(24px, 6vw, 34px);
  line-height: 1.05;
  margin: 0 0 calc(var(--line) * 0.35);
  letter-spacing: -0.005em;
}
.caret {
  display: inline-block;
  width: 0.5ch;
  height: 0.9em;
  background: var(--ink);
  transform: translateY(2px);
  margin-left: 0.15ch;
  animation: blink 1.05s steps(1, end) infinite;
  transition: opacity 0.6s ease, width 0.6s ease 0.4s, margin-left 0.6s ease 0.4s;
}
.caret.retired {
  opacity: 0;
  width: 0;
  margin-left: 0;
  animation: none;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

.role {
  color: var(--ink-soft);
  margin: 0 0 calc(var(--line) * 1.1);
}

section {
  margin: calc(var(--line) * 1.1) 0;
}
h2.sec {
  font-family: var(--type);
  font-weight: 700;
  font-size: 1em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 calc(var(--line) * 0.6) 0;
  color: var(--ink);
  scroll-margin-top: calc(var(--line) * 1.5);
}
h2.sec .anchor {
  color: var(--ink);
  border-bottom: none;
  padding: 0;
  cursor: pointer;
}
h2.sec .anchor:hover,
h2.sec .anchor:focus-visible {
  background: transparent;
  color: var(--ink);
}
h2.sec .anchor .hash {
  color: var(--ink-mute);
  font-weight: 400;
  transition: color 0.15s ease;
}
h2.sec .anchor:hover .hash,
h2.sec .anchor:focus-visible .hash {
  color: var(--ink);
}

p {
  margin: 0 0 var(--line) 0;
  text-wrap: pretty;
  color: var(--ink-soft);
}
p strong {
  color: var(--ink);
  font-weight: 700;
}

ul.md {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--line) 0;
}
ul.md li {
  display: grid;
  grid-template-columns: 2.5ch 1fr auto;
  gap: 0 1.5ch;
  padding: calc(var(--line) * 0.25) 0;
  align-items: baseline;
  border-bottom: 1px dotted var(--rule);
}
ul.md li:first-child {
  border-top: 1px dotted var(--rule);
}
ul.md li::before {
  content: "—";
  color: var(--ink-mute);
}
ul.md li .body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
ul.md li .name {
  color: var(--ink);
  font-weight: 700;
}
ul.md li .name a {
  border-bottom-style: dotted;
}
ul.md li .desc {
  color: var(--ink-soft);
  font-size: 0.92em;
  line-height: 1.55;
}
ul.md li .tag {
  color: var(--ink-mute);
  font-size: 0.8em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: right;
  white-space: nowrap;
  align-self: center;
}

ul.elsewhere-lines {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--line) 0;
  font-size: 0.92em;
  line-height: 1.85;
  overflow-x: auto;
}
ul.elsewhere-lines li {
  display: grid;
  grid-template-columns: 11ch 1fr auto;
  gap: 0 1.5ch;
  align-items: baseline;
  padding: 1px 0;
  color: var(--ink-soft);
}
ul.elsewhere-lines .key {
  color: var(--ink);
  font-weight: 700;
  text-transform: lowercase;
  white-space: nowrap;
}
ul.elsewhere-lines .key::before {
  content: "[";
  color: var(--ink-mute);
  font-weight: 400;
}
ul.elsewhere-lines .key::after {
  content: "]";
  color: var(--ink-mute);
  font-weight: 400;
}
ul.elsewhere-lines .note::before {
  content: "# ";
  color: var(--ink-mute);
}
ul.elsewhere-lines .url {
  color: var(--ink);
  border-bottom-style: dotted;
  white-space: nowrap;
}
ul.elsewhere-lines .url:hover,
ul.elsewhere-lines .url:focus-visible {
  background: var(--ink);
  color: var(--paper);
}
ul.elsewhere-lines .note {
  color: var(--ink-mute);
  font-size: 0.92em;
  text-align: right;
  white-space: nowrap;
}

.more {
  color: var(--ink-mute);
  font-size: 0.88em;
  margin-top: calc(var(--line) * 0.35);
}

.foot {
  display: flex;
  justify-content: space-between;
  color: var(--ink-mute);
  font-size: 0.85em;
  flex-wrap: wrap;
  gap: 12px;
}
.foot .end {
  opacity: 0.7;
}

@media (max-width: 560px) {
  ul.md li {
    grid-template-columns: 2.5ch 1fr;
  }
  ul.md li .tag {
    grid-column: 2;
    text-align: left;
  }
  ul.elsewhere-lines li {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 6px 0;
    border-bottom: 1px dotted var(--rule);
  }
  ul.elsewhere-lines .note {
    text-align: left;
    white-space: normal;
  }
}
