/* vdh.ai: hand-written, no framework. */

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-italic.woff2") format("woff2");
  font-weight: 100 800;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #08080a;
  --bg-2: #0e0e12;
  --bg-3: #15151b;
  --fg: #ecebe6;
  --dim: #8b8b94;
  --faint: #4a4a54;
  --line: #22222a;
  --accent: #c6ff3d;
  --on-accent: #08080a;
  --br-main: #ecebe6;
  --br-cyan: #3ad7ff;
  --br-amber: #ffb000;
  --br-magenta: #ff4fd8;
  --br-lime: #c6ff3d;
  --add: #7dff8a;
  --del: #ff6b6b;
  --font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --bar-h: 36px;
  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 16px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 15px/1.6 var(--font);
  font-feature-settings: "calt" 1, "liga" 1;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--on-accent); }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
kbd {
  font: inherit; font-size: .8em; padding: 0 .4em; border: 1px solid currentColor; border-radius: 3px; opacity: .8;
}
pre { margin: 0; font: inherit; }

.skip {
  position: fixed; left: 8px; top: -60px; z-index: 100; padding: 8px 12px;
  background: var(--accent); color: var(--on-accent); text-decoration: none;
}
.skip:focus { top: 8px; }

main { overflow-x: clip; } /* the tilted band must not widen the page */

/* ---------- status bar (tmux-ish) ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 40; height: var(--bar-h);
  display: flex; align-items: stretch; gap: 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  font-size: 13px; line-height: var(--bar-h);
}
.bar__session {
  padding: 0 14px; background: var(--accent); color: var(--on-accent); font-weight: 800; text-decoration: none;
}
.bar__session:hover { color: var(--on-accent); }
.nav { display: flex; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 0 12px; color: var(--dim); text-decoration: none; white-space: nowrap; }
.nav a:hover { color: var(--fg); }
.nav a.is-active { color: var(--fg); background: var(--bg-3); }
.nav a.is-active::after { content: "*"; color: var(--accent); }
.nav__n { color: var(--faint); }
.bar__term { padding: 0 12px; color: var(--accent); white-space: nowrap; border-left: 1px solid var(--line); }
.bar__term:hover { background: var(--accent); color: var(--on-accent); }
.bar__clock { padding: 0 14px; color: var(--dim); border-left: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .bar__clock { display: none; }
  .nav__n { display: none; }
  .nav a { padding: 0 9px; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--bar-h) + 48px) var(--gutter) 72px;
  overflow: hidden; isolation: isolate;
  touch-action: pan-y;
  cursor: grab;
}
.hero:active { cursor: grabbing; }
.hero__ascii { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::after { /* faint scanlines */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgb(0 0 0 / .18) 2px 3px);
}
.hero__copy { position: relative; max-width: 660px; cursor: auto; }
.hero__prompt { margin: 0 0 18px; color: var(--dim); font-size: 14px; }
.ps1 { color: var(--accent); }
.caret {
  display: inline-block; width: .6em; height: 1.1em; margin-left: 4px; vertical-align: -.2em;
  background: var(--accent); animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero__name {
  margin: 0; font-weight: 800; letter-spacing: -.045em; line-height: .9;
  font-size: clamp(44px, 8.2vw, 124px);
}
.hero__name > span { display: block; white-space: nowrap; }
.hero__last {
  color: transparent; -webkit-text-stroke: 1.5px var(--fg);
  font-size: .78em; margin-top: .06em;
}
.hero__lead { margin: 28px 0 0; font-size: clamp(15px, 1.5vw, 18px); line-height: 1.55; max-width: 34em; }
.hero__lead em { font-style: italic; color: var(--accent); }
.hero__facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0;
  margin: 28px 0 0; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  max-width: 560px;
}
.hero__facts div { padding: 10px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hero__facts div:nth-child(2n) { border-right: 0; }
.hero__facts div:nth-last-child(-n+2) { border-bottom: 0; }
.hero__facts dt { color: var(--faint); font-size: 12px; }
.hero__facts dd { margin: 0; font-size: 13.5px; }
.pulse {
  display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2s infinite;
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); } 70%, 100% { box-shadow: 0 0 0 10px transparent; } }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__hint {
  position: absolute; right: var(--gutter); bottom: 22px; margin: 0;
  font-size: 12px; color: var(--faint); pointer-events: none;
}
.hero__hint b { color: var(--dim); font-weight: 400; }
@media (hover: none) { .hide-touch { display: none; } }

