/* ==========================================================================
   eyosias.me: terminal theme
   Plain CSS, served as-is by GitHub Pages (no build step).
   ========================================================================== */

/* Tokens
   ========================================================================== */

:root {
  --bg: #0a0c0f;
  --bg-raised: #0f1317;
  --bg-hover: #13191f;
  --bar-bg: #10151a;
  --line: #1c2329;
  --line-strong: #2a333c;

  --fg: #c5cdd5;
  --fg-dim: #7d8893;
  --fg-faint: #3a434c;
  --fg-bright: #eef2f6;

  /* referenced by name from _data/pseudonyms.yml */
  --red-color: #ff073a;
  --blue-color: #209fe4;
  --green-color: #3ddc84;
  --amber: #e5b454;
  --violet: #c59cff;
  --cyan: #56c8d8;

  /* swapped by the `su` easter egg */
  --pseudonym-color: var(--red-color);

  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --bar-h: 2rem;
  --gutter: 1rem;
  --measure: 64rem;
}

@media (min-width: 48rem) {
  :root { --gutter: 2rem; }
}

/* Base
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 110%; /* everything is sized in rem, so this is the page's zoom level */
  font-variant-ligatures: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar-h) + 1.5rem);
  scrollbar-color: var(--line-strong) var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-size: 0.875rem;
  line-height: 1.7;
  background:
    radial-gradient(ellipse 70rem 34rem at 12% -10rem, rgba(255, 7, 58, 0.07), transparent 70%) no-repeat,
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@supports (background: color-mix(in srgb, red 10%, transparent)) {
  body {
    background:
      radial-gradient(ellipse 70rem 34rem at 12% -10rem, color-mix(in srgb, var(--pseudonym-color) 8%, transparent), transparent 70%) no-repeat,
      var(--bg);
  }
}

@media (min-width: 48rem) {
  body { font-size: 0.9375rem; }
}

/* Phones stay at the browser's default size; the 10% zoom is for larger screens. */
@media (max-width: 40rem) {
  html { font-size: 100%; }
}

/* ambient field behind everything: what the glass panes blur and refract */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1.6px) 0 0 / 1.5rem 1.5rem,
    radial-gradient(44rem 30rem at 92% 6%, rgba(32, 159, 228, 0.08), transparent 70%),
    radial-gradient(40rem 32rem at 4% 98%, rgba(255, 7, 58, 0.08), transparent 70%);
}

@supports (background: color-mix(in srgb, red 10%, transparent)) {
  body::before {
    background:
      radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1.6px) 0 0 / 1.5rem 1.5rem,
      radial-gradient(44rem 30rem at 92% 6%, rgba(32, 159, 228, 0.08), transparent 70%),
      radial-gradient(40rem 32rem at 4% 98%, color-mix(in srgb, var(--pseudonym-color) 9%, transparent), transparent 70%);
  }
}

/* faint CRT scanlines */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }

a {
  color: var(--blue-color);
  text-decoration: none;
}

::selection {
  background: var(--pseudonym-color);
  color: var(--bg);
}

:focus-visible {
  outline: 1px dashed var(--pseudonym-color);
  outline-offset: 2px;
}

button { font: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  z-index: 40;
  padding: 0.25rem 0.75ch;
  background: var(--fg-bright);
  color: var(--bg);
}

.skip-link:focus { top: 0.25rem; }

.dim { color: var(--fg-dim); }
.sep { color: var(--fg-faint); margin: 0 0.5ch; }
.comment { color: var(--fg-dim); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25ch;
}

.tag {
  color: var(--fg-dim);
  white-space: nowrap;
}

/* Layout
   ========================================================================== */

.screen {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding-top: clamp(4.5rem, 12vh, 8rem); }

/* tmux status line
   ========================================================================== */

.statusbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2ch;
  height: var(--bar-h);
  padding-right: var(--gutter);
  background: var(--bar-bg);
  border-bottom: 1px solid var(--line);
  font-size: 0.8125rem;
  line-height: var(--bar-h);
}

.tmux {
  display: flex;
  align-items: stretch;
  min-width: 0;
  height: 100%;
}

.tmux-session {
  flex: none;
  padding: 0 1ch;
  background: var(--pseudonym-color);
  color: var(--bg);
  font-weight: 700;
  transition: background-color 0.3s;
}

