@font-face{
  font-family:'JetBrains Mono';
  src:url('fonts/jetbrains-mono-400.woff2') format('woff2');
  font-weight:400;font-style:normal;font-display:swap;
}
@font-face{
  font-family:'JetBrains Mono';
  src:url('fonts/jetbrains-mono-700.woff2') format('woff2');
  font-weight:700;font-style:normal;font-display:swap;
}

/* ── theme tokens ─────────────────────────────────────────
   One block per theme. boot.js sets [data-theme] on <html> in <head>,
   before the stylesheet applies, so there is no flash of the wrong theme.
   :root is the no-JS / unknown-theme fallback and always dracula.
   Token contract: bg desktop · panel window · panel2 tab strip · bar bars
   edge borders · fg text · dim secondary · accent brand/focus
   accent2 hover · link anchors · on-accent text over accent fills */
:root,
[data-theme="dracula"]{
  --bg:#1e1f29; --panel:#282a36; --panel2:#21222c; --bar:#191a21;
  --edge:#44475a; --fg:#f8f8f2; --dim:#8692b9;   /* dim lightened for 4.5:1 on --panel */
  --accent:#bd93f9; --accent2:#ff79c6; --link:#8be9fd; --on-accent:#1e1f29;
  --glow1:#bd93f91a; --glow2:#8be9fd12;
  --red:#ff5555; --yellow:#f1fa8c; --green:#50fa7b; --cyan:#8be9fd;
}

/* matte black — Omarchy · warm monochrome, single orange accent */
[data-theme="matte-black"]{
  --bg:#0d0d0d; --panel:#121212; --panel2:#090909; --bar:#090909;
  --edge:#333333; --fg:#bebebe; --dim:#8a8a8d;
  --accent:#e68e0d; --accent2:#f59e0b; --link:#eaeaea; --on-accent:#090909;
  --glow1:#e68e0d1f; --glow2:#eaeaea10;
  --red:#d35f5f; --yellow:#e68e0d; --green:#ffc107; --cyan:#eaeaea;
}

/* vantablack — Omarchy · pure black, fully desaturated */
[data-theme="vantablack"]{
  --bg:#090909; --panel:#000000; --panel2:#070707; --bar:#070707;
  --edge:#1a1a1a; --fg:#ffffff; --dim:#7a7a7a;
  --accent:#8d8d8d; --accent2:#cecece; --link:#b0b0b0; --on-accent:#000000;
  --glow1:#8d8d8d1a; --glow2:#b0b0b010;
  --red:#a4a4a4; --yellow:#cecece; --green:#b6b6b6; --cyan:#b0b0b0;
}

/* catppuccin — Omarchy */
[data-theme="catppuccin"]{
  --bg:#161622; --panel:#1e1e2e; --panel2:#101019; --bar:#101019;
  --edge:#45475a; --fg:#cdd6f4; --dim:#83869b;   /* dim lightened for 4.5:1 on --panel */
  --accent:#89b4fa; --accent2:#f5c2e7; --link:#94e2d5; --on-accent:#101019;
  --glow1:#89b4fa1a; --glow2:#94e2d512;
  --red:#f38ba8; --yellow:#f9e2af; --green:#a6e3a1; --cyan:#94e2d5;
}

/* tokyo night — Omarchy */
[data-theme="tokyo-night"]{
  --bg:#13141c; --panel:#1a1b26; --panel2:#0e0e14; --bar:#0e0e14;
  --edge:#292e42; --fg:#a9b1d6; --dim:#7a82a9;   /* dim lightened for 4.5:1 on --panel */
  --accent:#7aa2f7; --accent2:#bb9af7; --link:#0db9d7; --on-accent:#0e0e14;
  --glow1:#7aa2f71a; --glow2:#0db9d712;
  --red:#f7768e; --yellow:#e0af68; --green:#9ece6a; --cyan:#0db9d7;
}