@media (max-width: 819px) {
  .hero { align-items: flex-end; padding-top: 0; padding-bottom: 64px; }
  .hero__copy { padding-top: 48svh; }
  .hero__copy::before { /* keep text readable over the 3D thing */
    content: ""; position: absolute; inset: 44svh -40px -80px; z-index: -1;
    background: linear-gradient(to bottom, transparent, var(--bg) 9svh);
  }
  .hero__hint { left: var(--gutter); right: auto; }
}
@media (max-width: 420px) {
  .hero__facts { grid-template-columns: 1fr; }
  .hero__facts div { border-right: 0; }
  .hero__facts div:nth-last-child(2) { border-bottom: 1px solid var(--line); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border: 1px solid var(--fg); color: var(--fg);
  text-decoration: none; font-size: 14px; font-weight: 600;
  transition: transform .15s, box-shadow .15s, background .15s, color .15s;
}
.btn:hover { color: var(--fg); transform: translate(-3px, -3px); box-shadow: 3px 3px 0 var(--accent); }
.btn--solid { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--solid:hover { color: var(--on-accent); box-shadow: 3px 3px 0 var(--fg); }
.btn--sm { padding: 6px 12px; font-size: 13px; }

/* ---------- marquee band ---------- */
.band {
  overflow: hidden; border-block: 1px solid var(--line); background: var(--accent); color: var(--on-accent);
  font-weight: 800; font-size: clamp(18px, 2.4vw, 28px); line-height: 1; padding: 14px 0;
  transform: rotate(-1.2deg) scale(1.03); margin: 8px 0 24px;
}
.band__track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.band__track span { white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .band__track { animation: none; } }

/* ---------- sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 96px var(--gutter) 40px; }
.cmd {
  margin: 0 0 8px; font-size: clamp(22px, 3.2vw, 40px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15;
}
.cmd .ps1 { color: var(--accent); }
.cmd__text { display: inline-block; vertical-align: bottom; white-space: nowrap; max-width: 100%; }
.js .cmd__text { width: 0; overflow: hidden; border-right: .5em solid transparent; }
.js .cmd.is-in .cmd__text {
  animation: type calc(var(--n) * 45ms) steps(var(--n)) forwards, caret 1s steps(1) calc(var(--n) * 45ms) 3;
}
@keyframes type { from { width: 0; border-color: var(--accent); } to { width: calc(var(--n) * 1ch + .5em); border-color: var(--accent); } }
@keyframes caret { 50% { border-color: transparent; } 100% { border-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .js .cmd__text { width: auto; } .js .cmd.is-in .cmd__text { animation: none; } }
@media (max-width: 560px) { .cmd__text { white-space: normal; } .js .cmd__text { width: auto; overflow: visible; } .js .cmd.is-in .cmd__text { animation: none; } }
.section__sub { margin: 0 0 32px; color: var(--dim); }

/* ---------- README ---------- */
.file { margin-top: 28px; border: 1px solid var(--line); background: var(--bg-2); max-width: 860px; }
.file__tab {
  display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px;
  border-bottom: 1px solid var(--line); font-size: 12px; color: var(--dim);
}
.file__tab span:first-child { color: var(--fg); border-bottom: 2px solid var(--accent); padding-bottom: 6px; margin-bottom: -9px; }
.readme { padding: 22px 20px 26px; white-space: pre-wrap; font-size: clamp(13px, 1.4vw, 15.5px); line-height: 1.75; overflow-x: auto; }
.md-h1 { color: var(--accent); font-weight: 800; }
.md-h2 { color: var(--br-cyan); font-weight: 700; }
.md-dim { color: var(--dim); }
.md-li { color: var(--accent); }
.md-add { color: var(--add); }
.md-del { color: var(--del); }
.md-mod { color: var(--br-amber); }
.readme a { color: var(--accent); }

/* ---------- git log ---------- */
.log { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
@media (min-width: 1000px) {
  .log { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .log__aside { position: sticky; top: calc(var(--bar-h) + 24px); }
}
@media (max-width: 999px) { .log__aside { display: none; } }
.log__list { position: relative; }
.log__svg { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.log__svg path { fill: none; stroke: var(--c); stroke-width: 2.5; stroke-linecap: round; }
.log__node { fill: var(--bg); stroke: var(--c); stroke-width: 2.5; }
.log__node.is-merge { fill: var(--c); }
.log__pulse { fill: none; stroke: var(--c); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: ring 2s ease-out infinite; }
@keyframes ring { from { transform: scale(1); opacity: .9; } to { transform: scale(3); opacity: 0; } }
.js .log__svg path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .7s ease calc(var(--i) * 90ms); }
.js .log__node { opacity: 0; transition: opacity .3s calc(var(--i) * 90ms); }
.js .log__list.is-drawn path { stroke-dashoffset: 0; }
.js .log__list.is-drawn .log__node { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .js .log__svg path, .js .log__node { transition: none; } }

.log__rows { list-style: none; margin: 0; padding: 0; }
.log__row {
  position: relative; display: block; width: 100%; text-align: left;
  padding: 10px 12px 10px var(--lanes, 80px); min-height: 44px;
  font-size: 14px; line-height: 1.5; border-left: 2px solid transparent;
  transition: background .15s;
}
.log__row:hover { background: var(--bg-2); }
.log__row.is-active { background: var(--bg-3); border-left-color: var(--c); }
.log__hash { color: var(--br-amber); margin-right: 2px; }
.log__refs { font-weight: 700; }
.ref { color: var(--c); }
.ref__head { color: var(--br-cyan); }
.log__msg { color: var(--fg); }
.log__row.is-active .log__msg { color: var(--c); }
.log__year { float: right; margin-left: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .log__row { font-size: 13px; }
  .log__year { float: none; display: block; margin: 0; font-size: 12px; }
}

.show { border: 1px solid var(--line); background: var(--bg-2); border-top: 2px solid var(--c); }
.log__item > .show { margin: 6px 0 14px var(--lanes, 80px); }
.show.is-in { animation: showin .35s ease; }
@keyframes showin { from { opacity: 0; transform: translateY(6px); } }
.show__pre { padding: 18px 20px 20px; white-space: pre-wrap; font-size: 13.5px; line-height: 1.7; overflow-wrap: anywhere; }
.show__commit { color: var(--br-amber); }
.show__refs { color: var(--c); font-weight: 700; }
.show__k { color: var(--dim); }
.show__body { display: block; margin: 1em 0; padding-left: 4ch; white-space: normal; color: var(--fg); }
.show__dim { color: var(--faint); }
.show__add { color: var(--add); }
.show__del { color: var(--del); }
.show__mod { color: var(--br-amber); }
.show__cta { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-align: left; }
.show a { color: var(--accent); }
.noscript { color: var(--dim); }

/* ---------- notes ---------- */
.notes__total { margin: 0 0 6px; color: var(--dim); font-size: 13px; }
.notes__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.notes__row {
  display: grid; grid-template-columns: auto 6ch 13ch minmax(0, 1fr); gap: 0 18px; align-items: baseline;
  width: 100%; text-align: left; padding: 14px 10px; border-bottom: 1px solid var(--line);
  font-size: 14px; white-space: pre; transition: background .15s, padding .15s;
}
.notes__row:hover { background: var(--bg-2); padding-left: 18px; }
.notes__perm, .notes__size, .notes__date { color: var(--dim); }
.notes__name { color: var(--br-cyan); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.notes__row:hover .notes__name { color: var(--accent); }
.notes__title { grid-column: 4; color: var(--dim); font-size: 13px; white-space: normal; }
@media (max-width: 760px) {
  .notes__row { grid-template-columns: minmax(0, 1fr) auto; }
  .notes__perm, .notes__size { display: none; }
  .notes__date { grid-column: 2; grid-row: 1; font-size: 12px; }
  .notes__name { grid-column: 1; grid-row: 1; }
  .notes__title { grid-column: 1 / -1; }
}

/* ---------- reader (less) ---------- */
.reader {
  width: min(760px, calc(100vw - 24px)); max-height: min(86vh, 900px); height: 86vh;
  padding: 0; border: 1px solid var(--line); border-top: 2px solid var(--accent);
  background: var(--bg-2); color: var(--fg);
  display: none; flex-direction: column;
}
.reader[open] { display: flex; animation: showin .25s ease; }
.reader::backdrop { background: rgb(0 0 0 / .7); backdrop-filter: blur(4px); }
.reader__bar, .reader__status {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 0 0 0 16px; font-size: 12.5px; color: var(--dim); flex: none;
}
.reader__bar { border-bottom: 1px solid var(--line); }
.reader__x { padding: 10px 16px; color: var(--accent); }
.reader__x:hover { background: var(--accent); color: var(--on-accent); }
.reader__status { padding: 8px 16px; border-top: 1px solid var(--line); background: var(--fg); color: var(--bg); font-weight: 600; }
.reader__body { overflow-y: auto; padding: 28px clamp(18px, 4vw, 44px) 40px; font-size: 15px; line-height: 1.75; flex: 1; outline: none; }
.reader__body h2 { margin: 0 0 24px; font-size: clamp(24px, 4vw, 34px); line-height: 1.15; letter-spacing: -.02em; }
.reader__body h3 { margin: 28px 0 0; font-size: 17px; color: var(--accent); }
.md-mark { color: var(--faint); }
.reader__body p, .reader__body ul { margin: 0 0 1.1em; }
.reader__body ul { padding-left: 2ch; list-style: none; }
.reader__body li::before { content: "- "; color: var(--accent); margin-left: -2ch; }
.reader__meta { color: var(--dim); font-size: 13px; margin: 0 0 6px !important; }
.reader__end { color: var(--bg); background: var(--fg); display: inline-block; padding: 0 6px; margin-top: 24px !important; }

/* ---------- ping ---------- */
.ping__out { min-height: 9em; color: var(--dim); font-size: 13.5px; white-space: pre-wrap; margin: 24px 0 20px; }
.ping__lead { margin: 0 0 18px; font-size: clamp(16px, 1.8vw, 20px); max-width: 36em; }
.ping__mail { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ping__addr {
  font-size: clamp(34px, 9vw, 112px); font-weight: 800; letter-spacing: -.05em; line-height: 1;
  text-decoration: none; color: var(--fg); position: relative;
  background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 100% / 0 .12em;
  transition: background-size .35s ease, color .2s;
}
.ping__addr:hover { color: var(--accent); background-size: 100% .12em; }
.ping__links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 32px 0 0; padding: 0; }
.ping__links a, .ping__links button { color: var(--dim); text-decoration: none; font-size: 15px; }
.ping__links a:hover, .ping__links button:hover { color: var(--accent); }

/* ---------- footer (vim status line) ---------- */
.foot { max-width: var(--maxw); margin: 80px auto 0; padding: 0 var(--gutter) 0; font-size: 12.5px; color: var(--dim); }
.foot p { margin: 0 0 6px; }
.foot__dim { color: var(--faint); }
.foot__dim a { color: var(--dim); }
.foot__vim {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 28px calc(var(--gutter) * -1) 0 !important; padding: 4px var(--gutter);
  background: var(--fg); color: var(--bg); font-weight: 700;
}

/* ---------- terminal ---------- */
.term {
  position: fixed; z-index: 60; left: 50%; top: calc(var(--bar-h) + 10px);
  width: min(880px, calc(100vw - 20px)); height: min(62vh, 560px);
  display: flex; flex-direction: column;
  background: rgb(10 10 13 / .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-top: 2px solid var(--accent);
  box-shadow: 0 30px 80px rgb(0 0 0 / .6), 0 0 0 1px rgb(255 255 255 / .02);
  transform: translate(-50%, -24px) scale(.98); opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
  font-size: 13.5px;
}
.term.is-open { transform: translate(-50%, 0) scale(1); opacity: 1; }
.term[hidden] { display: none; }
.term__bar { display: flex; align-items: center; gap: 12px; padding: 0 0 0 12px; border-bottom: 1px solid var(--line); color: var(--dim); font-size: 12px; }
.term__dots { display: flex; gap: 6px; }
.term__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); }
.term__dots i:first-child { background: #ff5f57; } .term__dots i:nth-child(2) { background: #febc2e; } .term__dots i:nth-child(3) { background: #28c840; }
.term__title { flex: 1; text-align: center; }
.term__x { padding: 8px 14px; color: var(--accent); }
.term__x:hover { background: var(--accent); color: var(--on-accent); }
.term__out { flex: 1; overflow-y: auto; padding: 14px 16px 4px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.term__o { margin-bottom: 6px; }
.term__cmd { color: var(--fg); margin-top: 6px; }
.term__err { color: var(--del); }
.term__h { color: var(--accent); font-weight: 700; }
.term__dim { color: var(--dim); }
.term__dir { color: var(--br-cyan); font-weight: 700; }
.term__user { color: var(--accent); font-weight: 700; }
.term__cwd { color: var(--br-cyan); }
.term__hash { color: var(--br-amber); }
.term__ref { color: var(--br-magenta); font-weight: 700; }
.term__graph { color: var(--br-cyan); }
.term__key { color: var(--accent); font-weight: 700; }
.term__logo { color: var(--accent); }
.term__run { color: var(--add); }
.term__swatch { display: inline-flex; gap: 0; }
.term__swatch i { width: 22px; height: 12px; background: var(--c); }
.term__out a { color: var(--accent); }
.term__out b { color: var(--fg); }
.term__line { display: flex; align-items: center; gap: 8px; padding: 6px 16px 12px; }
.term__ps1 { white-space: nowrap; }
.term__in {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--fg);
  font: inherit; font-size: 16px; caret-color: var(--accent); padding: 4px 0;
}
@media (min-width: 721px) { .term__in { font-size: inherit; } }
@media (max-width: 720px) {
  .term { top: auto; bottom: 0; width: 100vw; height: 70svh; transform: translate(-50%, 24px); }
  .term.is-open { transform: translate(-50%, 0); }
}

body.is-collapsing { overflow: hidden; }