.tmux-windows {
  position: relative;
  display: flex;
  min-width: 0;
  padding: 0 0 0 0.5ch;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.tmux-windows::-webkit-scrollbar { display: none; }

.tmux-windows a {
  display: block;
  padding: 0 1ch;
  color: var(--fg-dim);
  white-space: nowrap;
}

.tmux-windows a:hover { color: var(--fg-bright); }

.tmux-windows a[aria-current] {
  color: var(--fg-bright);
  font-weight: 700;
}

.tmux-windows a[aria-current]::after {
  content: "*";
  color: var(--pseudonym-color);
}

.tmux-right {
  flex: none;
  color: var(--fg-dim);
  white-space: nowrap;
}

.tmux-host { margin-right: 1ch; }

@media (max-width: 40rem) {
  .tmux-right { display: none; }
  .statusbar { padding-right: 0; }
}

/* Prompt + typing
   ========================================================================== */

.cmd {
  color: var(--fg-bright);
  overflow-wrap: anywhere;
}

.ps1 { font-weight: 700; }

.ps1-user,
.ps1-host {
  color: var(--pseudonym-color);
  transition: color 0.3s;
}

.ps1-at,
.ps1-colon { color: var(--fg-dim); font-weight: 400; }
.ps1-path { color: var(--blue-color); }
.ps1-sign { color: var(--fg-dim); }

.cursor,
.term-block.is-typing .cmd-text::after,
.rotate-cursor {
  content: "";
  display: inline-block;
  width: 0.62em;
  height: 1.2em;
  margin-left: 1px;
  vertical-align: -0.22em;
  background: var(--fg-bright);
}

.cursor,
.rotate-cursor { animation: blink 1.1s steps(1) infinite; }

.rotate-cursor {
  width: 0.5em;
  background: var(--pseudonym-color);
}

.out {
  margin-top: 0.35rem;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

/* With JS, output waits for its command to finish typing. */
.js .term-block:not(.is-done) .out {
  opacity: 0;
  transform: translateY(0.4rem);
}

.js .term-block:not(.is-done):not(.is-typing) .cmd-text { visibility: hidden; }

/* If terminal.js never boots, reveal everything anyway. */
.js:not(.term-ready) .term-block .out,
.js:not(.term-ready) .term-block .cmd-text { animation: reveal 0s 2.5s forwards; }

.cmd-idle { margin-top: 2.5rem; }

/* Landing
   ========================================================================== */

.hero {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-height: calc(100vh - var(--bar-h));
  min-height: calc(100svh - var(--bar-h));
  padding-top: clamp(1.5rem, 9vh, 5.5rem);
}

.motd { color: var(--fg-dim); }

.alias-line {
  margin: 0.1rem 0 0.2rem;
  font-size: clamp(3.4rem, 18vw, 8.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
}

.alias {
  all: unset;
  position: relative;
  isolation: isolate;
  display: inline-block;
  color: var(--pseudonym-color);
  cursor: pointer;
  transition: color 0.3s;
}

.alias::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  color: var(--pseudonym-color);
  text-shadow: 0 0 0.2em var(--pseudonym-color);
  opacity: 0.7;
  filter: blur(14px) brightness(1.3);
  animation: flicker 3.4s linear 5s infinite;
}

.alias:focus-visible {
  outline: 1px dashed var(--fg-dim);
  outline-offset: 0.08em;
}

.alias.is-switching { animation: glitch 0.32s steps(2, end); }

.finger {
  display: grid;
  gap: 0.15rem 4ch;
  max-width: 72ch;
}

.finger > div {
  display: flex;
  gap: 1ch;
  min-width: 0;
}

.finger dt {
  flex: none;
  width: 6ch;
  color: var(--fg-dim);
}

.finger dd {
  min-width: 0;
  color: var(--fg-bright);
}

.finger .plan {
  color: var(--fg);
  max-width: 62ch;
}

#txt-rotate { font-weight: 700; }

@media (min-width: 40rem) {
  .finger { grid-template-columns: max-content 1fr; }
  .finger-wide { grid-column: 1 / -1; }
}

.ls-links {
  display: grid;
  gap: 0.1rem;
  padding: 0;
  list-style: none;
}

.ls-links li {
  display: flex;
  align-items: baseline;
  gap: 2ch;
}

.ls-links .ls-perm { flex: none; color: var(--fg-dim); }
.ls-links .ls-name { min-width: 8ch; }

/* dircolors: directories blue, symlinks cyan, files green */
.ls-dir,
.ls-link,
.ls-file {
  font-weight: 700;
  padding: 0 0.25ch;
  margin: 0 -0.25ch;
}

.ls-dir { color: var(--blue-color); }
.ls-link { color: var(--cyan); overflow-wrap: anywhere; }
.ls-file { color: var(--green-color); }

/* Links are symlinks: `name -> target`, dotted underline like a terminal hyperlink. */
.ls-link .ls-name,
.ls-link .ls-target,
.ls-file .ls-name {
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

.ls-arrow {
  color: var(--fg-dim);
  font-weight: 400;
  white-space: pre;
}

.ls-target {
  color: var(--fg-dim);
  font-weight: 400;
}

a.ls-link:hover,
a.ls-link:focus-visible {
  background: var(--cyan);
  color: var(--bg);
}

a.ls-file:hover,
a.ls-file:focus-visible {
  background: var(--green-color);
  color: var(--bg);
}

a.ls-link:hover .ls-arrow,
a.ls-link:hover .ls-target,
a.ls-link:focus-visible .ls-arrow,
a.ls-link:focus-visible .ls-target { color: inherit; }

a:hover > .ls-name,
a:hover > .ls-target,
a:focus-visible > .ls-name,
a:focus-visible > .ls-target { text-decoration-style: solid; }

/* On phones the names alone carry the link; the `-> target` addresses are just clutter.
   Without them the landing links fit side by side, like plain `ls`. */
@media (max-width: 40rem) {
  .ls-arrow,
  .ls-target { display: none; }

  .ls-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 3ch;
  }

  .ls-links .ls-name { min-width: 0; }
}

/* Declassify: a bar in the link's own colour covers the label, then retracts
   while terminal.js unscrambles the text underneath. */
[data-redact] {
  position: relative;
  display: inline-block;
}

[data-redact]::after {
  content: "";
  position: absolute;
  inset: 0.2em -0.2ch;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

[data-redact].is-redacting::after { animation: redact 1s cubic-bezier(0.65, 0, 0.35, 1) both; }

/* Glass panes
   Each section's content sits on a pane whose liquid-glass finish fades in on
   hover, and stays on the section named in the URL hash (#skills, ...).
   ========================================================================== */

/* registered so the specular highlight glides after the pointer */
@property --mx {
  syntax: "<length-percentage>";
  inherits: false;
  initial-value: 18%;
}

@property --my {
  syntax: "<length-percentage>";
  inherits: false;
  initial-value: 0%;
}

.pane {
  /* bleed into the page gutter, but never all the way to the window edge */
  --pane-x: clamp(0.75rem, calc(var(--gutter) - 0.5rem), 1.75rem);
  --pane-y: clamp(1rem, 2.4vw, 1.75rem);
  --rim-tint: rgba(255, 7, 58, 0.55);
  position: relative;
  isolation: isolate;
  margin: calc(-1 * var(--pane-y)) calc(-1 * var(--pane-x));
  padding: var(--pane-y) var(--pane-x);
}

@supports (color: color-mix(in srgb, red 10%, transparent)) {
  .pane { --rim-tint: color-mix(in srgb, var(--pseudonym-color) 65%, transparent); }
}

.glass {
  position: absolute;
  inset: 0.75rem;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background:
    /* specular hotspot, follows the pointer */
    radial-gradient(28rem 18rem at var(--mx) var(--my), rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.025) 45%, transparent 70%),
    /* reflections pinned to the viewport, so they slide across the pane as it scrolls */
    linear-gradient(115deg, transparent 16%, rgba(255, 255, 255, 0.075) 28%, rgba(255, 255, 255, 0.02) 36%, transparent 45%,
      transparent 58%, rgba(255, 255, 255, 0.035) 64%, transparent 72%) fixed,
    /* gloss: brighter at the top edge, a little lift at the bottom */
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015) 30%, rgba(255, 255, 255, 0.01) 75%, rgba(255, 255, 255, 0.03)),
    rgba(14, 18, 23, 0.4);
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.24),
    inset 0 -1px 0.5px rgba(255, 255, 255, 0.06),
    inset 0 0 1.75rem rgba(255, 255, 255, 0.035),
    0 1.5rem 3.5rem -1rem rgba(0, 0, 0, 0.75),
    0 0 0 0.5px rgba(0, 0, 0, 0.6);
  transition:
    opacity 0.45s ease,
    inset 0.7s cubic-bezier(0.2, 1.35, 0.4, 1),
    -webkit-backdrop-filter 0.45s ease,
    backdrop-filter 0.45s ease,
    --mx 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
    --my 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* rim light: bright where the light hits (top-left), tinted by the current alias at the far corner */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  background: linear-gradient(145deg,
    rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.14) 16%, rgba(255, 255, 255, 0.03) 45%,
    rgba(255, 255, 255, 0.06) 72%, var(--rim-tint));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* glints along the top and bottom edges */
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent) top 0 left 9% / 34% 1px no-repeat,
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent) bottom 0 right 12% / 22% 1px no-repeat;
}