/* gruvbox — Omarchy */
[data-theme="gruvbox"]{
  --bg:#1e1e1e; --panel:#282828; --panel2:#161616; --bar:#161616;
  --edge:#504945; --fg:#d4be98; --dim:#9b8e83;   /* dim lightened for 4.5:1 on --panel */
  --accent:#7daea3; --accent2:#d3869b; --link:#89b482; --on-accent:#161616;
  --glow1:#7daea31a; --glow2:#89b48212;
  --red:#ea6962; --yellow:#d8a657; --green:#a9b665; --cyan:#89b482;
}

/* nord — Omarchy */
[data-theme="nord"]{
  --bg:#222730; --panel:#2e3440; --panel2:#191c23; --bar:#191c23;
  --edge:#434c5e; --fg:#d8dee9; --dim:#959da9;   /* dim lightened for 4.5:1 on --panel */
  --accent:#81a1c1; --accent2:#bfa4c5; --link:#88c0d0; --on-accent:#191c23;  /* accent2 lightened for 4.5:1 on --panel */
  --glow1:#81a1c11a; --glow2:#88c0d012;
  --red:#d08b91; --yellow:#ebcb8b; --green:#a3be8c; --cyan:#8fbcbb;  /* red for 4.5:1 on --panel */
}

/* everforest — Omarchy */
[data-theme="everforest"]{
  --bg:#21272c; --panel:#2d353b; --panel2:#181d20; --bar:#181d20;
  --edge:#3d484d; --fg:#d3c6aa; --dim:#9da9a0;
  --accent:#7fbbb3; --accent2:#d699b6; --link:#83c092; --on-accent:#181d20;
  --glow1:#7fbbb31a; --glow2:#83c09212;
  --red:#e67e80; --yellow:#dbbc7f; --green:#a7c080; --cyan:#83c092;
}

/* kanagawa — Omarchy */
[data-theme="kanagawa"]{
  --bg:#17171e; --panel:#1f1f28; --panel2:#111116; --bar:#111116;
  --edge:#363646; --fg:#dcd7ba; --dim:#89887f;   /* dim lightened for 4.5:1 on --panel */
  --accent:#dcd7ba; --accent2:#938aa9; --link:#7fb4ca; --on-accent:#111116;
  --glow1:#dcd7ba1a; --glow2:#7fb4ca12;
  --red:#d0696b; --yellow:#e6c384; --green:#98bb6c; --cyan:#7aa89f;  /* red for 4.5:1 on --panel */
}

:root{
  --gap:12px;
  --ease:cubic-bezier(.4,0,.2,1);
  --mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}

*{box-sizing:border-box}
html{color-scheme:dark;height:100%}
body{
  margin:0;height:100%;display:flex;flex-direction:column;
  background-color:var(--bg);
  /* boot.js picks one gif from assets/bg/ per load and sets --bg-gif before this
     paints. It is the bottom layer, under the theme's two glows, and there
     is no fallback file: --bg-gif resolves to `none` with js off. */
  background-image:
    radial-gradient(1100px 700px at 12% -5%,var(--glow1) 0%,transparent 52%),
    radial-gradient(900px 600px at 100% 105%,var(--glow2) 0%,transparent 55%),
    var(--bg-gif,none);
  background-size:auto,auto,cover;
  background-position:center;
  background-repeat:no-repeat;
  color:var(--fg);font-family:var(--mono);font-size:15px;line-height:1.45;
  -webkit-font-smoothing:antialiased;
}
/* scanlines */
body::before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:50;
  background:repeating-linear-gradient(0deg,rgba(255,255,255,.016) 0 1px,transparent 1px 3px);
}
::selection{background:var(--edge);color:var(--fg)}

a{color:var(--link);text-decoration:none}
a:hover{color:var(--accent2)}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* themed scrollbars */
*{scrollbar-width:thin;scrollbar-color:var(--edge) transparent}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--edge);border:2px solid transparent;background-clip:content-box}
::-webkit-scrollbar-thumb:hover{background:var(--accent)}

