/* The desktop is plain HTML inside the laptop display, modelled on macOS 26: a transparent menu bar over the
   wallpaper, Finder icons on the desktop and a glass Dock. Sizes are frame units and scale with
   the frame. Colours are semantic tokens with a light and a dark value, so the desktop follows the system
   appearance (dark-mode.md › Best practices). The phone icon grid (.m-grid) reuses the .ico and .fi styles. */
.desk, .m-grid, .dock-layer {
  --sel: #cfeee0; /* selected label: the accent pill, mint on the green wallpaper (11.8:1 with --on-sel) */
  --on-sel: #0b2f20;
  --sel-box: rgba(0, 0, 0, .28); /* the rounded box behind a selected icon */
  --fill: rgba(255, 255, 255, .12); /* hover behind an icon */
  --dock: rgba(255, 255, 255, .26);
  --dock-solid: #e9ece9;
  --edge: rgba(255, 255, 255, .45);
  --tip: rgba(246, 246, 246, .94);
  --tip-label: #252523;
  --tile: linear-gradient(#4a4f57, #16181c);
  --min-tile: rgba(255, 255, 255, .92); /* a minimised window: a small sheet of its surface */
  /* Wallpaper: dark at the top so the white menu bar stays legible (7.6:1 at its lightest), lighter below. */
  --wall:
    radial-gradient(60% 55% at 82% 78%, rgba(196, 240, 218, .7), transparent 70%),
    radial-gradient(70% 60% at 0% 0%, #0f4430, transparent 70%),
    linear-gradient(172deg, #1d5f43 0%, #2b8159 58%, #5fb88c 100%);
}
.desk {
  position: absolute;
  inset: 0;
  opacity: 0;
  color: #fff;
  font-family: var(--font-sys);
  background: var(--wall);
}
.desk :focus-visible, .dock-layer :focus-visible { outline-color: #fff; }

/* Menu bar (the-menu-bar.md › Anatomy): app name in bold, then one-word menu titles on the leading side;
   menu bar extras and the clock on the trailing side. Transparent over the wallpaper, as in macOS 26. */
.desk-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 24px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  text-shadow: 0 0 6px rgba(0, 0, 0, .25);
}
.desk-bar b { margin-right: 16px; font-weight: 700; }
.desk-bar .menus { display: flex; gap: 16px; min-width: 0; overflow: hidden; }
.desk-bar .extras { display: flex; align-items: center; gap: 12px; margin-left: auto; padding-left: 16px; }
.desk-bar svg { display: block; fill: currentColor; filter: drop-shadow(0 0 4px rgba(0, 0, 0, .2)); }
.desk-bar .x-wifi { width: 15px; height: 11px; }
.desk-bar .x-batt { width: 22px; height: 11px; }
.desk-bar time { font-variant-numeric: tabular-nums; }
/* Spotlight's menu bar extra: the magnifier, in a hit area as tall as the menu bar. */
.desk-bar .x-spot { display: grid; place-items: center; width: 22px; height: 20px; border-radius: 5px; transition: background-color .15s ease; }
.desk-bar .x-spot:hover { background: rgba(255, 255, 255, .18); }
.desk-bar .x-spot svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

.desk-icons {
  position: absolute;
  left: 14px;
  top: 36px;
  display: grid;
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  gap: 6px 4px;
}


/* Contact widget (top right, under the menu bar): a frosted pill that grows into a card. Dark green text on the
   light glass reads at 12:1; the glass is a functional layer over the wallpaper, not content (materials.md). */
.cw {
  position: absolute;
  top: 34px;
  right: 14px;
  width: 232px;
  padding: 7px;
  border-radius: 26px;
  color: #17211b;
  background: rgba(240, 246, 242, .88);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
  text-shadow: none;
  cursor: pointer;
}
.cw-head { display: flex; align-items: center; gap: 8px; }
.cw-head img { width: 36px; height: 36px; flex: none; border-radius: 50%; object-fit: cover; object-position: 50% 20%; }
.cw-t { min-width: 0; flex: 1; }
.cw h2 { margin: 0; font: 600 15px/18px 'Playfair Display', serif; white-space: nowrap; }
.cw-t p { margin: 0; font-size: 10px; line-height: 13px; color: #3a4640; white-space: nowrap; }
.cw-btn { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: #0b4d1e; color: #fff; transition: transform .2s ease, background-color .15s ease; }
.cw-btn:hover { background: #0f6328; }
.cw-btn svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s ease; }
.cw.open .cw-btn svg { transform: rotate(180deg); }
.cw-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s ease; }
.cw.open .cw-body { grid-template-rows: 1fr; }
.cw-rows { overflow: hidden; min-height: 0; visibility: hidden; transition: visibility 0s .28s; }
.cw.open .cw-rows { visibility: visible; transition-delay: 0s; }
.cw-rows::before { content: ''; display: block; height: 1px; margin: 8px 4px 4px; background: rgba(11, 77, 30, .14); }
.cw-rows a { cursor: auto; display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 12px; color: inherit; text-decoration: none; transition: background-color .15s ease; }
.cw-rows a:hover, .cw-rows a:focus-visible { background: rgba(11, 77, 30, .08); }
.cw-ico { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: rgba(11, 77, 30, .1); color: #0b4d1e; }
.cw-ico svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.cw-ico .i { width: 14px; height: 14px; }
.cw-txt { display: grid; min-width: 0; }
.cw-txt small { font-size: 9px; line-height: 12px; color: #3a4640; }
.cw-txt b { font-size: 11px; line-height: 14px; font-weight: 500; overflow-wrap: anywhere; }
.cw :focus-visible { outline-color: #0b4d1e; }
@media (prefers-color-scheme: dark) {
  .cw { color: #eef4f0; background: rgba(28, 40, 33, .82); border-color: rgba(255, 255, 255, .16); }
  .cw-t p, .cw-txt small { color: #b6c4bb; }
  .cw-btn { background: #cfeee0; color: #0b2f20; }
  .cw-btn:hover { background: #e2f7ec; }
  .cw-ico { background: rgba(207, 238, 224, .14); color: #cfeee0; }
  .cw-rows a:hover, .cw-rows a:focus-visible { background: rgba(255, 255, 255, .08); }
  .cw-rows::before { background: rgba(255, 255, 255, .14); }
  .cw :focus-visible { outline-color: #cfeee0; }
}
@media (prefers-reduced-motion: reduce) { .cw-body, .cw-btn svg, .cw-rows { transition: none; } }

/* The travel map as a small globe in the bottom-right corner (a desktop item, like the icons above it). */
.desk-globe {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
  transition: transform .2s ease;
}
.desk-globe [data-mini] { position: relative; width: 76px; height: 76px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35)); }
.desk-globe .lbl { font-size: 12px; font-weight: 500; line-height: 16px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.desk-globe:hover, .desk-globe:focus-visible { transform: scale(1.08); }
.desk-globe:active { transform: scale(.97); }
.desk-globe:focus-visible, .desk-bar .x-spot:focus-visible { outline: none; } /* focus returns here when Search / the map closes; no ring */
.desk-globe canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .desk-globe { transition: none; } }

/* The downloads folder, bottom left: a green Finder folder that stands on the desk. Opening it drops the front
   flap forward and fans the pages out above it; every page is a download link, so the folder holds nothing else
   (icons.md › Document icons: the pages reuse the folded-corner document look). The pages sit between the back
   and the front, clipped at the folder's foot, so closed they only peek over the flap. */
.dfold {
  --back: #4aa97b;
  --front: linear-gradient(#8fd6b1, #68c095);
  --glyph: rgba(16, 84, 54, .55);
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: 84px;
  height: 88px;
  perspective: 420px;
}
.dfold-back {
  position: absolute;
  left: 0;
  top: 0;
  width: 84px;
  height: 64px;
  border-radius: 8px;
  background: var(--back);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .3));
}
.dfold-back::before { content: ''; position: absolute; left: 8px; top: -8px; width: 34px; height: 12px; border-radius: 6px 6px 0 0; background: inherit; }
.dfold-pages {
  position: absolute;
  left: 0;
  top: 0;
  width: 84px;
  height: 60px;
  margin: 0;
  padding: 0;
  list-style: none;
  clip-path: inset(-400px -400px 0 -400px); /* the pages never show below the folder */
}
.dfold-pages li {
  position: absolute;
  left: 10px;
  bottom: 0;
  width: 64px;
  height: 82px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3));
  transform: translateY(34px) rotate(calc(var(--k) * 1.5deg));
  transition: transform .45s cubic-bezier(.34, 1.3, .5, 1);
}
.dfold:not(.open):hover .dfold-pages li { transform: translateY(20px) rotate(calc(var(--k) * 3deg)); }
.dfold.open .dfold-pages li {
  transform: translate(calc(var(--i) * 70px), -80px) rotate(calc(var(--k) * 6deg));
  transition-delay: calc(var(--i) * 45ms);
}
.dfold.open .dfold-pages li:hover, .dfold.open .dfold-pages li:focus-within { transform: translate(calc(var(--i) * 70px), -86px) rotate(0deg) scale(1.06); transition-delay: 0s; }
.dfold-page {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 12px 4px 0;
  box-sizing: border-box;
  border-radius: 4px;
  background: #fff;
  color: #252523;
  text-align: center;
  text-decoration: none;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}
.dfold-page::after { content: ''; position: absolute; right: 0; top: 0; width: 14px; height: 14px; background: #dcdedb; clip-path: polygon(0 0, 100% 100%, 0 100%); }
.dfold-page .i { width: 18px; height: 18px; color: #1a6b45; }
/* A locked transcript: the same page, a lock in place of its glyph (the request window opens on click). */
button.dfold-page { border: 0; font: inherit; cursor: pointer; }
.dfold-page.locked .i { color: #6b6b6b; }
.dfold-name { margin-top: 4px; font-size: 10px; font-weight: 600; line-height: 12px; overflow-wrap: anywhere; }
.dfold-sub { font-size: 9px; line-height: 12px; color: #6b6b6b; }
.dfold-ext { position: absolute; left: 0; right: 0; bottom: 5px; font-size: 8px; font-weight: 700; letter-spacing: .02em; color: #6b6b6b; }
.dfold-page:focus-visible { outline: 2px solid #1a6b45; outline-offset: 1px; clip-path: none; }
.dfold-front {
  position: absolute;
  left: 0;
  top: 20px;
  display: grid;
  place-items: center;
  width: 84px;
  height: 44px;
  border-radius: 6px 6px 8px 8px;
  background: var(--front);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 -1px 0 rgba(0, 0, 0, .08);
  transform-origin: 50% 100%;
  transition: transform .5s cubic-bezier(.34, 1.4, .5, 1);
}
.dfold-front .i { width: 24px; height: 24px; color: var(--glyph); }
.dfold:hover .dfold-front { transform: rotateX(-14deg); }
.dfold.open .dfold-front { transform: rotateX(-62deg); }
.dfold-front:focus-visible { outline: none; } /* focus returns here when the desktop is re-entered; no ring, as on the globe */
.dfold .lbl { position: absolute; left: 50%; bottom: 0; translate: -50% 0; font-size: 12px; font-weight: 500; line-height: 16px; white-space: nowrap; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); cursor: default; }
@media (prefers-reduced-motion: reduce) { .dfold-pages li, .dfold-front { transition: none; } }

/* About this site: a small app tile under the contact widget, right-aligned with it. The widget comes later in
   the DOM, so when it opens it covers the tile. */
.desk-tips {
  position: absolute;
  top: 96px;
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 84px;
  padding: 0;
  transition: transform .2s ease;
}
.desk-tile {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 9px; /* the macOS icon corner: about 22.4% of the tile */
  background: linear-gradient(#fdd86a, #f2a93b);
  color: #5a3a00;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 6px 10px rgba(0, 0, 0, .3);
}
.desk-tile svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.desk-tips .lbl { font-size: 11px; font-weight: 500; line-height: 14px; white-space: nowrap; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.desk-tips:hover, .desk-tips:focus-visible { transform: scale(1.06); }
.desk-tips:active { transform: scale(.97); }
.desk-tips:focus-visible { outline: none; }
.desk-tips:focus-visible .desk-tile { outline: 2px solid #fff; outline-offset: 3px; }

/* Ask about Karl: the one field at the foot of the desktop, where the Dock was. The same frosted glass as the contact widget, as it
   floats over the wallpaper (materials.md); dark green text on it reads at 12:1. The send button lights up once
   there is a question. The chips above it sit straight on the wallpaper, white on a faint fill. */
.ask {
  position: absolute;
  left: 50%;
  bottom: 16px;
  translate: -50% 0;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 12px;
  width: min(420px, 62%);
  transition: opacity .12s ease, visibility 0s;
}
/* While the chat window shows, the field it grew out of steps aside (js/wm.js › sync). */
body.has-chat .ask { opacity: 0; visibility: hidden; transition: opacity .12s ease, visibility 0s .12s; }
.ask-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  padding: 0 8px;
  border-radius: 26px;
  color: #17211b;
  background: rgba(240, 246, 242, .88);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
  transition: box-shadow .15s ease;
}
.ask-bar:focus-within { box-shadow: 0 0 0 2px #cfeee0, 0 10px 28px rgba(0, 0, 0, .28); }
/* The robot leads the field, with the AI sparkle in its small green circle at the bottom-right corner, as on the
   photo before (generative-ai.md › Transparency). It is a 36 px button that opens the chat window as it is. */
.ask-open { display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border-radius: 50%; transition: transform .15s ease; }
.ask-face { position: relative; display: block; width: 36px; height: 36px; }
.ask-robot { display: block; width: 100%; height: 100%; overflow: visible; }
.ask-robot .eyes { transform-box: fill-box; transform-origin: center; animation: ask-blink 4.5s ease-in-out infinite; }
.ask-robot .ant { animation: ask-glow 2.4s ease-in-out infinite; }
@keyframes ask-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }
@keyframes ask-glow { 0%, 100% { fill: #0b4d1e; } 50% { fill: #28c840; } }
.ask-open:hover { transform: scale(1.06); }
.ask-open:active { transform: scale(.96); }
.ask-spark {
  position: absolute;
  right: -3px;
  bottom: -3px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0b4d1e;
  color: #cfeee0;
  box-shadow: 0 0 0 2px var(--ring, #f0f6f2);
}
.ask-spark svg { width: 10px; height: 10px; }
.ask-bar input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: none;
  color: inherit;
  font: 400 15px/20px 'Poppins', sans-serif;
}
.ask-bar input::placeholder { color: #4a5650; }
.ask-send {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0b4d1e;
  color: #fff;
  transition: background-color .15s ease, transform .15s ease;
}
.ask-send:hover { background: #0f6328; }
.ask-send:active { transform: scale(.94); }
.ask-send svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ask :focus-visible { outline-color: #cfeee0; }
.ask-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ask-chips button {
  height: 28px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .32);
  color: #fff;
  font: 500 12px/16px var(--font-sys);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  transition: background-color .15s ease;
}
.ask-chips button:hover { background: rgba(255, 255, 255, .24); }
@media (prefers-color-scheme: dark) {
  .ask-bar { color: #eef4f0; background: rgba(28, 40, 33, .82); border-color: rgba(255, 255, 255, .16); }
  .ask-bar { --ring: #1c2821; }
  .ask-bar input::placeholder { color: #b6c4bb; }
  .ask-send { background: #cfeee0; color: #0b2f20; }
  .ask-send:hover { background: #e2f7ec; }
}
@media (prefers-reduced-transparency: reduce) {
  .ask-bar { background: #f0f6f2; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-transparency: reduce) and (prefers-color-scheme: dark) {
  .ask-bar { background: #1c2821; }
}
@media (prefers-reduced-motion: reduce) {
  .desk-tips, .ask, body.has-chat .ask, .ask-bar, .ask-open, .ask-send, .ask-chips button { transition: none; }
  .ask-robot .eyes, .ask-robot .ant { animation: none; }
}

/* File icons (icons.md › Document icons): a page with a folded corner, the glyph in the centre and the
   extension at the foot; folders carry an embossed glyph. --s sets the size everywhere they appear. */
.fi {
  /* Folders take a green tint (macOS 26 lets people tint folders); document pages stay white. */
  --folder-back: #4aa97b;
  --folder-front: linear-gradient(#8fd6b1, #68c095);
  --folder-glyph: rgba(16, 84, 54, .55);
  --page: #fff;
  --page-ear: #dcdedb;
  --page-glyph: #1a6b45; /* 6.5:1 on the page */
  --page-ext: #6b6b6b; /* 5.3:1 on the page */
  --page-name: #252523; /* preview: the name line at the top of the CV */
  --page-line: #c9ccc8; /* preview: placeholder lines of text */
  --s: 48px;
  position: relative;
  display: block;
  flex: none;
  width: var(--s);
  height: var(--s);
  font-size: calc(var(--s) * .14);
}
.fi svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .28)); }
.fi .back { fill: var(--folder-back); }
.fi .front { fill: var(--folder-back); }
.fi .page { fill: var(--page); }
.fi .ear { fill: var(--page-ear); }
.fi .nm { fill: var(--page-name); }
.fi .hd { fill: var(--page-glyph); }
.fi .ln { fill: var(--page-line); }
.fi .i { position: absolute; left: 50%; translate: -50% 0; }
.fi.dir .i { top: 46%; width: 34%; height: 34%; color: var(--folder-glyph); }
.fi.doc .i { top: 26%; width: 38%; height: 38%; color: var(--page-glyph); }
.fi b {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 13%;
  font: 700 1em/1 var(--font-sys);
  letter-spacing: .02em;
  text-align: center;
  color: var(--page-ext);
  text-shadow: none;
}
/* SVG fills cannot take a gradient from a custom property, so the folder front gets its gradient as a mask
   layer over a flat fill instead. */
.fi.dir::after {
  content: '';
  position: absolute;
  left: 6.25%;
  right: 6.25%;
  top: 32.8%;
  height: 51.6%;
  border-radius: calc(var(--s) * .0625);
  background: var(--folder-front);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.fi.dir .i { z-index: 1; }
/* A school's logo is the whole icon: contained in the square, rounded like an app tile, no page behind it. */
.fi.school img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: calc(var(--s) * .18); filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .28)); pointer-events: none; }

/* Desktop icons, as Finder draws them: white label on the wallpaper; when selected, a dark rounded box behind
   the icon and the label in an accent pill. Hover gets a faint tile for pointer feedback. */
.ico {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 84px;
  padding: 6px 4px;
  border-radius: 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 14px;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
  transition: background-color .15s ease;
}
.ico .fi { border-radius: 6px; transition: background-color .15s ease, box-shadow .15s ease; }
.ico .lbl { padding: 1px 5px; border-radius: 4px; transition: background-color .15s ease, color .15s ease; }
.ico:hover { background: var(--fill); }
.ico:focus-visible { outline: none; } /* selection look replaces the focus ring; keyboard only, no flash on click */
/* Only a selected icon drops the hover tile; a quiet one (focus handed back after a window closes) keeps it. */
.ico:not(.quiet):focus-visible { background: none; }
.ico:not(.quiet):focus-visible .fi { background: var(--sel-box); box-shadow: 0 0 0 3px var(--sel-box); }
.ico:not(.quiet):focus-visible .lbl { background: var(--sel); color: var(--on-sel); text-shadow: none; }

/* The CV is the file a visitor came for, so it takes four grid cells (two columns by two rows) and its icon is
   a preview of the page, as Finder draws a PDF at large icon sizes. The folded-corner page and the extension
   stay (icons.md › Document icons); the larger size shows the document rather than a scaled-up glyph
   (widgets.md › Best practices: "Avoid expanding a smaller widget's content to simply fill a larger area"). */
.ico.big { grid-row: span 2; grid-column: span 2; width: auto; justify-content: center; }
.ico.big .fi { --s: 136px; font-size: calc(var(--s) * .085); border-radius: 10px; }

/* The Dock's own layer sits above the windows (z 40) and below Spotlight (z 60). Its frame copies the laptop
   frame's transform, so the Dock lands on the display; it shows only on the desktop. */
.dock-layer {
  position: fixed;
  inset: 0;
  z-index: 45;
  overflow: hidden;
  font-family: var(--font-sys);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility 0s .3s;
}
body.is-desk .dock-layer { opacity: 1; visibility: visible; transition: opacity .6s ease .15s; }
/* In Mission Control the Dock drops under the dimmed backdrop so it never covers a thumbnail. */
body.mission .dock-layer { z-index: 39; }
/* An open window fills the display and would show through under the Dock's glass; hide the Dock
   until every window is closed again, as a maximised app hides it in real macOS. */
body.has-window:not(.mission) .dock-layer { opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s .2s; }
.dock-frame { position: absolute; left: 0; top: 0; width: var(--fw); height: var(--fh); transform-origin: 0 0; }
.dock-frame.glide { transition: transform var(--glide) cubic-bezier(.65, 0, .35, 1); }
.dock-screen { position: absolute; left: var(--scr-l); top: var(--scr-t); width: var(--scr-w); height: var(--scr-h); }

/* Dock: a floating glass shelf (liquid-glass.md: glass belongs to the floating functional layer). It holds only
   minimised windows: the links moved into the contact widget, Ask about Karl onto the desktop, and About this
   site beside the downloads folder. */
.dock {
  position: absolute;
  left: 50%;
  bottom: 124px; /* above the ask field and its chips, which hold the foot of the desktop */
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 20px;
  background: var(--dock);
  box-shadow: inset 0 0 0 1px var(--edge), 0 10px 32px rgba(0, 0, 0, .18);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  pointer-events: auto;
}
.dock-min {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px; /* the macOS icon corner: about 22.4% of the tile */
  background: var(--min-tile);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 0 0 .5px rgba(255, 255, 255, .18), 0 2px 5px rgba(0, 0, 0, .22);
  color: #fff;
  transition: translate .2s cubic-bezier(.2, .8, .2, 1);
}
.dock-min:hover, .dock-min:focus-visible { translate: 0 -4px; }
/* The Dock holds only minimised windows; with none it is not drawn at all. */
.dock:not(:has(.dock-min)) { display: none; }
.dock-tray { display: flex; gap: 6px; }
.dock-min:not(.in) { opacity: 0; } /* stays invisible until the genie lands in it */
.dock-min .fi { --s: 30px; }
.dock .i { width: 24px; height: 24px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .2)); }
.dock .tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  translate: -50% 4px;
  padding: 3px 10px;
  border-radius: 7px;
  background: var(--tip);
  color: var(--tip-label);
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12), 0 6px 16px rgba(0, 0, 0, .18);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, translate .15s ease;
}
.dock-min:hover .tip, .dock-min:focus-visible .tip { opacity: 1; translate: -50% 0; }

@media (prefers-color-scheme: dark) {
  .desk, .m-grid, .dock-layer {
    --sel-box: rgba(255, 255, 255, .18);
    --dock: rgba(20, 34, 27, .34);
    --dock-solid: #26302b;
    --edge: rgba(255, 255, 255, .16);
    --tip: rgba(44, 44, 44, .92);
    --tip-label: #ecece8;
    --min-tile: rgba(44, 47, 45, .92);
    --wall:
      radial-gradient(60% 55% at 82% 78%, rgba(74, 164, 120, .4), transparent 70%),
      radial-gradient(70% 60% at 0% 0%, #071b13, transparent 70%),
      linear-gradient(172deg, #0b261b 0%, #0f3a29 58%, #1b5a40 100%);
  }
  .fi { --folder-back: #3b946a; --folder-front: linear-gradient(#78c39d, #56aa80); }
  .dfold { --back: #3b946a; --front: linear-gradient(#78c39d, #56aa80); }
}

/* Reduce Transparency: opaque Dock and tooltip. Increase Contrast: a solid menu bar and visible edges. */
@media (prefers-reduced-transparency: reduce) {
  .dock { background: var(--dock-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .dock .tip { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .desk, .dock-layer { --tip: #f6f6f6; }
}
@media (prefers-reduced-transparency: reduce) and (prefers-color-scheme: dark) {
  .desk, .dock-layer { --tip: #2c2c2c; }
}
@media (prefers-contrast: more) {
  .desk, .dock-layer { --edge: #fff; --sel-box: rgba(0, 0, 0, .5); }
  .desk-bar { background: rgba(0, 0, 0, .7); text-shadow: none; }
  .ico .lbl, .dfold .lbl, .desk-tips .lbl { text-shadow: 0 0 2px #000, 0 1px 3px #000; }
  .ask-bar { border-color: #0b2f20; }
}