/* the pane under the pointer, the one in the URL hash, or the one holding keyboard focus.
   Opacity sets the overall strength of the effect. */
section:target > .pane > .glass,
.pane:has(:focus-visible) > .glass {
  opacity: 0.7;
  inset: 0;
  -webkit-backdrop-filter: blur(10px) saturate(190%) brightness(1.2);
  backdrop-filter: blur(10px) saturate(190%) brightness(1.2);
}

@media (hover: hover) {
  .pane:hover > .glass {
    opacity: 0.7;
    inset: 0;
    -webkit-backdrop-filter: blur(10px) saturate(190%) brightness(1.2);
    backdrop-filter: blur(10px) saturate(190%) brightness(1.2);
  }
}

/* Section titles
   ========================================================================== */

.out-title {
  margin: 0.6rem 0 1.5rem;
  color: var(--fg-bright);
  font-size: clamp(1.45rem, 1.05rem + 1.6vw, 2.25rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.out-title .hash { color: var(--pseudonym-color); transition: color 0.3s; }

.out-title + .comment { margin: -0.75rem 0 1.5rem; max-width: 70ch; }

/* Experience: `tree`
   ========================================================================== */

.tree-root {
  color: var(--blue-color);
  font-weight: 700;
}

.tree {
  padding: 0;
  list-style: none;
}

.tree > li {
  position: relative;
  padding-left: 4ch;
}

/* └── for every node; non-last nodes extend the trunk to make ├── */
.tree > li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0.5ch;
  width: 2.75ch;
  height: 0.85em;
  border-left: 1px solid var(--fg-faint);
  border-bottom: 1px solid var(--fg-faint);
}

.tree > li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0.5ch;
  border-left: 1px solid var(--fg-faint);
}