/* ── top bar ────────────────────────────────────────────── */
.topbar{
  position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  padding:8px var(--gap);background:var(--bar);border-bottom:1px solid var(--edge);font-size:13px;
}
.ws{display:flex;gap:6px;flex-wrap:wrap}
/* inactive workspaces are dim text at full opacity — a 55% opacity label
   can never reach 4.5:1 whatever the palette does */
.ws a,.ws .ws-chip{
  padding:2px 9px;color:var(--dim);background:#ffffff07;
  transition:color .3s ease,background .2s ease;
}
/* the 404 bar's chip is the workspace you are on, not something to click */
.ws a{cursor:pointer}
.ws a.live,.ws .ws-chip.live{color:var(--fg)}
.ws a.on,.ws .ws-chip.on{color:var(--on-accent);background:var(--accent);font-weight:700}
.ws a:hover{color:var(--fg)}
.ws a.on:hover{color:var(--on-accent)}
/* a pane closed with its red dot: the chip loses its fill and keeps an edge,
   so the bar says the workspace is still there, just off the desk */
.ws a.away{background:transparent;box-shadow:inset 0 0 0 1px var(--edge)}
.ws a.away.on{color:var(--accent);background:transparent}
.ws a.away:hover{box-shadow:inset 0 0 0 1px var(--dim)}
.brand{margin:0 auto;color:var(--accent);font-weight:700;letter-spacing:4px}
.tb-right{display:flex;align-items:center;gap:14px;color:var(--dim);font-size:12.5px}
.tb-right b{color:var(--fg);font-weight:400}
#clock{color:var(--fg);text-align:right;white-space:nowrap}

/* ── tiling desk ────────────────────────────────────────────
   Four equal panes: two columns, two rows, every pane a full cell.
   Tracks start collapsed (0fr) so #main owns the desk, then grow to
   1fr as each pane spawns. Animating the tracks — not display — is
   what makes the re-tile read as a window manager. */
.desk{
  flex:1;display:grid;
  grid-template-columns:1fr 0fr;
  grid-template-rows:1fr 0fr;
  gap:var(--gap);padding:var(--gap);
  align-items:stretch;min-height:0;
  transition:grid-template-columns .32s var(--ease),grid-template-rows .32s var(--ease);
}
#main{grid-column:1;grid-row:1}
#projects{grid-column:2;grid-row:1}

.bottom{
  grid-column:1 / -1;grid-row:2;
  display:grid;grid-template-columns:1fr 0fr;gap:0;
  min-width:0;min-height:0;height:100%;
  transition:grid-template-columns .32s var(--ease),gap .32s var(--ease);
}
.bottom.notes-open{grid-template-columns:1fr 1fr;gap:var(--gap)}

.desk.split-cols{grid-template-columns:1fr 1fr}
.desk.split-rows{grid-template-rows:1fr 1fr}

/* no-js: skip the animation and show the finished desktop */
.no-js .desk{grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr}
.no-js .bottom{grid-template-columns:1fr 1fr;gap:var(--gap)}