.tree-node { padding-bottom: 1rem; }
.tree-node:last-child { padding-bottom: 0; }

.node-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 2ch;
}

.node-date {
  color: var(--amber);
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.node-desc { color: var(--fg); }

.cv-link {
  border: 1px solid currentColor;
  padding: 0 0.75ch;
  margin: 0;
}

.tree-summary {
  margin-top: 1.25rem;
  color: var(--fg-dim);
}

/* Skills cloud
   ========================================================================== */

.skill-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1ch;
  margin-bottom: 1.25rem;
}

.skill-filter button {
  padding: 0 0.9ch;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg-dim);
  cursor: pointer;
  line-height: 1.7;
}

.skill-filter button:hover { color: var(--fg-bright); border-color: var(--fg-dim); }

.skill-filter button[aria-pressed="true"] {
  background: var(--fg-bright);
  border-color: var(--fg-bright);
  color: var(--bg);
}

.skill-filter button[data-filter="language"][aria-pressed="true"] { background: var(--red-color); border-color: var(--red-color); }
.skill-filter button[data-filter="framework"][aria-pressed="true"] { background: var(--blue-color); border-color: var(--blue-color); }
.skill-filter button[data-filter="tool"][aria-pressed="true"] { background: var(--green-color); border-color: var(--green-color); }

.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.3rem 1.8ch;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(0.75rem, 3vw, 2rem);
  list-style: none;
  border: 1px dashed var(--line-strong);
  line-height: 1.35;
}

.skill-cloud li {
  transition: opacity 0.25s, text-shadow 0.25s;
}

.skill-cloud li:hover { text-shadow: 0 0 0.6em currentColor; }