.win{
  background:var(--panel);border:1px solid var(--edge);overflow:hidden;
  min-width:0;min-height:0;display:flex;flex-direction:column;height:100%;
  /* just enough drop to lift the panes off the desk */
  box-shadow:0 14px 34px #00000047;
}
.win.focus{border-color:var(--accent);box-shadow:0 18px 46px #0000005c,0 0 0 1px var(--accent)}

.tab{
  display:flex;align-items:center;gap:9px;padding:9px 13px;flex-shrink:0;
  border-bottom:1px solid var(--edge);background:var(--panel2);
  font-size:12.5px;color:var(--dim);
  box-shadow:inset 0 1px 0 #ffffff10;      /* chrome highlight along the top */
}
.dot{width:11px;height:11px;border-radius:50%}
.r{background:var(--red)}.y{background:var(--yellow)}.g{background:var(--green)}
.tab .name{margin-left:5px;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tab .name b{color:var(--accent);font-weight:500}

.scr{padding:18px 16px;flex:1;overflow-y:auto;min-height:0}

/* spawn reveal — JS only, so no-js keeps every pane visible */
.js #projects,
.js #social,
.js #notes{
  opacity:0;transform:scale(.985);transform-origin:center;pointer-events:none;
  transition:opacity .45s ease,transform .5s var(--ease);
}
.js #projects.open,
.js #social.open,
.js #notes.open{opacity:1;transform:none;pointer-events:auto}

/* ── window chrome (script.js) ─────────────────────────────
   Red dot closes a pane off the desk and the other pane in its row takes
   the space; it comes back from the workspace bar, the way a minimized
   tiling window returns from the bar and not from itself. Double-click
   a titlebar to zoom that pane over the desk, and again to drop it back. */
#main.fold,#projects.fold,#social.fold,#notes.fold{display:none}
.desk.fold-main #projects{grid-column:1 / -1}
.desk.fold-projects #main{grid-column:1 / -1}
/* declared after .notes-open, so the survivor keeps the whole row */
.bottom.fold-social,.bottom.fold-notes{grid-template-columns:1fr}
/* a row with nothing left in it shouldn't hold half the desk open */
@media (min-width:821px){
  .desk.top-gone{grid-template-rows:0fr 1fr}
  .desk.bottom-gone{grid-template-rows:1fr 0fr}
}
.win.zoomed{position:fixed;z-index:36;margin:0;box-shadow:0 30px 70px #000000a6}
/* shaded: the titlebar stays, the body and its slice of the desk go away */
.win.shade{height:auto;align-self:start;box-shadow:0 8px 20px #00000047}
.win.shade .scr{display:none}
.win.shade .tab{cursor:pointer;border-bottom:0}
/* the dots are controls, so give them the hit target a note's red dot has */
.tab .dot.chrome-close,.tab .dot.chrome-shade,.tab .dot.chrome-zoom{
  position:relative;cursor:pointer;
}
.tab .dot.chrome-close::after,.tab .dot.chrome-shade::after,.tab .dot.chrome-zoom::after{
  content:"";position:absolute;inset:-7px;border-radius:50%;
}
.tab .dot.chrome-close:hover,.tab .dot.chrome-close:focus-visible{
  box-shadow:0 0 0 2px var(--bg),0 0 0 3px var(--red);
}
.tab .dot.chrome-shade:hover,.tab .dot.chrome-shade:focus-visible{
  box-shadow:0 0 0 2px var(--bg),0 0 0 3px var(--yellow);
}
.tab .dot.chrome-zoom:hover,.tab .dot.chrome-zoom:focus-visible{
  box-shadow:0 0 0 2px var(--bg),0 0 0 3px var(--green);
}

/* ── transcript ───────────────────────────────────────────── */
/* prompts sit one step below the output they print, so the transcript
   reads in two registers instead of one wall of 15px */
.line{white-space:pre-wrap;word-break:break-word;font-size:14px}
.pr{color:var(--green)}
.pa{color:var(--cyan)}
.d{color:var(--dim)}
.cmdtext{color:var(--fg)}
.out{display:block;margin:2px 0 11px}
.out:last-child{margin-bottom:0}
.dim{color:var(--dim)}

.caret,.cursor{display:inline-block;width:8px;height:16px;vertical-align:-3px}
.finalprompt{margin-top:4px}
.caret{background:var(--fg);opacity:.85}
.cursor{background:var(--accent);animation:blink 1.05s steps(1) infinite}
@keyframes blink{50%{opacity:0}}

/* ── fastfetch ─────────────────────────────────────────────
   logo left, key/value rows right, the way `fastfetch` prints. No frame
   around the art and no chips around the values: unboxed is the look. */
.fetch{display:grid;grid-template-columns:auto 1fr;gap:0 16px;align-items:start}
/* the mark is the site's own mono font set large, so it stays sharp at any
   size. two tones: the bowl in accent, the tail cut in on --link along the
   same diagonal the letter already descends on. --link rather than
   --accent2 because matte black's accent2 is all but the accent itself. */
.mini{
  display:block;flex:none;color:var(--accent);
  font-weight:700;font-size:150px;line-height:1;letter-spacing:-.02em;
  filter:drop-shadow(0 0 26px var(--glow1)) drop-shadow(0 0 10px var(--glow1));
}
/* the glow is drop-shadow, not text-shadow: once the fill is transparent
   for the gradient, a text-shadow would show through the letter itself */
@supports ((-webkit-background-clip:text) or (background-clip:text)){
  .mini{
    background-image:linear-gradient(135deg,var(--accent) 0 58%,var(--link) 58% 100%);
    -webkit-background-clip:text;background-clip:text;
    color:transparent;
  }
}
.ff-col{min-width:0}
/* the rule under the title is a dashed border, not a run of dashes:
   it stops exactly at the text instead of needing a guessed length */
.ff-name{
  display:inline-block;margin:0 0 8px;padding-bottom:2px;
  color:var(--accent);font-weight:700;font-size:15px;letter-spacing:.3px;
  border-bottom:1px dashed var(--dim);
}
.ff{
  display:grid;grid-template-columns:auto 1fr;gap:1px 14px;
  margin:0;font-size:13.5px;line-height:1.55;
}
/* key: value, the way fastfetch pads its keys */
.ff dt{color:var(--accent);font-weight:700}
.ff dt::after{content:":";color:var(--dim);font-weight:400}
.ff dd{margin:0;color:var(--fg);min-width:0;overflow-wrap:break-word}
/* fastfetch colours the value too, so the block isn't one grey wall */
.ff dd.kw{color:var(--link)}
.ff dd.hl{color:var(--accent2)}
.ff dd.dim{color:var(--dim)}
/* the palette strip fastfetch prints under the rows */
.ff-pal{display:flex;gap:2px;margin-top:9px}
.ff-pal i{display:block;width:17px;height:8px}
.ff-pal i:nth-child(1){background:var(--accent)}
.ff-pal i:nth-child(2){background:var(--accent2)}
.ff-pal i:nth-child(3){background:var(--link)}
.ff-pal i:nth-child(4){background:var(--green)}
.ff-pal i:nth-child(5){background:var(--yellow)}
.ff-pal i:nth-child(6){background:var(--red)}
.ff-pal i:nth-child(7){background:var(--fg)}
.ff-pal i:nth-child(8){background:var(--dim)}
/* staged print: script.js lights the mark, then each row, then the strip.
   hidden with opacity rather than display so the grid keeps its shape and
   the prompt below never jumps while the output streams in */
.js .fetch.staged :is(.mini,.ff-name,.ff-pal,.ff > *){opacity:0;transition:opacity .16s linear}
.js .fetch.staged :is(.mini,.ff-name,.ff-pal,.ff > *).lit{opacity:1}

/* projects */
.plist a{
  display:grid;grid-template-columns:1fr auto;gap:1px 12px;
  padding:8px;color:inherit;border:1px solid transparent;
}
.plist a:hover{background:#ffffff06;border-color:var(--edge)}
/* keyboard cursor in ~/notes, set by windows.js (j / k) */
.plist a.sel{background:#ffffff0a;border-color:var(--accent)}
.plist .nm{color:var(--accent);font-weight:500}
.plist .nm .p{color:var(--dim);font-weight:400;margin-right:9px}
.plist .ar{color:var(--cyan);font-size:12px;white-space:nowrap}
.plist .ds{grid-column:1 / -1;color:var(--dim);font-size:12.5px}

/* ── note body (the <template>s in index.html) ───────────── */
.nd .meta{color:var(--dim);font-size:12.5px;margin-bottom:7px}
.nd .meta time{color:var(--accent);font-weight:500}
.nd .t{color:var(--accent);font-size:19px;font-weight:700;margin:0 0 11px;line-height:1.3}
.nd p{margin:0 0 12px;color:var(--fg);line-height:1.6}
.nd p:last-child{margin-bottom:0}
.nd code{
  font-family:inherit;font-size:.92em;padding:1px 5px;
  border:1px solid var(--edge);background:var(--panel2);
  white-space:nowrap;                 /* keep sites-available on one line */
}
/* everything else a technical note might use, so writing one needs no css */
.nd pre{
  margin:0 0 12px;padding:10px 12px;overflow-x:auto;
  background:var(--panel2);border:1px solid var(--edge);line-height:1.55;
}
.nd pre code{
  padding:0;border:0;background:none;
  white-space:pre;font-size:12.5px;
}
.nd ul,.nd ol{margin:0 0 12px;padding-left:22px;color:var(--fg);line-height:1.6}
.nd li{margin:0 0 5px}
.nd li:last-child{margin-bottom:0}
.nd blockquote{
  margin:0 0 12px;padding:1px 0 1px 12px;
  border-left:2px solid var(--edge);color:var(--dim);
}
.nd h3{color:var(--fg);font-size:15px;font-weight:700;margin:18px 0 9px;letter-spacing:.4px}
.nd a{
  color:var(--link);border-bottom:1px solid var(--edge);
}
.nd a:hover{color:var(--accent2);border-color:var(--accent2)}
/* the note types itself in: opacity only, so the fade never reflows the
   body and the has-more fade is measured against the final height */
.nd > *{transition:opacity .18s linear}
.nd > .pending{opacity:0}

/* social */
.soc{display:flex;flex-direction:column;gap:8px}
.soc a{
  display:flex;gap:12px;align-items:baseline;padding:9px 12px;
  border:1px solid var(--edge);color:var(--fg);background:#ffffff04;
}
.soc a:hover{border-color:var(--accent)}
.soc .h{color:var(--accent);width:58px;flex-shrink:0}
.soc .s{color:var(--dim);font-size:12px}

/* ── bottom bar ───────────────────────────────────────────── */
.botbar{
  position:sticky;bottom:0;z-index:30;display:flex;align-items:center;gap:14px;
  padding:7px var(--gap);background:var(--bar);border-top:1px solid var(--edge);
  font-size:12.5px;color:var(--dim);
}
.swatches{display:flex}
.swatches i{width:19px;height:12px;display:block}
.swatches i:nth-child(1){background:var(--accent)}
.swatches i:nth-child(2){background:var(--accent2)}
.swatches i:nth-child(3){background:var(--link)}
.swatches i:nth-child(4){background:var(--green)}
.swatches i:nth-child(5){background:var(--yellow)}
.swatches i:nth-child(6){background:var(--red)}
.swatches i:nth-child(7){background:var(--fg)}
.swatches i:nth-child(8){background:var(--dim)}
.botbar .grow{margin-left:auto}
.botbar a.mail{color:var(--cyan)}
/* the theme name opens the picker, so it has to look like text, not a button */
.themelabel{
  font:inherit;font-size:12.5px;line-height:1;margin:0;padding:0;
  background:none;border:0;color:var(--dim);cursor:pointer;
}
.themelabel:hover{color:var(--accent)}

/* ── note window (windows.js) ───────────────────────────────
   A clicked note opens as a fifth window, centred over the four tiled
   panes. The layer sits under the scanline overlay (z 50) and ignores
   pointer events except on the window itself. */
.wmlayer{position:fixed;inset:0;z-index:40;pointer-events:none}
.floatwin{
  position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);
  width:min(680px,calc(100vw - 32px));
  max-height:calc(100vh - 108px);
  height:auto;pointer-events:auto;
  box-shadow:0 24px 60px #00000073;
}
/* the red dot is the note window's close control; ::after grows the
   11px circle into a comfortable hit target without moving anything */
.floatwin .tab .dot.r{position:relative;cursor:pointer}
.floatwin .tab .dot.r::after{content:"";position:absolute;inset:-7px;border-radius:50%}
.floatwin .tab .dot.r:hover,.floatwin .tab .dot.r:focus-visible{box-shadow:0 0 0 2px var(--bg),0 0 0 3px var(--red)}
/* the window takes focus when it opens, but it is a container, not a control */
.floatwin:focus{outline:none}

/* ◀ ▶ walk the notes without closing the window */
.nd-nav{margin-left:auto;display:flex;gap:2px;flex-shrink:0}
.nd-step{
  font:inherit;font-size:11px;line-height:1;padding:3px 5px;
  background:none;border:1px solid transparent;color:var(--dim);cursor:pointer;
}
.nd-step:hover:not(:disabled){color:var(--accent);border-color:var(--edge)}
.nd-step:disabled{opacity:.3;cursor:default}

/* ── theme picker (script.js) ──────────────────────────────
   Every swatch is read from the stylesheet's own tokens, so the list can
   never advertise a colour the page isn't actually using. */
.pklayer{position:fixed;inset:0;z-index:45;pointer-events:none}
/* .floatwin.pkwin, so the mobile .floatwin width can't win on source order */
.floatwin.pkwin{width:min(430px,calc(100vw - 32px));pointer-events:auto}
.pk{display:flex;flex-direction:column;gap:2px}
.pk-row{
  display:flex;align-items:center;gap:12px;width:100%;padding:7px 9px;
  font:inherit;font-size:13px;text-align:left;color:var(--fg);
  background:none;border:1px solid transparent;cursor:pointer;
}
.pk-row:hover{background:#ffffff06;border-color:var(--edge)}
.pk-row.on{border-color:var(--accent);background:#ffffff0a}
.pk-sw{display:flex;flex-shrink:0}
.pk-sw i{display:block;width:14px;height:9px}
.pk-nm{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pk-row.on .pk-nm{color:var(--accent);font-weight:700}
.pk-mk{margin-left:auto;font-size:10px;color:var(--accent);opacity:0}
.pk-row.on .pk-mk{opacity:1}
.pk-hint{margin-top:10px;padding-top:9px;border-top:1px dashed var(--edge);color:var(--dim);font-size:12px}

/* long note: fade the last line until you scroll to it */
.floatwin.has-more::after{
  content:"";position:absolute;left:0;right:0;bottom:0;height:46px;
  background:linear-gradient(transparent,var(--panel) 82%);
  pointer-events:none;
}

/* ── glass panes ────────────────────────────────────────────
   The wallpaper should be felt through the windows, not only around them:
   the panel goes translucent and whatever is behind it is blurred. The
   brightness() is the part that keeps the text legal — blurring a bright
   gif still averages to a bright grey, and --dim only ever had ~4.5:1 on an
   opaque panel. Dimming the backdrop under the glass (but not the wallpaper
   in the gaps) buys that back. Guarded on both features it needs: without
   color-mix there is no transparent panel, and without backdrop-filter the
   wallpaper would sit behind the text unblurred and un-dimmed — so either
   one missing keeps the solid panel. */
@supports (background: color-mix(in srgb, red 50%, transparent)) and ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root{--glass:color-mix(in srgb,var(--panel) 84%,transparent)}
  .win{
    background:var(--glass);
    -webkit-backdrop-filter:blur(8px) brightness(.5) saturate(1.15);
    backdrop-filter:blur(8px) brightness(.5) saturate(1.15);
  }
  /* the has-more fade has to fade to the glass, not to an opaque panel */
  .floatwin.has-more::after{
    background:linear-gradient(transparent,var(--glass) 82%);
  }
}
/* someone who asked the os for less transparency gets the solid panes */
@media (prefers-reduced-transparency: reduce){
  .win{background:var(--panel);-webkit-backdrop-filter:none;backdrop-filter:none}
  .floatwin.has-more::after{background:linear-gradient(transparent,var(--panel) 82%)}
}

@media (max-width:820px){
  /* phone: sized by its own text, capped between the bars */
  .floatwin{
    width:min(680px,calc(100vw - 16px));
    max-height:calc(100vh - 124px);
  }
  /* panes scroll with the page on phones, but the note window is capped
     in height — so it has to scroll inside itself or the tail is lost */
  .floatwin .scr{overflow-y:auto;flex:1;min-height:0;overscroll-behavior:contain}
}

/* ── 404 ───────────────────────────────────────────────────────────────
   One window, centred on the desk. .errdesk overrides the tiling grid. */
.errdesk{flex:1;display:flex;align-items:center;justify-content:center;padding:var(--gap)}
.errdesk .win{width:100%;max-width:760px;height:auto;max-height:100%;animation:winIn .5s ease both}
.errdesk .scr{padding:22px 20px}
.err-h{color:var(--red);font-weight:400;font-size:inherit;margin:2px 0 11px;line-height:inherit}
.err-links{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0 4px}
.err-links a{border:1px solid var(--edge);padding:4px 11px;background:#ffffff04;color:var(--fg)}
.err-links a:hover{border-color:var(--accent);color:var(--accent2)}

@keyframes winIn{from{opacity:0;transform:translateY(8px) scale(.99)}to{opacity:1;transform:none}}

/* ── narrow pane: the value column wraps more, and a tiled pane has a
   fixed height — tighten the block so the last row stays above the prompt */
@media (max-width:1150px){
  .fetch{gap:0 14px}
  .mini{font-size:116px}
  .ff{font-size:12.5px;line-height:1.4}
  /* the bottom bar already carries the palette; drop it here so the
     transcript still ends above the prompt in a half-width pane */
  .ff-pal{display:none}
}

/* ── mobile: abandon the tiling grid, stack the panes ─────── */
@media (max-width:820px){
  body{height:auto;min-height:100vh}
  .desk{
    grid-template-columns:1fr;grid-template-rows:none;grid-auto-rows:auto;
    padding:10px;align-items:start;transition:none;
  }
  /* .split-cols/.split-rows come from script.js and outrank plain .desk,
     so they have to be reset here or the single column never applies */
  .desk.split-cols,.desk.split-rows{grid-template-columns:1fr;grid-template-rows:none}
  #main,#projects,#social,#notes{grid-area:auto;grid-column:auto;grid-row:auto}
  .bottom{grid-column:auto;grid-row:auto;display:contents;transition:none}
  .win{height:auto}
  .scr{overflow-y:visible;flex:none}
  .js #projects,.js #social,.js #notes{display:none;opacity:1;transform:none;transition:none}
  .js #projects.open,.js #social.open,.js #notes.open{display:flex;animation:winIn .45s ease both}
  /* a closed pane stays closed here too: the .open rule above carries two
     classes and an id, so it outranks the plain #x.fold rule */
  .js #main.fold,.js #projects.fold,.js #social.fold,.js #notes.fold{display:none}
  .brand{display:none}
  .topbar{padding:8px 10px;gap:6px}
  .tb-right{gap:8px;font-size:12px}
  .ws a,.ws .ws-chip{padding:2px 7px;font-size:12px}
  /* zoom needs the tiled desk, so on a phone the green dot would be dead */
  .tab .dot.g{display:none}
  .scr{padding:14px 12px}
  .mini{font-size:100px}
  .plist a{padding:7px 6px}
  .botbar{padding:6px 10px;gap:10px;font-size:12px;flex-wrap:wrap}
  .botbar .grow{margin-left:0;width:100%;text-align:center;order:3}
}

@media (max-width:420px){
  .ws{gap:4px}
  .ws a,.ws .ws-chip{padding:2px 6px;font-size:11.5px}
  .fetch{grid-template-columns:1fr;gap:12px 0}
  .mini{font-size:100px}
}

@media (prefers-reduced-motion:reduce){
  .desk,.bottom{transition:none}
  .js #projects,.js #social,.js #notes{transition:none;transform:none}
  .js #projects.open,.js #social.open,.js #notes.open{animation:none}
  .cursor{animation:none}
  .errdesk .win{animation:none}
}