.skill-cloud [data-type="language"] { color: var(--red-color); }
.skill-cloud [data-type="framework"] { color: var(--blue-color); }
.skill-cloud [data-type="tool"] { color: var(--green-color); }

.skill-cloud [data-weight="1"] { font-size: 0.8rem; }
.skill-cloud [data-weight="2"] { font-size: 1rem; }
.skill-cloud [data-weight="3"] { font-size: 1.25rem; font-weight: 500; }
.skill-cloud [data-weight="4"] { font-size: 1.6rem; font-weight: 700; }
.skill-cloud [data-weight="5"] { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }

.skill-cloud[data-filter="language"] li:not([data-type="language"]),
.skill-cloud[data-filter="framework"] li:not([data-type="framework"]),
.skill-cloud[data-filter="tool"] li:not([data-type="tool"]) { opacity: 0.1; }

/* Writeups: `ls -l`
   ========================================================================== */

.ls-total { color: var(--fg-dim); margin-bottom: 0.5rem; }

.ls-long {
  display: grid;
  gap: 0.25rem;
  padding: 0;
  list-style: none;
}

.ls-entry {
  display: grid;
  gap: 0.2rem;
  margin: 0 calc(-1 * var(--pane-x));
  padding: 0.9rem var(--pane-x);
  border-left: 2px solid transparent;
  color: inherit;
  transition: background-color 0.2s, border-color 0.2s;
}

.ls-entry:hover,
.ls-entry:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  border-left-color: var(--pseudonym-color);
  outline: none;
}

.ls-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5ch;
  color: var(--fg-dim);
  font-size: 0.8125rem;
}

.ls-meta .ls-name { color: var(--fg-bright); }

.ls-title {
  justify-self: start; /* hug the text so the redaction bar matches it */
  color: var(--fg-bright);
  font-size: 1.15rem;
  font-weight: 700;
  transition: color 0.2s;
}

.ls-entry:hover .ls-title { color: var(--pseudonym-color); }

.ls-desc { max-width: 76ch; }

@media (max-width: 40rem) {
  .ls-perm,
  .ls-owner { display: none; }
}

/* Projects: TUI panels
   ========================================================================== */

.gh-summary { color: var(--fg-dim); }

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 2.25rem 1.5rem;
  margin-top: 2rem;
  padding: 0;
  list-style: none;
}

.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.5rem 1.15rem 1.1rem;
  border: 1px solid var(--line-strong);
  transition: border-color 0.2s;
}

.panel:hover { border-color: var(--pseudonym-color); }

.panel-title {
  position: absolute;
  top: 0;
  left: 0.75rem;
  max-width: calc(100% - 1.5rem);
  padding: 0 0.75ch;
  transform: translateY(-50%);
  background: var(--bg);
  color: var(--fg-bright);
  border-radius: 4px;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Frost the border line behind the title instead of painting over it, so it sits cleanly on glass too. */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .panel-title {
    background: transparent;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }
}

.panel-title a {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
  color: inherit;
}
.panel:hover .panel-title a { color: var(--pseudonym-color); }

.panel-desc { flex: 1; }

.panel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2ch;
  color: var(--fg-dim);
  font-size: 0.8125rem;
}

.panel-meta a { color: inherit; }
.panel-meta a:hover { color: var(--fg-bright); }

.lang::before {
  content: "\25CF";
  margin-right: 0.6ch;
  color: var(--lang-color, var(--fg-dim));
}

.lang[data-lang="Python"] { --lang-color: #3572a5; }
.lang[data-lang="TypeScript"] { --lang-color: #3178c6; }
.lang[data-lang="JavaScript"] { --lang-color: #f1e05a; }
.lang[data-lang="HTML"] { --lang-color: #e34c26; }
.lang[data-lang="CSS"] { --lang-color: #663399; }
.lang[data-lang="C"] { --lang-color: #a8b9cc; }
.lang[data-lang="C++"] { --lang-color: #f34b7d; }
.lang[data-lang="C#"] { --lang-color: #178600; }
.lang[data-lang="Go"] { --lang-color: #00add8; }
.lang[data-lang="Rust"] { --lang-color: #dea584; }
.lang[data-lang="Kotlin"] { --lang-color: #a97bff; }
.lang[data-lang="Java"] { --lang-color: #b07219; }
.lang[data-lang="PHP"] { --lang-color: #4f5d95; }
.lang[data-lang="Shell"] { --lang-color: #89e051; }

.panel-tags { font-size: 0.8125rem; }

.panel-links {
  display: flex;
  gap: 2ch;
}

.panel-links a:hover,
.panel-links a:focus-visible {
  background: var(--blue-color);
  color: var(--bg);
}

/* Contact
   ========================================================================== */

.contact-list {
  display: grid;
  gap: 0.4rem;
  font-size: 1.05rem;
}

.contact-list > div {
  display: grid;
  grid-template-columns: 10ch 1fr;
  gap: 1ch;
}

.contact-list dt { color: var(--fg-dim); }

.contact-list dd { min-width: 0; overflow-wrap: anywhere; }

.contact-list a {
  color: var(--fg-bright);
  font-weight: 500;
  padding: 0 0.25ch;
  margin: 0 -0.25ch;
}

.contact-list a:hover,
.contact-list a:focus-visible {
  background: var(--pseudonym-color);
  color: var(--bg);
}

/* Footer
   ========================================================================== */

.footer {
  max-width: var(--measure);
  margin: 6rem auto 0;
  padding: 1.5rem var(--gutter) 7rem; /* room for the fixed chat bar */
  color: var(--fg-dim);
  font-size: 0.75rem;
}

.footer p {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.footer a { color: var(--fg); }
.footer a:hover { color: var(--pseudonym-color); }

/* Writeup pages
   ========================================================================== */

.post {
  max-width: 78ch;
  padding-top: clamp(2rem, 7vh, 4.5rem);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  color: var(--fg-dim);
  font-size: 0.8125rem;
}

.prose {
  margin-top: 1.5rem;
  line-height: 1.8;
  overflow-wrap: break-word;
}

.prose > * + * { margin-top: 1.25rem; }

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  color: var(--fg-bright);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.prose h1 { font-size: clamp(1.6rem, 1.15rem + 2vw, 2.5rem); margin: 0 0 2rem; }
.prose h2 { font-size: 1.4rem; margin-top: 3rem; }
.prose h3 { font-size: 1.15rem; margin-top: 2.25rem; }
.prose h4 { font-size: 1rem; margin-top: 2rem; }

.prose h1::before,
.prose h2::before,
.prose h3::before,
.prose h4::before {
  color: var(--pseudonym-color);
  font-weight: 700;
}

.prose h1::before { content: "# "; }
.prose h2::before { content: "## "; }
.prose h3::before { content: "### "; }
.prose h4::before { content: "#### "; }

.prose li h2,
.prose li h3 { font-size: 1rem; margin-top: 0.75rem; }

.prose a {
  color: var(--blue-color);
  text-decoration: underline dotted;
  text-underline-offset: 0.2em;
}

.prose a:hover { color: var(--pseudonym-color); text-decoration-style: solid; }

.prose strong { color: var(--fg-bright); }
.prose em { color: var(--fg-bright); }

.prose ul,
.prose ol { padding-left: 3ch; }

.prose ul { list-style: "- "; }
.prose li + li { margin-top: 0.4rem; }
.prose li::marker { color: var(--pseudonym-color); }
.prose ol li::marker { color: var(--fg-dim); }

.prose li.task-list-item { list-style: none; }
.prose li.task-list-item > p:first-child { display: inline; }

.prose .task-list-item-checkbox {
  margin: 0 1ch 0 -2.5ch;
  accent-color: var(--green-color);
}

.prose blockquote {
  margin-left: 0;
  padding-left: 2ch;
  border-left: 2px solid var(--line-strong);
  color: var(--fg-dim);
}

.prose hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px dashed var(--line-strong);
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line-strong);
}

.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.prose th,
.prose td {
  padding: 0.35rem 1ch;
  border: 1px solid var(--line-strong);
  text-align: left;
}

.prose th { background: var(--bg-raised); color: var(--fg-bright); }

.prose code {
  padding: 0.05em 0.5ch;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--amber);
  font-family: inherit;
  font-size: 0.9em;
}

.prose .highlighter-rouge:not(code),
.prose pre {
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
}

.prose .highlighter-rouge pre { border: 0; }

.prose pre {
  margin: 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--fg);
}

.prose pre code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.prose .rouge-table,
.prose .rouge-table td {
  display: table;
  margin: 0;
  padding: 0;
  border: 0;
  border-collapse: collapse;
  background: none;
}

.prose .rouge-table td { display: table-cell; vertical-align: top; }

.prose .rouge-table pre {
  padding: 0;
  overflow: visible;
  border: 0;
  background: none;
}

.prose .rouge-gutter {
  padding-right: 1.5ch !important;
  border-right: 1px solid var(--line) !important;
  color: var(--fg-faint);
  text-align: right;
  user-select: none;
}

.prose .rouge-code { padding-left: 1.5ch !important; }

.post-footer { margin-top: 3.5rem; }

.eof {
  display: inline-block;
  padding: 0 0.75ch;
  background: var(--fg-bright);
  color: var(--bg);
}

.post-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 4ch;
  margin-top: 1.5rem;
}

.post-nav a {
  color: var(--fg-bright);
  padding: 0 0.25ch;
  margin: 0 -0.25ch;
}

.post-nav a:hover,
.post-nav a:focus-visible {
  background: var(--fg-bright);
  color: var(--bg);
}

.post-nav a:hover .dim { color: inherit; }

/* Rouge syntax tokens */

.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cd { color: #6b7681; font-style: italic; }
.highlight .cp, .highlight .cpf { color: var(--violet); }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kv { color: #ff5c7a; }
.highlight .kt, .highlight .kc { color: var(--cyan); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sd,
.highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr, .highlight .ss, .highlight .dl { color: var(--green-color); }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .mb, .highlight .il { color: var(--amber); }
.highlight .nf, .highlight .fm, .highlight .nc, .highlight .nn, .highlight .ne { color: var(--blue-color); }
.highlight .nb, .highlight .bp { color: var(--cyan); }
.highlight .nv, .highlight .vi, .highlight .vg, .highlight .vc, .highlight .nx { color: var(--violet); }
.highlight .na { color: var(--amber); }
.highlight .nt { color: #ff5c7a; }
.highlight .o, .highlight .ow { color: var(--fg); }
.highlight .p { color: #9aa5b0; }
.highlight .err { color: var(--red-color); }
.highlight .gd { color: #ff5c7a; }
.highlight .gi { color: var(--green-color); }
.highlight .gh, .highlight .gu { color: var(--blue-color); font-weight: 700; }
.highlight .ge { font-style: italic; }
.highlight .gs { font-weight: 700; }

/* Motion
   ========================================================================== */

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes redact {
  0%   { transform: scaleX(0); transform-origin: left; }
  20%  { transform: scaleX(1); transform-origin: left; }
  50%  { transform: scaleX(1); transform-origin: right; }
  85%  { transform: scaleX(0); transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

@keyframes reveal {
  to { opacity: 1; transform: none; visibility: visible; }
}

@keyframes flicker {
  0%   { filter: blur(14px) brightness(1.3); }
  3%   { filter: blur(14px) brightness(0.1); }
  6%   { filter: blur(14px) brightness(0.8); }
  8%   { filter: blur(14px) brightness(0.35); }
  9%   { filter: blur(14px) brightness(1.3); }
  10%  { filter: blur(14px) brightness(0.1); }
  20%  { filter: blur(14px) brightness(0.1); }
  21%  { filter: blur(14px) brightness(1.3); }
  50%  { filter: blur(14px) brightness(1.1); }
  55%  { filter: blur(14px) brightness(0.7); }
  70%  { filter: blur(14px) brightness(1.3); }
  100% { filter: blur(14px) brightness(1.3); }
}

@keyframes glitch {
  0%   { transform: none; clip-path: inset(0 0 0 0); }
  20%  { transform: translate(-0.04em, 0.02em) skewX(-6deg); clip-path: inset(12% 0 52% 0); }
  40%  { transform: translate(0.05em, -0.02em); clip-path: inset(58% 0 6% 0); }
  60%  { transform: translate(-0.03em, 0) skewX(4deg); clip-path: inset(30% 0 28% 0); }
  80%  { transform: translate(0.02em, 0.01em); clip-path: inset(0 0 68% 0); }
  100% { transform: none; clip-path: inset(0 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .alias::before,
  .alias.is-switching,
  .cursor,
  .rotate-cursor { animation: none; }

  .js .term-block .out { opacity: 1; transform: none; }
  .js .term-block .cmd-text { visibility: visible; }

  .glass { transition: opacity 0.3s ease; }
}
